Lars Poeschel wrote:
I want to build a cross compiler for fr30 architecture (including c++) and
configure in a separate build dir as follows:
.../gcc-4.1.1/configure --prefix=/usr/cross --target=fr30-unknown-elf --with-gnu-as --with-gnu-ld --enable-languages=c --disable-libssp
Then is make and make install, which runs fine without any error.
Then I build newlib with my fresh fr30-unknown-elf-gcc and install it which
also runs fine.
Then I configure gcc to build a c++ compiler:
.../gcc-4.1.1/configure --prefix=/usr/cross --target=fr30-unknown-elf --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-libssp --with-newlib
All this should work in two steps, the latter configure first with the
generic newlib headers
being preinstalled by copying them (with a single 'cp -r' command) and
then producing newlib...
And so the error you got :
/home/larsi/gcc/gcc-build/fr30-unknown-elf/libstdc++-v3/include/bits/fstream.tcc:
In member function 'typename std::basic_filebuf<_CharT, _Traits>::pos_type
std::basic_filebuf<_CharT, _Traits>::_M_seek(typename _Traits::off_type,
std::_Ios_Seekdir, typename _Traits::state_type) [with _CharT = char, _Traits
= std::char_traits<char>]':
/home/larsi/gcc/gcc-build/fr30-unknown-elf/libstdc++-v3/include/bits/fstream.tcc:753:
error: insn does not satisfy its constraints:
(insn 191 190 23
0 /home/larsi/gcc/gcc-build/fr30-unknown-elf/libstdc++-v3/include/bits/postypes.h:117
(set (mem/s/c:SI (plus:SI (reg/f:SI 14 fp [42])
(const_int 4 [0x4])) [27 <result>._M_state+4 S4 A32])
(reg:SI 2 r2 [orig:1+4 ] [1])) 6 {movsi_internal} (nil)
(expr_list:REG_DEAD (reg:SI 2 r2 [orig:1+4 ] [1])
(nil)))
/home/larsi/gcc/gcc-build/fr30-unknown-elf/libstdc++-v3/include/bits/fstream.tcc:753:
internal compiler error: in copyprop_hardreg_forward_1, at regrename.c:1592
would have appeared in the first "build the C and C++ compilers with
libiberty and libstdc++-v3
for the target"-step. But then you maybe hadn't tried producing newlib
with the "broken" GCC :-(
The earlier GCC I had tried to produce for 'fr30-elf' was the gcc-3.3.3
in 2004 and also it crashed
somewhere in the 'libstdc++-v3' build, just like the gcc-4.1.1 here too :
/data1/home/src/gcc-4.1.1/build/fr30-elf/libstdc++-v3/include/bits/fstream.tcc:753:
error: insn does not satisfy its constraints:
(insn 191 190 23 0
/data1/home/src/gcc-4.1.1/build/fr30-elf/libstdc++-v3/include/bits/postypes.h:117
(set (mem/s/c:SI (plus:SI (reg/f:SI 14 fp [42])
(const_int 4 [0x4])) [27 <result>._M_state+4 S4 A32])
(reg:SI 2 r2 [orig:1+4 ] [1])) 6 {movsi_internal} (nil)
(expr_list:REG_DEAD (reg:SI 2 r2 [orig:1+4 ] [1])
(nil)))
/data1/home/src/gcc-4.1.1/build/fr30-elf/libstdc++-v3/include/bits/fstream.tcc:753:
internal compiler error: in copyprop_hardreg_forward_1, at regrename.c:1592
So, if it helps in any way, someone else got just the same crash just in
the same place :-)
Can somebody please explain this a little bit more ? Is there something wrong
with fr30's machine description ?
Most probbably there is something wrong....
Or did I something wrong compiling ? A similar error appears in all gcc versions since 4.0.0.
Your "optimization level" in compiling libstdc++-v3 was just the same
'-Os' I had here, so it must
come from somewhere and be 'fr30' dependent. Maybe changing it to '-O2'
or to '-O' could help, I
will check that... Anyway the '-Os' seems to cause a crash in
libstdc++-v3 with 'fr30-elf' !