- fix build with current rust-bindgen

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1321
This commit is contained in:
Ana Guerrero 2024-08-22 06:34:51 +00:00 committed by Git OBS Bridge
parent cda19f8f9d
commit de847ebc54
3 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 21 16:53:28 UTC 2024 - Andreas Stieger <andreas.stieger@gmx.de>
- fix build with current rust-bindgen
* u_fix_rust_bindgen.patch
-------------------------------------------------------------------
Thu Jul 4 12:26:06 UTC 2024 - Stefan Dirsch <sndirsch@suse.com>

View File

@ -178,6 +178,7 @@ Patch11: u_0001-intel-genxml-Drop-from-__future__-import-annotations.patc
Patch12: u_0002-intel-genxml-Add-a-untyped-OrderedDict-fallback-for-.patch
Patch13: python36-buildfix1.patch
Patch14: python36-buildfix2.patch
Patch15: u_fix_rust_bindgen.patch
# never to be upstreamed
Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch
Patch58: u_dep_xcb.patch
@ -830,6 +831,7 @@ cp %{SOURCE6} subprojects/packagecache/
%if 0%{?suse_version} < 1550
%patch -P 14 -p1
%endif
%patch -P 15 -p1
# no longer needed since gstreamer-plugins-vaapi 1.18.4
%if 0%{?suse_version} < 1550
%patch -P 54 -p1

40
u_fix_rust_bindgen.patch Normal file
View File

@ -0,0 +1,40 @@
From 93e96da9458c9d0348f2390dc0bea67cf140b1a0 Mon Sep 17 00:00:00 2001
From: Karol Herbst <kherbst@redhat.com>
Date: Sun, 18 Aug 2024 00:08:50 +0200
Subject: [PATCH] rusticl: do not use CL vector types in bindings and code
Bindgen seems to miscompile them and I kinda thought I've done this
already in the past, but apparently not.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11722
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30710>
---
src/gallium/frontends/rusticl/api/device.rs | 2 +-
src/gallium/frontends/rusticl/meson.build | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
Index: mesa-24.1.3/src/gallium/frontends/rusticl/api/device.rs
===================================================================
--- mesa-24.1.3.orig/src/gallium/frontends/rusticl/api/device.rs
+++ mesa-24.1.3/src/gallium/frontends/rusticl/api/device.rs
@@ -198,7 +198,7 @@ impl CLInfo<cl_device_info> for cl_devic
// TODO proper retrival from devices
CL_DEVICE_MEM_BASE_ADDR_ALIGN => cl_prop::<cl_uint>(0x1000),
CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE => {
- cl_prop::<cl_uint>(size_of::<cl_ulong16>() as cl_uint)
+ cl_prop::<cl_uint>(16 * size_of::<cl_ulong>() as cl_uint)
}
CL_DEVICE_NAME => cl_prop::<&str>(&dev.screen().name()),
CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR => cl_prop::<cl_uint>(1),
Index: mesa-24.1.3/src/gallium/frontends/rusticl/meson.build
===================================================================
--- mesa-24.1.3.orig/src/gallium/frontends/rusticl/meson.build
+++ mesa-24.1.3/src/gallium/frontends/rusticl/meson.build
@@ -179,6 +179,7 @@ rusticl_opencl_bindings_rs = rust.bindge
'--raw-line', 'unsafe impl std::marker::Send for _cl_image_desc {}',
'--raw-line', 'unsafe impl std::marker::Sync for _cl_image_desc {}',
'--allowlist-type', 'cl_.*',
+ '--blocklist-type', '(__)?cl_.*[2348(16)]',
'--allowlist-var', 'CL_.*',
# needed for gl_sharing extension
'--allowlist-var', 'GL_.*',