From owner-freebsd-toolchain@FreeBSD.ORG Wed Feb 11 08:45:39 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4508B8F9; Wed, 11 Feb 2015 08:45:39 +0000 (UTC) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3767D8B; Wed, 11 Feb 2015 08:45:38 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id p10so1935720wes.2; Wed, 11 Feb 2015 00:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=hTraqvvCl6gQCKGjvErI+M9pziSmzchdT/oJk4oAzoA=; b=BkuPMnjCh6T27qlJad3GpiI1cgQgWlczp2HMDybiFMYbhO3q+W7QL3MfDySkf1xBXF GXlM9v0X3Mt5Nzqt6x7gVnGboLS6y+uWWhK17BuV3svenGckizWhxHNzMch17Wwe6y0t flseT0x4COBxrvP/1xhizeV73OCnyODvSeWH5CvEyoCdT9sCc/eZicb1U9v4hZWFlwlM kZ3UhJARJlOsZ7QT+nsay9p0vCvvJdhHJC9Zpi0dlWIa4DHw9OreFzn18FrdjW7CTQE8 izY8O+SjwcmYr3oDga2eW4Zczv/ZvUYrPOJwhDo3Y8agOhcf8divOfsyZ2aWRZTDHqp7 WhMw== X-Received: by 10.194.133.68 with SMTP id pa4mr1745532wjb.26.1423644337215; Wed, 11 Feb 2015 00:45:37 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id pr9sm307760wjc.4.2015.02.11.00.45.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 00:45:36 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 11 Feb 2015 09:45:34 +0100 From: Baptiste Daroussin To: Warner Losh Subject: Re: Resurrecting clang external toolchain support in Makefile.inc Message-ID: <20150211084534.GY29891@ivaldir.etoilebsd.net> References: <54DABF3A.8060003@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RUh7Gb6wQL2PrpWP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-toolchain@freebsd.org, Peter Grehan X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2015 08:45:39 -0000 --RUh7Gb6wQL2PrpWP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 10, 2015 at 07:50:59PM -0700, Warner Losh wrote: >=20 > > On Feb 10, 2015, at 7:32 PM, Peter Grehan wrote: > >=20 > > Hi toolchain folk, > >=20 > > I've recently tried using the base system clang as an external toolchai= n i.e. > >=20 > > make CROSS_COMPILER_PREFIX=3D/usr/bin/ buildworld > >=20 > > .. and found that this no longer works after r273755 which split XFLAGS= into XC/XCXXFLAGS. This appears to be because the XFLAGS definitions that = define --sysroot and -B options aren't being passed through to clang, resul= ting in using header files from the host system. > >=20 > > My quick hack was > >=20 > > --- Makefile.inc1 (revision 278542) > > +++ Makefile.inc1 (working copy) > > @@ -374,6 +374,8 @@ > > TARGET_ABI?=3D unknown > > TARGET_TRIPLE?=3D ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd1= 1.0 > > XCFLAGS+=3D -target ${TARGET_TRIPLE} > > +XCFLAGS+=3D ${XFLAGS} > > +XCXXFLAGS+=3D ${XFLAGS} > > .endif > > .endif > >=20 > > However, this doesn't look to be the right way to fix this. > >=20 > > Any opinions on a proper fix ? >=20 > I have a similar =E2=80=9Cfix=E2=80=9D in my tree as well, but hadn=E2=80= =99t pushed it because I wasn=E2=80=99t quite sure the right way either. >=20 > Warner In my opinion we should track down the last traces of XFLAGS and turn them = into proper XCFLAGS and XCXXFLAGS, the intent was to get rid of XFLAGS because t= he name was confusing. so instead of adding XFLAGS to XC*FLAGS, the XFLAGS should juste be convert= ed into XC*FLAGS directly in my opinion. Best regards, Bapt --RUh7Gb6wQL2PrpWP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTbFq4ACgkQ8kTtMUmk6EzdRACglKn6YCo/ZgkPcZtpUXRgSxKY vYAAn25LVYF5dxRf/b6slUUXOTXIr5Ju =O1TQ -----END PGP SIGNATURE----- --RUh7Gb6wQL2PrpWP--