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
288# would not match each other.288# would not match each other.
289 289
290quiet_cmd_rustc_o_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@290quiet_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
293define rule_rustc_o_rs
294 $(call cmd_and_fixdep,rustc_o_rs)
295 $(call cmd,gen_objtooldep)
296endef
292 297
293$(obj)/%.o: $(obj)/%.rs FORCE298$(obj)/%.o: $(obj)/%.rs FORCE
294 +$(call if_changed_dep,rustc_o_rs)299 +$(call if_changed_rule,rustc_o_rs)
295 300
296quiet_cmd_rustc_rsi_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@301quiet_cmd_rustc_rsi_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
297 cmd_rustc_rsi_rs = \302 cmd_rustc_rsi_rs = \