From owner-freebsd-current@FreeBSD.ORG Fri Sep 7 15:10:03 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 23B611065673 for ; Fri, 7 Sep 2012 15:10:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id CBB7A8FC1B for ; Fri, 7 Sep 2012 15:10:02 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C0EE85C37; Fri, 7 Sep 2012 17:09:55 +0200 (CEST) Message-ID: <504A0E46.3010306@FreeBSD.org> Date: Fri, 07 Sep 2012 17:09:58 +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> In-Reply-To: <5049C13E.5010808@mail.zedat.fu-berlin.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Current FreeBSD 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: Fri, 07 Sep 2012 15:10:03 -0000 On 2012-09-07 11:41, O. Hartmann wrote: > Building ports not explicitely enabling USE_GCC=4.6+ are considered > using the system's LLVM/CLANG, which is clang 3.2 in our installation > (FreeBSD 10.0-CURRENT #0 r240164), but since some ports require the > special ports devel/llvm and lang/clang, LLVM 3.1 and clang 3.1 get > installed and 3.1 is used instead the system's 3.2 whenever "clang", > "clang++" is invoked. Maybe a solution would be to use the same approach as with the gcc ports, namely installing the clang 3.1 executables into /usr/local/bin as clang-3.1, clang++-3.1 and clang-cpp-3.1. Then you could simply set CC=clang-3.1 CXX=clang++-3.1 CPP=clang-cpp-3.1 for the targets that require it. Brooks? :) > Following the WIKI at http://wiki.freebsd.org/BuildingFreeBSDWithClang > introduces the usage of > > CC=clang instead of CC=/usr/bin/clang > CXX=clang++ instead of CXX=/usr/bin/clang++ > CPP=clang-ccp instead of CPP=/usr/bin/clang-ccp > > Is this intended? Yes. During buildworld, in the cross-tools stage, a new compiler is built, and it is placed under ${WORLDTMP}, usually /usr/obj/usr/src/tmp. Afterwards, in the rest of the stages, the PATH is changed so executables from ${WORLDTMP} are preferred above those in the system directories. Therefore, if you set CC/CXX/CPP with an explicit path, this logic will not work, and your buildworld may have all kinds of trouble. I think there are several patches floating around to fix this, in various different ways. > Since I can not simply change the search patch - I need to have > /usr/local/bin before /usr/bin, is there a way to avoid this confusion? Yes, don't install the clang port, or do install it, but manually move the conflicting executables away, or delete them. This can't be fixed without fixing the clang ports to accept an option to change the compiler names into something non-conflicting. ... > My /etc/make.conf portion looks this: > > > > ## > ## CLANG > ## > .if !defined(NO_CLANG) > .if !defined(CC) || ${CC} == "cc" > CC= /usr/bin/clang > .endif > .if !defined(CXX) || ${CXX} == "c++" > CXX= /usr/bin/clang++ > .endif > .if !defined(CPP) || ${CPP} == "cpp" > CPP= /usr/bin/clang-cpp > .endif As said, putting an absolute path in these settings will defeat the logic in buildworld. Please don't do it, until there is a system in place to make this possible. (This is actually one of the stated goals for 10.0, to be able to specify even external toolchains for building world.)