git: a5cacc156c3b - main - graphics/mesa-{dri,libs}: Drop patches that are now included upstream

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Mon, 15 Jun 2026 17:48:03 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a5cacc156c3bdbc2f7a5493991bedbfca742107a

commit a5cacc156c3bdbc2f7a5493991bedbfca742107a
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2026-06-15 17:47:08 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2026-06-15 17:47:59 +0000

    graphics/mesa-{dri,libs}: Drop patches that are now included upstream
    
    Reported by:    kenrap
---
 graphics/mesa-dri/files/patch-llvm20-1 | 44 ------------------
 graphics/mesa-dri/files/patch-llvm20-2 | 82 ----------------------------------
 graphics/mesa-dri/files/patch-llvm21-1 | 36 ---------------
 graphics/mesa-dri/files/patch-llvm21-2 | 42 -----------------
 graphics/mesa-dri/files/patch-llvm21-3 | 46 -------------------
 graphics/mesa-dri/files/patch-llvm21-4 | 49 --------------------
 6 files changed, 299 deletions(-)

diff --git a/graphics/mesa-dri/files/patch-llvm20-1 b/graphics/mesa-dri/files/patch-llvm20-1
deleted file mode 100644
index 8031a3fb0c03..000000000000
--- a/graphics/mesa-dri/files/patch-llvm20-1
+++ /dev/null
@@ -1,44 +0,0 @@
-From 14ebecd78711804bc60f56cc53632bfab9d375df Mon Sep 17 00:00:00 2001
-From: Karol Herbst <kherbst@redhat.com>
-Date: Mon, 2 Sep 2024 16:57:08 +0200
-Subject: [PATCH] clc: fix compilation error with llvm-20
-
-LLVM commit:
-https://github.com/llvm/llvm-project/commit/924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68
-
-Cc: mesa-stable
-Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11814
-Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
-Reviewed-by: David Heidelberg <david@ixit.cz>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30980>
----
- src/compiler/clc/clc_helpers.cpp | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git src/compiler/clc/clc_helpers.cpp src/compiler/clc/clc_helpers.cpp
-index 8da3a8fc5e85..24bc7914a13f 100644
---- src/compiler/clc/clc_helpers.cpp
-+++ src/compiler/clc/clc_helpers.cpp
-@@ -886,10 +886,16 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
-       return {};
-    }
- 
--   // GetResourcePath is a way to retrive the actual libclang resource dir based on a given binary
-+   // GetResourcePath is a way to retrieve the actual libclang resource dir based on a given binary
-    // or library.
--   auto clang_res_path =
--      fs::path(Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR)) / "include";
-+   auto tmp_res_path =
-+#if LLVM_VERSION_MAJOR >= 20
-+      Driver::GetResourcesPath(std::string(clang_path));
-+#else
-+      Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR);
-+#endif
-+   auto clang_res_path = fs::path(tmp_res_path) / "include";
-+
-    free(clang_path);
- 
-    c->getHeaderSearchOpts().UseBuiltinIncludes = true;
--- 
-GitLab
-
diff --git a/graphics/mesa-dri/files/patch-llvm20-2 b/graphics/mesa-dri/files/patch-llvm20-2
deleted file mode 100644
index b23b4bd84c96..000000000000
--- a/graphics/mesa-dri/files/patch-llvm20-2
+++ /dev/null
@@ -1,82 +0,0 @@
-From 8a453669e2bd44651cacdeac1c372d6e80cab0a7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= <kai@dev.carbon-project.org>
-Date: Mon, 2 Dec 2024 18:29:19 +0100
-Subject: [PATCH] fix(FTBFS): clc/clover: pass a VFS instance explicitly
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This just replicates what upstream did before breaking mesa with commit
-df9a14d7bbf and requiring a VFS instance.
-
-Reported-by: @Lone_Wolf
-Reference: <https://github.com/llvm/llvm-project/commit/df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55>
-Closes: <https://gitlab.freedesktop.org/mesa/mesa/-/issues/12223>
-Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
-Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
-Reviewed-by: Karol Herbst <kherbst@redhat.com>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32439>
----
- src/compiler/clc/clc_helpers.cpp                 | 10 +++++++++-
- src/gallium/frontends/clover/llvm/invocation.cpp | 10 +++++++++-
- 2 files changed, 18 insertions(+), 2 deletions(-)
-
-diff --git src/compiler/clc/clc_helpers.cpp src/compiler/clc/clc_helpers.cpp
-index f3f884b21809..ce0563d7f4fd 100644
---- src/compiler/clc/clc_helpers.cpp
-+++ src/compiler/clc/clc_helpers.cpp
-@@ -56,6 +56,10 @@
- #include <spirv-tools/linker.hpp>
- #include <spirv-tools/optimizer.hpp>
- 
-+#if LLVM_VERSION_MAJOR >= 20
-+#include <llvm/Support/VirtualFileSystem.h>
-+#endif
-+
- #include "util/macros.h"
- #include "glsl_types.h"
- 
-@@ -841,7 +845,11 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
-    // http://www.llvm.org/bugs/show_bug.cgi?id=19735
-    c->getDiagnosticOpts().ShowCarets = false;
- 
--   c->createDiagnostics(new clang::TextDiagnosticPrinter(
-+   c->createDiagnostics(
-+#if LLVM_VERSION_MAJOR >= 20
-+                   *llvm::vfs::getRealFileSystem(),
-+#endif
-+                   new clang::TextDiagnosticPrinter(
-                            diag_log_stream,
-                            &c->getDiagnosticOpts()));
- 
-diff --git src/gallium/frontends/clover/llvm/invocation.cpp src/gallium/frontends/clover/llvm/invocation.cpp
-index d2e238c880bd..3cbb05baecf6 100644
---- src/gallium/frontends/clover/llvm/invocation.cpp
-+++ src/gallium/frontends/clover/llvm/invocation.cpp
-@@ -40,6 +40,10 @@
- #include <clang/Frontend/TextDiagnosticPrinter.h>
- #include <clang/Basic/TargetInfo.h>
- 
-+#if LLVM_VERSION_MAJOR >= 20
-+#include <llvm/Support/VirtualFileSystem.h>
-+#endif
-+
- // We need to include internal headers last, because the internal headers
- // include CL headers which have #define's like:
- //
-@@ -305,7 +309,11 @@ namespace {
-                                 ::llvm::Triple(target.triple),
-                                 get_language_version(opts, device_clc_version));
- 
--      c->createDiagnostics(new clang::TextDiagnosticPrinter(
-+      c->createDiagnostics(
-+#if LLVM_VERSION_MAJOR >= 20
-+                           *llvm::vfs::getRealFileSystem(),
-+#endif
-+                           new clang::TextDiagnosticPrinter(
-                               *new raw_string_ostream(r_log),
-                               &c->getDiagnosticOpts(), true));
- 
--- 
-GitLab
-
diff --git a/graphics/mesa-dri/files/patch-llvm21-1 b/graphics/mesa-dri/files/patch-llvm21-1
deleted file mode 100644
index 39d6a0d50f39..000000000000
--- a/graphics/mesa-dri/files/patch-llvm21-1
+++ /dev/null
@@ -1,36 +0,0 @@
-From 0e7c94b2b369ac0bf4439e207bc9047f2cd44ead Mon Sep 17 00:00:00 2001
-From: Natalie Vock <natalie.vock@gmx.de>
-Date: Mon, 10 Mar 2025 16:18:24 +0100
-Subject: [PATCH] ac/llvm: Don't use getTriple() on LLVM21+
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-setTargetTriple() takes a Triple now.
-
-Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
-Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33981>
----
- src/amd/llvm/ac_llvm_helper.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git src/amd/llvm/ac_llvm_helper.cpp src/amd/llvm/ac_llvm_helper.cpp
-index 1b6c955caa41..cb59123dacae 100644
---- src/amd/llvm/ac_llvm_helper.cpp
-+++ src/amd/llvm/ac_llvm_helper.cpp
-@@ -97,7 +97,11 @@ LLVMModuleRef ac_create_module(LLVMTargetMachineRef tm, LLVMContextRef ctx)
-    TargetMachine *TM = reinterpret_cast<TargetMachine *>(tm);
-    LLVMModuleRef module = LLVMModuleCreateWithNameInContext("mesa-shader", ctx);
- 
-+#if LLVM_VERSION_MAJOR >= 21
-+   unwrap(module)->setTargetTriple(TM->getTargetTriple());
-+#else
-    unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple());
-+#endif
-    unwrap(module)->setDataLayout(TM->createDataLayout());
-    return module;
- }
--- 
-GitLab
-
diff --git a/graphics/mesa-dri/files/patch-llvm21-2 b/graphics/mesa-dri/files/patch-llvm21-2
deleted file mode 100644
index e2c27f9d4758..000000000000
--- a/graphics/mesa-dri/files/patch-llvm21-2
+++ /dev/null
@@ -1,42 +0,0 @@
-From 531c6696d42953cd642dea7bf70153285c7949ae Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= <kai@dev.carbon-project.org>
-Date: Tue, 6 May 2025 14:36:57 +0200
-Subject: [PATCH] fix(FTBFS): clc: switch to new non-owned `TargetOptions` for
- LLVM 21
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream hid the `TargetOptions` in commit 985410f87f2d19910a8d327527fd30062b042b63
-
-Use the new `getTargetOpts()` to obtain the `TargetOptions` for
-`setTarget()`.
-
-Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
-Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13079
-Reference: https://github.com/llvm/llvm-project/commit/985410f87f2d19910a8d327527fd30062b042b63
-Reviewed-by: Karol Herbst <kherbst@redhat.com>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34835>
----
- src/compiler/clc/clc_helpers.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git src/compiler/clc/clc_helpers.cpp src/compiler/clc/clc_helpers.cpp
-index 41d4c4baf995..5744d7b48296 100644
---- src/compiler/clc/clc_helpers.cpp
-+++ src/compiler/clc/clc_helpers.cpp
-@@ -864,7 +864,11 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
-                            &c->getDiagnosticOpts()));
- 
-    c->setTarget(clang::TargetInfo::CreateTargetInfo(
-+#if LLVM_VERSION_MAJOR >= 21
-+                   c->getDiagnostics(), c->getInvocation().getTargetOpts()));
-+#else
-                    c->getDiagnostics(), c->getInvocation().TargetOpts));
-+#endif
- 
-    c->getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
- 
--- 
-GitLab
-
diff --git a/graphics/mesa-dri/files/patch-llvm21-3 b/graphics/mesa-dri/files/patch-llvm21-3
deleted file mode 100644
index 56c80b43b9c4..000000000000
--- a/graphics/mesa-dri/files/patch-llvm21-3
+++ /dev/null
@@ -1,46 +0,0 @@
-From 392ad203ebc2060ccc83022d03f76a8d7bb2f614 Mon Sep 17 00:00:00 2001
-From: Karol Herbst <kherbst@redhat.com>
-Date: Sat, 7 Jun 2025 09:51:00 +0200
-Subject: [PATCH] clc: use new createTargetMachine overload with llvm-21
-
-The old one is deprecated, so let's move and silence the warning.
-
-Cc: mesa-stable
-Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35399>
----
- src/compiler/clc/clc_helpers.cpp | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git src/compiler/clc/clc_helpers.cpp src/compiler/clc/clc_helpers.cpp
-index cbf46ce7aa49..2920f7325ed3 100644
---- src/compiler/clc/clc_helpers.cpp
-+++ src/compiler/clc/clc_helpers.cpp
-@@ -60,6 +60,10 @@
- #include <spirv-tools/linker.hpp>
- #include <spirv-tools/optimizer.hpp>
- 
-+#if LLVM_VERSION_MAJOR >= 16
-+#include <llvm/TargetParser/Triple.h>
-+#endif
-+
- #if LLVM_VERSION_MAJOR >= 20
- #include <llvm/Support/VirtualFileSystem.h>
- #endif
-@@ -1139,7 +1143,12 @@ llvm_mod_to_spirv(std::unique_ptr<::llvm::Module> mod,
-       auto target = TargetRegistry::lookupTarget(triple, error_msg);
-       if (target) {
-          auto TM = target->createTargetMachine(
--            triple, "", "", {}, std::nullopt, std::nullopt,
-+#if LLVM_VERSION_MAJOR >= 21
-+            llvm::Triple(triple),
-+#else
-+            triple,
-+#endif
-+            "", "", {}, std::nullopt, std::nullopt,
- #if LLVM_VERSION_MAJOR >= 18
-             ::llvm::CodeGenOptLevel::None
- #else
--- 
-GitLab
-
diff --git a/graphics/mesa-dri/files/patch-llvm21-4 b/graphics/mesa-dri/files/patch-llvm21-4
deleted file mode 100644
index f118959d499e..000000000000
--- a/graphics/mesa-dri/files/patch-llvm21-4
+++ /dev/null
@@ -1,49 +0,0 @@
-From a482ec7f05d2aeac29dc696cbd17e12693ad1393 Mon Sep 17 00:00:00 2001
-From: Karol Herbst <kherbst@redhat.com>
-Date: Sat, 7 Jun 2025 10:13:06 +0200
-Subject: [PATCH] clc: fix DiagnosticOptions related build failure with llvm-21
-
-Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13257
-Cc: mesa-stable
-Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35399>
----
- src/compiler/clc/clc_helpers.cpp | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git src/compiler/clc/clc_helpers.cpp src/compiler/clc/clc_helpers.cpp
-index 2920f7325ed3..d3629ceccebd 100644
---- src/compiler/clc/clc_helpers.cpp
-+++ src/compiler/clc/clc_helpers.cpp
-@@ -804,11 +804,17 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
-       c->addDependencyCollector(dep);
-    }
- 
-+#if LLVM_VERSION_MAJOR >= 21
-+   auto diag_opts = c->getDiagnosticOpts();
-+#else
-+   auto diag_opts = &c->getDiagnosticOpts();
-+#endif
-+
-    clang::DiagnosticsEngine diag {
-       new clang::DiagnosticIDs,
--      new clang::DiagnosticOptions,
-+      diag_opts,
-       new clang::TextDiagnosticPrinter(diag_log_stream,
--                                       &c->getDiagnosticOpts())
-+                                       diag_opts)
-    };
- 
- #if LLVM_VERSION_MAJOR >= 17
-@@ -865,7 +871,7 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
- #endif
-                    new clang::TextDiagnosticPrinter(
-                            diag_log_stream,
--                           &c->getDiagnosticOpts()));
-+                           diag_opts));
- 
-    c->setTarget(clang::TargetInfo::CreateTargetInfo(
- #if LLVM_VERSION_MAJOR >= 21
--- 
-GitLab
-