summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2021-08-31 16:39:55 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2021-09-22 09:26:25 +0900
commit918a6b7f68468ab80ec5e7ab7f3d2ef88905c20b (patch)
treee2273b8577225721e0a03cf61a515fd5a7169c35 /scripts
parent92594d569b6d377168fa74c6bb27c5696af02a9d (diff)
downloadlinux-stable-918a6b7f68468ab80ec5e7ab7f3d2ef88905c20b.tar.gz
linux-stable-918a6b7f68468ab80ec5e7ab7f3d2ef88905c20b.tar.bz2
linux-stable-918a6b7f68468ab80ec5e7ab7f3d2ef88905c20b.zip
kbuild: factor out OBJECT_FILES_NON_STANDARD check into a macro
The OBJECT_FILES_NON_STANDARD check is quite long. Factor it out into a new macro, objtool-enabled, to not repeat it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 021ae0146913..720a86642f48 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -241,12 +241,12 @@ ifndef CONFIG_LTO_CLANG
# 'OBJECT_FILES_NON_STANDARD := y': skip objtool checking for a directory
# 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
# 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
-cmd_objtool = $(if $(patsubst y%,, \
- $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \
- ; $(objtool) $(objtool_args) $@)
-objtool_obj = $(if $(patsubst y%,, \
- $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \
- $(objtool))
+
+objtool-enabled = $(if $(filter-out y%, \
+ $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
+
+cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@)
+objtool_obj = $(if $(objtool-enabled), $(objtool))
endif # CONFIG_LTO_CLANG
endif # CONFIG_STACK_VALIDATION