llvm-shlib: Remove the option to override __cxa_atexit
authorJustin Bogner <mail@justinbogner.com>
Mon, 14 Mar 2016 21:54:45 +0000 (21:54 +0000)
committerJustin Bogner <mail@justinbogner.com>
Mon, 14 Mar 2016 21:54:45 +0000 (21:54 +0000)
If anybody is actually using this, it probably doesn't do what they
think it does. This actually causes the dylib to *export* a
__cxa_atexit symbol, so anything that links it probably loses their
exit time destructors as well as disabling LLVM's.

This just removes the option entirely. If somebody does need this
behaviour we should figure out a more principled way to do it.

This is effectively a revert of r223805.

llvm-svn: 263498

llvm/CMakeLists.txt
llvm/include/llvm/Config/config.h.cmake
llvm/tools/llvm-shlib/libllvm.cpp

index 2c07e84..27d9c0a 100644 (file)
@@ -392,14 +392,6 @@ if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB)
   set(LLVM_BUILD_LLVM_DYLIB_default ON)
 endif()
 option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default})
-set(LLVM_DISABLE_LLVM_DYLIB_ATEXIT_DEFAULT ON)
-if (LLVM_LINK_LLVM_DYLIB)
-  set(LLVM_DISABLE_LLVM_DYLIB_ATEXIT_DEFAULT OFF)
-endif()
-option(LLVM_DISABLE_LLVM_DYLIB_ATEXIT "Disable llvm-shlib's atexit destructors." ${LLVM_DISABLE_LLVM_DYLIB_ATEXIT_DEFAULT})
-if(LLVM_DISABLE_LLVM_DYLIB_ATEXIT)
-  set(DISABLE_LLVM_DYLIB_ATEXIT 1)
-endif()
 
 option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF)
 if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND LLVM_ENABLE_ASSERTIONS))
@@ -778,7 +770,7 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
   if(CMAKE_CONFIGURATION_TYPES)
     message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
   endif()
-  
+
   add_custom_target(distribution)
   add_custom_target(install-distribution)
   foreach(target ${LLVM_DISTRIBUTION_COMPONENTS})
index 40520e2..2adc852 100644 (file)
@@ -13,9 +13,6 @@
 /* Define to enable crash overrides */
 #cmakedefine ENABLE_CRASH_OVERRIDES
 
-/* Define to disable C++ atexit */
-#cmakedefine DISABLE_LLVM_DYLIB_ATEXIT
-
 /* Define if position independent code is enabled */
 #cmakedefine ENABLE_PIC
 
index 8424d66..40b4f66 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