Unverified Commit 9561691c authored by Vladimír Čunát's avatar Vladimír Čunát Committed by GitHub
Browse files

mesa: 25.3.0 -> 25.2.6 (#466009)

parents 04931f3a 4ad09cd8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@
# nix build .#legacyPackages.x86_64-darwin.mesa .#legacyPackages.aarch64-darwin.mesa
rec {
  pname = "mesa";
  version = "25.3.0";
  version = "25.2.6";

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "mesa";
    repo = "mesa";
    rev = "mesa-${version}";
    hash = "sha256-MviXDRAbCEXM9dIzD94/CM0bjlF4zCJUVE91Xst/uII=";
    hash = "sha256-erfvNR1Yor3k8gVVClyiBJsgyaOv7BMFd1NSgieTY5I=";
  };

  meta = {
+1 −5
Original line number Diff line number Diff line
@@ -25,11 +25,6 @@ stdenv.mkDerivation {
    meta
    ;

  patches = [
    # Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38429
    ./fix-darwin-build.patch
  ];

  outputs = [
    "out"
    "dev"
@@ -63,6 +58,7 @@ stdenv.mkDerivation {
    "--sysconfdir=/etc"
    "--datadir=${placeholder "out"}/share"
    (lib.mesonEnable "glvnd" false)
    (lib.mesonEnable "shared-glapi" true)
    (lib.mesonEnable "llvm" true)
  ];

+3 −10
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
  spirv-tools,
  intltool,
  jdupes,
  libdisplay-info,
  libdrm,
  libgbm,
  libglvnd,
@@ -69,10 +68,6 @@
    "vc4" # Broadcom VC4 (Raspberry Pi 0-3)
    "virgl" # QEMU virtualized GPU (aka VirGL)
    "zink" # generic OpenGL over Vulkan, experimental
  ]
  ++ lib.optionals stdenv.hostPlatform.is64bit [
    "ethosu" # ARM Ethos NPU, does not build on 32-bit
    "rocket" # Rockchip NPU, probably horribly broken on 32-bit
  ],
  vulkanDrivers ? [
    "amd" # AMD (aka RADV)
@@ -80,7 +75,7 @@
    "broadcom" # Broadcom VC5 (Raspberry Pi 4, aka V3D)
    "freedreno" # Qualcomm Adreno (all Qualcomm SoCs)
    "gfxstream" # Android virtualized GPU
    "imagination" # PowerVR Rogue (currently N/A)
    "imagination-experimental" # PowerVR Rogue (currently N/A)
    "intel_hasvk" # Intel Haswell/Broadwell, "legacy" Vulkan driver (https://www.phoronix.com/news/Intel-HasVK-Drop-Dead-Code)
    "intel" # new Intel (aka ANV)
    "microsoft-experimental" # WSL virtualized GPU (aka DZN/Dozen)
@@ -101,7 +96,6 @@
    "wayland"
  ],
  vulkanLayers ? [
    "anti-lag"
    "device-select"
    "intel-nullhw"
    "overlay"
@@ -150,7 +144,8 @@ stdenv.mkDerivation {

  patches = [
    ./opencl.patch
    ./musl.patch
    # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37027
    ./gallivm-llvm-21.patch
  ];

  postPatch = ''
@@ -261,7 +256,6 @@ stdenv.mkDerivation {
      elfutils
      expat
      spirv-tools
      libdisplay-info
      libdrm
      libgbm
      libglvnd
@@ -341,7 +335,6 @@ stdenv.mkDerivation {
    moveToOutput bin/panfrost_compile $cross_tools
    moveToOutput bin/panfrost_texfeatures $cross_tools
    moveToOutput bin/panfrostdump $cross_tools
    moveToOutput bin/pco_clc $cross_tools
    moveToOutput bin/vtn_bindgen2 $cross_tools

    moveToOutput "lib/lib*OpenCL*" $opencl
+0 −34
Original line number Diff line number Diff line
diff --git a/src/glx/apple/apple_cgl.c b/src/glx/apple/apple_cgl.c
index 81b6730f8e29b3920216461858b98bcd3b7a870c..9bdfe555949482ddb6153ee926967ac5c04fe7c8 100644
--- a/src/glx/apple/apple_cgl.c
+++ b/src/glx/apple/apple_cgl.c
@@ -34,6 +34,7 @@
 
 #include "apple_cgl.h"
 #include "apple_glx.h"
+#include "util/os_misc.h"
 
 #ifndef OPENGL_FRAMEWORK_PATH
 #define OPENGL_FRAMEWORK_PATH "/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL"
diff --git a/src/loader/loader.c b/src/loader/loader.c
index d06a368c1bbff180fcc9432183db66398b75f4a3..0567beb3dee569895fbb36c7e7c3df34be8b32b7 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -139,6 +139,9 @@ iris_predicate(int fd, const char *driver)
 bool
 nouveau_zink_predicate(int fd, const char *driver)
 {
+#ifndef HAVE_LIBDRM
+   return true;
+#else
    /* Never load on nv proprietary driver */
    if (!drm_fd_is_nouveau(fd))
       return false;
@@ -191,6 +194,7 @@ nouveau_zink_predicate(int fd, const char *driver)
    if (!use_zink && !strcmp(driver, "nouveau"))
       return true;
    return false;
+#endif
 }
 
 
+53 −0
Original line number Diff line number Diff line
From eca19331d94005485de5246cfa87a21621486cd8 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>
---
 src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
index 3d2b8cf81bc0c..0be69b02b6eef 100644
--- 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, const char *name,
    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,
-- 
GitLab
Loading