Move external GCC compiler hacks to bsd.sys.mk.

This allows respecting -nostdinc, -nostdinc++ and -nostdlib before
making the decision to add in -isystem, etc.  The -isystem flags
are problematic for building lib/libc++ and lib/libcxxrt which wants
to only use its own headers.

More information the need of these flags can be found at
https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html

This also reverts r300873.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery
2016-05-27 23:03:44 +00:00
parent 47873c16d3
commit ce00342bb2
5 changed files with 29 additions and 17 deletions
-7
View File
@@ -72,13 +72,6 @@ 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.
LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include
# Force using libc++ for external GCC.
LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \
-nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++
.endif
# Yes, the flags are redundant.
LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \