[libFuzzer] Do not link pthreads on Android.
authorMatt Morehouse <mascasa@google.com>
Wed, 5 Aug 2020 18:11:42 +0000 (11:11 -0700)
committerMatt Morehouse <mascasa@google.com>
Wed, 5 Aug 2020 18:17:10 +0000 (11:17 -0700)
Android has pthreads included in bionic and doesn't recognize -lpthread.

compiler-rt/lib/fuzzer/CMakeLists.txt

index 0a9a420..6b4fc98 100644 (file)
@@ -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