Skip to content

Commit

Permalink
llvm-shlib: Remove the option to override __cxa_atexit
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263498 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
bogner committed Mar 14, 2016
1 parent 07a4ec0 commit 3479006
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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})
Expand Down
3 changes: 0 additions & 3 deletions include/llvm/Config/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 0 additions & 7 deletions tools/llvm-shlib/libllvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3479006

Please sign in to comment.