After r255321, clang uses libc++ by default. This leads to a lot of

errors when you enable WITH_GNUCXX to build libstdc++, since it will
include C++ headers from the libc++ installation under ${WORLDTMP}, and
those are not compatible with libstdc++ at all.

To fix this, add -stdlib=libstdc++ to CXXFLAGS when building libstdc++
(and its companion libsupc++) with clang.

Approved by:	re (delphij)
This commit is contained in:
Dimitry Andric 2013-09-12 21:24:59 +00:00
parent f5355ab1ba
commit 44acc1e156
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255500
2 changed files with 8 additions and 0 deletions

View File

@ -636,3 +636,7 @@ CLEANFILES+= ${VERSION_MAP}
# Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98.
CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
.if ${COMPILER_TYPE} == "clang"
CXXFLAGS+= -stdlib=libstdc++
.endif

View File

@ -56,3 +56,7 @@ VERSION_MAP= ${.CURDIR}/Version.map
# Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98.
CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
.if ${COMPILER_TYPE} == "clang"
CXXFLAGS+= -stdlib=libstdc++
.endif