[lsb-discuss] Packaging

Fabian Groffen grobian at gentoo.org
Fri Oct 27 07:36:54 PDT 2006

On 27-10-2006 10:12:26 -0400, Michael Sweet wrote:
> Actually, I'd suggest initializing LD_LIBRARY_PATH (on Linux anyways)
> in the default login environment to point to the user install root.
> That will cover all user installed library files and avoid the rpath
> trap.

If you don't want to crash your system, you better not touch
A user installs the jpeg library on her OSX system.  She sets the
DYLD_LIBRARY_PATH to her lib-dirs in ${prefix}{,/usr}/lib.  (OSX doesn't
do lib64 or the like, instead is has "fat" files.)  When she tries to
start an OSX application now, she gets a runtime linker kernel trap,
because the jpeg library she just installed is not compatible with the
one provided with her host system.  The DYLD_LIBRARY_PATH just forces
the runtime linker to first look at her own libs, also for applications
that were not built against that.  Instead -rpath should have been used
during linking to make sure each application uses the libraries it found
during compile time.  For the Darwin linker this is default behaviour,
so in fact nothing is necessary here.  Linux and Solaris on the other
hand do need it.  Using install_name_tool on Darwin, the dynamic shared
library install names can be changed, for Linux and Solaris I don't know
a way to do that.

> FWIW, the Mozilla and OpenOffice.org apps have a long history of
> using LD_LIBRARY_PATH on Linux and other OS's...

They wrap it in scripts which is way more controlled than setting it
global.  Also including the system library paths before the offset ones
is not an option, because the sole purpose of the offset usually is to
override those of the host system.

Food for thoughts?

Fabian Groffen
Gentoo on a different level

More information about the lsb-discuss mailing list