[libcxx-commits] [libcxx] r354212 - [compiler-rt] Build custom libcxx with libcxxabi

Jonas Hahnfeld via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 17 04:16:21 PST 2019


Author: hahnfeld
Date: Sun Feb 17 04:16:20 2019
New Revision: 354212

URL: http://llvm.org/viewvc/llvm-project?rev=354212&view=rev
Log:
[compiler-rt] Build custom libcxx with libcxxabi

This changes add_custom_libcxx to also build libcxxabi and merges
the two into a static and hermetic library.
There are multiple advantages:
1) The resulting libFuzzer doesn't expose C++ internals and looks
   like a plain C library.
2) We don't have to manually link in libstdc++ to provide cxxabi.
3) The sanitizer tests cannot interfere with an installed version
   of libc++.so in LD_LIBRARY_PATH.

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

Modified:
    libcxx/trunk/CMakeLists.txt
    libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=354212&r1=354211&r2=354212&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Sun Feb 17 04:16:20 2019
@@ -23,7 +23,7 @@ set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   )
 
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD)
   project(libcxx CXX C)
 
   set(PACKAGE_NAME libcxx)

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=354212&r1=354211&r2=354212&view=diff
==============================================================================
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Sun Feb 17 04:16:20 2019
@@ -98,7 +98,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
   if (LIBCXX_CXX_ABI_INTREE)
     # Link against just-built "cxxabi" target.
-    if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+    if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
       set(CXXABI_LIBNAME cxxabi_static)
     else()
       set(CXXABI_LIBNAME cxxabi_shared)




More information about the libcxx-commits mailing list