>>>> "VK" == Valdis Kletnieks
<Valdis.Kletnieks(a)vt.edu> writes:
VK> On Sun, 16 Jan 2000 04:32:41 PST, Martin Buchholz said:
> Well, the way it *should* work is that the RPATH baked into the
> executable is searched first, and then, if not all libraries are
> found, /etc/ld.so.conf is searched, and if not all libraries are
> found, the hardcoded /usr/lib is searched.
>
> Does it really not work like that? It might depend on your version of
> Linux.
>
> ..... Hmmmmm.
>
> OK, I actually tried it. On my system (Red Hat Linux 6.0) I
> experimented and found that it works exactly as I expected it to be:
>
> - the RPATH specified via -Wl,-rpath=... was used, _but_ if the shared
> libraries cannot be found there, the system falls back to
> /etc/ld.so.conf.
VK> Not being a heavy-duty Linuxoid yet, if you have an older binary
VK> that wants the libc5 version of -lc how does that get resolved
VK> if it finds a libc6 version via -rpath? Or are we being careful
VK> to only specify -rpath for things not usually found by ld.so.conf?
VK> Basically, what mechanism are we using to make sure that Things
VK> Dont Suck if we link against a now-current library, but the sysadmin
VK> then uses ld.so.conf to move it around for compatability while
VK> installing a new version of the library?
VK> Or am I missing something due to too many nights of 5 hours sleep? ;)
The new library should have a new major version number or should use
some other magic to make sure old binaries don't use it.
Imagine a system with all libs in /usr/lib. /etc/ld.so.conf contains
only /usr/lib. The system is upgraded to a new set of libraries. All
the original libs in /usr/lib are moved to /usr/moldy/lib, and then
/usr/lib is repopulated. Contents of /etc/ld.so.conf are changed to
/usr/lib
/usr/moldy/lib
Now imagine starting an old app, one that needs to use the old
libs. Because /usr/lib comes first in the search path, there must be
some mechanism used by the dynamic linker to prevent the old apps from
using the new libraries. That same mechanism will also prevent that
if an explicit rpath is used when linking.
The design of glibc also includes the concept of `symbol versioning'.
The intent is that you can always upgrade your libc version, and old
apps will continue to use old versions of particular symbols. So this
dance of old libraries should finally come to a stop.
After the a.out->elf and now libc5->glibc transition, there are no
more gut-wrenching transitions planned in the Linux world.
Martin