From owner-freebsd-current@FreeBSD.ORG Sat Sep 8 10:59:05 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC62C106566B; Sat, 8 Sep 2012 10:59:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 63C298FC12; Sat, 8 Sep 2012 10:59:05 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:7556:32b3:4fd3:596e] (unknown [IPv6:2001:7b8:3a7:0:7556:32b3:4fd3:596e]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C98E85C37; Sat, 8 Sep 2012 12:59:03 +0200 (CEST) Message-ID: <504B24FF.5070901@FreeBSD.org> Date: Sat, 08 Sep 2012 12:59:11 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20120905 Thunderbird/16.0 MIME-Version: 1.0 To: "O. Hartmann" References: <5049C13E.5010808@mail.zedat.fu-berlin.de> <504A0E46.3010306@FreeBSD.org> <504A16BA.7030407@mail.zedat.fu-berlin.de> <20120907170728.GB28113@lor.one-eyed-alien.net> <504B033B.4020001@zedat.fu-berlin.de> In-Reply-To: <504B033B.4020001@zedat.fu-berlin.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Current FreeBSD , "O. Hartmann" , Brooks Davis Subject: Re: FreeBSD 10.0-CURRENT: CLANG and port/clang weirdness! 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: Sat, 08 Sep 2012 10:59:05 -0000 On 2012-09-08 10:35, O. Hartmann wrote: > On 09/07/12 19:07, Brooks Davis wrote: ... >> FWIW, picking up clang etc from /usr/local should be mostly harmless >> during the early build stage. You're actual world will be built with >> the cross clang. > ... means, the resulting WORLD and KERNEL is then build by the > LLVM/CLANG that is residing in /usr/obj/...? Yes. This is done so you can build an updated version of the system compiler during the cross-tools stage, and then build the rest of the world with this updated compiler. > But what is with PORTS I build later? They definitely pick up the > "wrong" clang/clang++. If your search path has /usr/local/bin before /usr/bin, it will obviously always pick up the ports-compiled clang, whatever version that is. If some other ports explicitly require clang 3.1, there should be a mechanism to specifically invoke that version, instead of whatever the first "clang" executable in the search path is. For now, I think the best solution is to use the following (admittedly rather kludgy) fragment in /etc/make.conf: .if ${.CURDIR:M/usr/src*} || ${.CURDIR:M/usr/obj*} CC=clang CXX=clang++ CPP=clang-cpp .else CC=/usr/bin/clang CXX=/usr/bin/clang++ CPP=/usr/bin/clang-cpp .endif Or alternatively: .if ${.CURDIR:M/usr/ports*} CC=/usr/bin/clang CXX=/usr/bin/clang++ CPP=/usr/bin/clang-cpp .else CC=clang CXX=clang++ CPP=clang-cpp .endif >> You're probably looking for WITH_CLANG_EXTRAS. > I already have that option enabled in my /etc/src.conf. But > unfortunately, a tool called "llvm-config" and sibblings weren't > installed, they get installed only with /usr/ports/devel/llvm[-devel]. This is on purpose, at least for now. The base system should only contain the clang compiler proper, and none of the LLVM libraries. The WITH_CLANG_EXTRAS option is just for getting a few tools that could be handy, but should not be used by 99% of the users out there. If you want the whole llvm and/or clang shebang, including the shared libraries, just install the port. You can use the lang/clang-devel port if you want to try out the bleeding edge version. AFAIK Brooks updates it regularly.