From 9edd74509a4429274add4886be9dcd67edbfe4d0 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 29 Jul 2017 12:22:29 +0000 Subject: [PATCH] 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 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11776 --- Makefile.inc1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 75ca42a49936..90d55a3f590a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -624,8 +624,7 @@ XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib # combined with --sysroot. XCFLAGS+= -B${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++ .endif