From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: tot@trema.com Cc: egcs@cygnus.com Subject: Re: Shared library runpath trouble in Solaris. Date: Mon, 10 Nov 1997 08:42:00 -0000 Message-id: <199711101642.LAA15048@subrogation.cygnus.com> References: <199711101404.PAA09449@lev.labs.trema.com> X-SW-Source: 1997-11/msg00346.html From: Teemu Torma 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