This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Issues building gcc natively on mipsel


On Tue, 31 Jul 2018 at 07:25, martin krastev <blu.dark@gmail.com> 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<std::experimental::filesystem::v1::path::_Cmpt>]':
> /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 <https://gcc.gnu.org/bugs/> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]