Commit 918a6b7f authored by Masahiro Yamada's avatar Masahiro Yamada

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
parent 92594d56
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment