[llvm] r263498 - llvm-shlib: Remove the option to override __cxa_atexit

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 14:54:46 PDT 2016


Author: bogner
Date: Mon Mar 14 16:54:45 2016
New Revision: 263498

URL: http://llvm.org/viewvc/llvm-project?rev=263498&view=rev
Log:
llvm-shlib: Remove the option to override __cxa_atexit

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.

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

Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=263498&r1=263497&r2=263498&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Mon Mar 14 16:54:45 2016
@@ -392,14 +392,6 @@ if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LL
   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})

Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=263498&r1=263497&r2=263498&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Mon Mar 14 16:54:45 2016
@@ -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
 

Modified: llvm/trunk/tools/llvm-shlib/libllvm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-shlib/libllvm.cpp?rev=263498&r1=263497&r2=263498&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-shlib/libllvm.cpp (original)
+++ llvm/trunk/tools/llvm-shlib/libllvm.cpp Mon Mar 14 16:54:45 2016
@@ -11,10 +11,3 @@
 // 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




More information about the llvm-commits mailing list