>>>> "JV" == Jan Vroonhof
<vroonhof(a)math.ethz.ch> writes:
JV> [I am having an unproductive spell thesis wise. So I am unlurking for
JV> a second.[1] ]
JV> Martin Buchholz <martin(a)xemacs.org> writes:
> Here's the easy and obvious rpath patch as suggested by
recent
> discussion on getting Xaw linking more reliable. Perhaps Hrvoje would
> like to test it?
JV> I agree this might be the only way to fix this problem. I just want to
JV> point out something that was unclear from your summary of the
JV> problem. The main reason that we were not using -rpath on linux as
JV> opposed to say Solaris, is that on Linux -rpath takes precedence
JV> always. You cannot override with things like LD_LIBRARY_PATH [2]. On
JV> Solaris -rpath is more of a "place to search in last resort thing."[3]
I've overlooked/forgotten that.
I agree that it's bad that executable RPATH overrides LD_LIBRARY_PATH.
On the other hand, because the executable refers to a specific soname,
you can never get the wrong major version of a shared library, only
the wrong minor version. And those are supposed to be binary
compatible, so you typically only have one installed. And
LD_LIBRARY_PATH is searched if executable RPATH is insufficient to
find library dependencies.
So the downside from LD_LIBRARY_PATH not overriding executable RPATH
is pretty small. If you need to override RPATH for testing, you can
use LD_PRELOAD for a specific library, or you can use the time-honored
method of editing the binary and replacing RPATH with another
(shorter) string.
Also, ld-linux.so.2 claims the ability to ignore the RPATH in an
executable, but I could not get that to work.
Martin