From owner-freebsd-toolchain@FreeBSD.ORG Wed Feb 11 02:32:40 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 894AC548 for ; Wed, 11 Feb 2015 02:32:40 +0000 (UTC) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47A8EF13 for ; Wed, 11 Feb 2015 02:32:40 +0000 (UTC) Received: from localhost (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id D4E4628111F for ; Wed, 11 Feb 2015 12:32:30 +1000 (EST) X-Amavis-Modified: Mail body modified (using disclaimer) - iredmail.onthenet.com.au X-Virus-Scanned: amavisd-new at iredmail.onthenet.com.au Received: from iredmail.onthenet.com.au ([127.0.0.1]) by localhost (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5625e9WW_yU5 for ; Wed, 11 Feb 2015 12:32:30 +1000 (EST) Received: from Peters-MacBook-Pro.local (unknown [64.245.0.210]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id 11F9328111C; Wed, 11 Feb 2015 12:32:28 +1000 (EST) Message-ID: <54DABF3A.8060003@freebsd.org> Date: Tue, 10 Feb 2015 18:32:26 -0800 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: freebsd-toolchain@freebsd.org Subject: Resurrecting clang external toolchain support in Makefile.inc Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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:32:40 -0000 Hi toolchain folk, I've recently tried using the base system clang as an external toolchain i.e. make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld .. 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. My quick hack was --- Makefile.inc1 (revision 278542) +++ Makefile.inc1 (working copy) @@ -374,6 +374,8 @@ TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} +XCFLAGS+= ${XFLAGS} +XCXXFLAGS+= ${XFLAGS} .endif .endif However, this doesn't look to be the right way to fix this. Any opinions on a proper fix ? later, Peter.