On 05/24/12 21:29, Dimitry Andric wrote:
On 2012-05-24 18:53, O. Hartmann wrote:
Trying to build buildworld on FreeBSD 10-CURRENT/amd64 with CLANG today
ends up in the following error:
=== lib/clang/libllvmtablegen (obj,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmtablegen created for
/usr/src/lib/clang/libllvmtablegen
rm -f .depend
CC='clang' mkdep -f .depend -a
-I/usr/obj/usr/src/tmp/legacy/usr/include
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Error.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Main.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Record.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TableGenAction.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TableGenBackend.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TGLexer.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TGParser.cpp
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Error.cpp:15:10:
fatal error: 'llvm/TableGen/Error.h' file not found
#include llvm/TableGen/Error.h
Something is going wrong with your include paths; most likely your
CFLAGS gets mangled. The actual mkdep command line should have been
similar to (wrapped for clarity):
CC='clang' \
mkdep \
-f .depend \
-a \
-I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/include \
-I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/tools/clang/include
\
-I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen \
-I. \
-I/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/../../lib/clang/include
\
-DLLVM_ON_UNIX \
-DLLVM_ON_FREEBSD \
-D__STDC_LIMIT_MACROS \
-D__STDC_CONSTANT_MACROS \
-DLLVM_DEFAULT_TARGET_TRIPLE=\i386-unknown-freebsd10.0\ \
-DDEFAULT_SYSROOT=\\ \
-I/usr/obj/usr/src/tmp/legacy/usr/include \
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Error.cpp
\
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Main.cpp
\
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/Record.cpp
\
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TableGenAction.cpp
\
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TableGenBackend.cpp
\
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TGLexer.cpp
\
/usr/src/lib/clang/libllvmtablegen/../../../contrib/llvm/lib/TableGen/TGParser.cpp
Are you appending or assigning to CFLAGS in make.conf/src.conf?
Yes,
I do. This very moment, I got rid of those messages. I think it is not
very clear to me (and maybe others) anymore, what goes into
/etc/src.conf and what is to be remaining in /etc/make.conf.
Since I wrecked all my FreeBSD 10-0-CURRENT boxes around the 15th of May
by simply building a world (on a daily baisis, so they got affected
all), but was luckily able to repair, I guess I need to figure out
what's really necessary to go in /etc/src.conf and in /etc/make.conf.
There are some mails in this list claiming that setting CC=, CXX= and
CPP= needs also to be done in /etc/src.conf. I have those already set in
/etc/make.conf using a knob for checking to build with CLANG or not.
Well, am I right that first /etc/make.conf gets read and then
/etc/src.conf? By mistake I set CFLAGS= instead of CFLAGS+= in
/etc/src.conf, so all settings performed prior to the sucking in of
/etc/src.conf got banned from the options - and ended up in not finding
even includes anymore (due to missing -Ifoo/bar options). Very tricky
and a large pithole to step into if not carefully thought about.
Regards,
Oliver
P.S. Most of the confusion is due to the fact I want the base OS be
built by CLANG as well as all ports which can bear being built by CLANG.
But there are those which can't yet and somehow I try to sort them out
and build them with prefereably the gcc46 or gcc47 (I use the base
systems USE_GCC=4.6+ option).
For this purpose, I include at the end of /etc/make.conf a file named
ports.conf like this:
.include /usr/local/etc/ports.conf
The content of ports.conf is like:
[...]
# mail/thunderbird
.if ${.CURDIR:M/usr/ports/mail/thunderbird}
USE_GCC=4.6+
#CC=cc
#CXX= c++
#CPP= cpp
CFLAGS+=-DLDAP_DEPRECATED
CXXFLAGS+= -DLDAP_DEPRECATED
.endif
[...]
This approach does only work, if the not well documented knob
WITH_CLANG_IS_CC is not set, so cc stays with the legacy gcc 4.2.1.
By the way, I would like to see a much more restrictive way to separate
the FreeBSD core system from ports in a logical way. Either I have a
great misunderstanding and this is already the fact, or ...
signature.asc
Description: OpenPGP