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)
using:
--with-prefix=/usr/rcf
and
LDFLAGS="-L/usr/rcf/lib -R/usr/rcf/lib"
/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
its own.
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
somewhere.
-- 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
machines.
Essentially removing /usr/rcf/lib/libgcc_s.so from existence
while building.
That's about all I've got.
Jeff Blaine wrote:
Ian Lance Taylor wrote:
Jeff Blaine <jblaine@xxxxxxxxx> writes:
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).
subversion-1.2.0:cairo> ldd subversion/clients/cmdline/.libs/svn |
grep libgcc
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
libgcc_s.so.
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.
No.
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
libgcc_s.so.
I am poking around some more to see if I can make any sense out of
my situation.
Thanks again for the help so far, Ian.