From owner-freebsd-current@FreeBSD.ORG Sat Sep 8 12:15:20 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 512581065670 for ; Sat, 8 Sep 2012 12:15:20 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm11-vm0.bullet.mail.ukl.yahoo.com (nm11-vm0.bullet.mail.ukl.yahoo.com [217.146.183.244]) by mx1.freebsd.org (Postfix) with SMTP id BBAA48FC0C for ; Sat, 8 Sep 2012 12:15:19 +0000 (UTC) Received: from [217.146.183.209] by nm11.bullet.mail.ukl.yahoo.com with NNFMP; 08 Sep 2012 12:15:13 -0000 Received: from [77.238.184.58] by tm2.bullet.mail.ukl.yahoo.com with NNFMP; 08 Sep 2012 12:15:13 -0000 Received: from [127.0.0.1] by smtp127.mail.ukl.yahoo.com with NNFMP; 08 Sep 2012 12:15:13 -0000 X-Yahoo-Newman-Id: 662641.75710.bm@smtp127.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: QGG68QwVM1mziHVcE.Cz55GVlv6je8feJh8vhNpGg.GdPYo fnhslXUlMbk.a7DW5g_Sjme_WIqQZygUAOwylpHwePI_gKOE4nDHb.rarpq7 uWh2kqecYu39WWw1hOj8oY18Qx6sf2Khruh67NL2o5umWyE0Gfi7rjiLGm.I cwEIqb_lg0YgtOq_H1zRacNb.3qX5sMUW2uFXglh.9OA6.zey8LaQqbXBk8D fpBI1bF5oiXChr13MYcoisiCYltxBAnie7by2MsqPNJkiazbQApPw4.iLyNZ cX.Yg.XAE9UA2DH7P7sabWqnsNEVmGYBqQOhv.ag5XFOCzTfuLDxrjV4zzUJ jcHdJLBU7AjEYrJ2xhzRaZuNPU79n_xMc3VrbardX4_2jFR6p4lQeeMO7Cxk LjhcfJx16cm0UUOaF3.gJ8CdKz4_dArgb0tnSKTaI.3ujkz0F88Sw0eEdkrr 4C9E4I838hX0g9goyr1n4NTo75HWqZoFIgWKDcGSPdUvGnlKb0gA- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. Received: from [192.168.119.19] (se@81.173.156.71 with plain) by smtp127.mail.ukl.yahoo.com with SMTP; 08 Sep 2012 12:15:13 +0000 GMT Message-ID: <504B36CD.9050905@freebsd.org> Date: Sat, 08 Sep 2012 14:15:09 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: ohartman@zedat.fu-berlin.de 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> X-Enigmail-Version: 1.4.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org 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 12:15:20 -0000 Am 08.09.2012 10:35, schrieb O. Hartmann: > On 09/07/12 19:07, Brooks Davis wrote: >> On Fri, Sep 07, 2012 at 05:46:02PM +0200, O. Hartmann wrote: >>> On 09/07/12 17:09, Dimitry Andric wrote: >>>> 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? :) >>> >>> I would appreciate such an approach, since it would be >>> consistent with with GCC, as you stated. >> >> I'd like to do this, but it doesn't look like it will be easy. >> There appears to be no support in the llvm build system for it. >> :( >> >>>>> 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. >>> >>> Understood. >> >> 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/...? > > But what is with PORTS I build later? They definitely pick up the > "wrong" clang/clang++. > > I was suggested to deinstall (or not to install) the port's version > of LLVM/CLANG, but this happens automatically for some ports - > like LibreOffice. Simple solution: If /usr/local/bin must be in front of /usr/bin and the port version of CLANG is thus found in preference of the system version, you may still put another directory with symbolic links to system binaries in front of /usr/local/bin. E.g.: PATH=/usr/pref_bin:/usr/local/bin:/usr/bin Directory /usr/pref_bin contains symbolic links to binaries in /usr/bin, e.g. /usr/pref_bin/clang -> /usr/bin/clang. Regards, STefan