summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-08-02 19:43:20 +0000
committerLang Hames <lhames@gmail.com>2019-08-02 19:43:20 +0000
commitcb391279b41bddfa12bdd61a08781daaa263b0a2 (patch)
tree0cc912d2ba383bceb414b6509ab322579c782c4e /llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
parentfae0a60a9cac5731d66a52aefa9f24da85b442c7 (diff)
downloadbcm5719-llvm-cb391279b41bddfa12bdd61a08781daaa263b0a2.tar.gz
bcm5719-llvm-cb391279b41bddfa12bdd61a08781daaa263b0a2.zip
[ORC] Turn on symbol-flags overrides for LLJIT on Windows by default.
libObject does not apply the Exported flag to symbols in COFF object files, which can lead to assertions when the symbol flags initially derived from IR added to the JIT clash with the flags seen by the JIT linker. Both RTDyldObjectLinkingLayer and ObjectLinkingLayer have a workaround for this: they can be told to override the flags seen by the linker with the flags attached to the materialization responsibility object that was passed down to the linker. This patch modifies LLJIT's setup code to enable this override by default on platforms where COFF is the default object format. llvm-svn: 367712
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/LLJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/LLJIT.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
index 94323632391..14b3b6ac7f6 100644
--- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
@@ -64,12 +64,18 @@ LLJIT::createObjectLinkingLayer(LLJITBuilderState &S, ExecutionSession &ES) {
// If the config state provided an ObjectLinkingLayer factory then use it.
if (S.CreateObjectLinkingLayer)
- return S.CreateObjectLinkingLayer(ES);
+ return S.CreateObjectLinkingLayer(ES, S.JTMB->getTargetTriple());
// Otherwise default to creating an RTDyldObjectLinkingLayer that constructs
// a new SectionMemoryManager for each object.
auto GetMemMgr = []() { return llvm::make_unique<SectionMemoryManager>(); };
- return llvm::make_unique<RTDyldObjectLinkingLayer>(ES, std::move(GetMemMgr));
+ auto ObjLinkingLayer =
+ llvm::make_unique<RTDyldObjectLinkingLayer>(ES, std::move(GetMemMgr));
+
+ if (S.JTMB->getTargetTriple().isOSBinFormatCOFF())
+ ObjLinkingLayer->setOverrideObjectFlagsWithResponsibilityFlags(true);
+
+ return ObjLinkingLayer;
}
Expected<IRCompileLayer::CompileFunction>
OpenPOWER on IntegriCloud