Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Fix CONFIG_OBJTOOL_WERROR for vmlinux.o

With (!X86_KERNEL_IBT && !LTO_CLANG && NOINSTR_VALIDATION), objtool runs
on both translation units and vmlinux.o. With CONFIG_OBJTOOL_WERROR,
the TUs get --Werror but vmlinux.o doesn't. Fix that.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/4f71ab9b947ffc47b6a87dd3b9aff4bb32b36d0a.1742852846.git.jpoimboe@kernel.org

authored by

Josh Poimboeuf and committed by
Ingo Molnar
4759670b 1154bbd3

+11 -3
+11 -3
scripts/Makefile.vmlinux_o
··· 30 30 # objtool for vmlinux.o 31 31 # --------------------------------------------------------------------------- 32 32 # 33 - # For LTO and IBT, objtool doesn't run on individual translation units. 34 - # Run everything on vmlinux instead. 33 + # For delay-objtool (IBT or LTO), objtool doesn't run on individual translation 34 + # units. Instead it runs on vmlinux.o. 35 + # 36 + # For !delay-objtool + CONFIG_NOINSTR_VALIDATION, it runs on both translation 37 + # units and vmlinux.o, with the latter only used for noinstr/unret validation. 35 38 36 39 objtool-enabled := $(or $(delay-objtool),$(CONFIG_NOINSTR_VALIDATION)) 37 40 38 - vmlinux-objtool-args-$(delay-objtool) += $(objtool-args-y) 41 + ifeq ($(delay-objtool),y) 42 + vmlinux-objtool-args-y += $(objtool-args-y) 43 + else 44 + vmlinux-objtool-args-$(CONFIG_OBJTOOL_WERROR) += --Werror 45 + endif 46 + 39 47 vmlinux-objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable 40 48 vmlinux-objtool-args-$(CONFIG_NOINSTR_VALIDATION) += --noinstr \ 41 49 $(if $(or $(CONFIG_MITIGATION_UNRET_ENTRY),$(CONFIG_MITIGATION_SRSO)), --unret)