diff options
author | Petr Hosek <phosek@chromium.org> | 2019-05-30 07:40:21 +0300 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-05-30 07:40:21 +0300 |
commit | 789b7f0828b08f5c4bf9ff1ff7ef733c73ecdc0a (patch) | |
tree | 529f48a2d6693be385cf978860ec04995e6dfe86 /libcxxabi/src/cxa_exception_storage.cpp | |
parent | 2c91c3b7af7cd4da64f1babde3798d65522a21e4 (diff) |
[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
Diffstat (limited to 'libcxxabi/src/cxa_exception_storage.cpp')
-rw-r--r-- | libcxxabi/src/cxa_exception_storage.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxxabi/src/cxa_exception_storage.cpp b/libcxxabi/src/cxa_exception_storage.cpp index 93506ac5c589..81ba5f0207ad 100644 --- a/libcxxabi/src/cxa_exception_storage.cpp +++ b/libcxxabi/src/cxa_exception_storage.cpp @@ -46,6 +46,10 @@ extern "C" { #include "abort_message.h" #include "fallback_malloc.h" +#if defined(__unix__) && defined(__ELF__) && defined(_LIBCXXABI_HAS_COMMENT_LIB_PRAGMA) +#pragma comment(lib, "pthread") +#endif + // In general, we treat all threading errors as fatal. // We cannot call std::terminate() because that will in turn // call __cxa_get_globals() and cause infinite recursion. |