This is the mail archive of the
mailing list for the GCC project.
Re: libgcc_s : What links to it and why?
Well, here's all I can figure out from the last few hours.
I moved my special 'specs' file aside and removed any
static trickery from LDFLAGS.
-- If I build my app (Subversion, although there are others)
/usr/rcf/lib/libgcc_s.so gets linked (somewhere) even
though I am using /afs/rcf/lang/gcc/current/bin/gcc which
is built with --disable-shared and has only a libgcc.a of
This is true no matter what arguments I pass to the linker.
I say "linked" above because I have confirmed that no other
shared library being used by my Subversion build has its
own reference to libgcc_s.so. The build jams it in there
-- If I build my app using --with-prefix=/blah, libgcc_s.so
does not get linked. This, unfortunately, isn't what we
need. I don't recall if this was with the special specs
file (or linker flags) in place or not.
-- The only solution I came to late tonight after toying with
this crazyness for 3 days now is to unrelease the "bad"
GCC from /usr/rcf on our "beta" class machines, do the new
builds on a beta class machine, then release the new build
(Subversion in this case) to both beta and production class
Essentially removing /usr/rcf/lib/libgcc_s.so from existence
That's about all I've got.
Jeff Blaine wrote:
Ian Lance Taylor wrote:
Jeff Blaine <email@example.com> writes:
I have no explanation for this behaviour. If you run the link
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).
subversion-1.2.0:cairo> ldd subversion/clients/cmdline/.libs/svn |
libgcc_s.so.1 => /usr/rcf/lib/libgcc_s.so.1
This in itself doesn't prove that your program was linked with
libgcc_s.so. It may be the case that your program was linked with
something which uses uses libgcc_s.so.
To see whether your program was linked with libgcc_s.so, you need to
do something like "objdump -p FILE | grep NEEDED". If you see
libgcc_s.so on that list, then your program was linked with
Gotcha. It's not.
ldd, on the other hand, does the transitive closure. That is, ldd
will print any shared library which was used by your program or by any
shared library which your program linked against, recursively.
Yes, there is a /usr/rcf/lib/libgcc_s.so that MUST remain where it is.
I simply don't want to link to it with my *other* (production) GCC.
Actually, I was asking whether you had a libgcc.so file somewhere.
That would be another way to get a dependency on libgcc_s.so: if -lgcc
causes the linker to find libgcc.so, and that file has a DT_SONAME of
I am poking around some more to see if I can make any sense out of
Thanks again for the help so far, Ian.