[libc++abi] Disable libc++ extern templates project-wide
authorShoaib Meenai <smeenai@fb.com>
Wed, 10 May 2017 21:52:39 +0000 (21:52 +0000)
committerShoaib Meenai <smeenai@fb.com>
Wed, 10 May 2017 21:52:39 +0000 (21:52 +0000)
libc++abi can't depend on libc++, so disable extern templates in libc++
headers project-wide. This was previously done in cxa_demangle.cpp, but
I consider it more appropriate to do at the cmake level (since none of
libc++abi's source files can use libc++ extern templates).

I also think the _LIBCPP_NO_EXCEPTIONS in cxa_demangle.cpp is
suspicious, but I'm doing one thing at a time.

Differential Revision: https://reviews.llvm.org/D32329

llvm-svn: 302739

libcxxabi/CMakeLists.txt
libcxxabi/src/cxa_demangle.cpp

index 349e613..9b3e9c4 100644 (file)
@@ -457,6 +457,9 @@ if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
   add_definitions(-D_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL)
 endif()
 
+# Prevent libc++abi from having library dependencies on libc++
+add_definitions(-D_LIBCPP_DISABLE_EXTERN_TEMPLATE)
+
 if (MSVC)
   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 endif()
index 27579d5..7a81ecb 100644 (file)
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _LIBCPP_EXTERN_TEMPLATE(...)
 #define _LIBCPP_NO_EXCEPTIONS
 
 #include "__cxxabi_config.h"