Subject: Re: static vs. dynamic runtime linking, and silly 'ld -L' breakage
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Arto Huusko <arto.huusko@utu.fi>
List: tech-userlevel
Date: 01/29/2005 12:42:13
On Sat, 29 Jan 2005, Jaromir Dolecek wrote:

> > In a way, the point 4 in the ld.so.conf entry of the web page
> > above is kind of ironic in this light: "the system should just
> > work..."
>
> Also, you can drop local libs in /usr/local/lib and use them, without fear
> of interferring with rest of system.

No, I can't, if the binary that needs those libs has a different
compiled-in rpath.

In a perfect world everyone would compile all software by themselves,
but in the real world this does not happen. And in the real world
someone who compiles an executable can't know in advance where a
user might want to install the executable and the shared libraries.

Even in UNIX-like environments, which are quite rigid, there are
several "standard" places where you might install third-party
software. At least /usr/local, /opt, /usr/opt, user's home
directories, and so on. It seems very silly to me that a
software package imposes on the user the location where shared
libraries *must* be.

> compiled-in rpaths indeed 'just works'. That's why it's default

It works as long as the libraries are installed somewhere in
the compiled-in rpath. Once they are somewhere else, it no longer
works at all.