[PATCH] D57492: [CMake][compiler-rt] Enable statically linking unwinder and c++abi

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 19:38:44 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT352723: [CMake][compiler-rt] Enable statically linking unwinder and c++abi (authored by phosek, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57492?vs=184423&id=184440#toc

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57492/new/

https://reviews.llvm.org/D57492

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -215,6 +215,24 @@
   set(SANITIZER_CXX_ABI_SYSTEM 1)
 endif()
 
+set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER OFF)
+if (FUCHSIA)
+  set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER ON)
+elseif (DEFINED LIBUNWIND_ENABLE_SHARED AND NOT LIBUNWIND_ENABLE_SHARED)
+  set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER ON)
+endif()
+
+option(SANITIZER_USE_STATIC_LLVM_UNWINDER
+  "Use static LLVM unwinder." ${DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER})
+
+set(DEFAULT_SANITIZER_USE_STATIC_CXX_ABI OFF)
+if (DEFINED LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_SHARED)
+  set(DEFAULT_SANITIZER_USE_STATIC_CXX_ABI ON)
+endif()
+
+option(SANITIZER_USE_STATIC_CXX_ABI
+  "Use static libc++abi." ${DEFAULT_SANITIZER_USE_STATIC_CXX_ABI})
+
 set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY OFF)
 if (FUCHSIA)
   set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY ON)
@@ -393,15 +411,16 @@
 
 if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++")
   if (SANITIZER_CXX_ABI_INTREE)
-    if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
-      list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_shared)
-    elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
+    if (SANITIZER_USE_STATIC_LLVM_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
       list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_static)
+    elseif (TARGET unwind_shared OR HAVE_LIBUNWIND)
+      list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_shared)
     endif()
-    if (NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND (TARGET cxxabi_shared OR HAVE_LIBCXXABI))
-      list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_shared)
-    elseif (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND (TARGET cxxabi_static OR HAVE_LIBCXXABI))
+
+    if (SANITIZER_USE_STATIC_CXX_ABI AND (TARGET cxxabi_static OR HAVE_LIBCXXABI))
       list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_static)
+    elseif (TARGET cxxabi_shared OR HAVE_LIBCXXABI)
+      list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_shared)
     endif()
   else()
     append_list_if(COMPILER_RT_HAS_LIBCXX c++ SANITIZER_CXX_ABI_LIBRARY)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57492.184440.patch
Type: text/x-patch
Size: 2205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190131/6bd8b6fa/attachment.bin>


More information about the llvm-commits mailing list