2006-07-31 under KDE 3.4.0 Overview: When compiling trivial code with a gcc4.1.1 i686 to powerpc-eabi cross compiler and specifying -msim, I am getting a "could not read symbols: File format not recognized" error with libgcc.a.
Details: Upon further research and experimentation of my problem case in <A HREF=http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28133>28133</A> I'm still running into what may be a compiler issue. I'm currently trying to make a c cross-compiler from i686 to powerpc-eabi to test code in PSIM against a powerpc development board. I am using the usual steps- 1. build binutils (2.15, which is the most recent version I can build on the shared academic machine I'm using without building a whole new native gcc) 2. build a stripped-down gcc (4.1.1, the most recent as of the start of the project) 3. compile newlib (1.14.0) 4. build full gcc 1 and 2 go fine, but when I try to build anything with the stripped-down gcc I get libgcc.a(eabi.o)undefined symbol errors (see below) when I don't specify a target (eg -msim, -mads, ...) and File Format Not Recognized errors (see below) when I use -msim. The same problem appears to be <A HREF=http://sources.redhat.com/ml/gdb/2005-11/msg00639.html>documented by Barry Wealand</A> for gcc3.4.4. I will continue to poke and investigate my case to see if it's just something stupid in my configuration, but even if the issue is only lack of -msim and an inadvertent library mistargeting, I've seen a few other reported cases where lack of a -mtarget has been a non-obvious roadblock, so it might be worth setting up a default target for embedded cross-compilation that is compatible with the default libgcc.a format. ----- output without -msim: powerpc-unknown-eabi-gcc arithtest.c /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/../../../../powerpc-unknown-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 01800074 /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.text+0xc4): In function `__eabi': /scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:232: undefined reference to `__init' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x8):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:146: undefined reference to `__SDATA_START__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0xc):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:148: undefined reference to `__SBSS_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x14):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:150: undefined reference to `__SDATA2_START__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x18):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:151: undefined reference to `__SBSS2_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x1c):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:152: undefined reference to `__GOT_START__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x28):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:155: undefined reference to `__GOT_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x2c):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:156: undefined reference to `__GOT2_START__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x30):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:157: undefined reference to `__GOT2_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x34):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:158: undefined reference to `__FIXUP_START__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x38):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:159: undefined reference to `__FIXUP_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x3c):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:163: undefined reference to `__CTOR_LIST__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x40):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:164: undefined reference to `__CTOR_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x44):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:165: undefined reference to `__DTOR_LIST__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x48):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:166: undefined reference to `__DTOR_END__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x4c):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:167: undefined reference to `__EXCEPT_START__' /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a(eabi.o)(.got2+0x50):/scratch/spkelly/gcc-4.1.1/build/gcc/eabi.S:171: undefined reference to `__EXCEPT_END__' collect2: ld returned 1 exit status ----- output with -msim: powerpc-unknown-eabi-gcc -msim arithtest.c /scratch/spkelly/ppcbin/lib/gcc/powerpc-unknown-eabi/4.1.1/libgcc.a: could not read symbols: File format not recognized collect2: ld returned 1 exit status ----- arithtest.c: int main(){ int a,b,c,d; a=5; b=7; c=a+b; d=a*b; return 0; } -- Summary: libgcc.a being generated in improper format for powerpc- eabi cross Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: spkelly at andrew dot cmu dot edu GCC build triplet: i686-pc-linux-gnu GCC host triplet: powerpc-*-eabi GCC target triplet: powerpc-*-eabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28551