[runtimes] Check if pragma comment(lib, ...) is supported first
This fixes the issue introduced by r362048 where we always use
pragma comment(lib, ...) for dependent libraries when the compiler
is Clang, but older Clang versions don't support this pragma so
we need to check first if it's supported before using it.
llvm-svn: 362055
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 789b7f0828b08f5c4bf9ff1ff7ef733c73ecdc0a
diff --git a/src/shared_mutex.cpp b/src/shared_mutex.cpp
index 3f1aecf..eb3f5f3 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(__clang__)
+#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "pthread")
#endif