Effect of using the -rpath linkler option
Jonathan Wakely
jwakely.gcc@gmail.com
Wed Oct 3 23:14:00 GMT 2018
On Thu, 4 Oct 2018 at 00:06, Jonathan Wakely wrote:
> The ld.so(8) man page says usage of RPATH is deprecated. I believe
> that's because there's no way to override RPATH if it's present. If
> RUNPATH is used you can still override it if needed via LD_RUN_PATH.
> If you don't want LD_RUN_PATH to have effect, don't set it (or unset
> it) in your program's environment.
Sorry, brainfart, I meant LD_LIBRARY_PATH both times here, not LD_RUN_PATH.
N.B. some runtime linkers (musl, maybe some BSD ones) will always
allow LD_LIBRARY_PATH to override both RUNPATH and RPATH tags, so you
can't guarantee the behaviour you want on those systems.
More information about the Gcc-help
mailing list