From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130529 invoked by alias); 7 Jan 2018 17:23:06 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 130516 invoked by uid 89); 7 Jan 2018 17:23:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=ongoing, everybody, H*i:sk:df30423, H*f:sk:df30423 X-HELO: out3-smtp.messagingengine.com Received: from out3-smtp.messagingengine.com (HELO out3-smtp.messagingengine.com) (66.111.4.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 07 Jan 2018 17:23:04 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 448E22089E for ; Sun, 7 Jan 2018 12:23:03 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 07 Jan 2018 12:23:03 -0500 X-ME-Sender: Received: from localhost (135-23-125-70.cpe.pppoe.ca [135.23.125.70]) by mail.messagingengine.com (Postfix) with ESMTPA id DFCC57E322 for ; Sun, 7 Jan 2018 12:23:02 -0500 (EST) Date: Sun, 07 Jan 2018 17:23:00 -0000 From: Steven Taschuk To: crossgcc@sourceware.org Subject: Re: binutils executables capture paths from build machine Message-ID: <20180107172557.GB8958@femur> References: <20180106192755.GA3536@femur> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00002.txt.bz2 Quoth Alexey Neyman: > On 01/06/2018 11:27 AM, Steven Taschuk wrote: > > I've understood correctly, the bash function do_binutils_for_host > > configures binutils with --prefix=${CT_PREFIX_DIR} and installs the > > executables with make install. This procedure results in paths from > > the build machine being embedded in the binaries, in at least two > > places: the use of BINDIR at binutils-2.28/bfd/plugin.c:337; and > > the various uses of DEBUGDIR in binutils-2.28/bfd/dwarf2.c (where > > DEBUGDIR=${libdir}/debug; see binutils-2.28/bfd/configure.ac:108). > > It is not just that. Also, NLS code embeds some build-time paths > into the code, etc. [...] I think in my situation, for binutils, it actually is just these two spots. (Details: My config has NLS disabled. To handle debugging information, I patch the build->host cross toolchain to support BUILD_PATH_PREFIX_MAP from the Debian reproducible builds project. I'm not sure what else you had in mind for "etc", but if I tweak the binutils source in the two places I mentioned to use hard-coded paths, the binutils executables become reproducible in my build, in the few environments I've tested. I won't be surprised to find other irreproducibilities when I expand the set of build environments that I test with, but that's where things stand right now.) > [...] The problem is that we don't know where the > toolchain will be located and many configure scripts "automagically" > find headers/libraries based on the value of $prefix. [...] Yeah, I understand that many packages are distributed with build systems that don't support the build!=host case well, and that magical autodetection in configure scripts is a big part of that, and I certainly don't expect crosstool-ng to fix everybody else's build systems. As you said, that'd be a huge ongoing maintenance headache. Is this known to be a problem with binutils specifically? Also, if it is a problem with binutils, why does do_binutils_for_target use the procedure where --prefix refers to a path on the host, and DESTDIR is used to install it elsewhere on the build machine? -- Steven Taschuk http://www.amotlpaa.org/ "What? shall we receive good at the hand of God, and shall we not receive evil?" -- Job 2:10