From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31086 invoked by alias); 5 Feb 2014 16:53:07 -0000 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 Received: (qmail 31077 invoked by uid 89); 5 Feb 2014 16:53:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f43.google.com Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com) (209.85.216.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 05 Feb 2014 16:53:04 +0000 Received: by mail-qa0-f43.google.com with SMTP id o15so942518qap.30 for ; Wed, 05 Feb 2014 08:53:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=A20HzjT592et034cN3pDxNgfdnaGSuxJeoCqHLMtdwI=; b=Aak2ldofL1SiZlQPHMTfWy2ZxeyeVQO1UGnST1cPWoWVdeciSdi+jgv9OeVxODycss VCvQbzHFUfGaPtNX0467uDroSDRvCL2/lVdGt8KnNV5lPazhlaz+fd+xeQW2E8zdfmZP MUtmTGRkZGe5RoONAC5gGEty8XIOvpvf9jZkawl4XbyMrYZCAWOg9JSKBxb6YNhsGiGH HzCLXgDNAETsWZO787XMoL/hDmUOqIwIIyiK0uSm0ddiRTDbRdK3/KOFmV03ftYMnxOr qGc6NohAToVPgaahkSZoodMVjnhncDAiDYiHaKm5N2tjK1rCE82rEsAJKUDUCi5DkhC2 SYXg== X-Gm-Message-State: ALoCoQkTMZN1qYYdXJkhya/IzG8qwLPGPi4NvWfKj0IhddvbD1LQ3COdaMd/hknz0izLm3a0q48Hxxnj4S+7/h4ckk66v4tpIlH+ZzRKy9rfnJeBYRWlH8trO4x8vGwSc8NGeGeuZ7umx2382Av8XW1rjp/KA4T091X+Gs7ATjaSH1MzzBpUlfXCxyHs/Yp0DqLWmJrNyj06J1w5uQWlhEx+Yh7uz+e4Xg== MIME-Version: 1.0 X-Received: by 10.229.35.194 with SMTP id q2mr4390459qcd.7.1391619181967; Wed, 05 Feb 2014 08:53:01 -0800 (PST) Received: by 10.140.25.205 with HTTP; Wed, 5 Feb 2014 08:53:01 -0800 (PST) In-Reply-To: References: <1356420600-11507-1-git-send-email-vapier@gentoo.org> <201302200115.32464.vapier@gentoo.org> <201302201340.48380.vapier@gentoo.org> Date: Wed, 05 Feb 2014 16:53:00 -0000 Message-ID: Subject: Re: [PATCH 2/2 v5] gold: enable new dtags by default From: Cary Coutant To: "Joseph S. Myers" Cc: Mike Frysinger , "H.J. Lu" , Ian Lance Taylor , Binutils Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00033.txt.bz2 >> It seems to me that the cases where DT_RUNPATH causes breakage are >> broken as intended, and the second-level libraries that depend on >> third-level libraries should have an embedded DT_RUNPATH that says >> where to find them. Of course, since they've been working for so long, > > Say you have a sysroot containing what's eventually intended to be some > system's root filesystem. None of the libraries therein should have RPATH > or RUNPATH set - paths on the host or the system used for testing wouldn't > work on the final target system, and on the final system the libraries > will be in standard directories such as /usr/lib. To build a test binary > that uses the sysroot before it's installed in a root filesystem, you use > -Wl,-dynamic-linker,/sysroot/ > -Wl,-rpath,/sysroot/lib:/sysroot/usr/lib. For this (which is the main > purpose I use -rpath for at all, building programs to use non-installed > libraries) to work reliably relies on all dependencies being found via > that RPATH, both direct and indirect. I consider this part of the > semantics of the -rpath option; that is, generating DT_RUNPATH should be a > different option such as -runpath. Why is LD_LIBRARY_PATH not the right way to do this? For the same reason that you don't want to build the libraries in the sysroot specially, I'd think that you'd want to build test binaries exactly the way they'd be built on the test system, rather than build them with a special linker option. For this scenario, maybe what we really need is an LD_SYSROOT environment variable. When the dynamic linker starts up, if it's not under the sysroot, it could re-exec the sysrooted dynamic linker, and all library searches would be subject to sysroot substitution. -cary