libtool
[Top][All Lists]
Advanced

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

Re: Why is "setting LD_LIBRARY_PATH very bad"?


From: Ralf Wildenhues
Subject: Re: Why is "setting LD_LIBRARY_PATH very bad"?
Date: Thu, 25 Oct 2007 12:50:24 +0200
User-agent: Mutt/1.5.16 (2007-10-15)

Hello Jan, all,

* Jan Horan wrote on Thu, Oct 25, 2007 at 11:06:55AM CEST:
>
> Note also that using of RPATH is obsolete (DT_RPATH in ELF) due to
> it's incorrect precedence to LD_LIBRARY_PATH.
> RUNPATH (DT_RUNPATH) should be used instead. This is from man ld.so:

This is very platform specific (even existence of DT_RUNPATH is, while
DT_RPATH is specified by ELF).  Among all the systems which use the
variable LD_LIBRARY_PATH, some let it override run paths, some don't.
On GNU/Linux, whether `ld -rpath' sets DT_RPATH only, or also
DT_RUNPATH, varies even among distributions (for example Gentoo has ld
patched to do the latter, most others don't).

Libtool tries to get $shlibpath_overrides_runpath correct for each of
the systems, so you should be able to find out by looking at that (the
logic is in libtool.m4; CVS HEAD's is a bit better than branch-1-5).

FWIW, I wouldn't call one or the other precedence "better".  Both have
advantages and disadvantages.

IIRC, some systems even have two different environment variables, one of
which overrides the embedded run path, one doesn't.

Bottom line is, if you're out for portability, you can't be certain of
any of these semantics.  One reason for Libtool's existence.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]