From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73959 invoked by alias); 31 Jul 2018 22:22:46 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 73939 invoked by uid 89); 31 Jul 2018 22:22:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:J6_AgwC, H*f:7rhDamBd0n2d, H*f:TrD7, H*i:sk:J6_AgwC X-HELO: mail-oi0-f42.google.com Received: from mail-oi0-f42.google.com (HELO mail-oi0-f42.google.com) (209.85.218.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 31 Jul 2018 22:22:42 +0000 Received: by mail-oi0-f42.google.com with SMTP id k12-v6so30954937oiw.8 for ; Tue, 31 Jul 2018 15:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=obThHINBastrZC3JDyIOe9DkUkpfrhqzu2XlV498Z3g=; b=V48F9yMQQbxD+MdJsAa9MHoUfjcSGxBnCdyVi4V1vtmoAea07zihsn2MKNRaL4QTO5 +0CnmT/ciz78QE+4nEFkmcyRaJWCe7AQcVCYJ/a8pU4zmC6nY8b45iERga6YIq8TRZr5 d1TFW3h48wTsCcebblNkkMHHUClEHkZjrW3HFHSJlJW5dbBUDWlcuY//Z4pjSRsaTt91 yfTkGSRM5Fbm8mSDLBx6sfDqWg1sSDj7VHdV2EpCuNuaBJqaNILaWLrdQaOE9YXNUJGo O1OxAxJUVQDChcekSPBANQvsE2UbNDyj7VTRFiY1J6CIrxrkJn3vCs3nOFdNKt1S1Vnb 1u8w== MIME-Version: 1.0 References: In-Reply-To: From: martin krastev Date: Tue, 31 Jul 2018 22:29:00 -0000 Message-ID: Subject: Re: Issues building gcc natively on mipsel To: jwakely.gcc@gmail.com Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00263.txt.bz2 Hi Jonathan, Thank you for the directions to the correct list, I hadn't posted to the gcc mailing lists in a while so I had forgotten which is which. Back to the issue at hand: Letting gcc fetch and build the correct gmp, mpfr and mpc moves the crash to a different file form the libstdc++ set: libtool: compile: /home/blu/proj/gcc_build/./gcc/xgcc -shared-libgcc -B/home/blu/proj/gcc_build/./gcc -nostdinc++ -L/home/blu/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/src -L/home/blu/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/src/.libs -L/home/blu/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/local/mipsel-linux-gnu/bin/ -B/usr/local/mipsel-linux-gnu/lib/ -isystem /usr/local/mipsel-linux-gnu/include -isystem /usr/local/mipsel-linux-gnu/sys-include -I/home/blu/proj/gcc-7.3.0/libstdc++-v3/../libgcc -I/home/blu/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/mipsel-linux-gnu -I/home/blu/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include -I/home/blu/proj/gcc-7.3.0/libstdc++-v3/libsupc++ -std=gnu++11 -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=cxx11-hash_tr1.lo -g -O2 -D_GNU_SOURCE -minterlink-mips16 -c /home/blu/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/c++11/cxx11-hash_tr1.cc -fPIC -DPIC -D_GLIBCXX_SHARED -o cxx11-hash_tr1.o In file included from /home/blu/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/c++11/cow-shim_facets.cc:35:0: /home/blu/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/c++11/cxx11-shim_facets.cc: In member function 'const std::locale::facet* std::locale::facet::_M_cow_shim(const std::locale::id*) const': /home/blu/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/c++11/cxx11-shim_facets.cc:344:52: internal compiler error: Illegal instruction moneypunct_shim(const facet* f, __cache_type* c = new __cache_type) ^~~~~~~~~~~~~~~~ 0x15c9913 crash_signal /home/blu/proj/gcc_build/../gcc-7.3.0/gcc/toplev.c:337 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Makefile:558: recipe for target 'cow-shim_facets.lo' failed make[6]: *** [cow-shim_facets.lo] Error 1 Best regards, Martin On Tue, 31 Jul 2018 at 11:37, Jonathan Wakely wrote: > On Tue, 31 Jul 2018 at 07:25, martin krastev wrote: > > > > Hello, > > > > I'm trying to build gcc-7.3.0 (md5 747d5010b7c6938b480bc6e4d7c4be9a of > > tar.gz) natively on a MACHTYPE=mipsel-unknown-linux-gnu MIPS p5600 > machine > > under Debian Stretch. I'm getting an illegal instruction during libstdc++ > > build phase: > > This mailing list is for discussion of GCC development, not help using > or building GCC. Your mail would be appropriate on the gcc-help list, > which I've CC'd. Please remove gcc@ from further replies and use the > gcc-help@ list. > > > libtool: compile: /home/gru/proj/gcc_build/./gcc/xgcc -shared-libgcc > > -B/home/gru/proj/gcc_build/./gcc -nostdinc++ > > -L/home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/src > > -L/home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/src/.libs > > -L/home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/libsupc++/.libs > > -B/usr/local/mipsel-linux-gnu/bin/ -B/usr/local/mipsel-linux-gnu/lib/ > > -isystem /usr/local/mipsel-linux-gnu/include -isystem > > /usr/local/mipsel-linux-gnu/sys-include > > -I/home/gru/proj/gcc-7.3.0/libstdc++-v3/../libgcc > > > -I/home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/mipsel-linux-gnu > > -I/home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include > > -I/home/gru/proj/gcc-7.3.0/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED > > -std=gnu++14 -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi > > -fdiagnostics-show-location=once -ffunction-sections -fdata-sections > > -frandom-seed=cow-ops.lo -g -O2 -D_GNU_SOURCE -minterlink-mips16 -c > > > /home/gru/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/filesystem/cow-ops.cc > > -fPIC -DPIC -D_GLIBCXX_SHARED -o cow-ops.o > > In file included from > > > /home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/vector:64:0, > > from > > > /home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/experimental/bits/fs_path.h:39, > > from > > > /home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/experimental/filesystem:39, > > from > > > /home/gru/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/filesystem/dir.cc:29, > > from > > > /home/gru/proj/gcc_build/../gcc-7.3.0/libstdc++-v3/src/filesystem/cow-dir.cc:26: > > > /home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/bits/stl_vector.h: > > In member function 'void std::vector<_Tp, > > _Alloc>::_M_move_assign(std::vector<_Tp, _Alloc>&&, std::true_type) [with > > _Tp = std::experimental::filesystem::v1::path::_Cmpt; _Alloc = > > std::allocator]': > > > /home/gru/proj/gcc_build/mipsel-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:1531:9: > > internal compiler error: Illegal instruction > > vector __tmp(get_allocator()); > > ^~~~~ > > 0x159a473 crash_signal > > /home/gru/proj/gcc_build/../gcc-7.3.0/gcc/toplev.c:337 > > Please submit a full bug report, > > with preprocessed source if appropriate. > > Please include the complete backtrace with any bug report. > > See for instructions. > > Makefile:523: recipe for target 'cow-dir.lo' failed > > make[6]: *** [cow-dir.lo] Error 1 > > > > > > I have configured and launched the build as: > > > > $ CPATH=/usr/include/mipsel-linux-gnu/ > > LIBRARY_PATH=/usr/lib/mipsel-linux-gnu/ $PWD/../gcc-7.3.0/configure > > --enable-languages=c,c++ --with-float=hard --disable-multiarch > > --target=mipsel-linux-gnu > > $ CPATH=/usr/include/mipsel-linux-gnu > > LIBRARY_PATH=/usr/lib/mipsel-linux-gnu make -j2 > > > > I've clearly misconfigured the build -- xgcc ended up with a wrong ISA, > but > > I can't figure out how. What am I missing? > > The most common reason for SIGILL is that one of the support libraries > (gmp, mpfr, or mpc) has been built with the wrong ISA. I wouldn't > expect that to fail on that line in libstdc++, but it's worth > checking. > > The simplest way to build those libraries for use with GCC is to put > their sources in the GCC source tree, as done by the > contrib/download_prerequisites script. See > https://gcc.gnu.org/wiki/InstallingGCC for more info. >