Subject: Re: static vs. dynamic runtime linking, and silly 'ld -L' breakage
To: Arto Huusko <arto.huusko@utu.fi>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-userlevel
Date: 01/29/2005 10:42:19
Arto Huusko wrote:
> Of course, many good points supporting this view are made.
> And the point is made that it is needed if people want to move
> things around. However, it is not explained why that is a bad idea.
> I can't understand why I shouldn't install my X to /usr/local/X11
> if I wanted; without ld.so.conf no third party binary executable
> would work, because they only have /usr/X11R6/lib in their search
> path. Or as a more convincing argument, say I have a third party
> binary with only /usr/lib search path, but I want to install the
> binary and associated shared libraries under /usr/local.
> 
> 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..."

ld.so.conf hurts for same reasons why it's wrong to use LD_LIBRARY_PATH.

In order to work in POLA fashion, the path specified in LD_LIBRARY_PATH
or ld.so.conf must be searched first. This completely destroys
ability to use differently compiled library for different binaries,
think e.g. /usr/pkg/lib/libfoo.so.1 vs. /usr/pkg/with-some-option/libfoo.so.1.
Also, you can drop local libs in /usr/local/lib and use them, without fear
of interferring with rest of system.

Not depending on ld.so.conf is actually more flexible, and using
compiled-in rpaths indeed 'just works'. That's why it's default
since ELF switch.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same;     -=-
-=- We can run alone and free if we pursue a different aim.          -=-