missing crt1.o

David Scidmore dscidmore@xes-inc.com
Wed Jun 16 15:27:00 GMT 2004


> The problem I'm facing is that the toolchain is missing crt1.o. I believe
this
> was supposed to be installed with gcc, but I'm not sure. I have found
several
> items on crt1.o on the net, but so far have been unable to resolve my
> problem. I'm probably missing a very critical step somewhere, since there
is
> no crt1.o installed:

I think I may have gotten to the bottom of this as much as I could given my
limited knowledge. I ran into the same thing trying to cross compile mips.
I'm using the crosstools scripts as a base, but obviously wasn't doing it
exactly the same way. In my case I think the trouble comes from:

gcc-3.3.3/gcc/config/linux.h

Configure lists this, when configuring gcc, along with several other files.
You can see these when gcc is configuring, they look like:

Using the following target machine macro files:
        .../gcc-3.3.3/gcc/config/dbxelf.h
        .../gcc-3.3.3/gcc/config/elfos.h
        .../gcc-3.3.3/gcc/config/svr4.h
        .../gcc-3.3.3/gcc/config/linux.h
        .../gcc-3.3.3/gcc/config/mips/mips.h
        .../gcc-3.3.3/gcc/config/mips/linux.h

That particular file contains the STARTFILE_SPEC macro, which documentation
says is used to define startup files. The relevent lines in
gcc-3.3.3/gcc/config/linux.h are:

#undef  STARTFILE_SPEC
#ifdef USE_GNULIBC_1
#define STARTFILE_SPEC \
  "%{!shared: \
     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
                       %{!p:%{profile:gcrt1.o%s} \
                         %{!profile:crt1.o%s}}}} \
   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
#else
#define STARTFILE_SPEC \
  "%{!shared: \
     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
                       %{!p:%{profile:gcrt1.o%s} \
                         %{!profile:crt1.o%s}}}} \
   crti.o%s %{static:crtbeginT.o%s}\
   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
#endif

I noticed that "%{!shared" along with "%{!profile"cause crt1.o to be
included in the startup file spec . Experimenting leads me to believe those
two are a reflection of the --disable-shared/--enable-shared
and --disable-profile/--enable-profile configure options. So disabling
shared libraries and profiling causes crt1.o to be included in the startup
files.

A search for crt1.[csS] leads me to believe that it isn't even a part of the
gcc build. The bottom line is if your building a cross compiler and
configure takes it's final STARTFILE_SPEC from this file, and you disable
shared libraries and profiling you may encounter this problem.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list