Skip to content

Commit 5250b38

Browse files
committed
rust: bindgen: upgrade to 0.65.1
upgrade bindgen version to accommodate LLVM16 Signed-off-by: Allen Xu <[email protected]>
1 parent 18b7491 commit 5250b38

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

Documentation/process/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ you probably needn't concern yourself with pcmciautils.
3232
GNU C 5.1 gcc --version
3333
Clang/LLVM (optional) 11.0.0 clang --version
3434
Rust (optional) 1.71.0 rustc --version
35-
bindgen (optional) 0.56.0 bindgen --version
35+
bindgen (optional) 0.65.1 bindgen --version
3636
GNU make 3.82 make --version
3737
bash 4.2 bash --version
3838
binutils 2.25 ld -v

rust/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ quiet_cmd_bindgen = BINDGEN $@
325325
$(BINDGEN) $< $(bindgen_target_flags) \
326326
--use-core --with-derive-default --ctypes-prefix core::ffi --no-layout-tests \
327327
--no-debug '.*' \
328-
--size_t-is-usize -o $@ -- $(bindgen_c_flags_final) -DMODULE \
328+
-o $@ -- $(bindgen_c_flags_final) -DMODULE \
329329
$(bindgen_target_cflags) $(bindgen_target_extra)
330330

331331
$(obj)/bindings/bindings_generated.rs: private bindgen_target_flags = \
@@ -339,8 +339,8 @@ $(obj)/bindings/bindings_generated.rs: $(src)/bindings/bindings_helper.h \
339339
# given it is `libclang`; but for consistency, future Clang changes and/or
340340
# a potential future GCC backend for `bindgen`, we disable it too.
341341
$(obj)/bindings/bindings_helpers_generated.rs: private bindgen_target_flags = \
342-
--blacklist-type '.*' --whitelist-var '' \
343-
--whitelist-function 'rust_helper_.*'
342+
--blocklist-type '.*' --allowlist-var '' \
343+
--allowlist-function 'rust_helper_.*'
344344
$(obj)/bindings/bindings_helpers_generated.rs: private bindgen_target_cflags = \
345345
-I$(objtree)/$(obj) -Wno-missing-prototypes -Wno-missing-declarations
346346
$(obj)/bindings/bindings_helpers_generated.rs: private bindgen_target_extra = ; \

rust/helpers.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -657,19 +657,18 @@ int rust_helper_fs_parse(struct fs_context *fc,
657657
EXPORT_SYMBOL_GPL(rust_helper_fs_parse);
658658

659659
/*
660-
* We use `bindgen`'s `--size_t-is-usize` option to bind the C `size_t` type
661-
* as the Rust `usize` type, so we can use it in contexts where Rust
662-
* expects a `usize` like slice (array) indices. `usize` is defined to be
663-
* the same as C's `uintptr_t` type (can hold any pointer) but not
664-
* necessarily the same as `size_t` (can hold the size of any single
660+
* `bindgen` binds the C `size_t` type the Rust `usize` type, so we can
661+
* use it in contexts where Rust expects a `usize` like slice (array) indices.
662+
* `usize` is defined to be the same as C's `uintptr_t` type (can hold any pointer)
663+
* but not necessarily the same as `size_t` (can hold the size of any single
665664
* object). Most modern platforms use the same concrete integer type for
666665
* both of them, but in case we find ourselves on a platform where
667666
* that's not true, fail early instead of risking ABI or
668667
* integer-overflow issues.
669668
*
670669
* If your platform fails this assertion, it means that you are in
671-
* danger of integer-overflow bugs (even if you attempt to remove
672-
* `--size_t-is-usize`). It may be easiest to change the kernel ABI on
670+
* danger of integer-overflow bugs (even if you attempt to add
671+
* `--no-size_t-is-usize`). It may be easiest to change the kernel ABI on
673672
* your platform such that `size_t` matches `uintptr_t` (i.e., to increase
674673
* `size_t`, because `uintptr_t` has to be at least as big as `size_t`).
675674
*/

rust/kernel/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,4 @@ fn panic(info: &core::panic::PanicInfo<'_>) -> ! {
257257
pr_emerg!("{}\n", info);
258258
// SAFETY: FFI call.
259259
unsafe { bindings::BUG() };
260-
// Bindgen currently does not recognize `__noreturn` so `BUG` returns `()`
261-
// instead of `!`. See <https://github.com/rust-lang/rust-bindgen/issues/2094>.
262-
loop {}
263260
}

scripts/min-tool-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustc)
3030
echo 1.71.0
3131
;;
3232
bindgen)
33-
echo 0.56.0
33+
echo 0.65.1
3434
;;
3535
*)
3636
echo "$1: unknown tool" >&2

0 commit comments

Comments
 (0)