From dbe8b058eed9a44fda1baf6350e66d921ed4e0bd Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 19 Aug 2024 17:24:51 +0200 Subject: [PATCH] Fix DelegateGenerator on macOS Commit 785c9df34d ("Restore symbol lookup in child interpreters") added a DefinitionGenerator to allow symbol lookup in the parent IncrementalJIT after the upgrade to LLVM 13. It appears that instead of the unmangled name, we need to lookup already linker mangled names. This fixes the tests CodeUnloading/AtExit.C and MultipleInterpreters/MultipleInterpreters.C on macOS, which adds an underscore during linker mangling. No change on Linux because there is no additional linker name mangling. --- lib/Interpreter/IncrementalJIT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Interpreter/IncrementalJIT.cpp b/lib/Interpreter/IncrementalJIT.cpp index 01530824ba..10ce77baba 100644 --- a/lib/Interpreter/IncrementalJIT.cpp +++ b/lib/Interpreter/IncrementalJIT.cpp @@ -586,7 +586,7 @@ IncrementalJIT::IncrementalJIT( std::unique_ptr IncrementalJIT::getGenerator() { return std::make_unique( - [&](StringRef UnmangledName) { return Jit->lookup(UnmangledName); }); + [&](StringRef Name) { return Jit->lookupLinkerMangled(Name); }); } void IncrementalJIT::addModule(Transaction& T) {