From de847ebc54a74d15274d05cbbdb7b9fbf90a7030aa226c19dd346fb512893560 Mon Sep 17 00:00:00 2001 From: Ana Guerrero Date: Thu, 22 Aug 2024 06:34:51 +0000 Subject: [PATCH] - fix build with current rust-bindgen OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1321 --- Mesa.changes | 6 ++++++ Mesa.spec | 2 ++ u_fix_rust_bindgen.patch | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 u_fix_rust_bindgen.patch diff --git a/Mesa.changes b/Mesa.changes index 706cbb0..287faea 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 21 16:53:28 UTC 2024 - Andreas Stieger + +- fix build with current rust-bindgen + * u_fix_rust_bindgen.patch + ------------------------------------------------------------------- Thu Jul 4 12:26:06 UTC 2024 - Stefan Dirsch diff --git a/Mesa.spec b/Mesa.spec index b0500b9..7531200 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -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 diff --git a/u_fix_rust_bindgen.patch b/u_fix_rust_bindgen.patch new file mode 100644 index 0000000..3a39b3d --- /dev/null +++ b/u_fix_rust_bindgen.patch @@ -0,0 +1,40 @@ +From 93e96da9458c9d0348f2390dc0bea67cf140b1a0 Mon Sep 17 00:00:00 2001 +From: Karol Herbst +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: +--- + 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 for cl_devic + // TODO proper retrival from devices + CL_DEVICE_MEM_BASE_ADDR_ALIGN => cl_prop::(0x1000), + CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE => { +- cl_prop::(size_of::() as cl_uint) ++ cl_prop::(16 * size_of::() as cl_uint) + } + CL_DEVICE_NAME => cl_prop::<&str>(&dev.screen().name()), + CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR => cl_prop::(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_.*',