From owner-svn-src-head@freebsd.org Sat May 28 23:10:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B81B4ECAF; Sat, 28 May 2016 23:10:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B225C1F6E; Sat, 28 May 2016 23:10:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SNA7Tw038938; Sat, 28 May 2016 23:10:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SNA7Ux038937; Sat, 28 May 2016 23:10:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605282310.u4SNA7Ux038937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 28 May 2016 23:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300917 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 23:10:09 -0000 Author: bdrewery Date: Sat May 28 23:10:07 2016 New Revision: 300917 URL: https://svnweb.freebsd.org/changeset/base/300917 Log: GCC XCC -isystem hack: Ensure CXX search =/usr/include/c++1/v1 first. The C++ header files must be searched before /usr/include. The original code in Makefile.inc1 did this before the change in r297271 to use -isystem. The libc++ import in r300770 fixed the bug introduced in r297271 by swapping XCFLAGS and XCXXFLAGS ordering in CROSSENV. Moving the code from Makefile.inc1 to bsd.sys.mk in r300886 also made it more difficult to control the order of the flags. CXXFLAGS is based on CFLAGS, so any additions to it will come after CFLAGS. The CROSSENV code from Makefile.inc1 was such that it was ensured the CXXFLAGS came first by setting them directly in CXX. Using CXXFLAGS+=-I would work here, but instead continue to use -isystem by adding it to CXX so it comes before CFLAGS. Reported by: dim Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 28 22:42:56 2016 (r300916) +++ head/share/mk/bsd.sys.mk Sat May 28 23:10:07 2016 (r300917) @@ -198,7 +198,11 @@ LDFLAGS+= -L=/usr/lib # sysroot/usr/lib/libc++.so. .if ${CXXFLAGS:M-nostdinc++} == "" && ${CXXFLAGS:M-nostdlib} == "" CXXFLAGS+= -std=c++11 \ - -nostdinc++ -isystem =/usr/include/c++/v1 + -nostdinc++ +# Need to ensure this path comes before the above -isystem =/usr/include. +# CXXFLAGS is CFLAGS with extra added in, so there's no way to fix the +# ordering otherwise. +CXX+= -isystem =/usr/include/c++/v1 LDFLAGS+= -L${OBJTOP}/lib/libc++ .endif .endif # --sysroot