[runtimes] Don't depend on libpthread on Android
r362048 added support for ELF dependent libraries, but broke Android
build since Android does not have libpthread. Remove the dependency on
the Android build.
Differential Revision: https://reviews.llvm.org/D65098
llvm-svn: 366734
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: d8bdb9225ce3896797892293053efac8ad8d52fb
diff --git a/src/algorithm.cpp b/src/algorithm.cpp
index a110ae8..ffdcb5f 100644
--- a/src/algorithm.cpp
+++ b/src/algorithm.cpp
@@ -10,7 +10,7 @@
#include "random"
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/src/chrono.cpp b/src/chrono.cpp
index 8f533f1..c461d19 100644
--- a/src/chrono.cpp
+++ b/src/chrono.cpp
@@ -37,7 +37,7 @@
#endif
#endif
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "rt")
#endif
diff --git a/src/condition_variable.cpp b/src/condition_variable.cpp
index b8426c6..bf89d25 100644
--- a/src/condition_variable.cpp
+++ b/src/condition_variable.cpp
@@ -15,7 +15,7 @@
#include "system_error"
#include "__undef_macros"
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
diff --git a/src/debug.cpp b/src/debug.cpp
index c4cc281..1f5ce10 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -15,7 +15,7 @@
#include "__hash_table"
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/src/experimental/memory_resource.cpp b/src/experimental/memory_resource.cpp
index 9aa0779..5730c4a 100644
--- a/src/experimental/memory_resource.cpp
+++ b/src/experimental/memory_resource.cpp
@@ -12,7 +12,7 @@
#include "atomic"
#elif !defined(_LIBCPP_HAS_NO_THREADS)
#include "mutex"
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/src/filesystem/operations.cpp b/src/filesystem/operations.cpp
index 69350dd..4e6cb14 100644
--- a/src/filesystem/operations.cpp
+++ b/src/filesystem/operations.cpp
@@ -44,7 +44,7 @@
#include <sys/time.h> // for gettimeofday and timeval
#endif // !defined(CLOCK_REALTIME)
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "rt")
#endif
diff --git a/src/memory.cpp b/src/memory.cpp
index c8c0038..e89d94f 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -10,7 +10,7 @@
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
#include "thread"
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/src/mutex.cpp b/src/mutex.cpp
index 0d69d7c..e741432 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -13,7 +13,7 @@
#include "__undef_macros"
#ifndef _LIBCPP_HAS_NO_THREADS
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/src/shared_mutex.cpp b/src/shared_mutex.cpp
index eb3f5f3..9e6d520 100644
--- a/src/shared_mutex.cpp
+++ b/src/shared_mutex.cpp
@@ -10,7 +10,7 @@
#ifndef _LIBCPP_HAS_NO_THREADS
#include "shared_mutex"
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif
diff --git a/src/thread.cpp b/src/thread.cpp
index 39bb9e9..cee778f 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -35,7 +35,7 @@
#include <windows.h>
#endif
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif