Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Sep 2012 10:35:07 +0200
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        Brooks Davis <brooks@FreeBSD.org>
Cc:        "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>, Current FreeBSD <freebsd-current@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org>
Subject:   Re: FreeBSD 10.0-CURRENT: CLANG and port/clang weirdness!
Message-ID:  <504B033B.4020001@zedat.fu-berlin.de>
In-Reply-To: <20120907170728.GB28113@lor.one-eyed-alien.net>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig98553C4A03C9C0FA0F70B63A
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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=3D4.6+ are considere=
d
>>>> using the system's LLVM/CLANG, which is clang 3.2 in our installatio=
n
>>>> (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/bi=
n
>>> as clang-3.1, clang++-3.1 and clang-cpp-3.1.  Then you could simply s=
et
>>>
>>> CC=3Dclang-3.1
>>> CXX=3Dclang++-3.1
>>> CPP=3Dclang-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.
>=20
> 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. :(
>=20
>>>> Following the WIKI at http://wiki.freebsd.org/BuildingFreeBSDWithCla=
ng
>>>> introduces the usage of
>>>>
>>>> CC=3Dclang instead of CC=3D/usr/bin/clang
>>>> CXX=3Dclang++ instead of CXX=3D/usr/bin/clang++
>>>> CPP=3Dclang-ccp instead of CPP=3D/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/t=
mp.
>>> 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 wi=
ll
>>> 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.
>=20
> 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.


=2E.. 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.

>=20
>> Since I'm using on most boxes 10.0, where can I read more about the ne=
w
>> toolchain approach?
>=20
> Discussions will take place on the toolchain@ list.  I'll be posting
> some writeups soon.
>=20
>> And by the way - is there a way to have also LLVM installed with the
>> base system by a knob like "WITH_LLVM"? This would avoid the same
>> confusion as mentioned above with CLANG when it comes to LLVM
>> dependencies (I play around with some OpenCL libs (pocl), which seems =
to
>> need LLVM port installed).
>=20
> 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].
I discovered this playing around with LLVM and there is a software
package I play with (pocl, portable OpenCL library) which uses LLVM backe=
nd.

At this point, my "point of view" might me wrong, but I look at CLANG as
it is a part of the LLVM framework and so I inherently expected it to be
existent (the LLVM) in FreeBSD. But I guess the policy in FBSD is to
have only the clang and the necessary portions of LLVM in the tree. So I
thought it would be nice to have the "magic knob" in case one will take
the burden of compiling more and time consuming more LLVM/CLANG stuff if
he chooses to do.

>=20
> -- Brooks
>=20
>>
>> Thanks for your response,
>>
>> regards
>>
>> Oliver
>>
>>
>=20



--------------enig98553C4A03C9C0FA0F70B63A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQEcBAEBAgAGBQJQSwNBAAoJEOgBcD7A/5N8oSUIAMjHHoaXaxlFQaqdjqQ8yDFp
BnbpW+fcy0OfRtGtIZQ3r9it9rGtBI0leqtbQLQ/v1nM+wyRDSUwMo37LKR2Jo1A
TPqpe4lkXBw8gF1TuEQXjU6FUc1l24x7gAdYcsvuJMFd4i2vvm9iWuib1TuJ2RRD
25v1SDfqTrfnNb5TZMan7P/AdYgBYchg2X0N7kIUAcpn6rrTJ8YhlHpx7pJIczGG
VkECwXrna9cCYSCTFn3RpadxjOuCTEJFXF7SDMl1WI1R7R+5+9FiB9lSh1EpNhS1
GqcvsTfYuwFuicBPZVwMAQ12etVLDjmSlEVb1wmZdFbf0OsCQdi6HT0l2neNPLE=
=hZsG
-----END PGP SIGNATURE-----

--------------enig98553C4A03C9C0FA0F70B63A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?504B033B.4020001>