pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

llvm-all-in-one: Add support for libstdc++ on GCC systems



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Jul 9 18:13:18 2017 +0200
Changeset:	395122c7aa2fe6b6252428e00ec13ac3716b463f

Modified Files:
	llvm-all-in-one/Makefile

Log Message:
llvm-all-in-one: Add support for libstdc++ on GCC systems

This might be temporary hack. It's required or good enough to run
"check-sanitizers" in compiler-rt.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=395122c7aa2fe6b6252428e00ec13ac3716b463f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 llvm-all-in-one/Makefile | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diffs:
diff --git a/llvm-all-in-one/Makefile b/llvm-all-in-one/Makefile
index 57a3773e89..1c3e6ea4e6 100644
--- a/llvm-all-in-one/Makefile
+++ b/llvm-all-in-one/Makefile
@@ -113,7 +113,28 @@ CMAKE_ARGS+=	-DLIBCXX_INCLUDE_TESTS=ON
 
 CMAKE_ARGS.Darwin+=	-DCMAKE_LIBTOOL=/usr/bin/libtool
 
+.include "../../mk/compiler.mk"
+
+.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang)
+# command to check if clang is using libc++ or libstdc++
+LIBCPP_CHECK_SH=	printf "\#include <ciso646>\n\#ifdef _LIBCPP_VERSION\nYES\n\#endif" | ${CLANGBASE}/bin/clang++ -x c++ -E - 2>&1 | grep YES || true
+.else
+LIBCPP_CHECK_SH=	echo NO
+.endif
+
+# patch NetBSD::GetCXXStdlibType
+.if ${OPSYS} == "NetBSD" && empty(LIBCPP_CHECK_SH:sh:MYES)
+SUBST_CLASSES+=			libcxx
+SUBST_STAGE.libcxx=		pre-configure
+SUBST_MESSAGE.libcxx=		Patching toolchain to use libstdc++ (matching the host compiler)
+SUBST_FILES.libcxx+=		${WRKDIR}/clang/lib/Driver/ToolChains/NetBSD.cpp
+SUBST_SED.libcxx=		-e 's,(Major >= 7 || Major == 0),(false),'
+
+CMAKE_ARGS+=			-DCLANG_DEFAULT_CXX_STDLIB:STRING="libstdc++"
+.endif
+
 TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
+TEST_ENV+=		VERBOSE=1
 
 # Not complete, not everything works
 .for _test_ in check-llvm check-clang check-lldb check-compiler-rt check-lld check-libcxx check-unwind check-polly check-libomptarget check-sanitizer


Home | Main Index | Thread Index | Old Index