mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
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
This commit is contained in:
@@ -33,6 +33,14 @@
|
|||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include "llvm/Target/TargetSelect.h"
|
#include "llvm/Target/TargetSelect.h"
|
||||||
#include <cerrno>
|
#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;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -99,8 +107,11 @@ namespace {
|
|||||||
static ExecutionEngine *EE = 0;
|
static ExecutionEngine *EE = 0;
|
||||||
|
|
||||||
static void do_shutdown() {
|
static void do_shutdown() {
|
||||||
|
// Cygwin-1.5 invokes DLL's dtors before atexit handler.
|
||||||
|
#ifndef DO_NOTHING_ATEXIT
|
||||||
delete EE;
|
delete EE;
|
||||||
llvm_shutdown();
|
llvm_shutdown();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Reference in New Issue
Block a user