Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2012 12:07:28 -0500
From:      Brooks Davis <brooks@FreeBSD.org>
To:        "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>
Cc:        Current FreeBSD <freebsd-current@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org>
Subject:   Re: FreeBSD 10.0-CURRENT: CLANG and port/clang weirdness!
Message-ID:  <20120907170728.GB28113@lor.one-eyed-alien.net>
In-Reply-To: <504A16BA.7030407@mail.zedat.fu-berlin.de>
References:  <5049C13E.5010808@mail.zedat.fu-berlin.de> <504A0E46.3010306@FreeBSD.org> <504A16BA.7030407@mail.zedat.fu-berlin.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 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.
> >=20
> > 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
> >=20
> > CC=3Dclang-3.1
> > CXX=3Dclang++-3.1
> > CPP=3Dclang-cpp-3.1
> >=20
> > for the targets that require it.  Brooks? :)
>=20
> 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=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?
> >=20
> > 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.
> >=20
> > 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.
>=20
> 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.

> Since I'm using on most boxes 10.0, where can I read more about the new
> toolchain approach?

Discussions will take place on the toolchain@ list.  I'll be posting
some writeups soon.

> 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).

You're probably looking for WITH_CLANG_EXTRAS.

-- Brooks

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



--vtzGhvizbBRQ85DL
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iD8DBQFQSinPXY6L6fI4GtQRAoNDAKC8pWHN2AHPMikAanTYkGdmSnb2kgCfbtul
i1AbdZPVqXjYv9dI9+/yUBE=
=8jRa
-----END PGP SIGNATURE-----

--vtzGhvizbBRQ85DL--



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