Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Aug 1998 23:04:17 -0400 (EDT)
From:      "Matthew N. Dodd" <winter@jurai.net>
To:        John Polstra <jdp@polstra.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: ELF problems to occur 
Message-ID:  <Pine.BSF.4.02.9808152250550.5813-100000@sasami.jurai.net>
In-Reply-To: <199808160249.TAA20839@austin.polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 15 Aug 1998, John Polstra wrote:
> > Whats wrong with specifying the search path with the '-R' flag when
> > the program is linked?
> 
> Nothing, provided you know where the libraries are going to be.
> Actually, I like this idea.  It makes a lot of sense, especially for
> ports.

Exactly.  '-R' is the easy way for us to keep track of dependancies on
libraries; the binary keeps track of its search path, not the
administrator of the system.

If the administrator wants to move things from their default locations, he
should be able to recompile the binary, edit the search path in the binary
(is this possiable?  I've not been able to find a way to do this in
Solaris.) or at last resort, use LD_LIBRARY_PATH.

Its too easy for users to subvert LD_LIBRARY_PATH and dig themselves
gopher holes to trip up in.  In addition, relying on LD_LIBRARY_PATH
complicates the use of multiple versions of a library with different
binaries.  At the site I work at, we use a commercial version of Kerberos,
installed in say /usr/kerberos/{bin,lib,etc}.  I compile and install MIT
kerberos in $HOME/opt/krb5/{bin,lib,etc}.  I neglect to modify the build
process to add the proper '-R' and decide to use LD_LIBRARY_PATH; both the
commercial and the MIT versions of kerberos call their libraries the same
thing (libkrb5.so for short.).  Running the original binaries out of
/usr/kerberos/bin results in an error as the LD_LIBRARY_PATH lets the
binary load the wrong library.

Long winded but this is one of the reasons I dislike relying on
LD_LIBRARY_PATH.  Using it for temporary situations is fine; installed
programs have no business using it.

If anyone knows if it is feasible to modify the compiled in search paths
I'd like to know about it.  This is the best solution for the desire to
allow libraries to be moved.

-- 
| Matthew N. Dodd  |This space | '78 Datsun 280Z | FreeBSD/NetBSD/Sprite/VMS |
| winter@jurai.net |is for rent| '84 Volvo 245DL | ix86,sparc,m68k,pmax,vax  |
| http://www.jurai.net/~winter | Are you k-rad elite enough for my webpage?  |


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02.9808152250550.5813-100000>