Adding a new option to CMake to disable C++ atexit on llvm-shlib.
[oota-llvm.git] / tools / llvm-shlib / libllvm.cpp
index 40b4f66b0733135a9d0ca726acb390b3f0eb2533..8424d660c9d0e0e17714378d1b9e8bfa84fd0677 100644 (file)
 // 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