[PATCH] D47100: [CMake] Support libc++ as Clang default stdlib in compiler-rt
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 21 18:31:46 PDT 2018
phosek updated this revision to Diff 147931.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D47100
Files:
compiler-rt/CMakeLists.txt
Index: compiler-rt/CMakeLists.txt
===================================================================
--- compiler-rt/CMakeLists.txt
+++ compiler-rt/CMakeLists.txt
@@ -112,9 +112,6 @@
# COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in.
pythonize_bool(COMPILER_RT_DEBUG)
-include(HandleCompilerRT)
-include(config-ix)
-
if(APPLE AND SANITIZER_MIN_OSX_VERSION AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9")
# Mac OS X prior to 10.9 had problems with exporting symbols from
# libc++/libc++abi.
@@ -133,24 +130,28 @@
set(SANITIZER_CXX_ABI "default" CACHE STRING
"Specify C++ ABI library to use.")
-set(CXXABIS none default libcxxabi libstdc++ libc++)
+set(CXXABIS none default libstdc++ libc++)
set_property(CACHE SANITIZER_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
if (SANITIZER_CXX_ABI STREQUAL "default")
- if (HAVE_LIBCXXABI AND COMPILER_RT_DEFAULT_TARGET_ONLY)
- set(SANITIZER_CXX_ABI_LIBNAME "libcxxabi")
+ if (CLANG_DEFAULT_CXX_STDLIB STREQUAL "libc++" AND (TARGET cxx OR HAVE_LIBCXX))
+ set(SANITIZER_CXX_ABI_LIBNAME "libc++")
set(SANITIZER_CXX_ABI_INTREE 1)
elseif (APPLE)
- set(SANITIZER_CXX_ABI_LIBNAME "libcxxabi")
+ set(SANITIZER_CXX_ABI_LIBNAME "libc++")
set(SANITIZER_CXX_ABI_SYSTEM 1)
+ elseif (FUCHSIA)
+ set(SANITIZER_CXX_ABI_LIBNAME "libc++")
+ set(SANITIZER_CXX_ABI_INTREE 1)
else()
set(SANITIZER_CXX_ABI_LIBNAME "libstdc++")
endif()
else()
set(SANITIZER_CXX_ABI_LIBNAME "${SANITIZER_CXX_ABI}")
+ set(SANITIZER_CXX_ABI_SYSTEM 1)
endif()
-if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libcxxabi")
+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)
@@ -163,16 +164,17 @@
list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_static)
endif()
else()
- list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++abi")
+ list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++")
endif()
-elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++")
- list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++")
elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libstdc++")
append_list_if(COMPILER_RT_HAS_LIBSTDCXX stdc++ SANITIZER_CXX_ABI_LIBRARY)
endif()
option(SANITIZER_USE_COMPILER_RT "Use compiler-rt builtins instead of libgcc" OFF)
+include(HandleCompilerRT)
+include(config-ix)
+
#================================
# Setup Compiler Flags
#================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47100.147931.patch
Type: text/x-patch
Size: 2525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180522/e189980a/attachment.bin>
More information about the llvm-commits
mailing list