Re: Ian's solution [was: What hack in ld.so?]
On Sat, Jan 30, 1999 at 10:40:33PM -0600, Gordon Matzigkeit wrote:
> There's been so much traffic on this thread, that I suspect most
> people have missed the fact that Ian Lance Taylor has analyzed and
> *solved* the problems with interaction between libtool and
> libc5-compat shared libraries.
> I'm quoting and reposting his message so that it doesn't get lost in
> the shuffle. Please read and understand this message before posting
> more flameage.
I am the Debian and upstream maintainer of the libc5 ld.so. Ian's
patch will not be going in. IMO, -rpath should not be used for any
libraries installed in standard, system locations (i.e. any place
listed in /etc/ld.so.conf). -rpath should only be used when libraries
are installed in nonstandard locations.
FWIW, I cringed the first time I saw what RedHat had done. They did
not foresee the evils of -rpath and the problems it would cause in the
> >>>>> Ian Lance Taylor writes:
> ILT> I just spent some time looking at the ld.so sources.
> ILT> Interestingly, it seems to me that everything will work
> ILT> correctly in the sources I was looking at. That is because the
> ILT> libc5 dynamic linker on my system (RedHat 5.2) was modified to
> ILT> search the library cache before using the application's
> ILT> DT_RPATH.
> ILT> I think that is a hack that Debian is missing: it is the final
> ILT> hack to the libc5 dynamic linker to change the search path to
> ILT> account for the moved shared libraries even when rpath is used.
> ILT> I have appended the RedHat patch below. This is to ld.so-1.9.5.
> ILT> Of course, this will technically break the handling of DT_RPATH.
> ILT> However, we've already determined that DT_RPATH binaries will
> ILT> not work correctly anyhow, because the shared libraries were
> ILT> moved. So using this patch should not make us any worse off.
> ILT> Although I can not test this, I now believe that if you take a
> ILT> libtool program, compile it on a libc5 Slackware and try to run
> ILT> it on a RedHat 5.2 system, it will work.
> His patch follows...