help building gcc 3.2

Ralph Blach rcblach@us.ibm.com
Wed Oct 9 09:54:00 GMT 2002


I understand that these files are needed to link with, but thats for ld,
not GCC the compiller.
The compiler really should not have to understand crti.o or any libraries
to compile an source into an object.

Chip

Rupert Wood <rup@kanat.pair.com> on 10/09/2002 09:20:20 AM

To:    Ralph Blach/Raleigh/IBM@IBMUS
cc:    gcc-help@gcc.gnu.org
Subject:    Re: help building gcc 3.2



Ralph Blach wrote:

> crti.o and libc.a
:
> Whey would a compiler need these files or care about them.

It needs them to link applications. The first one in the C runtime
entrypoint/initialization and the second is the C library.

For example, the operating system knows nothing about main(). The
application's real entrypoint has to fetch the arguments from the OS, chop
them up into an array and then invoke main(). It usually also sets up
floating point state and, for C++, invokes constructors of global objects
and initializes the exception mechanism.

> After all, you might need the compiler to build theses files.

At this point you should have enough of the compiler to build these.
Likely crti will be compiled from assembler, and the C library source
should neither make assumptions about having a C library to link against
(!) nor that it can link an executable.

Your best bet is to fetch these, along with the /usr/include headers, from
the target powerpc-linux system or, if you don't have access to one, from
a PowerPC linux distribution; then see --with-headers and --with-libs in
the GCC configure documentation. Alternatively you could use these to
compile and install glibc for powerpc-linux.

> How do I specify the configure options so that these files are not
> needed.

Build and install newlib and configure --with-newlib. newlib (I think) can
now interface with a linux kernel. However, glibc's probably a better
bet.

Rup.







More information about the Gcc-help mailing list