public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Issues building gcc natively on mipsel
       [not found] <CAKPuMhOLrEN-TuH=JwGHawTQ63rSxFc0NZAAyHZfa4pkVTo2rQ@mail.gmail.com>
@ 2018-07-31  9:29 ` Jonathan Wakely
  2018-07-31 10:37   ` YunQiang Su
  2018-07-31 22:29   ` martin krastev
  0 siblings, 2 replies; 6+ messages in thread
From: Jonathan Wakely @ 2018-07-31  9:29 UTC (permalink / raw)
  To: blu.dark; +Cc: gcc, gcc-help

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues building gcc natively on mipsel
  2018-07-31  9:29 ` Issues building gcc natively on mipsel Jonathan Wakely
@ 2018-07-31 10:37   ` YunQiang Su
       [not found]     ` <CAKPuMhM_JyYnfLnQzWjPaLUQ6qawNzZOAm3VxFJjvDLO_8c9FQ@mail.gmail.com>
  2018-07-31 22:29   ` martin krastev
  1 sibling, 1 reply; 6+ messages in thread
From: YunQiang Su @ 2018-07-31 10:37 UTC (permalink / raw)
  To: jwakely.gcc; +Cc: blu.dark, gcc, gcc-help

Jonathan Wakely <jwakely.gcc@gmail.com> 于2018年7月31日周二 下午4:37写道:
>
> 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?
>

Do you pass some option like march=p6500 etc or native?
I guess the problem is about nan=2008 vs nan=legacy.

> 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.



-- 
YunQiang Su

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues building gcc natively on mipsel
  2018-07-31  9:29 ` Issues building gcc natively on mipsel Jonathan Wakely
  2018-07-31 10:37   ` YunQiang Su
@ 2018-07-31 22:29   ` martin krastev
  1 sibling, 0 replies; 6+ messages in thread
From: martin krastev @ 2018-07-31 22:29 UTC (permalink / raw)
  To: jwakely.gcc; +Cc: gcc-help

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 <https://gcc.gnu.org/bugs/> 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 <jwakely.gcc@gmail.com> wrote:

> 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.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues building gcc natively on mipsel
       [not found]     ` <CAKPuMhM_JyYnfLnQzWjPaLUQ6qawNzZOAm3VxFJjvDLO_8c9FQ@mail.gmail.com>
@ 2018-08-01  3:32       ` YunQiang Su
  2018-08-01  5:57       ` Kai Ruottu
  1 sibling, 0 replies; 6+ messages in thread
From: YunQiang Su @ 2018-08-01  3:32 UTC (permalink / raw)
  To: martin krastev; +Cc: jwakely.gcc, gcc-help

Can you have a try to force nan=legacy?
martin krastev <blu.dark@gmail.com> 于2018年8月1日周三 上午6:29写道:
>
> Hi YunQiang,
>
> Nope, I haven't passed to the config anything beyond what I already posted in the original post.
>
> I'll drop --with-float=hard next and see what happens, as a shot in the dark.
>
> Best regards,
> Martin
>
> On Tue, 31 Jul 2018 at 12:29, YunQiang Su <wzssyqa@gmail.com> wrote:
>>
>> Jonathan Wakely <jwakely.gcc@gmail.com> 于2018年7月31日周二 下午4:37写道:
>> >
>> > 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?
>> >
>>
>> Do you pass some option like march=p6500 etc or native?
>> I guess the problem is about nan=2008 vs nan=legacy.
>>
>> > 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.
>>
>>
>>
>> --
>> YunQiang Su



-- 
YunQiang Su

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues building gcc natively on mipsel
       [not found]     ` <CAKPuMhM_JyYnfLnQzWjPaLUQ6qawNzZOAm3VxFJjvDLO_8c9FQ@mail.gmail.com>
  2018-08-01  3:32       ` YunQiang Su
@ 2018-08-01  5:57       ` Kai Ruottu
  2018-08-01  6:36         ` martin krastev
  1 sibling, 1 reply; 6+ messages in thread
From: Kai Ruottu @ 2018-08-01  5:57 UTC (permalink / raw)
  To: martin krastev, wzssyqa; +Cc: jwakely.gcc, gcc-help

martin krastev kirjoitti 1.8.2018 klo 1.29:
> Hi YunQiang,
>
> Nope, I haven't passed to the config anything beyond what I already posted
> in the original post.
>
> I'll drop --with-float=hard next and see what happens, as a shot in the
> dark.

>>>> 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
>>>>
>>

When the current native GCC ("gcc") in the system works, it would be 
wise to look at
how it was configured. What special options ('-mcpu=', '-march=' etc) 
was used when
it was configured. Then try them first if possible.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues building gcc natively on mipsel
  2018-08-01  5:57       ` Kai Ruottu
@ 2018-08-01  6:36         ` martin krastev
  0 siblings, 0 replies; 6+ messages in thread
From: martin krastev @ 2018-08-01  6:36 UTC (permalink / raw)
  To: kai.ruottu; +Cc: Yunqiang Su, jwakely.gcc, gcc-help

Hi Kai,

Looking at the native gcc config is what I did last night -- low and
behold, passing several args that seemed meaningful produced a working
gcc-7.3.0!

Here is the successful config:
$ ../gcc-7.3.0/configure --enable-languages=c,c++ --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new
--disable-multiarch --with-arch-32=mips32r2 --with-fp-32=xx --with-madd4=no
--with-lxc1-sxc1=no --enable-checking=release --build=mipsel-linux-gnu
--host=mipsel-linux-gnu --target=mipsel-linux-gnu

Of course I still had to pass the CPATH and LIBRARY_PATH adjustments, but
that doesn't bother me:

CPATH=/usr/include/mipsel-linux-gnu LIBRARY_PATH=/usr/lib/mipsel-linux-gnu


Best regards,
Martin


On Wed, 1 Aug 2018 at 09:01, Kai Ruottu <kai.ruottu@wippies.com> wrote:

> martin krastev kirjoitti 1.8.2018 klo 1.29:
> > Hi YunQiang,
> >
> > Nope, I haven't passed to the config anything beyond what I already
> posted
> > in the original post.
> >
> > I'll drop --with-float=hard next and see what happens, as a shot in the
> > dark.
>
> >>>> 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
> >>>>
> >>
>
> When the current native GCC ("gcc") in the system works, it would be
> wise to look at
> how it was configured. What special options ('-mcpu=', '-march=' etc)
> was used when
> it was configured. Then try them first if possible.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-01  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAKPuMhOLrEN-TuH=JwGHawTQ63rSxFc0NZAAyHZfa4pkVTo2rQ@mail.gmail.com>
2018-07-31  9:29 ` Issues building gcc natively on mipsel Jonathan Wakely
2018-07-31 10:37   ` YunQiang Su
     [not found]     ` <CAKPuMhM_JyYnfLnQzWjPaLUQ6qawNzZOAm3VxFJjvDLO_8c9FQ@mail.gmail.com>
2018-08-01  3:32       ` YunQiang Su
2018-08-01  5:57       ` Kai Ruottu
2018-08-01  6:36         ` martin krastev
2018-07-31 22:29   ` martin krastev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).