Files
video/libs/mesa/patches/001-gallivm-support-LLVM-21.patch
Daniel Golle 282ef05e74 mesa: update to version 25.2.4
Mesa 25.2 brings a bunch of new features, especially the Panfrost Vulkan
driver saw many improvements.

See https://docs.mesa3d.org/relnotes.html for details about what has
happened since Mesa 25.1.6.

Note that OSMesa as well as the old OpenCL 1.1 support has been dropped.
The new Rusticl OpenCL implementation cannot be supported yet as OpenWrt's
meson integration still lacks support for Rust at this point.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-10-19 14:53:15 +01:00

50 lines
2.0 KiB
Diff

From cd129dbf8af2d16b1243f2ce287ff69c6a5dc557 Mon Sep 17 00:00:00 2001
From: no92 <no92.mail@gmail.com>
Date: Wed, 27 Aug 2025 16:02:31 +0200
Subject: [PATCH] gallivm: support LLVM 21
LLVM PR#146819 changed the signature of `setObjectLinkingLayerCreator`,
dropping the Triple argument. The PR was first included in the LLVM 21
series, and the new signature is gated behind a version check for that.
`LLVMOrcThreadSafeContextGetContext` was removed in LLVM commit b18e5b6,
and the ORC examples in the LLVM tree seem to just create a context
instead, which we replicate here.
With this commit, mesa successfully builds the llvmpipe gallium driver
on riscv64 with LLVM 21.1.0.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13785
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13852
Reviewed-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37027>
---
src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
@@ -340,7 +340,12 @@ LPJit::LPJit() :jit_dylib_count(0) {
.setJITTargetMachineBuilder(std::move(JTMB))
#ifdef USE_JITLINK
.setObjectLinkingLayerCreator(
+#if LLVM_VERSION_MAJOR >= 21
+ /* LLVM 21 removed the Triple argument */
+ [&](ExecutionSession &ES) {
+#else
[&](ExecutionSession &ES, const llvm::Triple &TT) {
+#endif
return std::make_unique<ObjectLinkingLayer>(
ES, ExitOnErr(llvm::jitlink::InProcessMemoryManager::Create()));
})
@@ -552,7 +557,7 @@ init_gallivm_state(struct gallivm_state
gallivm->cache = cache;
gallivm->_ts_context = context->ref;
- gallivm->context = LLVMOrcThreadSafeContextGetContext(context->ref);
+ gallivm->context = LLVMContextCreate();
gallivm->module_name = LPJit::get_unique_name(name);
gallivm->module = LLVMModuleCreateWithNameInContext(gallivm->module_name,