# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/mesa/hotfix-llvm23-jitlink.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- Adapt the JITLink object layer creator to the LLVM 23 API, which now passes the JITLinkMemoryManager to the creator callback. Copyright (C) 2026 René Rebe Signed-off-by: René Rebe --- a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp 2026-09-24 15:36:09.921762617 +0200 +++ b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp 2026-09-24 15:36:09.922187823 +0200 @@ -341,6 +341,13 @@ LPJit::LPJit() :jit_dylib_count(0) { .setJITTargetMachineBuilder(std::move(JTMB)) #ifdef USE_JITLINK .setObjectLinkingLayerCreator( +#if LLVM_VERSION_MAJOR >= 23 + /* LLVM 23 passes the JITLink memory manager to the creator */ + [&](ExecutionSession &ES, llvm::jitlink::JITLinkMemoryManager &MemMgr) + -> llvm::Expected> { + return std::make_unique(ES, MemMgr); + }) +#else #if LLVM_VERSION_MAJOR >= 21 /* LLVM 21 removed the Triple argument */ [&](ExecutionSession &ES) { @@ -350,6 +357,7 @@ LPJit::LPJit() :jit_dylib_count(0) { return std::make_unique( ES, ExitOnErr(llvm::jitlink::InProcessMemoryManager::Create())); }) +#endif #else #if LLVM_USE_INTEL_JITEVENTS .RegisterJITEventListener(