Skip to content

Commit 7824850

Browse files
committed
Merge tag 'rust-fixes-6.13' of https://github.com/Rust-for-Linux/linux
Pull rust fixes from Miguel Ojeda: "Toolchain and infrastructure: - Set bindgen's Rust target version to prevent issues when pairing older rustc releases with newer bindgen releases, such as bindgen >= 0.71.0 and rustc < 1.82 due to unsafe_extern_blocks. drm/panic: - Remove spurious empty line detected by a new Clippy warning" * tag 'rust-fixes-6.13' of https://github.com/Rust-for-Linux/linux: rust: kbuild: set `bindgen`'s Rust target version drm/panic: remove spurious empty line to clean warning
2 parents 115c0cc + 7a5f93e commit 7824850

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

drivers/gpu/drm/drm_panic_qr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,6 @@ impl QrImage<'_> {
929929
/// * `tmp` must be valid for reading and writing for `tmp_size` bytes.
930930
///
931931
/// They must remain valid for the duration of the function call.
932-
933932
#[no_mangle]
934933
pub unsafe extern "C" fn drm_panic_qr_generate(
935934
url: *const i8,

rust/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,22 @@ endif
280280
# architecture instead of generating `usize`.
281281
bindgen_c_flags_final = $(bindgen_c_flags_lto) -fno-builtin -D__BINDGEN__
282282

283+
# Each `bindgen` release may upgrade the list of Rust target versions. By
284+
# default, the highest stable release in their list is used. Thus we need to set
285+
# a `--rust-target` to avoid future `bindgen` releases emitting code that
286+
# `rustc` may not understand. On top of that, `bindgen` does not support passing
287+
# an unknown Rust target version.
288+
#
289+
# Therefore, the Rust target for `bindgen` can be only as high as the minimum
290+
# Rust version the kernel supports and only as high as the greatest stable Rust
291+
# target supported by the minimum `bindgen` version the kernel supports (that
292+
# is, if we do not test the actual `rustc`/`bindgen` versions running).
293+
#
294+
# Starting with `bindgen` 0.71.0, we will be able to set any future Rust version
295+
# instead, i.e. we will be able to set here our minimum supported Rust version.
283296
quiet_cmd_bindgen = BINDGEN $@
284297
cmd_bindgen = \
285-
$(BINDGEN) $< $(bindgen_target_flags) \
298+
$(BINDGEN) $< $(bindgen_target_flags) --rust-target 1.68 \
286299
--use-core --with-derive-default --ctypes-prefix ffi --no-layout-tests \
287300
--no-debug '.*' --enable-function-attribute-detection \
288301
-o $@ -- $(bindgen_c_flags_final) -DMODULE \

0 commit comments

Comments
 (0)