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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 22 12:46:32 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216229

Dimitry Andric <dim at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dim at FreeBSD.org
           Assignee|freebsd-toolchain at FreeBSD.o |dim at FreeBSD.org
                   |rg                          |
             Status|New                         |In Progress

--- Comment #1 from Dimitry Andric <dim at FreeBSD.org> ---
(In reply to Mark Millard from comment #0)
> 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.

This is incorrect: in share/mk/sys.mk, CXXFLAGS are derived from CFLAGS, with
the following rule:

CXXFLAGS        ?=     
${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition}

E.g. -std flags and some others are filtered out.


> The lack of -I definitions for C++ ends up with build failures
> such as below (from a first-time kernel-toolchain example):

I have seen such failures before, and they were almost always caused by setting
CFLAGS or CXXFLAGS incorrectly in /etc/make.conf, e.g. doing:

CFLAGS=   -DFOO
CXXFLAGS= -DBAR

while one should use the += operator instead, e.g.:

CFLAGS+=   -DFOO
CXXFLAGS+= -DBAR

Can you please post your make.conf?

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


More information about the freebsd-toolchain mailing list