Skip to content

Commit a5f77c5

Browse files
committed
kbuild: rust: use shared host Rust flags for macros
Proc macros run in the host, so apply those flags for them instead of just the common ones. In practice, this currently adds: -O -Cstrip=debuginfo -Zallow-features= and, if enabled, `-Dwarnings` too (i.e. `CONFIG_WERROR`) -- the `macros` crate should be (and currently is) warning-free, so applying this to it ensures it is kept that way. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 6b2262f commit a5f77c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ $(obj)/exports_kernel_generated.h: $(obj)/kernel.o FORCE
386386

387387
quiet_cmd_rustc_procmacro = $(RUSTC_OR_CLIPPY_QUIET) P $@
388388
cmd_rustc_procmacro = \
389-
$(RUSTC_OR_CLIPPY) $(rust_common_flags) \
389+
$(RUSTC_OR_CLIPPY) $(KBUILD_HOSTRUSTFLAGS) \
390390
-Clinker-flavor=gcc -Clinker=$(HOSTCC) \
391391
-Clink-args='$(call escsq,$(KBUILD_HOSTLDFLAGS))' \
392392
--emit=dep-info=$(depfile) --emit=link=$@ --extern proc_macro \

0 commit comments

Comments
 (0)