summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2017-08-12 17:50:22 +0000
committerdim <dim@FreeBSD.org>2017-08-12 17:50:22 +0000
commitb56f764e82b4ec25e10b4520a495356c8f747e61 (patch)
treefce5ca3043002682d571626a10333720e36b9143 /Makefile.inc1
parent421999627a0a4cd844964230a704c8764ccf3ecb (diff)
downloadFreeBSD-src-b56f764e82b4ec25e10b4520a495356c8f747e61.zip
FreeBSD-src-b56f764e82b4ec25e10b4520a495356c8f747e61.tar.gz
MFC r321684:
Don't use libc++ when cross-building for gcc arches Since we imported clang 5.0.0, the version check in Makefile.inc1 which checks whether to use libc++ fires even when the compiler for the target architecture is gcc 4.2.1. This is because only X_COMPILER_VERSION is checked. Also check X_COMPILER_TYPE, so it will only use libc++ when an external gcc toolchain is used. Reviewed by: emaste, rpokala Differential Revision: https://reviews.freebsd.org/D11776 MFC r322170: Follow-up to r321684 (Don't use libc++ when cross-building for gcc arches), and handle two more cases where libc++ includes could be incorrectly enabled, in case the host compiler is clang 5.0.0, and the target (cross) compiler is gcc 4.2.1. Noted by: bdrewery
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc16
1 files changed, 2 insertions, 4 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 07be889..8e99c36 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -589,8 +589,7 @@ TARGET_ABI= gnueabi
# 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
-.if ${X_COMPILER_VERSION} >= 40800
+.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800
XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
-nostdinc++ -L${WORLDTMP}/../lib/libc++
.endif
@@ -2537,8 +2536,7 @@ CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib
# combined with --sysroot.
CD2CFLAGS+= -B${XDDESTDIR}/usr/lib
# Force using libc++ for external GCC.
-# XXX: This should be checking MK_GNUCXX == no
-.if ${X_COMPILER_VERSION} >= 40800
+.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800
CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
-nostdinc++
.endif
OpenPOWER on IntegriCloud