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
This commit is contained in:
dim 2017-07-29 12:22:29 +00:00
parent 93f7d03418
commit 9edd74509a

View File

@ -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