From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5124 invoked by alias); 20 Feb 2013 18:40:50 -0000 Received: (qmail 5068 invoked by uid 22791); 20 Feb 2013 18:40:49 -0000 X-SWARE-Spam-Status: No, hits=-9.3 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Feb 2013 18:40:32 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 3872D33DE46; Wed, 20 Feb 2013 18:40:30 +0000 (UTC) From: Mike Frysinger To: "H.J. Lu" Subject: Re: [PATCH 2/2 v5] gold: enable new dtags by default Date: Wed, 20 Feb 2013 18:40:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.7.6; KDE/4.6.5; x86_64; ; ) Cc: Ian Lance Taylor , binutils@sourceware.org References: <1356420600-11507-1-git-send-email-vapier@gentoo.org> <201302200115.32464.vapier@gentoo.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7540062.M3l7PNY8op"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201302201340.48380.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00258.txt.bz2 --nextPart7540062.M3l7PNY8op Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 3791 On Wednesday 20 February 2013 12:16:51 H.J. Lu wrote: > On Tue, Feb 19, 2013 at 10:15 PM, Mike Frysinger wrot= e: > > On Tuesday 05 February 2013 00:43:04 Ian Lance Taylor wrote: > >> On Mon, Feb 4, 2013 at 5:44 PM, H.J. Lu wrote: > >> > This caused: > >> >=20 > >> > http://www.sourceware.org/bugzilla/show_bug.cgi?id=3D15098 > >> >=20 > >> > I changed BFD linker not set new dtags with -rpath. > >>=20 > >> I don't see why that is the right fix. Since DT_RPATH/DT_RUNPATH are > >> only ever set by the linker's -rpath option, it seems like the right > >> fix is to always use DT_RPATH and never use DT_RUNPATH. > >>=20 > >> Of course, since the only thing --new-dtags does in gold is select > >> DT_RUNPATH rather than DT_RPATH, this makes new--dtags completely > >> useless in gold. > >>=20 > >> It seems that we have made sensible-seeming decisions to wind up in an > >> absurd place. It seems that we should now make --new-dtags a no-op > >> and drop all support for generating DT_RUNPATH. Which makes me wonder > >> why DT_RUNPATH was invented in the first place. > >=20 > > sorry, but my main comp hd died, so i've been offline for a while. it > > seems that the current status is that the linker no longer defaults to > > --enable-new- dtags, but bfd still only specifies DT_RUNPATH if the flag > > is enabled (rather than using both). is that correct ? > >=20 > > DT_RUNPATH is preferable to DT_RPATH because the latter is searched > > *before* LD_LIBRARY_PATH which is bad. most of the use cases i've seen > > with rpath fall > >=20 > > into two categories: > > - people want to generate libraries with a custom path to loadable > > plugins -- > >=20 > > DT_RUNPATH works great > >=20 > > - people want their application to search a local path for all of its > > libs -- > >=20 > > DT_RPATH works here w/$ORIGIN > >=20 > > - people want to install their shared libs into a non-searchable path > > and > >=20 > > have their application use it -- DT_RUNPATH works here > >=20 > > i've seen build cases where DT_RPATH actively causes problems when there > > is a version already installed. they compile their local binary and its > > shared libs, then attempt to use LD_LIBRARY_PATH to force the binary to > > use the local libs. unfortunately, the DT_RPATH kicks in and loads > > everything from / instead and it falls down. > >=20 > > considering Gentoo has been defaulting to --enable-new-dtags since at > > least 2004 and i have yet to see a bug report related to it, i wonder > > what actually broke that caused you to notice this ? and if it's a > > minor case, is a better answer to tell people to use --disable-new-dtags > > if they really don't want the new DT_RUNPATH behavior ? seems like the > > DT_RPATH behavior is the exception rather than the rule ... the only > > thing it has going for it is historical precedence. > >=20 > > similarly, i don't think it generally makes sense for libraries to > > utilize DT_RPATH. dare i suggest that a middle ground might be to > > default to DT_RUNPATH when -shared is in use, and DT_RPATH otherwise ? >=20 > Since DT_RPATH !=3D DT_RUNPATH. we need a new option to > specify DT_RUNPATH. i'm aware "DT_RPATH !=3D DT_RUNPATH" is a true statement. however, my poin= t=20 still stands that for the majority of cases, people want runpath tags to=20 specify custom paths for loading libraries and in that regard, DT_RUNPATH i= s=20 the same as DT_RPATH. imo, the example you posted is the exception rather= =20 than the rule when it comes to expected behavior and already works w/the=20 patches i posted -- if you want that behavior, use -rpath --disable-new-dta= gs.=20=20 hence the idea is to improve the default rather than requiring everyone to= =20 change flags. -mike --nextPart7540062.M3l7PNY8op Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJRJRiwAAoJEEFjO5/oN/WB5jYQAOOqp1EomS8p3MF0NVUYrhbx cZ872MY/fiwWw4KPpcSmFNPUIvHEo2U9L0gH0cVWmfKlct21xABl7SFuVAWbgCi/ jIPRJdEMXapWy9pVowa6f4DmoUw9F395ndc+qmCrlHlTs7Jb4OLeY5IgD4Ca4L4s tYHEkVgzYjHuXWe3wElGNbayvas9z2NsRZP7kHmXDxCSGe4mVU/J+X3LjopO5ZrW 7n7fKnMDAC+BZ05AUAZW4CsaoqB3BvPK5vHyKWoDom2HGYePe1ROfL19/IKm05Gm bXLgKUMCJFhqEEvAxj1x0KiFFQ1vkdPKouTV42O2k4JEG5ayvpGfxAQye3WwvVsM 3aGVgJJC2o0Sf7DaR6rTgS3+cWc0n1WFNxhmdg8asdOS4Ap86XEuTUNBJuKje3vC oVWjCroxptd9IZJEYdfJvN68Q6lWLnfp5+cAjvaBH8wENG57Uc07gbfadosYOKoz VGGw6yvwBqISe/Icu1yYKjg8nbt/j6pHBLXByoa1MeMf4i5riwmsFO2+ojBI+o9V BlYsRQXvnCvi203o5mCxhOgrjLoPmICorTWIYByYZpJCOUxtv80ovBtg2yQO/hK6 aHI1SACeAxdfPw4PdQXZDsj59vRlLwy/EfORkNcZVdm+Lurf5mcFZttGIQ97Xs1a jNH9Tc5fDpgvO6jxncqT =bNJD -----END PGP SIGNATURE----- --nextPart7540062.M3l7PNY8op--