Skip to content

Commit 7b4583e

Browse files
committed
Kbuild: avoid recompilation of rust/ due to cmdline change
Signed-off-by: Miguel Ojeda <[email protected]>
1 parent d6741e2 commit 7b4583e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rust/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ endif
6161

6262
bindgen_opaque_types := xregs_state desc_struct arch_lbr_state
6363

64+
# To avoid several recompilations in PowerPC, which inserts `-D_TASK_CPU`
65+
bindgen_c_flags_final = $(filter-out -D_TASK_CPU=%, $(bindgen_c_flags))
66+
6467
quiet_cmd_bindgen = BINDGEN $@
6568
cmd_bindgen = \
6669
$(BINDGEN) $< $(addprefix --opaque-type , $(bindgen_opaque_types)) \
6770
--use-core --with-derive-default --ctypes-prefix c_types \
68-
--size_t-is-usize -o $@ -- $(bindgen_c_flags) -DMODULE
71+
--size_t-is-usize -o $@ -- $(bindgen_c_flags_final) -DMODULE
6972

7073
$(objtree)/rust/bindings_generated.rs: $(srctree)/rust/kernel/bindings_helper.h FORCE
7174
$(call if_changed_dep,bindgen)

0 commit comments

Comments
 (0)