Building a Linux->AIX crosscompiler -- problem with libgcc_s.a

Torsten Schlabach tschlabach@gmx.net
Wed Oct 17 16:42:00 GMT 2007


Terve Kai!

Sorry for the typos, I was writing this out of the top of my head and I 
was tired then.

Reading your two posts, are you saying this could be a bug in the GCC 
sources?

To answer your questions:

 > What on earth "first stage gcc"?

I understand that the idea of building a cross-compiler would be:

1. Build a cross-binutils for the target platform.
2. Build some kind of cross-gcc for the target platform.
3. Use that cross-gcc (in some howtos referred to as 1st-stage GCC) to 
build a glibc for the target platform.
4. Re-build GCC with itself.

Are you saying I need a AIX C library on my Linux host system in order 
to be able to build a Linux hosted cross-compiler for AIX? Why?

 > I didn't use the '--with-sysroot=$sysroot' to point to the
 > (unexisting) AIX5.3 C library...

What is that business? Would you have a pointer to dome f* manual I 
could use to educate myself? Even if the AIX C library is not freely 
available, I could get a hold of one, but what would I have to do with it?

Regards,
Torsten


Kai Ruottu schrieb:
> Kai Ruottu wrote:
> 
>> <snip>
>> ./unwind-sjlj_s.o libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o -lc
>> `case . in *pthread*) echo -L/usr/lib/threads -lpthreads -lc_r 
>> /usr/lib/libc.a ;;
>> *) echo -lc ;; esac` ; rm -f ./tmp-libgcc_s.a ;
>> /usr/local/rs6000-ibm-aix5.3/bin/ar -X32_64 -X32_64 rc 
>> ./tmp-libgcc_s.a ./shr.o ;
>> mv ./tmp-libgcc_s.a ./libgcc_s.a ; rm -f ./shr.o
>> /usr/local/rs6000-ibm-aix5.3/bin/nm: /usr/lib/libc.a: File format not 
>> recognized
>> ----------------- clip 
>> ---------------------------------------------------------------
>>
>> As can be seen the '/usr/lib/libc.a' is tried to be linked in order to 
>> create the 'shr.o' and then
>> the 'tmp-libgcc_s.a' from it with 'ar' and finally rename this to 
>> 'libgcc_s.a'...
> 
> This can be a bug or then the 'sysroot'ed  "$sysroot/usr/lib/libc.a"  
> would be used  by  the 'nm'.
> I didn't use the '--with-sysroot=$sysroot' to point to the (unexisting) 
> AIX5.3 C library...  In a
> "traditional" crosscompiler build this would be a serious bug in the 
> gcc-4.2.2 sources, the
> '$tooldir/lib/libc.a' should appear here!



More information about the Gcc-help mailing list