File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,20 @@ if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$")
119
119
CHECK_SYMBOL_EXISTS (__thumb__ "" COMPILER_RT_ARM_THUMB )
120
120
endif ()
121
121
endif ()
122
+
123
+ set (ANDROID_HAS_ELF_TLS 0 )
122
124
if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE} " MATCHES ".*android.*" )
123
125
set (ANDROID 1 )
126
+ CHECK_CXX_SOURCE_COMPILES ("
127
+ int main() {
128
+ #if __ANDROID_API__ >= 28
129
+ return 0;
130
+ #else
131
+ #error NO_ELF_TLS
132
+ return 1;
133
+ #endif
134
+ }
135
+ " ANDROID_HAS_ELF_TLS )
124
136
string (REGEX MATCH "-target(=| +)[^ ]+android([0-9]+)" ANDROID_API_LEVEL "${CMAKE_C_FLAGS} " )
125
137
set (ANDROID_API_LEVEL ${CMAKE_MATCH_2} )
126
138
endif ()
@@ -277,7 +289,7 @@ if(NOT COMPILER_RT_HAS_FUNC_SYMBOL)
277
289
endif ()
278
290
279
291
# Provide some common commmandline flags for Sanitizer runtimes.
280
- if (${ANDROID_API_LEVEL} GREATER_EQUAL 28 )
292
+ if (ANDROID_HAS_ELF_TLS )
281
293
list (APPEND SANITIZER_COMMON_CFLAGS -fno-emulated-tls )
282
294
list (APPEND COMPILER_RT_TEST_COMPILER_CFLAGS -fno-emulated-tls )
283
295
endif ()
You can’t perform that action at this time.
0 commit comments