bindgen: kernel build failure due to 0.66 bug (fixed upstream)
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| rust-bindgen-cli (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Bug Description
Hi,
Ubuntu LTS (24.04)'s `bindgen` is not able to build a kernel with Rust enabled due to a bug (fixed upstream) in 0.66:
$ bindgen --version --verbose
bindgen 0.66.1
Clang: Ubuntu clang version 18.1.3 (1ubuntu1)
$ make LLVM=1
...
***
*** Rust bindings generator 'bindgen' versions 0.66.0 and 0.66.1 may not
*** work due to a bug (https:/
*** unless patched (like Debian's).
*** Your version: 0.66.1
***
***
*** Please see Documentation/
*** on how to set up the Rust support.
***
...
BINDGEN rust/bindings/
panicked at 'called `Result::unwrap()` on an `Err` value: FromBytesWithNu
The message above comes from a build test we have in the kernel build system where we test if the bug is present or not:
$ echo '#define A "\0"' >x.h && bindgen x.h
panicked at 'called `Result::unwrap()` on an `Err` value: FromBytesWithNu
The bug was fixed upstream with:
https:/
The fix was backported in Debian Testing's `bindgen` package.
It would be nice to have that fixed in Ubuntu's `bindgen` too, so that users do not need to use e.g. `bindgen-0.65`, which is the current one we recommend in our instructions:
https:/
Thanks!
Cheers,
Miguel

Status changed to 'Confirmed' because the bug affects multiple users.