summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2010-10-22 14:53:59 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2010-10-22 14:53:59 +0000
commit1530487cb1edaf8f953dabfd901c4b255a32c950 (patch)
tree19042c01415fb63bcd722a26b64b8b5928463e62 /llvm/tools
parenta92b66ec47085fdd398500b415d5998e15fbee96 (diff)
downloadbcm5719-llvm-1530487cb1edaf8f953dabfd901c4b255a32c950.tar.gz
bcm5719-llvm-1530487cb1edaf8f953dabfd901c4b255a32c950.zip
lli: On Cygwin-1.5, lli crashes at invoking destructors in atexit handler.
llvm-svn: 117095
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lli/lli.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 4c377805e6a..adc6e90eb99 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/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
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud