Skip to content

Commit 2008b8e

Browse files
BennoLossinjannau
authored andcommitted
rust: add pin-init as a dependency to bindings and uapi
This allows `bindings` and `uapi` to implement `Zeroable` and use other items from pin-init. Co-developed-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.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@kernel.org>
1 parent ea34c95 commit 2008b8e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

rust/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,17 +531,19 @@ $(obj)/ffi.o: private skip_gendwarfksyms = 1
531531
$(obj)/ffi.o: $(src)/ffi.rs $(obj)/compiler_builtins.o FORCE
532532
+$(call if_changed_rule,rustc_library)
533533

534-
$(obj)/bindings.o: private rustc_target_flags = --extern ffi
534+
$(obj)/bindings.o: private rustc_target_flags = --extern ffi --extern pin_init
535535
$(obj)/bindings.o: $(src)/bindings/lib.rs \
536536
$(obj)/ffi.o \
537+
$(obj)/pin_init.o \
537538
$(obj)/bindings/bindings_generated.rs \
538539
$(obj)/bindings/bindings_helpers_generated.rs FORCE
539540
+$(call if_changed_rule,rustc_library)
540541

541-
$(obj)/uapi.o: private rustc_target_flags = --extern ffi
542+
$(obj)/uapi.o: private rustc_target_flags = --extern ffi --extern pin_init
542543
$(obj)/uapi.o: private skip_gendwarfksyms = 1
543544
$(obj)/uapi.o: $(src)/uapi/lib.rs \
544545
$(obj)/ffi.o \
546+
$(obj)/pin_init.o \
545547
$(obj)/uapi/uapi_generated.rs FORCE
546548
+$(call if_changed_rule,rustc_library)
547549

scripts/generate_rust_analyzer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def append_crate_with_generated(
139139
"exclude_dirs": [],
140140
}
141141

142-
append_crate_with_generated("bindings", ["core", "ffi"])
143-
append_crate_with_generated("uapi", ["core", "ffi"])
142+
append_crate_with_generated("bindings", ["core", "ffi", "pin_init"])
143+
append_crate_with_generated("uapi", ["core", "ffi", "pin_init"])
144144
append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"])
145145

146146
def is_root_crate(build_file, target):

0 commit comments

Comments
 (0)