1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

lli: On Cygwin-1.5, lli crashes at invoking destructors in atexit handler.

llvm-svn: 117095
This commit is contained in:
NAKAMURA Takumi 2010-10-22 14:53:59 +00:00
parent e43dd89068
commit 4c7d031a0d

View File

@ -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
}
//===----------------------------------------------------------------------===//