[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH5fLgg1gMBE1_LjwXqpbg8zK_1ve_STNwQZWmTq6nfsxpTHpQ@mail.gmail.com>
Date: Wed, 27 Aug 2025 19:30:15 +0200
From: Alice Ryhl <aliceryhl@...gle.com>
To: Benno Lossin <lossin@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 01/11] rust: add `pin-init` as a dependency to
`bindings` and `uapi`
On Thu, Aug 14, 2025 at 11:31 AM Benno Lossin <lossin@...nel.org> wrote:
>
> This allows `bindings` and `uapi` to implement `Zeroable` and use other
> items from pin-init.
>
> Co-developed-by: Miguel Ojeda <ojeda@...nel.org>
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
> Link: https://rust-for-linux.zulipchat.com/#narrow/channel/291565-Help/topic/Zeroable.20trait.20for.20C.20structs/near/510264158
> Signed-off-by: Benno Lossin <lossin@...nel.org>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> rust/Makefile | 14 ++++++++------
> scripts/generate_rust_analyzer.py | 4 ++--
> 2 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/rust/Makefile b/rust/Makefile
> index 4263462b8470..09d4f389240a 100644
> --- a/rust/Makefile
> +++ b/rust/Makefile
> @@ -184,12 +184,12 @@ rusttestlib-kernel: $(src)/kernel/lib.rs rusttestlib-bindings rusttestlib-uapi \
> $(obj)/bindings.o FORCE
> +$(call if_changed,rustc_test_library)
>
> -rusttestlib-bindings: private rustc_target_flags = --extern ffi
> -rusttestlib-bindings: $(src)/bindings/lib.rs rusttestlib-ffi FORCE
> +rusttestlib-bindings: private rustc_target_flags = --extern ffi --extern pin_init
> +rusttestlib-bindings: $(src)/bindings/lib.rs rusttestlib-ffi rusttestlib-pin_init FORCE
> +$(call if_changed,rustc_test_library)
>
> -rusttestlib-uapi: private rustc_target_flags = --extern ffi
> -rusttestlib-uapi: $(src)/uapi/lib.rs rusttestlib-ffi FORCE
> +rusttestlib-uapi: private rustc_target_flags = --extern ffi --extern pin_init
> +rusttestlib-uapi: $(src)/uapi/lib.rs rusttestlib-ffi rusttestlib-pin_init FORCE
> +$(call if_changed,rustc_test_library)
>
> quiet_cmd_rustdoc_test = RUSTDOC T $<
> @@ -521,17 +521,19 @@ $(obj)/ffi.o: private skip_gendwarfksyms = 1
> $(obj)/ffi.o: $(src)/ffi.rs $(obj)/compiler_builtins.o FORCE
> +$(call if_changed_rule,rustc_library)
>
> -$(obj)/bindings.o: private rustc_target_flags = --extern ffi
> +$(obj)/bindings.o: private rustc_target_flags = --extern ffi --extern pin_init
> $(obj)/bindings.o: $(src)/bindings/lib.rs \
> $(obj)/ffi.o \
> + $(obj)/pin_init.o \
> $(obj)/bindings/bindings_generated.rs \
> $(obj)/bindings/bindings_helpers_generated.rs FORCE
> +$(call if_changed_rule,rustc_library)
>
> -$(obj)/uapi.o: private rustc_target_flags = --extern ffi
> +$(obj)/uapi.o: private rustc_target_flags = --extern ffi --extern pin_init
> $(obj)/uapi.o: private skip_gendwarfksyms = 1
> $(obj)/uapi.o: $(src)/uapi/lib.rs \
> $(obj)/ffi.o \
> + $(obj)/pin_init.o \
> $(obj)/uapi/uapi_generated.rs FORCE
> +$(call if_changed_rule,rustc_library)
>
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index 7c3ea2b55041..fc27f0cca752 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -139,8 +139,8 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
> "exclude_dirs": [],
> }
>
> - append_crate_with_generated("bindings", ["core", "ffi"])
> - append_crate_with_generated("uapi", ["core", "ffi"])
> + append_crate_with_generated("bindings", ["core", "ffi", "pin_init"])
> + append_crate_with_generated("uapi", ["core", "ffi", "pin_init"])
> append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"])
>
> def is_root_crate(build_file, target):
> --
> 2.50.1
>
Powered by blists - more mailing lists