mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 22:30:13 +00:00
[mlir] ExecutionEngine needs special handling for COFF binaries
Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D97141
This commit is contained in:
parent
16a50c9e64
commit
3c4cdd0b6a
@ -255,6 +255,15 @@ Expected<std::unique_ptr<ExecutionEngine>> ExecutionEngine::create(
|
||||
if (engine->perfListener)
|
||||
objectLayer->registerJITEventListener(*engine->perfListener);
|
||||
|
||||
// COFF format binaries (Windows) need special handling to deal with
|
||||
// exported symbol visibility.
|
||||
// cf llvm/lib/ExecutionEngine/Orc/LLJIT.cpp LLJIT::createObjectLinkingLayer
|
||||
llvm::Triple targetTriple(llvm::Twine(llvmModule->getTargetTriple()));
|
||||
if (targetTriple.isOSBinFormatCOFF()) {
|
||||
objectLayer->setOverrideObjectFlagsWithResponsibilityFlags(true);
|
||||
objectLayer->setAutoClaimResponsibilityForObjectSymbols(true);
|
||||
}
|
||||
|
||||
// Resolve symbols from shared libraries.
|
||||
for (auto libPath : sharedLibPaths) {
|
||||
auto mb = llvm::MemoryBuffer::getFile(libPath);
|
||||
|
Loading…
Reference in New Issue
Block a user