From owner-freebsd-current Sat Aug 15 20:04:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA21552 for freebsd-current-outgoing; Sat, 15 Aug 1998 20:04:53 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sasami.jurai.net (sasami.jurai.net [207.153.65.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA21547 for ; Sat, 15 Aug 1998 20:04:52 -0700 (PDT) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.8.8/8.8.7) with SMTP id XAA06693; Sat, 15 Aug 1998 23:04:17 -0400 (EDT) Date: Sat, 15 Aug 1998 23:04:17 -0400 (EDT) From: "Matthew N. Dodd" To: John Polstra cc: current@FreeBSD.ORG Subject: Re: ELF problems to occur In-Reply-To: <199808160249.TAA20839@austin.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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