summaryrefslogtreecommitdiffstats
path: root/gnu/lib
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-09-12 21:24:59 +0000
committerdim <dim@FreeBSD.org>2013-09-12 21:24:59 +0000
commita4339b7e0aafb18a837c9296b3ee0f7fb0e0ee4f (patch)
treec79e8a71b37de11d4b1eec2f1407c9747f131d48 /gnu/lib
parent2bafcef1c81d47e6f6fcf6b975ac47200b590c7e (diff)
downloadFreeBSD-src-a4339b7e0aafb18a837c9296b3ee0f7fb0e0ee4f.zip
FreeBSD-src-a4339b7e0aafb18a837c9296b3ee0f7fb0e0ee4f.tar.gz
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)
Diffstat (limited to 'gnu/lib')
-rw-r--r--gnu/lib/libstdc++/Makefile4
-rw-r--r--gnu/lib/libsupc++/Makefile4
2 files changed, 8 insertions, 0 deletions
diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile
index da88e70..935a899 100644
--- a/gnu/lib/libstdc++/Makefile
+++ b/gnu/lib/libstdc++/Makefile
@@ -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
diff --git a/gnu/lib/libsupc++/Makefile b/gnu/lib/libsupc++/Makefile
index ee6c601..630387a 100644
--- a/gnu/lib/libsupc++/Makefile
+++ b/gnu/lib/libsupc++/Makefile
@@ -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
OpenPOWER on IntegriCloud