[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: XFree86 4.0.1 works!

On Wed, Oct 25, 2000 at 07:09:13PM +0200, Niels Möller wrote:
> Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> writes:
> > That's a question I can't answer. The last answer I got was that "rpath is
> > the right thing for this problem", and the last comment I got from a Debian
> > developer on this (representing the majority) was "nothing overrides rpath
> > so its evil".
> If that is correct, perhaps that should be considered a bug in the
> dynamic linker?

I don't know. Maybe, but I just don't know. It is certainly a bit
inconvenient. The glibc ld allows to drop rpath settings with
--inhibit-rpath, but I couldn't get it to work (I probably don't know the
correct "object name" to specify).

That the rpath setting is not overridden by LD_LIBRARY_PATH is easy to show:
foo_1/libfoo.so contains a single int foo() { return 1; }, while
foo_2/libfoo.so has the same but return 2. ./main prints the return value of
foo(), main-rpath is the same but linked with -Wl,rpath=foo_1:

marcus@ulysses[0]:~/rpath-test$ ./main
./main: error in loading shared libraries: libfoo.so: cannot open shared object file: No such file or directory
marcus@ulysses[127]:~/rpath-test$ LD_LIBRARY_PATH=foo_1 ./main
marcus@ulysses[2]:~/rpath-test$ LD_LIBRARY_PATH=foo_2 ./main
marcus@ulysses[2]:~/rpath-test$ ./main-rpath
marcus@ulysses[2]:~/rpath-test$ LD_LIBRARY_PATH=foo_2 ./main-rpath

The last line shows the precedence of rpath.

> The Solaris ld.so.1(1) man page says
>      The default search paths are the runpath recorded in the object,
>      followed by /usr/lib. The runpath is specified when the dynamic
>      object is constructed using the -R option to ld(1).
>      LD_LIBRARY_PATH can be used to indicate directories to be
>      searched before the default directories.
> To me it makes sense to search any directories in LD_LIBRARY_PATH
> *before* the -rpath directories compiled into the binary.

Your word in the glibc hackers ears. Bother to take this up with them on the
libc-hacker list and let us know what they think?


`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org

Reply to: