[PATCH] D49272: [CMake] Don't use CLANG_DEFAULT_* values

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 16:05:43 PDT 2018


phosek created this revision.
phosek added reviewers: manojgupta, vitalybuka, morehouse, beanz.
Herald added subscribers: Sanitizers, llvm-commits, mgorny.

These are not necessarily correct, just because Clang is configured
to use libc++ or compiler-rt as defaults doesn't mean that the host
compiler uses these as defaults as well. A more correct solution
would be to test the host compiler to check what the default actually
is as attempted in https://reviews.llvm.org/D46857.

PR-38025


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49272

Files:
  compiler-rt/CMakeLists.txt


Index: compiler-rt/CMakeLists.txt
===================================================================
--- compiler-rt/CMakeLists.txt
+++ compiler-rt/CMakeLists.txt
@@ -142,10 +142,7 @@
 set_property(CACHE SANITIZER_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
 
 if (SANITIZER_CXX_ABI STREQUAL "default")
-  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)
+  if (APPLE)
     set(SANITIZER_CXX_ABI_LIBNAME "libc++")
     set(SANITIZER_CXX_ABI_SYSTEM 1)
   elseif (FUCHSIA)
@@ -164,9 +161,7 @@
     "Compiler runtime to use.")
 
 if (COMPILER_RT_RUNTIME STREQUAL "default")
-  if (CLANG_DEFAULT_RTLIB STREQUAL "compiler-rt")
-    set(COMPILER_RT_RUNTIME_LIBRARY "builtins")
-  elseif (FUCHSIA)
+  if (FUCHSIA)
     set(COMPILER_RT_RUNTIME_LIBRARY "builtins")
   endif()
 else()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49272.155299.patch
Type: text/x-patch
Size: 901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180712/c28b001f/attachment.bin>


More information about the llvm-commits mailing list