[compiler-rt] 6b67e22 - Fix breakage in D89615 (due to cmake version 3.16.5)
Vy Nguyen via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 4 08:19:20 PST 2020
Author: Vy Nguyen
Date: 2020-11-04T11:19:01-05:00
New Revision: 6b67e22ea3941019a617282a49b37ee12ee8a0db
URL: https://github.com/llvm/llvm-project/commit/6b67e22ea3941019a617282a49b37ee12ee8a0db
DIFF: https://github.com/llvm/llvm-project/commit/6b67e22ea3941019a617282a49b37ee12ee8a0db.diff
LOG: Fix breakage in D89615 (due to cmake version 3.16.5)
Differential Revision: https://reviews.llvm.org/D90764
Added:
Modified:
compiler-rt/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 422ea58c1fc77..1871d99615f26 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -119,8 +119,20 @@ if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$")
CHECK_SYMBOL_EXISTS (__thumb__ "" COMPILER_RT_ARM_THUMB)
endif()
endif()
+
+set(ANDROID_HAS_ELF_TLS 0)
if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*android.*")
set(ANDROID 1)
+ CHECK_CXX_SOURCE_COMPILES("
+int main() {
+#if __ANDROID_API__ >= 28
+ return 0;
+#else
+ #error NO_ELF_TLS
+ return 1;
+#endif
+}
+ " ANDROID_HAS_ELF_TLS)
string(REGEX MATCH "-target(=| +)[^ ]+android([0-9]+)" ANDROID_API_LEVEL "${CMAKE_C_FLAGS}")
set(ANDROID_API_LEVEL ${CMAKE_MATCH_2})
endif()
@@ -277,7 +289,7 @@ if(NOT COMPILER_RT_HAS_FUNC_SYMBOL)
endif()
# Provide some common commmandline flags for Sanitizer runtimes.
-if(${ANDROID_API_LEVEL} GREATER_EQUAL 28)
+if(ANDROID_HAS_ELF_TLS)
list(APPEND SANITIZER_COMMON_CFLAGS -fno-emulated-tls)
list(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS -fno-emulated-tls)
endif()
More information about the llvm-commits
mailing list