Shared library runpath trouble in Solaris.
Ian Lance Taylor
ian@cygnus.com
Mon Nov 10 08:42:00 GMT 1997
From: Teemu Torma <tot@trema.com>
Date: Mon, 10 Nov 1997 15:04:45 +0100
It seems that gcc does not specify any runpath for shared libraries.
At least if using multilibs the whole thing does not work, and
if `prefix' is not a standard one (I am using /usr/gnu), shared
libraries are not found at all.
I have made following changes to allow gcc automatically set -R
to all directories it adds itself.
Or am I missing something completely?
This is not a good idea, and, nothing personal, but I've explained why
so many times that I weary of doing it again. Perhaps we need a
developers FAQ to answer this. The short version is that if you
always pass a -R option to the linker, then your programs become
dependent on directories which may be NFS mounted, and programs may
hang unnecessarily when an NFS server goes down. SunOS effectively
always passed a -R option for every -L option; this was a bad idea,
and so it was removed for Solaris. We should not recreate it.
I agree that there is a problem here, and I agree that it would be
nice to fix it, but I do not think that this is the fix. This can be
fixed in the linker, but I do not know how to fix it in the compiler.
Ian
More information about the Gcc
mailing list