You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
So the rustc --target argument (which is usually included in the rust value of cross
files) isn't passed to the bindgen command line
This isn't a problem in non-cross builds, but with cross builds the struct size validation
fails with variable-length types like pointers (which was an optional thing but now it's
enabled by default with rust-lang/rust-bindgen@4f78afa)
To compile those files on Arch Linux: meson setup --cross-file lib32 build && meson compile -C build
(you possibly need to make a cross file in other distros)
Expected behavior
The rustc target argument should be passed to bindgen (with the correct struct sizes for 32-bit cross build)
System parameters
I'm building x86 code on an AMD64 system (so it's definitely a 32-bit on 64-bit cross build)
Arch Linux
Python 3.12.4
Meson 1.5.1
Ninja 1.12.1
The text was updated successfully, but these errors were encountered:
As a bit of a workaround, I found setting the env var BINDGEN_EXTRA_CLANG_ARGS to either --target=i686-unknown-linux-gnu or -target i686-unknown-linux-gnu got things compiling correctly. You'll need to set it during the build process (when you call meson compile -C build).
Describe the bug
So the rustc
--target
argument (which is usually included in therust
value of crossfiles) isn't passed to the bindgen command line
This isn't a problem in non-cross builds, but with cross builds the struct size validation
fails with variable-length types like pointers (which was an optional thing but now it's
enabled by default with rust-lang/rust-bindgen@4f78afa)
This issue was also reported on https://gitlab.freedesktop.org/mesa/mesa/-/issues/11735
To reproduce
https://gist.github.com/TheComputerGuy96/8069e05f5db26a304bc11026ca07c290
To compile those files on Arch Linux:
meson setup --cross-file lib32 build && meson compile -C build
(you possibly need to make a cross file in other distros)
Expected behavior
The rustc target argument should be passed to bindgen (with the correct struct sizes for 32-bit cross build)
System parameters
The text was updated successfully, but these errors were encountered: