diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2010-10-22 14:53:59 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2010-10-22 14:53:59 +0000 |
commit | a13d14a1290bc2c8b2e25a51ec4ae4e9bc8cd215 (patch) | |
tree | aa3800e6df3e9c1f78111a311d34a7969f832e82 /tools/lli | |
parent | ed50d3855345113cedbe6517d8801b3fe61a7d2b (diff) | |
download | external_llvm-a13d14a1290bc2c8b2e25a51ec4ae4e9bc8cd215.zip external_llvm-a13d14a1290bc2c8b2e25a51ec4ae4e9bc8cd215.tar.gz external_llvm-a13d14a1290bc2c8b2e25a51ec4ae4e9bc8cd215.tar.bz2 |
lli: On Cygwin-1.5, lli crashes at invoking destructors in atexit handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli')
-rw-r--r-- | tools/lli/lli.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 4c37780..adc6e90 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -33,6 +33,14 @@ #include "llvm/System/Signals.h" #include "llvm/Target/TargetSelect.h" #include <cerrno> + +#ifdef __CYGWIN__ +#include <cygwin/version.h> +#if defined(CYGWIN_VERSION_DLL_MAJOR) && CYGWIN_VERSION_DLL_MAJOR<1007 +#define DO_NOTHING_ATEXIT 1 +#endif +#endif + using namespace llvm; namespace { @@ -99,8 +107,11 @@ namespace { static ExecutionEngine *EE = 0; static void do_shutdown() { + // Cygwin-1.5 invokes DLL's dtors before atexit handler. +#ifndef DO_NOTHING_ATEXIT delete EE; llvm_shutdown(); +#endif } //===----------------------------------------------------------------------===// |