From owner-freebsd-stable@FreeBSD.ORG Thu May 31 11:32:23 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C2241065672 for ; Thu, 31 May 2012 11:32:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B8A3C8FC15 for ; Thu, 31 May 2012 11:32:22 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4VBWFRr028477; Thu, 31 May 2012 14:32:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4VBWFcG032977; Thu, 31 May 2012 14:32:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4VBWF3k032976; Thu, 31 May 2012 14:32:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 31 May 2012 14:32:15 +0300 From: Konstantin Belousov To: Eugene Grosbein Message-ID: <20120531113215.GO2358@deviant.kiev.zoral.com.ua> References: <201205301615.q4UGFxSF051308@lurza.secnetix.de> <20120531095847.GN2358@deviant.kiev.zoral.com.ua> <4FC747DA.8040902@rdtc.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SdRgamFw6JHQm+h4" Content-Disposition: inline In-Reply-To: <4FC747DA.8040902@rdtc.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-stable@freebsd.org, Oliver Fromme Subject: Re: i386 binaries on amd64: ldconfig problems X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 11:32:23 -0000 --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--