-
Notifications
You must be signed in to change notification settings - Fork 746
bindgen with explicit padding generates an array of size 18446744073709551608 #3068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
qsr
pushed a commit
to qsr/rust-bindgen
that referenced
this issue
Mar 20, 2025
qsr
pushed a commit
to qsr/rust-bindgen
that referenced
this issue
Mar 20, 2025
qsr
pushed a commit
to qsr/rust-bindgen
that referenced
this issue
Mar 20, 2025
bherrera
pushed a commit
to misttech/fuchsia
that referenced
this issue
Apr 1, 2025
This CL 1) updates the outputs of generate.py so that they match what the script does at ToT (outputs such as arm.rs at ToT haven't been updated/synced), and 2) makes sure fx build works after the update. Steps: 1. Run `./src/starnix/lib/linux_uapi/generate.py` (no edits) This results in some changes, notably, io_uring_sqe__bindgen_ty_6 updating to a struct and having 5 params. 2. Run `fx build`. This fails due to: ``` error[E0080]: evaluation of `std::mem::size_of::<io_uring_sqe>` failed --> /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/mem/mod.rs:1229:26 | = note: values of the type `[u8; 18446744073709551608]` are too big for the target architecture ``` This is rust-lang/rust-bindgen#3068. 3. Patch in the generate.py edit. Run `./src/starnix/lib/linux_uapi/generate.py` (with edit). Note that generated files now do not have the `pub __bindgen_padding_0` line. 4. `fx build` completes. Once's qsr's fix at rust-lang/rust-bindgen#3173 is merged and rolled in, we shouldn't need to do the regex replace. Bug: 398914504 Change-Id: Ic6be5a14f4f00477795588a5ed52e5770c64955e Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1235157 Reviewed-by: Benjamin Lerman <[email protected]> Commit-Queue: Mary Xia <[email protected]>
bherrera
pushed a commit
to misttech/integration
that referenced
this issue
Apr 3, 2025
…_padding_0 This CL 1) updates the outputs of generate.py so that they match what the script does at ToT (outputs such as arm.rs at ToT haven't been updated/synced), and 2) makes sure fx build works after the update. Steps: 1. Run `./src/starnix/lib/linux_uapi/generate.py` (no edits) This results in some changes, notably, io_uring_sqe__bindgen_ty_6 updating to a struct and having 5 params. 2. Run `fx build`. This fails due to: ``` error[E0080]: evaluation of `std::mem::size_of::<io_uring_sqe>` failed --> /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/mem/mod.rs:1229:26 | = note: values of the type `[u8; 18446744073709551608]` are too big for the target architecture ``` This is rust-lang/rust-bindgen#3068. 3. Patch in the generate.py edit. Run `./src/starnix/lib/linux_uapi/generate.py` (with edit). Note that generated files now do not have the `pub __bindgen_padding_0` line. 4. `fx build` completes. Once's qsr's fix at rust-lang/rust-bindgen#3173 is merged and rolled in, we shouldn't need to do the regex replace. Original-Bug: 398914504 Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1235157 Original-Revision: 3b130710ba6aac0d9130bc718184bfaf34abbfa8 GitOrigin-RevId: c1e0371e35ebae79d27ecaaac3fc16ae30461a38 Change-Id: I4169f94aa0c01a8be2ddcddb6b094e46b6c7108d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running
bindgen
with the--explicit-padding
option on the following file:it ends up generating the following struct:
The
__bindgen_padding_0
field is a little bit extreme.The text was updated successfully, but these errors were encountered: