Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Sep 2012 11:41:18 +0200
From:      "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>
To:        Current FreeBSD <freebsd-current@freebsd.org>
Subject:   FreeBSD 10.0-CURRENT: CLANG and port/clang weirdness!
Message-ID:  <5049C13E.5010808@mail.zedat.fu-berlin.de>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig19310305CB1D4343BC0E2C29
Content-Type: multipart/mixed; boundary="------------070608030709050508060704"

This is a multi-part message in MIME format.
--------------070608030709050508060704
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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.

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?

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?

Building software with makefiles or self-created ports always refer to
the port's LLVM/CLANG, which is LLVM/CLANG 3.1 due to some reuqirements
of several ports.

I'm really confused. Am I missing some special knob here and fell into
this pit by not-having-the-knowledge? Or is it really this messy?

Well, I'd like to stay with the core's LLVM/CLANG, which is 3.2 whenever
I simply issue "clang" or "clang++" (a pity that LLVM isn't completely
installed).

My /etc/make.conf portion looks this:



##
##      CLANG
##
=2Eif !defined(NO_CLANG)
=2Eif !defined(CC) || ${CC} =3D=3D "cc"
CC=3D                             /usr/bin/clang
=2Eendif
=2Eif !defined(CXX) || ${CXX} =3D=3D "c++"
CXX=3D                            /usr/bin/clang++
=2Eendif
=2Eif !defined(CPP) || ${CPP} =3D=3D "cpp"
CPP=3D                            /usr/bin/clang-cpp
=2Eendif
## Don't die on warnings
#NO_WERROR=3D
#WERROR=3D
## Don't forget this when using Jails!
#NO_FSCHG=3D
CFLAGS=3D                         -O3 -pipe # -fno-strict-aliasing
COPTFLAGS=3D                      -O3 -pipe
#
#CXXFLAGS+=3D                     -stdlib=3Dlibc++
=2Eendif

My /etc/src.conf is attached.

If there is a clean way to distinguish, please help me.

Regards,

Oliver

--------------070608030709050508060704
Content-Type: text/plain; charset=us-ascii;
 name="src.conf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="src.conf"

#.if !defined(NO_CLANG)
#CC=3D			/usr/bin/clang
#CXX=3D			/usr/bin/clang++
#CPP=3D			/usr/bin/clang-cpp
##
#CFLAGS+=3D		-O3 -pipe # -fno-strict-aliasing
#COPTFLAGS+=3D		-O3 -pipe
#CXXFLAGS+=3D		-stdlib=3Dlibc++
#
## Don't die on warnings
#NO_WERROR=3D
#WERROR=3D
#
## Don't forget this when using Jails!
#NO_FSCHG=3D
# need clang++ to be built
#WITH_LIBCPLUSPLUS=3D	YES
#
#WITH_CLANG_IS_CC=3D	YES
#.endif
#
WITH_CLANG=3D		YES
WITH_CLANG_EXTRAS=3D	YES
#
WITH_LIBCPLUSPLUS=3D	YES
#
WITH_BIND_LARGE_FILE=3D	YES
WITH_BIND_SIGCHASE=3D	YES
WITH_BIND_LIBS=3D		YES
#
WITH_IDEA=3D		YES
WITH_HESIOD=3D		YES
#
#WITH_ICONV=3D		YES
#WITH_BSD_GREP=3D		YES
WITH_BSD_SORT=3D		YES
#
WITH_BSDCONFIG=3D		YES
#
#WITH_OFED=3D		YES
#
MALLOC_PRODUCTION=3D	YES
#
PORTS_MODULES=3D		emulators/virtualbox-ose-kmod x11/nvidia-driver

--------------070608030709050508060704--

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

iQEcBAEBAgAGBQJQScFDAAoJEOgBcD7A/5N81nAIAMUBZ7UROq96AZuDkB9NxPuA
nwnGTm2lfV2sqSN0C2VXZVayzvgZ9ixWDyzq6huFYIdV5hd7M6I+9PSDK8piIWpA
o2//FKilNbiqE/VHPqvyd02/52Jm3bMB/D+2Y4/kGigjLcsKbMnpXG6Wm7dcc59X
+UEf/N0AYa7it+C0AYk7lQVG8nsjU7it3StcFLAQafQM9P1ePuIyzqCrNh8kIJ/d
/wNmwTdYCWT+GWS6hYbr0/I9CHT8+FjPFLpHuJSy3f2JEH4JmmOuKpiFLQx+Ea8r
6De3DQD48yuRE73fE3kpkBcT9Jt+4uO3axW0o5GnHEnmyoT5so0NTeCwTQEQQEI=
=mPUB
-----END PGP SIGNATURE-----

--------------enig19310305CB1D4343BC0E2C29--



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