[compiler-rt] 2918727 - [libFuzzer] Do not link pthreads on Android.

Matt Morehouse via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 11:17:35 PDT 2020


Author: Matt Morehouse
Date: 2020-08-05T11:17:10-07:00
New Revision: 2918727588bbf38ac844fff70c6aa3d2dafbec1c

URL: https://github.com/llvm/llvm-project/commit/2918727588bbf38ac844fff70c6aa3d2dafbec1c
DIFF: https://github.com/llvm/llvm-project/commit/2918727588bbf38ac844fff70c6aa3d2dafbec1c.diff

LOG: [libFuzzer] Do not link pthreads on Android.

Android has pthreads included in bionic and doesn't recognize -lpthread.

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/CMakeLists.txt b/compiler-rt/lib/fuzzer/CMakeLists.txt
index 0a9a42052cf9..6b4fc9878508 100644
--- a/compiler-rt/lib/fuzzer/CMakeLists.txt
+++ b/compiler-rt/lib/fuzzer/CMakeLists.txt
@@ -191,7 +191,9 @@ else()
   set(LIBFUZZER_SHARED_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
   list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lstdc++")
   list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lm")
-  list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lpthread")
+  if(NOT ANDROID)
+    list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lpthread")
+  endif()
 
   # If we aren't statically linking libc++ into the fuzzer, we can build the shared object directly
   add_compiler_rt_runtime(clang_rt.fuzzer_no_main


        


More information about the llvm-commits mailing list