summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2017-08-22 18:34:28 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2017-08-22 18:34:28 +0000
commite8a32dc127ff883b7ba27fe912570d5357d6763b (patch)
tree6e826f2e8797be496b26ea8a3030d49517c14b21
parent6c60ed285ac8446f30cef11a983e1cc398a6bac4 (diff)
[libFuzzer] Move check for thread_local back into libFuzzer's CMake,
as it breaks builtin standalone build on some bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311482 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/base-config-ix.cmake10
-rw-r--r--lib/fuzzer/CMakeLists.txt10
2 files changed, 10 insertions, 10 deletions
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
index 953d9e530..f9904fbd1 100644
--- a/cmake/base-config-ix.cmake
+++ b/cmake/base-config-ix.cmake
@@ -89,16 +89,6 @@ if(APPLE)
option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off)
option(COMPILER_RT_ENABLE_TVOS "Enable building for tvOS - Experimental" Off)
- CHECK_CXX_SOURCE_COMPILES("
- static thread_local int blah;
- int main() {
- return 0;
- }
- " HAS_THREAD_LOCAL)
-
- if( NOT HAS_THREAD_LOCAL )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dthread_local=__thread")
- endif()
else()
option(COMPILER_RT_DEFAULT_TARGET_ONLY "Build builtins only for the default target" Off)
endif()
diff --git a/lib/fuzzer/CMakeLists.txt b/lib/fuzzer/CMakeLists.txt
index 03cb7fb0a..f06f93881 100644
--- a/lib/fuzzer/CMakeLists.txt
+++ b/lib/fuzzer/CMakeLists.txt
@@ -23,9 +23,19 @@ set(LIBFUZZER_SOURCES
FuzzerUtilWindows.cpp
)
+CHECK_CXX_SOURCE_COMPILES("
+ static thread_local int blah;
+ int main() {
+ return 0;
+ }
+ " HAS_THREAD_LOCAL)
+
if (CMAKE_CXX_FLAGS MATCHES "fsanitize-coverage")
set(LIBFUZZER_CFLAGS -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters)
endif()
+if(NOT HAS_THREAD_LOCAL)
+ set(LIBFUZZER_CFLAGS "${LIBFUZZER_CFLAGS} -Dthread_local=__thread")
+endif()
if(APPLE)
set(FUZZER_SUPPORTED_OS osx)