Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 2017 11:55:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 216229] head: (e.g. -r312009): kernel-toolchain: bootstrap-tools stage libllvmminimal can fail for lack of -I options (e.g., from scratch kernel-toolchain)
Message-ID:  <bug-216229-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216229

            Bug ID: 216229
           Summary: head: (e.g. -r312009): kernel-toolchain:
                    bootstrap-tools stage libllvmminimal can fail for lack
                    of -I options (e.g., from scratch kernel-toolchain)
           Product: Base System
           Version: CURRENT
          Hardware: powerpc
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: markmi@dsl-only.net

[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=3Dgnu99 that are not appropriate to =
c++
(clang++).]

So the lines from /usr/src/lib/clang/llvm.build.mk for CFLAGS:

CFLAGS+=3D        -I${SRCTOP}/lib/clang/include
CFLAGS+=3D        -I${LLVM_SRCS}/include
CFLAGS+=3D        -DLLVM_ON_UNIX
CFLAGS+=3D        -DLLVM_ON_FREEBSD
CFLAGS+=3D        -D__STDC_LIMIT_MACROS
CFLAGS+=3D        -D__STDC_CONSTANT_MACROS
#CFLAGS+=3D       -DNDEBUG
. . .
CFLAGS+=3D        -DLLVM_DEFAULT_TARGET_TRIPLE=3D\"${TARGET_TRIPLE}\"
CFLAGS+=3D        -DLLVM_HOST_TRIPLE=3D\"${BUILD_TRIPLE}\"
CFLAGS+=3D        -DDEFAULT_SYSROOT=3D\"${TOOLS_PREFIX}\"

do not contribute to the C++ compiles for libllvmminimal.

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/t=
mp/usr/src/lib/clang/libllvmminimal/_usr_obj_powerpc64vtsc_clang_altbinutil=
s_kernel_powerpc.powerpc64_usr_src_tmp_usr_src_lib_clang_libllvmminimal_Sup=
port_APInt.o.meta
CMD clang++  -B/usr/local/powerpc64-freebsd/bin/  -std=3Dc++11 -fno-excepti=
ons
-fno-rtti  -stdlib=3Dlibc++ -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/t=
mp/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 actualyl trace
back to such issues --so poudriere might not be essential to the actual iss=
ue.]

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-216229-8>