From owner-freebsd-questions@FreeBSD.ORG Fri Oct 15 09:21:26 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5036C16A4CE for ; Fri, 15 Oct 2004 09:21:26 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id C28B543D39 for ; Fri, 15 Oct 2004 09:21:24 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i9F9LKuD094545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Oct 2004 10:21:20 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)i9F9LJmo094544; Fri, 15 Oct 2004 10:21:19 +0100 (BST) (envelope-from matthew) Date: Fri, 15 Oct 2004 10:21:19 +0100 From: Matthew Seaman To: Dave Horsfall Message-ID: <20041015092119.GA93093@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Dave Horsfall , freebsd-questions@freebsd.org References: <20041015125113.G68950@mippet.ci.com.au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: <20041015125113.G68950@mippet.ci.com.au> User-Agent: Mutt/1.4.2.1i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (smtp.infracaninophile.co.uk [IPv6:::1]); Fri, 15 Oct 2004 10:21:20 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040904, clamav-milter version 0.75l on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,AWL,HAIR_LOSS autolearn=ham version=3.0.0 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: Getting LD_LIBRARY_PATH to work X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2004 09:21:26 -0000 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 15, 2004 at 12:52:32PM +1000, Dave Horsfall wrote: > [ Re-sent; I forgot I wasn't on the list ] No need to resend: non members are allowed to post to freebsd-questions@ =20 > FreeBSD 4.10-STABLE (i386) >=20 > For various reasons I need to "downgrade" OpenSSL 0.9.7d to something like > 0.9.6, to investigate an interoperability issue (upgrading the other box - > running 4.5-STABLE and OpenSSL 0.9.6a - is out of the question right now). >=20 > I'm trying to do this by setting the various variables LD_LIBRARY_PATH, > LD_RUN_PATH etc to "/usr/local/ssl/lib", but it keeps using the system > version. I'm used to the SunOS/Solaris implementation, if that makes a > difference. >=20 > I'd use "lfconfig", but I can never remember the right flags, and since > this is a soon-to-be production box I can't afford to get it wrong. >=20 > 1) Are LD_LIBRARY_PATH and friends actually supported, and if so how > exactly are they use; and >=20 > 2) What would be the correct flags to "ldconfig"? I think you're on a bit of a hiding to nothing here. FreeBSD ld(1) is from GNU binutils, so the shlib behaviour is like Linux rather than Solaris. One crucial difference is that binaries can have hints compiled into them about where to search for shlibs -- see the sections on '-rpath' and '-rpath-link' in the ld(1) manual page. That mechanism generally overrides the uses of LD_LIBRARY_PATH as seen under Solaris. ldconfig(8) probably won't help you very much either. What it does is generate a quick lookup table of all of the shlibs found in the standard system directories and any other directories passed to it on the command line. So when the dynamic loader rltd(1) is searching for the shlibs it needs, instead of having to open up and scan through actual directories on disk, it can just consult that file, which is very much faster. ldconfig(8) has no effect on what order shlib directories are searched. See libmap.conf(5) for what is probably the answer to your problem. If you fiddle the ABI version number on your regressed OpenSSL shlib, you can use libmap.cong(5) to force whatever applications you're interested in to link against it. Note that playing with shlib mappings like this is fraught with pitfalls and likely to result in premature hair loss, so proceed carefully. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBb5aPiD657aJF7eIRAp3vAJ4sO6NOTOF0f9o029KNEEg/3yRgrgCgoqa0 +7SefCFdd1GLO0bcyRSTPnk= =pK9X -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi--