Skip to content

Commit 7052ffb

Browse files
committed
Use AddSymbol mapping in Win LLVM21 stability mode
1 parent cb90c4a commit 7052ffb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <llvm/Target/TargetMachine.h>
4545
#include <llvm/Support/TargetSelect.h>
4646
#include <llvm/Support/Casting.h>
47+
#include <llvm/Support/DynamicLibrary.h>
4748
#if LLVM_VERSION_MAJOR >= 18
4849
#include <llvm/TargetParser/Host.h>
4950
#else
@@ -249,6 +250,13 @@ class LPJit
249250
debug_printf("ORCJIT skip addMapping for unknown JITDylib handle %p\n", jd);
250251
return;
251252
}
253+
#if LP_ORCJIT_WIN21_STABILITY_MODE
254+
auto sym_name = llvm::unwrap(sym)->getName().str();
255+
if (!sym_name.empty()) {
256+
llvm::sys::DynamicLibrary::AddSymbol(sym_name, addr);
257+
}
258+
return;
259+
#endif
252260
auto& es = jit->lljit->getExecutionSession();
253261
auto name = es.intern(llvm::unwrap(sym)->getName());
254262
SymbolMap map(1);

0 commit comments

Comments
 (0)