@@ -225,7 +225,10 @@ endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT
ifdef CONFIG_STACK_VALIDATION
-objtool = $(objtree)/tools/objtool/objtool \
+# Record the md5sum of the objtool executable so any change in it results in
+# rebuilding objects.
+objtool = : $(objtool-md5sum) ; \
+ $(objtree)/tools/objtool/objtool \
$(if $(CONFIG_UNWINDER_ORC),orc generate,check) \
$(if $(part-of-module), --module) \
$(if $(CONFIG_FRAME_POINTER),, --no-fp) \
@@ -239,12 +242,9 @@ 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
-#
-# Record the md5sum of the objtool executable so any change in it results in
-# rebuilding objects.
cmd_objtool = $(if $(patsubst y%,, \
$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \
- ; : $(objtool-md5sum) ; $(objtool) $@)
+ ; $(objtool) $@)
endif # CONFIG_LTO_CLANG
endif # CONFIG_STACK_VALIDATION
When objtool is changed, all objects are rebuilt, but this check is missing in the %.lto.o rule. Move the objtool-md5sum into the objtool variable so the updated objtool is detected when CONFIG_LTO_CLANG=y as well. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- scripts/Makefile.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)