This is the mail archive of the
mailing list for the GCC project.
Re: How do I prevent gcc from linking with GNU standard C library
- From: Jim Wilson <wilson at redhat dot com>
- To: Tanveer Ahmad <tahmad at intertrust dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: 01 May 2002 16:23:10 -0400
- Subject: Re: How do I prevent gcc from linking with GNU standard C library
- References: <3C124172E7FDD511B510000347426D592AA1B7@exchange.epr.com>
>I want to link my program with a third party standard C library, instead of
>the GNU standard C library. I used the "-nostdlib" option in gcc, however I
>get the following warning during linking:
> /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 080488d0
-nostdlib does two things. It disables linking against the default libraries
(i.e. libgcc and libc), and it disables linking against the startup files
(i.e. crt0.o). _start is defined in one of the startup files. Your program
will not work without the startup files.
If your third party library includes startup files, you could try linking
against them. Probably, however, the right solution is to stop using
-nostdlib. This is really only useful for embedded systems. You are
already using -nodefaultlibs, which will avoid linking in the standard C
See the documentation for -nostartfiles, -nostdlib, and -nodefaultlibs.