From owner-freebsd-current@FreeBSD.ORG Thu May 1 21:40:23 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A47CF30; Thu, 1 May 2014 21:40:23 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E4F7F10BB; Thu, 1 May 2014 21:40:22 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::acc1:8e53:4fbd:d697] (unknown [IPv6:2001:7b8:3a7:0:acc1:8e53:4fbd:d697]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 95B6C5C43; Thu, 1 May 2014 23:40:17 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_A7148505-F64E-40E2-ACE4-16657CAB9710"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: POLA.. missing --sysroot option in ld? From: Dimitry Andric In-Reply-To: <20140501131830.GA9578@lor.one-eyed-alien.net> Date: Thu, 1 May 2014 23:40:00 +0200 Message-Id: <8886F538-1002-4DE6-8273-817E228AE8A2@FreeBSD.org> References: <536061A9.7030502@freebsd.org> <53607ABD.1000605@freebsd.org> <20140501131830.GA9578@lor.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.1874) Cc: FreeBSD Current , Warner Losh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 21:40:23 -0000 --Apple-Mail=_A7148505-F64E-40E2-ACE4-16657CAB9710 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 01 May 2014, at 15:18, Brooks Davis wrote: > On Wed, Apr 30, 2014 at 11:02:31PM -0600, Warner Losh wrote: >>=20 >> On Apr 29, 2014, at 10:23 PM, Julian Elischer = wrote: >>> On 4/30/14, 10:36 AM, Julian Elischer wrote: >>>> In our 8.0 based systems at $JOB our build environment made heavy = use of the --sysroot option in gcc and ld. >>>>=20 >>>> We are trying to move up to a newer release but suddenly the = --sysroot option has disappeared. >>>>=20 >>>> we get the message "/usr/bin/ld: this linker was not configured to = use sysroots" >>> more spefically the following command (from 'configure') fails on = "near 9" >>> and succeeds on 8.0. >>>=20 >>> configure:3352: /usr/bin/gcc -Wall -Wno-unused-parameter -nostdinc = -isystem /usr/build/buildroot/tools/x86_gcc4.2.4/usr/include --sysroot = /usr/build/buildroot/tools/x86_gcc4.2.4 -Wall -Wno-unused-parame >>> ter -nostdinc -isystem = /usr/build/buildroot/tools/x86_gcc4.2.4/usr/include --sysroot = /usr/build/buildroot/tools/x86_gcc4.2.4 --sysroot = /usr/build/buildroot/tools/x86_gcc4.2.4 -L/usr/build/buildroot/too >>> ls/x86_gcc4.2.4/lib = -L/usr/build/buildroot/tools/x86_gcc4.2.4/usr/lib conftest.c >&5 >>>>=20 >>>> Does anyone know what happened? and when, and by who? >>>> I have looked in the Makefiles and configuration files in SVN and I = can't see a change that would have done this.. >>>> of course the building of these tools is rather complex so I may = have missed some place.. >>=20 >> Yea, I looked too and don?t see anything. I thought it was broken in = more like 2005 not 2011. You?re only hope is to bisect the tree down to = the change that caused it? >=20 > It's been broken since at least the last binutils import and probably > longer since the inane ld behavior of activating --sysroot only when > built with a specified sysroot is from upstream. The fix is trivial, = just > merge r257268 and r257530 to the branch you are using. Yes, I already had a discussion with Julian on IRC about it, but for the sake of the mailing list, a summary: * The change got introduced with the binutils 2.17.50 merge, in r218822 (-CURRENT, at the time). * Upstream apparently introduced this, "because it was hard to make it work": see the thread starting at https://sourceware.org/ml/binutils/2007-02/msg00274.html * Upstream binutils git master still contains the same logic. * Brooks's r257268 and r257530 ensures TARGET_SYSTEM_ROOT is always defined (e.g. to "/" in the regular case), making --sysroot work correctly. -Dimitry --Apple-Mail=_A7148505-F64E-40E2-ACE4-16657CAB9710 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlNivz8ACgkQsF6jCi4glqPyHQCgiaYWHGNSBoep/NsobaIgM/rF pkQAoNol2WEFdptjDHR4ZoBTO5bjCGe4 =OKAg -----END PGP SIGNATURE----- --Apple-Mail=_A7148505-F64E-40E2-ACE4-16657CAB9710--