diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2016-03-25 19:12:41 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2016-03-25 19:12:41 +0000 |
commit | db936da363a52fe99a03cc894e0b81316494c4c8 (patch) | |
tree | 04577834a42cc352b0c437197624a7cf4aa2eef6 /Makefile.inc1 | |
parent | 64d40c9f8c1b4d9a3355f6fa6fcace1dd40c9f3d (diff) | |
download | FreeBSD-src-db936da363a52fe99a03cc894e0b81316494c4c8.zip FreeBSD-src-db936da363a52fe99a03cc894e0b81316494c4c8.tar.gz |
Update flags for external GCC.
- The -L WORLDTMP/usr/lib is not needed as GCC is already adding in
-L =/usr/lib internally with --sysroot. It does not do this for
header include paths though, thus passing -isystem =/usr/include is
still needed.
For the forced libc++ usage:
- Use -isystem rather than -I for libc++ headers.
- Use -std=c++11 rather than gnu++11.
- Use -nostdinc++ to ensure GCC's headers don't leak in.
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'Makefile.inc1')
-rw-r--r-- | Makefile.inc1 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index 135d9bf..fddb06e 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -432,8 +432,11 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib -XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ +# GCC requires -isystem when using a cross-compiler. +XCFLAGS+= -isystem ${WORLDTMP}/usr/include +# Force using libc++ for external GCC. +XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${WORLDTMP}/../lib/libc++ # XXX: DEPFLAGS is a workaround for not properly passing CXXFLAGS to sub-makes # due to CXX="${XCXX} ${XCXXFLAGS}". bsd.dep.mk does use CXXFLAGS when # building C++ files so this can come out if passing CXXFLAGS down is fixed. |