summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-shlib/libllvm.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2014-12-09 18:49:55 +0000
committerChris Bieneman <beanz@apple.com>2014-12-09 18:49:55 +0000
commit5d388e111afc98d393d838784cab502c33565023 (patch)
tree5770a298c16c26d8f570e300913136e855f1bd6c /llvm/tools/llvm-shlib/libllvm.cpp
parent8e8c39963da7a361f9df0dee749ef22127556e86 (diff)
downloadbcm5719-llvm-5d388e111afc98d393d838784cab502c33565023.tar.gz
bcm5719-llvm-5d388e111afc98d393d838784cab502c33565023.zip
Adding a new option to CMake to disable C++ atexit on llvm-shlib.
Summary: This is desirable for WebKit and other clients of the llvm-shlib because C++ exit time destructors have a tendency to crash when invoked from multi-threaded applications. Ideally this option will be temporary, because the ideal fix is to just not have exit time destructors. Reviewers: chapuni, ributzka Reviewed By: ributzka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6572 llvm-svn: 223805
Diffstat (limited to 'llvm/tools/llvm-shlib/libllvm.cpp')
-rw-r--r--llvm/tools/llvm-shlib/libllvm.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-shlib/libllvm.cpp b/llvm/tools/llvm-shlib/libllvm.cpp
index 40b4f66b073..8424d660c9d 100644
--- a/llvm/tools/llvm-shlib/libllvm.cpp
+++ b/llvm/tools/llvm-shlib/libllvm.cpp
@@ -11,3 +11,10 @@
// you can't define a target with no sources.
//
//===----------------------------------------------------------------------===//
+
+#include "llvm/Config/config.h"
+
+#if defined(DISABLE_LLVM_DYLIB_ATEXIT)
+extern "C" int __cxa_atexit();
+extern "C" int __cxa_atexit() { return 0; }
+#endif
OpenPOWER on IntegriCloud