[compiler-rt] r311482 - [libFuzzer] Move check for thread_local back into libFuzzer's CMake,

George Karpenkov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 11:34:28 PDT 2017


Author: george.karpenkov
Date: Tue Aug 22 11:34:28 2017
New Revision: 311482

URL: http://llvm.org/viewvc/llvm-project?rev=311482&view=rev
Log:
[libFuzzer] Move check for thread_local back into libFuzzer's CMake,

as it breaks builtin standalone build on some bots.

Modified:
    compiler-rt/trunk/cmake/base-config-ix.cmake
    compiler-rt/trunk/lib/fuzzer/CMakeLists.txt

Modified: compiler-rt/trunk/cmake/base-config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/base-config-ix.cmake?rev=311482&r1=311481&r2=311482&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/base-config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/base-config-ix.cmake Tue Aug 22 11:34:28 2017
@@ -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()

Modified: compiler-rt/trunk/lib/fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/CMakeLists.txt?rev=311482&r1=311481&r2=311482&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/fuzzer/CMakeLists.txt Tue Aug 22 11:34:28 2017
@@ -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)




More information about the llvm-commits mailing list