mesa: build regression with rust-bindgen 0.70 on 32 bit
by lucabon from LinuxQuestions.org on (#6Q6EY)
After upgrading rust-bindgen to 0.70, mesa failed to build on 32 bit with the following error (the first of 14):
Code:error[E0080]: evaluation of constant value failed
--> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7030:31
|
7030 | ["Alignment of cl_char8"][::std::mem::align_of::<cl_char8>() - 8usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflowThe problem was already fixed in the following merge request (maybe included in the next release):
https://gitlab.freedesktop.org/mesa/...bea67cf140b1a0
Code:--- 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_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),
--- a/src/gallium/frontends/rusticl/meson.build
+++ b/src/gallium/frontends/rusticl/meson.build
@@ -157,6 +157,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_.*(2|3|4|8|16)',
'--allowlist-type', 'cl.*_fn',
'--allowlist-var', 'CL_.*',
# needed for gl_sharing extension
Code:error[E0080]: evaluation of constant value failed
--> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7030:31
|
7030 | ["Alignment of cl_char8"][::std::mem::align_of::<cl_char8>() - 8usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflowThe problem was already fixed in the following merge request (maybe included in the next release):
https://gitlab.freedesktop.org/mesa/...bea67cf140b1a0
Code:--- 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_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),
--- a/src/gallium/frontends/rusticl/meson.build
+++ b/src/gallium/frontends/rusticl/meson.build
@@ -157,6 +157,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_.*(2|3|4|8|16)',
'--allowlist-type', 'cl.*_fn',
'--allowlist-var', 'CL_.*',
# needed for gl_sharing extension