Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Sep 2012 17:46:02 +0200
From:      "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        Current FreeBSD <freebsd-current@freebsd.org>
Subject:   Re: FreeBSD 10.0-CURRENT: CLANG and port/clang weirdness!
Message-ID:  <504A16BA.7030407@mail.zedat.fu-berlin.de>
In-Reply-To: <504A0E46.3010306@FreeBSD.org>
References:  <5049C13E.5010808@mail.zedat.fu-berlin.de> <504A0E46.3010306@FreeBSD.org>

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

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? :)

I would appreciate such an approach, since it would be consistent with
with GCC, as you stated.

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

Understood.

>=20
>=20
>> 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=
?
>=20
> 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.

The LibreOffice package doesn't compile with the system's CLANG, so it
is installed whenever LibreOffice is installed.

We have on all workstations running FreeBSD LibreOffice installed and so
devel/llvm and lang/clang get installed, as far as I know.

>=20
>=20
> ...
>> My /etc/make.conf portion looks this:
>>
>>
>>
>> ##
>> ##      CLANG
>> ##
>> .if !defined(NO_CLANG)
>> .if !defined(CC) || ${CC} =3D=3D "cc"
>> CC=3D                             /usr/bin/clang
>> .endif
>> .if !defined(CXX) || ${CXX} =3D=3D "c++"
>> CXX=3D                            /usr/bin/clang++
>> .endif
>> .if !defined(CPP) || ${CPP} =3D=3D "cpp"
>> CPP=3D                            /usr/bin/clang-cpp
>> .endif
>=20
> 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.)

Changed back, so hopefully no danger to pollute the list with more
questions about failures ;-)

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

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

Thanks for your response,

regards

Oliver



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

iQEcBAEBAgAGBQJQShbCAAoJEOgBcD7A/5N81qMIALE9ZuuAFslBSTcGStfJhXpz
mG7nntPphLGmu/iaPerAFjkPRj+0y0ChAf7OGtPqnfmyg4tq1RzWKWOY7tRNXWfw
4c9okFUiV6+j/TAmiQ2/qIIONTSerrqP6f+DoNDYWKG44wz9r7jMKgzfmejJFPb8
M1r9kZMPeOAwMDq5LWWgHpRV5bxz0PwTrRU/xgfk50eslFh8yJaA2EJFvcJefCUt
f4o6eibklK4fM/ChCRxjPbRK/nfJk7M1FMB/kvWnklkOVglVsrEu7iG9AHdCA0sn
cnC8FRnIFXufDzuQe+bshsTfLDd+x/oGVQ9PenZMra9tHWb9BNPTZ1VGteAynDw=
=m9G3
-----END PGP SIGNATURE-----

--------------enig77A406738018B61D522F186A--



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