FreeBSD 10.0-CURRENT: CLANG and port/clang weirdness!

From: O. Hartmann <ohartman_at_mail.zedat.fu-berlin.de>
Date: Fri, 07 Sep 2012 11:41:18 +0200
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.

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?

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
##
.if !defined(NO_CLANG)
.if !defined(CC) || ${CC} == "cc"
CC=                             /usr/bin/clang
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=                            /usr/bin/clang++
.endif
.if !defined(CPP) || ${CPP} == "cpp"
CPP=                            /usr/bin/clang-cpp
.endif
## Don't die on warnings
#NO_WERROR=
#WERROR=
## Don't forget this when using Jails!
#NO_FSCHG=
CFLAGS=                         -O3 -pipe # -fno-strict-aliasing
COPTFLAGS=                      -O3 -pipe
#
#CXXFLAGS+=                     -stdlib=libc++
.endif

My /etc/src.conf is attached.

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

Regards,

Oliver

Received on Fri Sep 07 2012 - 07:41:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:30 UTC