summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-06-15 23:58:03 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-06-15 23:58:03 +0000
commit42d9d45fb8f34ef4435a75f575dee6583cf4c909 (patch)
tree4fda9fe592267442bb91a73468aeb9d1dd14876f /Makefile.inc1
parentd00ea3e574b447595fa2962290c22eb060990413 (diff)
downloadFreeBSD-src-42d9d45fb8f34ef4435a75f575dee6583cf4c909.zip
FreeBSD-src-42d9d45fb8f34ef4435a75f575dee6583cf4c909.tar.gz
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
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc15
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 0daa440..ab028a6 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -543,9 +543,12 @@ TARGET_ABI= gnueabi
.endif
.endif
.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
-# GCC requires -isystem and -L when using a cross-compiler.
+# GCC requires -isystem and -L when using a cross-compiler. --sysroot
+# won't set header path and -L is used to ensure the base library path
+# is added before the port PREFIX library path.
XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
# Force using libc++ for external GCC.
+# XXX: This should be checking MK_GNUCXX == no
XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
-nostdinc++ -L${WORLDTMP}/../lib/libc++
.else
OpenPOWER on IntegriCloud