Fix native powerpc64 build of lib32 with in-tree GCC.
- This was broken by r300350 and r300885. - Add some comments around the external GCC logic since it is spread out and in need of some cleanup. - The problem was that X_COMPILER_TYPE is always defined from CC->XCC's default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then X_COMPILER_TYPE was getting GCC and triggering the external logic in Makefile.libcompat. It was intended to always provide -isystem with GCC since --sysroot is used into the lib32 sysroot which won't modify the header path without the -isystem. The use of the libc++/std=c++11 override was only intended to be used for external compilers though (more accurately GCC 4.8+ but that's a separate assumption to cleanup). Apply the same logic from Makefile.inc1 to Makefile.libcompat to only add the libc++ override when needed for external compilers. Pointyhat to: bdrewery Tested with: native ppc64 (swills), universe, ppc64 xtoolchain, amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2) Reported by: andreast, swills Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
+9
-1
@@ -72,13 +72,21 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \
|
||||
# -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for
|
||||
# Clang/GCC.
|
||||
LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat}
|
||||
|
||||
.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
|
||||
# GCC requires -isystem when using a cross-compiler.
|
||||
# GCC requires -isystem when using a cross-compiler and --sysroot. Note that
|
||||
# Makefile.inc1 only applies this with an external compiler but libcompat
|
||||
# always does since even in-tree GCC 4.2 needs this to override the built-in
|
||||
# sysroot path which --sysroot does not actually do for headers.
|
||||
LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include
|
||||
# Force using libc++ for external GCC.
|
||||
# XXX: This should be checking MK_GNUCXX == no
|
||||
.if ${MK_CROSS_COMPILER} == "no" || \
|
||||
(${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no")
|
||||
LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \
|
||||
-nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# Yes, the flags are redundant.
|
||||
LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \
|
||||
|
||||
Reference in New Issue
Block a user