From f61049b2d8aa19341c32b0dbe67c272b30e078d3 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 27 Oct 2013 10:22:52 +0000 Subject: MCJIT-remote: __main should be resolved in child context. - Mark tests as XFAIL:cygming in test/ExecutionEngine/MCJIT/remote. Rather to suppress them, I'd like to leave them running as XFAIL. - Revert r193472. RecordMemoryManager no longer resolves __main on cygming. There are a couple of issues. - X86 Codegen emits "call __main" in @main for targeting cygming. It is useless in JIT. FYI, tests are passing when emitting __main is disabled. - Current remote JIT does not resolve any symbols in child context. FIXME: __main should be disabled, or remote JIT should resolve __main. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193498 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/lli/RemoteMemoryManager.cpp | 16 ---------------- tools/lli/RemoteMemoryManager.h | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) (limited to 'tools') diff --git a/tools/lli/RemoteMemoryManager.cpp b/tools/lli/RemoteMemoryManager.cpp index f730f0984f..04fc40e426 100644 --- a/tools/lli/RemoteMemoryManager.cpp +++ b/tools/lli/RemoteMemoryManager.cpp @@ -204,19 +204,3 @@ uint8_t *RemoteMemoryManager::allocateGlobal(uintptr_t Size, unsigned Alignment) void RemoteMemoryManager::deallocateFunctionBody(void *Body) { llvm_unreachable("Unexpected!"); } - -static int jit_noop() { - return 0; -} - -uint64_t RemoteMemoryManager::getSymbolAddress(const std::string &Name) { - // We should not invoke parent's ctors/dtors from generated main()! - // On Mingw and Cygwin, the symbol __main is resolved to - // callee's(eg. tools/lli) one, to invoke wrong duplicated ctors - // (and register wrong callee's dtors with atexit(3)). - // We expect ExecutionEngine::runStaticConstructorsDestructors() - // is called before ExecutionEngine::runFunctionAsMain() is called. - if (Name == "__main") return (uintptr_t)&jit_noop; - - return 0; -} diff --git a/tools/lli/RemoteMemoryManager.h b/tools/lli/RemoteMemoryManager.h index 3368b30ed6..5d0456f509 100644 --- a/tools/lli/RemoteMemoryManager.h +++ b/tools/lli/RemoteMemoryManager.h @@ -78,7 +78,7 @@ public: // interface does support this, but clients must provide their own // mechanism for finding remote symbol addresses. MCJIT will resolve // symbols from Modules it contains. - uint64_t getSymbolAddress(const std::string &Name); + uint64_t getSymbolAddress(const std::string &Name) { return 0; } void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj); -- cgit v1.2.3