[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/AddressSpace.hpp b/src/AddressSpace.hpp
index 6643953..fb07c80 100644
--- a/src/AddressSpace.hpp
+++ b/src/AddressSpace.hpp
@@ -27,7 +27,7 @@
#if _LIBUNWIND_USE_DLADDR
#include <dlfcn.h>
-#if defined(__unix__) && defined(__ELF__) && defined(__clang__)
+#if defined(__unix__) && defined(__ELF__) && defined(_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
#pragma comment(lib, "dl")
#endif
#endif