Skip to content

Commit

Permalink
kbuild: rename __objtool_obj and reuse it for cmd_cc_lto_link_modules
Browse files Browse the repository at this point in the history
Rename __objtool_obj to objtool, and move it out of the
'ifndef CONFIG_LTO_CLANG' conditional, so it can be used for
cmd_cc_lto_link_modules as well.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
  • Loading branch information
masahir0y committed Sep 22, 2021
1 parent 8f0c32c commit 5c4859e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT

ifdef CONFIG_STACK_VALIDATION

objtool := $(objtree)/tools/objtool/objtool

objtool_args = \
$(if $(CONFIG_UNWINDER_ORC),orc generate,check) \
$(if $(part-of-module), --module) \
Expand All @@ -236,17 +238,15 @@ objtool_args = \

ifndef CONFIG_LTO_CLANG

__objtool_obj := $(objtree)/tools/objtool/objtool

# '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_obj) $(objtool_args) $@)
$(objtool) $(objtool_args) $@)
objtool_obj = $(if $(patsubst y%,, \
$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \
$(__objtool_obj))
$(objtool))

endif # CONFIG_LTO_CLANG
endif # CONFIG_STACK_VALIDATION
Expand Down Expand Up @@ -300,8 +300,7 @@ cmd_cc_lto_link_modules = \
ifdef CONFIG_STACK_VALIDATION
# objtool was skipped for LLVM bitcode, run it now that we have compiled
# modules into native code
cmd_cc_lto_link_modules += ; \
$(objtree)/tools/objtool/objtool $(objtool_args) --module $@
cmd_cc_lto_link_modules += ; $(objtool) $(objtool_args) --module $@
endif

$(obj)/%.lto.o: $(obj)/%.o FORCE
Expand Down

0 comments on commit 5c4859e

Please sign in to comment.