Bug 216229 - head: (e.g. -r312009): kernel-toolchain: bootstrap-tools stage libllvmminimal can fail for lack of -I options
Mark Millard
markmi at dsl-only.net
Wed Jan 18 12:00:56 UTC 2017
I have reported the following as bugzilla 216229. . .
[powerpc64 may not be essential but it is the
environment I found this in.]
Background information: libllvmminimal has C++ code, not (just) C code.
[Note that CFLAGS has things like -std=gnu99 that are not appropriate to c++ (clang++).]
So the lines from /usr/src/lib/clang/llvm.build.mk for CFLAGS:
CFLAGS+= -I${SRCTOP}/lib/clang/include
CFLAGS+= -I${LLVM_SRCS}/include
CFLAGS+= -DLLVM_ON_UNIX
CFLAGS+= -DLLVM_ON_FREEBSD
CFLAGS+= -D__STDC_LIMIT_MACROS
CFLAGS+= -D__STDC_CONSTANT_MACROS
#CFLAGS+= -DNDEBUG
. . .
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\"
CFLAGS+= -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\"
CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
do not contribute to the C++ compiles for libllvmminimal. (See the later
meta file content from such a failure: no -I options at all.)
Thus unless the system compiler is in use so that no
bootstrap compiler is to be built. . .
The lack of -I definitions for C++ ends up with build failures
such as below (from a first-time kernel-toolchain example):
(this was a on-powerpc64, targeting powerpc64, example,
not a cross-build)
# Meta data file /usr/obj/powerpc64vtsc_clang_altbinutils_kernel/powerpc.powerpc64/usr/src/tmp/usr/src/lib/clang/libllvmminimal/_usr_obj_powerpc64vtsc_clang_altbinutils_kernel_powerpc.powerpc64_usr_src_tmp_usr_src_lib_clang_libllvmminimal_Support_APInt.o.meta
CMD clang++ -B/usr/local/powerpc64-freebsd/bin/ -std=c++11 -fno-exceptions -fno-rtti -stdlib=libc++ -Wno-c++11-extensions -c /usr/src/contrib/llvm/lib/Support/APInt.cpp -o Support/APInt.o
CWD /usr/obj/powerpc64vtsc_clang_altbinutils_kernel/powerpc.powerpc64/usr/src/tmp/usr/src/lib/clang/libllvmminimal
TARGET Support/APInt.o
-- command output --
/usr/src/contrib/llvm/lib/Support/APInt.cpp:15:10: fatal error: 'llvm/ADT/APInt.h' file not found
#include "llvm/ADT/APInt.h"
^
1 error generated.
*** Error code 1
libllvmminimal is not necessarily the only problem but it is the first one
and it is very early (bootstrap-tools stage).
-I is not necessarily the only compile option type that is missing for
libllvmminimal.
[Note: I've a couple of poudriere-devel submittals that may actually trace
back to such issues --so poudriere might not be essential to the actual issue.]
===
Mark Millard
markmi at dsl-only.net
More information about the freebsd-ppc
mailing list