This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgcc_s : What links to it and why?


Ian Lance Taylor wrote:
Jeff Blaine <jblaine@mitre.org> writes:

Hi Ian, thanks for the reply.

I didn't get an answer to my previous long post about the
problem I am having, so I figured I would try asking
more direct questions:

What, in GCC, makes the determination to link in -lgcc?
-lgcc is always linked in.
I assume you are asking: what decides whether to link it statically
or
dynamically?  That is controlled by the -static-libgcc and
-shared-libgcc options, q.v.
I forgot to mention this below -- I also tried LDFLAGS="-static-libgcc"
and watched it be referenced/used during my build.  It did nothing.
The resulting build had libgcc_s.so linked.

I have no explanation for this behaviour. If you run the link command using the -v option, does it pass -lgcc_s to the linker? Is there any chance that you somewhere have a file named libgcc.so? (You should normally have libgcc.a and libgcc_s.so).

# make distclean, add -v to LDFLAGS, re-configure, make... # subversion-1.2.0:cairo> grep gcc_s make.log subversion-1.2.0:cairo> grep lgcc make.log | wc -l 28 subversion-1.2.0:cairo>

All 28 of those references to -lgcc are "-Bstatic -lgcc -Bdynamic"

Yet:

subversion-1.2.0:cairo> ldd subversion/clients/cmdline/.libs/svn | grep libgcc
libgcc_s.so.1 => /usr/rcf/lib/libgcc_s.so.1
subversion-1.2.0:cairo>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]