From owner-freebsd-toolchain@FreeBSD.ORG Wed Feb 11 02:51:08 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C1FD936 for ; Wed, 11 Feb 2015 02:51:08 +0000 (UTC) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) (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 0DBA4141 for ; Wed, 11 Feb 2015 02:51:07 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id fb1so1110726pad.8 for ; Tue, 10 Feb 2015 18:51:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=BL6KCaoIJwa5l/TIIQa3bEtQ6fKSzu/lWxbYmATXxDY=; b=epfRrOapU48aeBYHxbp61ajMB9tNmgJAj5W/daVRFRnKCJv1clm9lh/A0hKkF5tnUd f+ZvF4Mc6cyEJ79m/rc1F70/BRGhStNKhx0APu/AjPdb7Ewig8oJNsH20L3ekg4BuB6S HkUWUMuQ+oFLuf2ltU0Cg7plVieEyxPBy/5y6VV5rIl5J7FQ6S2nTqxLdKP9frnUwfUq W7nACFH5qfhj2JfQWihJhJD6Kk6kVmmvW2zSf5oOYC3z8VUUG+wG6aA8dwqthgl2wJ5p Nfq7R35HyuAn6BC9v+AY+FP0PXvhewEs98/zLAuHbKSJJuzDg+Chhaq6EFbUgDj6qSKq pC9w== X-Gm-Message-State: ALoCoQnI1LYo1vtJ6hF9Y/5FgjPUylShfMpnKPMccHVa0xkUk17lrLqBJlK43AIc3dRlYfleoRfN X-Received: by 10.70.25.4 with SMTP id y4mr26339915pdf.5.1423623061099; Tue, 10 Feb 2015 18:51:01 -0800 (PST) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id y2sm20716240pdm.31.2015.02.10.18.51.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Feb 2015 18:51:00 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Resurrecting clang external toolchain support in Makefile.inc From: Warner Losh In-Reply-To: <54DABF3A.8060003@freebsd.org> Date: Tue, 10 Feb 2015 19:50:59 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <54DABF3A.8060003@freebsd.org> To: Peter Grehan X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-toolchain@freebsd.org 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 02:51:08 -0000 > 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 = toolchain 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, resulting 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}-freebsd11.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 ? I have a similar =E2=80=9Cfix=E2=80=9D in my tree as well, but hadn=E2=80=99= t pushed it because I wasn=E2=80=99t quite sure the right way either. Warner=