svn commit: r297271 - head

Bryan Drewery bdrewery at FreeBSD.org
Fri Mar 25 19:12:42 UTC 2016


Author: bdrewery
Date: Fri Mar 25 19:12:41 2016
New Revision: 297271
URL: https://svnweb.freebsd.org/changeset/base/297271

Log:
  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

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Fri Mar 25 19:12:38 2016	(r297270)
+++ head/Makefile.inc1	Fri Mar 25 19:12:41 2016	(r297271)
@@ -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.


More information about the svn-src-head mailing list