From owner-freebsd-current@FreeBSD.ORG Tue Aug 17 12:05:34 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95CD1106567A for ; Tue, 17 Aug 2010 12:05:34 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2F48FC19 for ; Tue, 17 Aug 2010 12:05:33 +0000 (UTC) Received: from gidgate.gid.co.uk (80-46-130-69.static.dsl.as9105.com [80.46.130.69]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id o7HBoB0q074797; Tue, 17 Aug 2010 12:50:11 +0100 (BST) (envelope-from rb@gid.co.uk) Received: from [192.168.1.2] (host86-178-206-201.range86-178.btcentralplus.com [86.178.206.201]) by gidgate.gid.co.uk (8.13.8/8.13.8) with ESMTP id o7HBo5hZ029584; Tue, 17 Aug 2010 12:50:05 +0100 (BST) (envelope-from rb@gid.co.uk) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Bob Bishop In-Reply-To: <4C6A7357.8000606@andric.com> Date: Tue, 17 Aug 2010 12:49:59 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <19F5467B-6432-4531-BF04-62D8EB4F3093@gid.co.uk> References: <4C6A7357.8000606@andric.com> To: Dimitry Andric X-Mailer: Apple Mail (2.1081) Cc: current@freebsd.org Subject: Re: Building world with clang X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 17 Aug 2010 12:05:34 -0000 Hi, On 17 Aug 2010, at 12:32, Dimitry Andric wrote: > Hi, >=20 > Since clang has gone into the tree, there has been an effort to get = head > in a state where world can optionally be built with it. > [...] > Now, for building clang as the bootstrap compiler, there are basically > two methods to make it use the correct headers, C startup objects, and > libraries from the object tree (${WORLDTMP}): >=20 > 1) The "isysroot" method: build a regular version of clang, and make > sure WMAKEENV contains something like: >=20 > CC=3D"${CC} -isysroot ${WORLDTMP} -B${WORLDTMP}/usr/lib/ \ > -L${WORLDTMP}/usr/lib/" >=20 > 2) The "tools-prefix" method: build a special version of clang, that > has its default search paths for headers, startup objects and > libraries modified, to look for everything under ${WORLDTMP}. >=20 > Method 1) is used in the clangbsd project branch. >=20 > Method 2) is similar to what is used for building the in-tree gcc as > the bootstrap compiler. During the cross-tools stage, TOOLS_PREFIX is > defined to point at ${WORLDTMP}, and the bootstrap gcc's built-in > search paths get prefixed with it. >=20 > An advantage of method 1) is that it does not require any = modifications > to the compiler, and basically just a few extra command line = arguments. > The same method could probably even be made to work for gcc. >=20 > However, a disadvantage is that the built-in search paths of the > bootstrap compiler are not entirely disabled by using the -isysroot, = -B > and -L flags, This could be viewed as a bug ... > so there is still a chance that headers, objects or > libraries outside of ${WORLDTMP} will be picked up during the world > stage. ... and the last thing you want in buildworld is this kind of POLA = violation ... > An advantage of method 2) is that you can be 100% sure all built-in > search paths of the bootstrap compiler point to directories under > ${WORLDTMP}. Of course, a disadvantage is that you have to make some > modifications to the compiler source itself. ... so, which fix to the compiler do you want to make? > [etc] -- Bob Bishop rb@gid.co.uk