diff options
author | Chris Bieneman <beanz@apple.com> | 2014-12-09 18:49:55 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2014-12-09 18:49:55 +0000 |
commit | 5d388e111afc98d393d838784cab502c33565023 (patch) | |
tree | 5770a298c16c26d8f570e300913136e855f1bd6c /llvm/tools/llvm-shlib/libllvm.cpp | |
parent | 8e8c39963da7a361f9df0dee749ef22127556e86 (diff) | |
download | bcm5719-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.cpp | 7 |
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 |