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.
Not being a heavy-duty Linuxoid yet, if you have an older binary
that wants the libc5 version of -lc how does that get resolved
if it finds a libc6 version via -rpath? Or are we being careful
to only specify -rpath for things not usually found by ld.so.conf?
Basically, what mechanism are we using to make sure that Things
Dont Suck if we link against a now-current library, but the sysadmin
then uses ld.so.conf to move it around for compatability while
installing a new version of the library?
Or am I missing something due to too many nights of 5 hours sleep? ;)
/Valdis