mesa-32: fix build with rust-bindgen

This commit is contained in:
Tim Biermann 2024-08-31 11:10:40 +02:00
parent 0411e8fac9
commit 7644e871f8
Signed by: tb
GPG Key ID: 42F8B4E30B673606
3 changed files with 50 additions and 3 deletions

View File

@ -1,7 +1,8 @@
untrusted comment: verify with /etc/ports/compat-32.pub
RWSwxGo/zH7eXd0DHfDu2VgezNVG8QOwZ5FGS76r78wyuLkCUugiuKCkEUgurOKnSp3+W/aUU85REy9i/tckGOwmFdjne06LQwQ=
SHA256 (Pkgfile) = 51794880c3a9135c849a4c4b929394bc9c56354c3cc46d2c1e804cac638615d6
RWSwxGo/zH7eXVMzYCd78VoYgNNhz+g4jKQmZw/C1Vlljbb5gPR7pVl6q1UHv5uWqqKzWyRZHsDoUdX5QlHlNEZlhq4QcFDPbgA=
SHA256 (Pkgfile) = 8e9260b9affa33698b596174ed57d9629f750c6e15c3541150217454c46c885a
SHA256 (.footprint) = 322f4acaff91b5348ea7020f15b6bdbbbf342a5ab0c79e8e0af70f5b62f389b3
SHA256 (mesa-24.2.1.tar.xz) = fc9a495f3a9af906838be89367564e10ef335e058f88965ad49ccc3e9a3b420b
SHA256 (x86-linux-gnu) = 866e56da6164785120e4cee5ed2f44f0f7e5a5db9b34242332286754638dbdde
SHA256 (x86-linux-gnu-ccache) = 91649ec781699a1cbebfa812ffe707b668f3990be3914b8febcd542f110f12a8
SHA256 (30710.patch) = 7c5cfd5c767668cfc7e91542e0f837b0b4749d67a7eafe849a6565b8fc54e512

43
mesa-32/30710.patch Normal file
View File

@ -0,0 +1,43 @@
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(-)
diff --git a/src/gallium/frontends/rusticl/api/device.rs b/src/gallium/frontends/rusticl/api/device.rs
index 9793092db5ad4..c1cb7902e0371 100644
--- a/src/gallium/frontends/rusticl/api/device.rs
+++ b/src/gallium/frontends/rusticl/api/device.rs
@@ -196,7 +196,7 @@ impl CLInfo<cl_device_info> for cl_device_id {
// 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),
diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
index 612e47bfe88e1..1fe75a611444d 100644
--- a/src/gallium/frontends/rusticl/meson.build
+++ b/src/gallium/frontends/rusticl/meson.build
@@ -146,6 +146,7 @@ rusticl_opencl_bindings_rs = rust.bindgen(
'--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-type', 'cl.*_fn',
'--allowlist-var', 'CL_.*',
# needed for gl_sharing extension
--
GitLab

View File

@ -8,7 +8,8 @@ name=mesa-32
version=24.2.1
release=1
source=(https://archive.mesa3d.org/mesa-$version.tar.xz
x86-linux-gnu x86-linux-gnu-ccache)
x86-linux-gnu x86-linux-gnu-ccache
30710.patch)
build() {
export PKG_CONFIG_LIBDIR='/usr/lib32/pkgconfig:/usr/share/pkgconfig'
@ -38,6 +39,8 @@ build() {
#prt-get isinst xorg-libxdamage-32 xorg-libxrandr-32 xorg-libxshmfence-32 xorg-libxvmc-32 xorg-libxxf86vm-32 && PKGMK_MESA_PLATFORMS+=',x11'
PKGMK_MESA_PLATFORMS+=',x11'
patch -Np1 -d mesa-$version -i $SRC/30710.patch
meson setup mesa-$version build $PKGMK_MESA \
--cross-file=$SRC/$_cross_file \
--prefix=/usr \