cross for RS6000, missing crt0.o

Kai Ruottu
Sun Sep 27 17:13:00 GMT 1998

> Rene Schenk wrote:
> > 
> > Hi all,
> > 
> > I'm trying to build a crosscompiler on a linux i386 host, for an rs6000 as target.
> > I'm using the instr. 0.81 (cygnus) for building a crosscomp. I build the
> > binutils, gcc and glibc without an error. Compiling a simple test-prog with the
> > new gcc ( gcc -c test.c ) works fine, but linking doesn't work, cause I don't got
> > the startup-file crt0.o for this machine. Does anyone s an idea how to solve this
> > problem (I have no access to an rs6000 machine!), or how to build this file?
> > (The file crt1.o is build, but when trying to link it, I got a wrong file format
> > error)
> For an embedded target, this is typically your boot code.  You would probably
> want to start by writing your own boot code and linker script for your rs6000
> target (my guess is that there is a default linker script being used that is
> looking for crt0.o).

 Rene seems to not replied yet, but the using of 'glibc' and 'rs6000' hints 
that the target is  a 'RS/6000'-machine with AIX-something, not an embedded
system for 'PowerPC' using 'newlib' as the C-library...

 The 'wrong file format' error would say that glibc has been compiled with
the 'native' compiler, using a target 'rs6000-something'...

 Saying "I build the binutils, gcc and glibc without an error" can be true,
but 'gcc' and 'binutils' are compiled using the native compiler, when the
'glibc' should be compiled using the 'rs6000-something'-target cross-compiler.

 Ok, the simple tests like 'file crt1.o', 'rs6000-<something>-nm crt1.o' etc.
would reveal easily if the C-library really is 'rs6000'-code, not the native

 Saying "I have no access to an rs6000 machine!" is really weird, when the
right way would be to take the native libs & headers from a RS/6000-AIX-
machine, and not use 'glibc' as the C-library (I don't think the rs6000-aix
port is ready and working, the old glibc-1.09' was the last where other systems 
than Linux were somehow supported...).

 If trying to make a 'normal' ppc-eabi target cross-compiler using Cygnus
newlib as the C-library, there shouldn't be much troubles and quite a lot
people could help in this... The 'psim'-simulator is great and 'having no
access to a powerpc-machine' doesn't hurt so much... (Ok, it should be
capable to simulate even Linux/PPC and Solaris/PPC, but not AIX...)

 These were just my guesses...

 Regards,  Kai
To get command help for the crossgcc list, including help
on adding/removing yourself to/from the list, send e-mail
to with the text 'help' (without the
quotes) in the body of the message.

More information about the crossgcc mailing list