[libcxx] r176026 - Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.

Howard Hinnant hhinnant at apple.com
Mon Feb 25 07:50:36 PST 2013


Author: hhinnant
Date: Mon Feb 25 09:50:36 2013
New Revision: 176026

URL: http://llvm.org/viewvc/llvm-project?rev=176026&view=rev
Log:
Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.

Modified:
    libcxx/trunk/CMakeLists.txt
    libcxx/trunk/include/memory

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=176026&r1=176025&r2=176026&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Mon Feb 25 09:50:36 2013
@@ -228,6 +228,10 @@ else()
     list(APPEND LIBCXX_CXX_FEATURE_FLAGS -DNDEBUG)
   endif()
 endif()
+# Static library
+if (NOT LIBCXX_ENABLE_SHARED)
+  list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_LIBCPP_BUILD_STATIC)
+endif()
 
 # This is the _ONLY_ place where add_definitions is called.
 add_definitions(

Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=176026&r1=176025&r2=176026&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Mon Feb 25 09:50:36 2013
@@ -3629,10 +3629,13 @@ public:
     long use_count() const _NOEXCEPT {return __shared_count::use_count();}
     __shared_weak_count* lock() _NOEXCEPT;
 
-    // purposefully not protected with #ifndef _LIBCPP_NO_RTTI because doing so
-    //  breaks ABI for those clients who need to compile their projects with
-    //    -fno-rtti and yet link against a libc++.dylib compiled without -fno-rtti.
+    // Define the function out only if we build static libc++ without RTTI.
+    // Otherwise we may break clients who need to compile their projects with
+    // -fno-rtti and yet link against a libc++.dylib compiled
+    // without -fno-rtti.
+#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
     virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
+#endif
 private:
     virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
 };





More information about the cfe-commits mailing list