Date: Thu, 31 May 2012 14:32:15 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Eugene Grosbein <egrosbein@rdtc.ru> Cc: freebsd-stable@freebsd.org, Oliver Fromme <olli@lurza.secnetix.de> Subject: Re: i386 binaries on amd64: ldconfig problems Message-ID: <20120531113215.GO2358@deviant.kiev.zoral.com.ua> In-Reply-To: <4FC747DA.8040902@rdtc.ru> References: <201205301615.q4UGFxSF051308@lurza.secnetix.de> <20120531095847.GN2358@deviant.kiev.zoral.com.ua> <4FC747DA.8040902@rdtc.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--SdRgamFw6JHQm+h4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 31, 2012 at 05:28:42PM +0700, Eugene Grosbein wrote: > 31.05.2012 16:58, Konstantin Belousov writes: >=20 > >> But actually I shouldn't have to use LD_32_LIBRARY_PATH. > >> I mean, it's ldconfig's job to configure the directories for > >> locating the libraries. > >> > >> What is wrong here? > > The library search order is LD_{32}_LIBRARY_PATH, then DT_RPATH from > > the binary, then hints, then /lib:/usr/lib. So if rpath of the binary > > contains /usr/local/lib, you get /usr/local/lib before hints. > >=20 > > Rtld uses only the search path from the hints file. When a library with > > the matched name found, rtld tries to load it. Regardless of the result > > of the load attempt, further components of the search path list are not > > tried. > >=20 > > Look at the olvwm binary with readelf and see whether DT_RPATH specifies > > /usr/local/lib. >=20 > I've faced exactly same problem. What can be done other to rebuild > of all such 32bit bit binaries to make them work for transition period? > Should libmap32.conf help? It seems it does not. No idea. The presence of rpath in the binary indicates self-inflicted damage. Just do not specify -rpath for linking. If you have such broken binary, use LD_LIBRARY_PATH to override. In fact, the ELF standard requires that DT_RPATH is not overridable by LD_LIBRARY_PATH env variable, but DT_RUNPATH is. Currently our rtld interpretes both DT_RPATH and DT_RUNPATH as overridable, thus violating the standard and diverging from other ELF platforms. Dragonfly fixed this. --SdRgamFw6JHQm+h4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/HVr8ACgkQC3+MBN1Mb4ihFQCfQ3i8BsFmE9/mvCvWVZTeS/zh NuAAnRVbfHpCQjLAI4hSDft8LWWIr0NA =RLKJ -----END PGP SIGNATURE----- --SdRgamFw6JHQm+h4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120531113215.GO2358>