History

objtool/kbuild/rust: enable objtool for Rust

Now that we should be `objtool`-warning free, enable `objtool` for Rust too. Before this patch series, we were already getting warnings under e.g. IBT builds, since those would see Rust code via `vmlinux.o`.

Miguel Ojeda committed 2 years ago

Commit c4d7f541 parent 56d680d2 files · +21 −10Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/Makefile.build+7−2
@@ -288,10 +288,15 @@ rust_common_cmd = \ · 287 unmodified lines
288288 # would not match each other.
289289
290290 quiet_cmd_rustc_o_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
291− cmd_rustc_o_rs = $(rust_common_cmd) --emit=obj=$@ $<
291+ cmd_rustc_o_rs = $(rust_common_cmd) --emit=obj=$@ $< $(cmd_objtool)
292+
293+define rule_rustc_o_rs
294+ $(call cmd_and_fixdep,rustc_o_rs)
295+ $(call cmd,gen_objtooldep)
296+endef
292297
293298 $(obj)/%.o: $(obj)/%.rs FORCE
294− +$(call if_changed_dep,rustc_o_rs)
299+ +$(call if_changed_rule,rustc_o_rs)
295300
296301 quiet_cmd_rustc_rsi_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
297302 cmd_rustc_rsi_rs = \