diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2022-09-07 03:49:35 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2022-09-29 04:40:15 +0900 |
commit | 9ec6ab6ee5ca72afdf8f60c330ad997825c0819b (patch) | |
tree | 46c934066d128e305931b973c59dd2420cca9bed /scripts/Makefile.vmlinux_o | |
parent | cc306abd19e8acdd85072b162d09e80408389cd8 (diff) | |
download | linux-9ec6ab6ee5ca72afdf8f60c330ad997825c0819b.tar.gz |
kbuild: use objtool-args-y to clean up objtool arguments
Based on Linus' patch. Refactor scripts/Makefile.vmlinux_o as well.
Link: https://lore.kernel.org/lkml/CAHk-=wgjTMQgiKzBZTmb=uWGDEQxDdyF1+qxBkODYciuNsmwnw@mail.gmail.com/
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'scripts/Makefile.vmlinux_o')
-rw-r--r-- | scripts/Makefile.vmlinux_o | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/scripts/Makefile.vmlinux_o b/scripts/Makefile.vmlinux_o index 84019814f33f..7d531b825712 100644 --- a/scripts/Makefile.vmlinux_o +++ b/scripts/Makefile.vmlinux_o @@ -35,18 +35,11 @@ endif objtool-enabled := $(or $(delay-objtool),$(CONFIG_NOINSTR_VALIDATION)) -# Reuse objtool_args defined in scripts/Makefile.lib if LTO or IBT is enabled. -# -# Add some more flags as needed. -# --no-unreachable and --link might be added twice, but it is fine. -# -# Expand objtool_args to a simple variable to avoid circular reference. +vmlinux-objtool-args-$(delay-objtool) += $(objtool-args-y) +vmlinux-objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable +vmlinux-objtool-args-$(CONFIG_NOINSTR_VALIDATION) += --noinstr $(if $(CONFIG_CPU_UNRET_ENTRY), --unret) -objtool_args := \ - $(if $(delay-objtool),$(objtool_args)) \ - $(if $(CONFIG_NOINSTR_VALIDATION), --noinstr $(if $(CONFIG_CPU_UNRET_ENTRY), --unret)) \ - $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) \ - --link +objtool-args = $(vmlinux-objtool-args-y) --link # Link of vmlinux.o used for section mismatch analysis # --------------------------------------------------------------------------- |