mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
08ab786556
In LLVM 16, anonymous items may return names like `(unnamed union at ..)` rather than empty names [1], which breaks Rust-enabled builds because bindgen assumed an empty name instead of detecting them via `clang_Cursor_isAnonymous` [2]: $ make rustdoc LLVM=1 CLIPPY=1 -j$(nproc) RUSTC L rust/core.o BINDGEN rust/bindings/bindings_generated.rs BINDGEN rust/bindings/bindings_helpers_generated.rs BINDGEN rust/uapi/uapi_generated.rs thread 'main' panicked at '"ftrace_branch_data_union_(anonymous_at__/_/include/linux/compiler_types_h_146_2)" is not a valid Ident', .../proc-macro2-1.0.24/src/fallback.rs:693:9 ... thread 'main' panicked at '"ftrace_branch_data_union_(anonymous_at__/_/include/linux/compiler_types_h_146_2)" is not a valid Ident', .../proc-macro2-1.0.24/src/fallback.rs:693:9 ... This was fixed in bindgen 0.62.0. Therefore, upgrade bindgen to a more recent version, 0.65.1, to support LLVM 16. Since bindgen 0.58.0 changed the `--{white,black}list-*` flags to `--{allow,block}list-*` [3], update them on our side too. In addition, bindgen 0.61.0 moved its CLI utility into a binary crate called `bindgen-cli` [4]. Thus update the installation command in the Quick Start guide. Moreover, bindgen 0.61.0 changed the default functionality to bind `size_t` to `usize` [5] and added the `--no-size_t-is-usize` flag to not bind `size_t` as `usize`. Then bindgen 0.65.0 removed the `--size_t-is-usize` flag [6]. Thus stop passing the flag to bindgen. Finally, bindgen 0.61.0 added support for the `noreturn` attribute (in its different forms) [7]. Thus remove the infinite loop in our Rust panic handler after calling `BUG()`, since bindgen now correctly generates a `BUG()` binding that returns `!` instead of `()`. Link: |
||
---|---|---|
.. | ||
1.Intro.rst | ||
2.Process.rst | ||
3.Early-stage.rst | ||
4.Coding.rst | ||
5.Posting.rst | ||
6.Followthrough.rst | ||
7.AdvancedTopics.rst | ||
8.Conclusion.rst | ||
adding-syscalls.rst | ||
applying-patches.rst | ||
botching-up-ioctls.rst | ||
changes.rst | ||
clang-format.rst | ||
code-of-conduct-interpretation.rst | ||
code-of-conduct.rst | ||
coding-style.rst | ||
contribution-maturity-model.rst | ||
deprecated.rst | ||
development-process.rst | ||
email-clients.rst | ||
embargoed-hardware-issues.rst | ||
handling-regressions.rst | ||
howto.rst | ||
index.rst | ||
kernel-docs.rst | ||
kernel-driver-statement.rst | ||
kernel-enforcement-statement.rst | ||
license-rules.rst | ||
magic-number.rst | ||
maintainer-handbooks.rst | ||
maintainer-kvm-x86.rst | ||
maintainer-netdev.rst | ||
maintainer-pgp-guide.rst | ||
maintainer-soc.rst | ||
maintainer-tip.rst | ||
maintainers.rst | ||
management-style.rst | ||
programming-language.rst | ||
researcher-guidelines.rst | ||
security-bugs.rst | ||
stable-api-nonsense.rst | ||
stable-kernel-rules.rst | ||
submit-checklist.rst | ||
submitting-patches.rst | ||
volatile-considered-harmful.rst |