From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31957 invoked by alias); 9 Oct 2014 02:55:12 -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 31944 invoked by uid 89); 9 Oct 2014 02:55:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: bes.se.axis.com Received: from bes.se.axis.com (HELO bes.se.axis.com) (195.60.68.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Oct 2014 02:55:10 +0000 Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id B14E52E4A1; Thu, 9 Oct 2014 04:55:06 +0200 (CEST) Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id IdXVUWbOG7nq; Thu, 9 Oct 2014 04:55:01 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bes.se.axis.com (Postfix) with ESMTP id 59EC62E49D; Thu, 9 Oct 2014 04:55:01 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 3870213AE; Thu, 9 Oct 2014 04:54:49 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id 2D09A109E; Thu, 9 Oct 2014 04:54:49 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 2A6B63E1EB; Thu, 9 Oct 2014 04:54:49 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id s992smQD020448; Thu, 9 Oct 2014 04:54:49 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id s992sm9O020444; Thu, 9 Oct 2014 04:54:48 +0200 Date: Thu, 09 Oct 2014 02:55:00 -0000 Message-Id: <201410090254.s992sm9O020444@ignucius.se.axis.com> From: Hans-Peter Nilsson To: binutils@sourceware.org CC: nickc@redhat.com In-reply-to: <5395BD06.2000403@redhat.com> (message from Nicholas Clifton on Mon, 9 Jun 2014 15:56:22 +0200) Subject: [PATCH 0/6] Allow a first "=" to mean sysroot for all paths in linker-scripts MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-SW-Source: 2014-10/txt/msg00053.txt.bz2 > From: Nicholas Clifton > Date: Mon, 9 Jun 2014 15:56:22 +0200 > Hi Hans-Peter, > > > Is there a reason not to allow a first character '=' to mean > > sysroot-prefix for all paths inside linker scripts? > > No... > > > So again, how about treating "=" as the sysroot prefix for > > *all* paths in linker scripts? > > A good idea - please submit a patch. > > > What to do about quoted paths? > > (I suggest both quoted and unquoted "="-prefixed paths to work.) > > Hmm, I can think of no situation where a user would want to use = as a > valid first character of a real filepath, so quoted and unquoted > prefixes are fine. So, here we go, a patch-set to implement this. I haven't done the same for gold though. I had a brief look: it appears it doesn't currently support a "=" as in SEARCH_DIR("=/file/path") so at least it's not inconsistent. :) Again, the automatic and context-sensitive semantics of naked absolute paths for sysrooted configurations may look like a feature but can actually pick up the wrong files. See for original RFC. Hopefully after this, the glibc project can consider autoconf-checking if the linker being used supports a "=" prefix and then always prefix that in its libc.so, like GROUP ( =/lib/libc.so.6 =/lib/libc_nonshared.a AS_NEEDED ( =/lib/ld.so.1 ) ) as this'll work for both sysrooted and non-sysrooted configurations. The default sysroot for the *linker* is "" (and then that's also the only supported option to --sysroot). (I also have a glimmer of a hope that some day cross-toolchains will default to have sysroot enabled with a value like //sys-root, so you'd have sane semantics when linking dynamically and with no need to pass configure options other than --target and --prefix.) brgds, H-P