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

Kai Ruottu karuottu@mbnet.fi
Tue Oct 16 17:53:00 GMT 2007


Torsten Schlabach wrote:

> I am trying to use my Linux box (Debian, AMD64) as a host to cross-compile for the AIX 5.3 platform.
>
> I have successfully built and installed the cross-binutils, but I am stuck when it comes to building, well more precisely, installing the first-stage gcc.
>   

What on earth "first stage gcc"?

> make gcc-all
>   

Probably you meaned 'make all-gcc', which produces only the stuff in 
'gcc'....  For a normal crosscompiler with a pre-existing
C library the plain 'make' is the command...

> works fine, so I'd assume I got all the necessary headers any anything else I need.

You will require also the AIX 5.3 target libraries, the headers aren't 
enough!

> But when I then try to do a 
>
> make gcc-install
>   

Again some typo, 'make install-gcc' sounds more probable...

> it tries to install libgcc_s.a, which does not exist.
>   

If it couldn't be produced, it doesn't exist !   That it couldn't be 
produced is the real problem...

> Searching the archives, I found that that lib seems to be called libgcc_eh.a now, and that file *is* there. But might the install routine have just missed the renaming?
>   

No, there should be that 'shared' library!

> I am using GCC 4.2.1.
>   
I tried your 'rs6000-ibm-aix5.3' target "just for a fun" with 
binutils-2.17.50.0.16 and gcc-4.2.2 but without the
AIX5.3 C library - is it freely available somewhere?  The build 
succeeded as long as :

----------------- clip 
---------------------------------------------------------------
/data1/home/src/gcc-4.2.2/build/./gcc/xgcc 
-B/data1/home/src/gcc-4.2.2/build/./gcc/
 -B/usr/local/rs6000-ibm-aix5.3/bin/ -B/usr/local/rs6000-ibm-aix5.3/lib/
 -isystem /usr/local/rs6000-ibm-aix5.3/include -isystem 
/usr/local/rs6000-ibm-aix5.3/sys-include -O2  -O2 -Os
 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes
 -Wold-style-definition  -isystem ./include  -mlong-double-128 -g 
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -shared -nodefaultlibs 
-Wl,-bE:libgcc/./libgcc.map -o ./shr.o
 libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o 
libgcc/./_ashldi3_s.o
<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'...

> Any ideas are very welcome.
>   
Just try a 'make > LogFile 2>&1' and then look at the 'LogFile' and 
where it failed and why!



More information about the Gcc-help mailing list