Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Oct 2004 10:21:19 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Dave Horsfall <dave@horsfall.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Getting LD_LIBRARY_PATH to work
Message-ID:  <20041015092119.GA93093@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20041015125113.G68950@mippet.ci.com.au>
References:  <20041015125113.G68950@mippet.ci.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041015092119.GA93093>