aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
authorMiguel Ojeda <ojeda@kernel.org>2026-06-08 16:14:36 +0200
committerMiguel Ojeda <ojeda@kernel.org>2026-06-09 04:13:23 +0200
commit506054980429497d106261568bd39c22a40e0fdd (patch)
tree6b69f7a7a59c0e962e552b03490f3b99fd24a37a /scripts
parentca06116d62bf78e420a528ee4febc8451b9f12e8 (diff)
downloadath-506054980429497d106261568bd39c22a40e0fdd.tar.gz
rust: zerocopy-derive: enable support in kbuild
With all the new files in place and ready from the new crate, enable the support for it in the build system. In addition, skip formatting for this vendored crate. Link: https://patch.msgid.link/20260608141439.182634-18-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build2
-rwxr-xr-xscripts/generate_rust_analyzer.py10
2 files changed, 9 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index ddf0461dda6ab..9117457432463 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -329,7 +329,7 @@ rust_common_cmd = \
-Zcrate-attr=no_std \
-Zcrate-attr='feature($(rust_allowed_features))' \
-Zunstable-options --extern pin_init --extern kernel \
- --extern zerocopy \
+ --extern zerocopy --extern zerocopy_derive \
--crate-type rlib -L $(objtree)/rust/ \
--sysroot=/dev/null \
--out-dir $(dir $@) --emit=dep-info=$(depfile)
diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index 80f7647f633a8..dc1219736f77a 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -252,6 +252,12 @@ def generate_crates(
[std, proc_macro, proc_macro2, quote, syn],
)
+ zerocopy_derive = append_proc_macro_crate(
+ "zerocopy_derive",
+ srctree / "rust" / "zerocopy-derive" / "lib.rs",
+ [std, proc_macro, proc_macro2, quote, syn],
+ )
+
build_error = append_crate(
"build_error",
srctree / "rust" / "build_error.rs",
@@ -310,7 +316,7 @@ def generate_crates(
bindings = append_crate_with_generated("bindings", [core, ffi, pin_init])
uapi = append_crate_with_generated("uapi", [core, ffi, pin_init])
kernel = append_crate_with_generated(
- "kernel", [core, macros, build_error, pin_init, ffi, bindings, uapi, zerocopy]
+ "kernel", [core, macros, build_error, pin_init, ffi, bindings, uapi, zerocopy, zerocopy_derive]
)
scripts = srctree / "scripts"
@@ -355,7 +361,7 @@ def generate_crates(
append_crate(
crate_name,
path,
- [core, kernel, pin_init, zerocopy],
+ [core, kernel, pin_init, zerocopy, zerocopy_derive],
cfg=generated_cfg,
)