Accepting request 1267883 from X11:XOrg

- let Mesa-dri only require libvulkan1, libvulkan_lvp if build
  of vulkan drivers is enabled on this platform

- let Mesa-dri also require libvulkan_lvp; fixes startup of Wayland
  sessions with Mesa 25.0.3 (boo#1240854)

- U_clover-Don-t-include-libclc-headers.patch
  * don't break clover with libclc 20.1.0 update (boo#1240848)

- Update to release 25.0.3
  --> https://docs.mesa3d.org/relnotes/25.0.3

- require llvm20/clang20

OBS-URL: https://build.opensuse.org/request/show/1267883
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/Mesa?expand=0&rev=540
This commit is contained in:
2025-04-09 19:49:23 +00:00
committed by Git OBS Bridge
7 changed files with 188 additions and 10 deletions

View File

@@ -1,3 +1,32 @@
-------------------------------------------------------------------
Mon Apr 7 19:20:37 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>
- let Mesa-dri only require libvulkan1, libvulkan_lvp if build
of vulkan drivers is enabled on this platform
-------------------------------------------------------------------
Mon Apr 7 14:37:45 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>
- let Mesa-dri also require libvulkan_lvp; fixes startup of Wayland
sessions with Mesa 25.0.3 (boo#1240854)
-------------------------------------------------------------------
Mon Apr 7 09:54:36 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>
- U_clover-Don-t-include-libclc-headers.patch
* don't break clover with libclc 20.1.0 update (boo#1240848)
-------------------------------------------------------------------
Sun Apr 6 09:24:16 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>
- Update to release 25.0.3
--> https://docs.mesa3d.org/relnotes/25.0.3
-------------------------------------------------------------------
Fri Apr 4 12:23:19 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>
- require llvm20/clang20
-------------------------------------------------------------------
Mon Mar 31 16:20:27 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>

View File

@@ -43,7 +43,7 @@
%define glamor 1
%define _name_archive mesa
%ifnarch s390x
%define _version 25.0.2
%define _version 25.0.3
%else
%define _version 24.1.7
%endif
@@ -156,7 +156,7 @@
Name: Mesa%{psuffix}
%ifnarch s390x
Version: 25.0.2
Version: 25.0.3
%else
Version: 24.1.7
%endif
@@ -187,8 +187,8 @@ Source9: manual-pages.tar.bz2
Source10: Mesa-rpmlintrc
Source11: Mesa.keyring
Source12: README-suse-maintenance.md
Source20: https://archive.mesa3d.org/%{_name_archive}-25.0.2.tar.xz
Source21: https://archive.mesa3d.org/%{_name_archive}-25.0.2.tar.xz.sig
Source20: https://archive.mesa3d.org/%{_name_archive}-25.0.3.tar.xz
Source21: https://archive.mesa3d.org/%{_name_archive}-25.0.3.tar.xz.sig
Patch2: n_add-Mesa-headers-again.patch
Patch11: u_0001-intel-genxml-Drop-from-__future__-import-annotations.patch
Patch12: u_0002-intel-genxml-Add-a-untyped-OrderedDict-fallback-for-.patch
@@ -211,6 +211,7 @@ Patch500: u_dep_xcb-s390x.patch
%ifnarch s390x
Patch700: u_meson-lower-python-version-requirement.patch
Patch701: u_intel-drop-annotations-from-spv2hex.patch
Patch702: U_clover-Don-t-include-libclc-headers.patch
%endif
%ifnarch s390x
Patch1222040: u_mesa-CVE-2023-45913.patch
@@ -325,10 +326,10 @@ BuildRequires: pkgconfig(wayland-protocols) >= 1.8
BuildRequires: pkgconfig(wayland-server) >= 1.11
%if 0%{with_llvm}
%if 0%{?suse_version} >= 1550
BuildRequires: llvm-devel >= 15
BuildRequires: llvm-devel
%else
%if 0%{?sle_version} >= 150600
BuildRequires: llvm19-devel
BuildRequires: llvm20-devel
%endif
%endif
%endif
@@ -338,7 +339,7 @@ BuildRequires: llvm19-devel
BuildRequires: clang-devel
%else
%if 0%{?sle_version} >= 150600
BuildRequires: clang19-devel
BuildRequires: clang20-devel
%endif
%endif
BuildRequires: libclc
@@ -597,7 +598,10 @@ rendering context on an X Server. It uses a pure software renderer.
Summary: DRI plug-ins for 3D acceleration
Group: System/Libraries
Requires: Mesa = %{version}
%if 0%{with_vulkan}
Requires: libvulkan1
Requires: libvulkan_lvp
%endif
Supplements: Mesa
# merged into libgallium in 24.2.3
Provides: libvdpau_gallium = %{version}-%{release}
@@ -903,6 +907,7 @@ cp %{SOURCE6} subprojects/packagecache/
%ifnarch s390x
%patch -P 700 -p1
%patch -P 701 -p1
%patch -P 702 -p1
%endif
%patch -P 1222040 -p1
%patch -P 1222041 -p1

View File

@@ -0,0 +1,144 @@
From e4eb5e80c316c0af3fff310ca89e1175d81556c1 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Thu, 27 Feb 2025 15:44:27 +0100
Subject: [PATCH] clover: Don't include libclc headers
Per https://github.com/llvm/llvm-project/issues/119967 these
headers are internal implementation details of libclc and were
never supposed to be installed. They are not available anymore
since LLVM 20. Instead opencl-c.h should be used.
There already ise a code path for including opencl-c.h, so always
use it.
This didn't work for me out of the box, because the build system
currently hardcodes the clang resource directory, which is incorrect
for Fedora at least. Fix this by using GetResourcePath +
CLANG_RESOURCE_DIR provided by clang instead. This is basically
the same as what is done in clc_helper.c
I've still retained the old behavior as a fallback just in case
(e.g. if clang is linked statically?)
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33805>
---
.../frontends/clover/llvm/invocation.cpp | 53 +++++++++++++------
src/gallium/frontends/clover/meson.build | 5 +-
2 files changed, 39 insertions(+), 19 deletions(-)
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
index 3cbb05baecf..ca030b404d7 100644
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
@@ -24,6 +24,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+#include <dlfcn.h>
+
#include <llvm/IR/DiagnosticPrinter.h>
#include <llvm/IR/DiagnosticInfo.h>
#include <llvm/IR/LLVMContext.h>
@@ -39,6 +41,8 @@
#include <clang/Frontend/TextDiagnosticBuffer.h>
#include <clang/Frontend/TextDiagnosticPrinter.h>
#include <clang/Basic/TargetInfo.h>
+#include <clang/Config/config.h>
+#include <clang/Driver/Driver.h>
#if LLVM_VERSION_MAJOR >= 20
#include <llvm/Support/VirtualFileSystem.h>
@@ -323,6 +327,30 @@ namespace {
return c;
}
+ std::string getResourceDirectory() {
+ Dl_info info;
+ if (dladdr((void *)clang::CompilerInvocation::CreateFromArgs, &info) == 0) {
+ return FALLBACK_CLANG_RESOURCE_DIR;
+ }
+
+ char *libclang_path = realpath(info.dli_fname, NULL);
+ if (libclang_path == nullptr) {
+ return FALLBACK_CLANG_RESOURCE_DIR;
+ }
+
+ // GetResourcePath is a way to retrieve the actual libclang resource dir based on a given
+ // binary or library.
+ std::string clang_resource_dir =
+#if LLVM_VERSION_MAJOR >= 20
+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path));
+#else
+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path), CLANG_RESOURCE_DIR);
+#endif
+ free(libclang_path);
+
+ return clang_resource_dir;
+ }
+
std::unique_ptr<Module>
compile(LLVMContext &ctx, clang::CompilerInstance &c,
const std::string &name, const std::string &source,
@@ -331,25 +359,18 @@ namespace {
c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
c.getHeaderSearchOpts().UseBuiltinIncludes = true;
c.getHeaderSearchOpts().UseStandardSystemIncludes = true;
- c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR;
- if (use_libclc) {
- // Add libclc generic search path
- c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR,
- clang::frontend::Angled,
- false, false);
+ std::string clang_resource_dir = getResourceDirectory();
+ c.getHeaderSearchOpts().ResourceDir = clang_resource_dir;
- // Add libclc include
- c.getPreprocessorOpts().Includes.push_back("clc/clc.h");
- } else {
- // Add opencl-c generic search path
- c.getHeaderSearchOpts().AddPath(CLANG_RESOURCE_DIR,
- clang::frontend::Angled,
- false, false);
+ // Add opencl-c generic search path
+ std::string clang_include_path = clang_resource_dir + "/include";
+ c.getHeaderSearchOpts().AddPath(clang_include_path,
+ clang::frontend::Angled,
+ false, false);
- // Add opencl include
- c.getPreprocessorOpts().Includes.push_back("opencl-c.h");
- }
+ // Add opencl include
+ c.getPreprocessorOpts().Includes.push_back("opencl-c.h");
// Add definition for the OpenCL version
const auto dev_version = dev.device_version();
diff --git a/src/gallium/frontends/clover/meson.build b/src/gallium/frontends/clover/meson.build
index e569b86a1be..56a9894f0db 100644
--- a/src/gallium/frontends/clover/meson.build
+++ b/src/gallium/frontends/clover/meson.build
@@ -10,7 +10,6 @@ clover_opencl_cpp_args = [
'-DCL_USE_DEPRECATED_OPENCL_2_0_APIS',
'-DCL_USE_DEPRECATED_OPENCL_2_1_APIS',
'-DCL_USE_DEPRECATED_OPENCL_2_2_APIS',
- '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')),
'-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir'))
]
clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
@@ -43,9 +42,9 @@ libclllvm = static_library(
cpp_args : [
clover_cpp_args,
clover_opencl_cpp_args,
- '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
+ '-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths(
dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
- dep_llvm.version(), 'include',
+ dep_llvm.version()
)),
],
gnu_symbol_visibility : 'hidden',
--
2.43.0

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:adf904d083b308df95898600ffed435f4b5c600d95fb6ec6d4c45638627fdc97
size 46705776

Binary file not shown.

3
mesa-25.0.3.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ff426ed6ce0588fd96d18975bdff451ae2ab2fe98b5d1528842ee71ec66711b
size 46736740

BIN
mesa-25.0.3.tar.xz.sig Normal file

Binary file not shown.