From 57ad3995ac702061bf86d8e316d17367af8453b4 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Mon, 14 Mar 2016 21:54:45 +0000 Subject: [PATCH] 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. llvm-svn: 263498 --- CMakeLists.txt | 10 +--------- include/llvm/Config/config.h.cmake | 3 --- tools/llvm-shlib/libllvm.cpp | 7 ------- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c07e84a293..27d9c0a52c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index 40520e29995..2adc8527c80 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -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 diff --git a/tools/llvm-shlib/libllvm.cpp b/tools/llvm-shlib/libllvm.cpp index 8424d660c9d..40b4f66b073 100644 --- a/tools/llvm-shlib/libllvm.cpp +++ b/tools/llvm-shlib/libllvm.cpp @@ -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