Skip to content

Commit 945c2e6

Browse files
[Orc] Fix process-symbols setup in LLJITBuilder for out-of-process case (#76244)
For out-of-process support the DynamicLibrarySearchGenerator must go through EPC, otherwise we lookup symbols from the host and not the target process.
1 parent 18f219c commit 945c2e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/ExecutionEngine/Orc/LLJIT.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,11 +768,11 @@ Error LLJITBuilderState::prepareForConstruction() {
768768
// create a default one.
769769
if (!SetupProcessSymbolsJITDylib && LinkProcessSymbolsByDefault) {
770770
LLVM_DEBUG(dbgs() << "Creating default Process JD setup function\n");
771-
SetupProcessSymbolsJITDylib = [this](LLJIT &J) -> Expected<JITDylibSP> {
771+
SetupProcessSymbolsJITDylib = [](LLJIT &J) -> Expected<JITDylibSP> {
772772
auto &JD =
773773
J.getExecutionSession().createBareJITDylib("<Process Symbols>");
774-
auto G = orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
775-
DL->getGlobalPrefix());
774+
auto G = EPCDynamicLibrarySearchGenerator::GetForTargetProcess(
775+
J.getExecutionSession());
776776
if (!G)
777777
return G.takeError();
778778
JD.addGenerator(std::move(*G));

0 commit comments

Comments
 (0)