diff options
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/Makefile | 15 | ||||
| -rw-r--r-- | rust/kernel/net/phy.rs | 4 | 
2 files changed, 16 insertions, 3 deletions
diff --git a/rust/Makefile b/rust/Makefile index 9da9042fd627..a40a3936126d 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -280,9 +280,22 @@ endif  # architecture instead of generating `usize`.  bindgen_c_flags_final = $(bindgen_c_flags_lto) -fno-builtin -D__BINDGEN__ +# Each `bindgen` release may upgrade the list of Rust target versions. By +# default, the highest stable release in their list is used. Thus we need to set +# a `--rust-target` to avoid future `bindgen` releases emitting code that +# `rustc` may not understand. On top of that, `bindgen` does not support passing +# an unknown Rust target version. +# +# Therefore, the Rust target for `bindgen` can be only as high as the minimum +# Rust version the kernel supports and only as high as the greatest stable Rust +# target supported by the minimum `bindgen` version the kernel supports (that +# is, if we do not test the actual `rustc`/`bindgen` versions running). +# +# Starting with `bindgen` 0.71.0, we will be able to set any future Rust version +# instead, i.e. we will be able to set here our minimum supported Rust version.  quiet_cmd_bindgen = BINDGEN $@        cmd_bindgen = \ -	$(BINDGEN) $< $(bindgen_target_flags) \ +	$(BINDGEN) $< $(bindgen_target_flags) --rust-target 1.68 \  		--use-core --with-derive-default --ctypes-prefix ffi --no-layout-tests \  		--no-debug '.*' --enable-function-attribute-detection \  		-o $@ -- $(bindgen_c_flags_final) -DMODULE \ diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs index b89c681d97c0..2fbfb6a94c11 100644 --- a/rust/kernel/net/phy.rs +++ b/rust/kernel/net/phy.rs @@ -860,7 +860,7 @@ impl DeviceMask {  /// ];  /// #[cfg(MODULE)]  /// #[no_mangle] -/// static __mod_mdio__phydev_device_table: [::kernel::bindings::mdio_device_id; 2] = _DEVICE_TABLE; +/// static __mod_device_table__mdio__phydev: [::kernel::bindings::mdio_device_id; 2] = _DEVICE_TABLE;  /// ```  #[macro_export]  macro_rules! module_phy_driver { @@ -883,7 +883,7 @@ macro_rules! module_phy_driver {          #[cfg(MODULE)]          #[no_mangle] -        static __mod_mdio__phydev_device_table: [$crate::bindings::mdio_device_id; +        static __mod_device_table__mdio__phydev: [$crate::bindings::mdio_device_id;              $crate::module_phy_driver!(@count_devices $($dev),+) + 1] = _DEVICE_TABLE;      };  | 
