[Gllug] How do I make sources available to compile against?

Tethys tet at createservices.com
Tue Dec 7 14:25:28 UTC 2004


Nix writes:

>> Didn't we have a thread about this sometime last year and conclude
>> that it was better to use DT_RUNPATH instead of ld.so.conf for
>> libraries in non-standard locations?
>
>Odd: I still have the opposite opinion (and so do the majority of the
>GNU binutils and GNU libc developers, IIRC).

Think about the case where you're installing to a directory which is
shared using NFS by a bunch of other machines. You can either change
ld.so.conf on each of the clients, or just use it centrally by using
DT_RUNPATH. The ease of central management (i.e., make the change
in one place rather than many) means ld.so.conf loses by a mile here.
This isn't a contrived example to prove a point, either -- it's
representative of probably 95% of all my software installs.

>DT_RUNPATH hardwires absolute paths into binaries, which cannot be a
>good thing. It's better than DT_RPATH because it is at least searched
>after LD_LIBRARY_PATH and /etc/ld.so.conf libraries, but it's
>still not a terribly good thing. Nothing that breaks relocation of
>binaries is good, IMNSHO.

Agreed. But DT_RUNPATH doesn't break anything any more than they would
break anyway. If your binary (and its associated libraries) moves, you
need to update where you look for its libraries. You can do that with
either /etc/ld.so.conf or LD_LIBRARY_PATH, irrespective of whether the
original location was compiled into the binary (or I suppose in theory,
you could probably patch the binary to update DT_RUNPATH -- but that's
not an approach I'd recommend :-).

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list