From: Nicolas Schier <nsc@kernel.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
live-patching@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Joe Lawrence <joe.lawrence@redhat.com>,
Song Liu <song@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Mark Rutland <mark.rutland@arm.com>,
Nathan Chancellor <nathan@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH v2 07/12] kbuild: Only run objtool if there is at least one command
Date: Wed, 18 Mar 2026 20:54:31 +0100 [thread overview]
Message-ID: <absC93h6fNgyniD4@derry.ads.avm.de> (raw)
In-Reply-To: <42418c5fa73a8876e91b3dfb38fa3f263e39f1c1.1773787568.git.jpoimboe@kernel.org>
On Tue, Mar 17, 2026 at 03:51:07PM -0700, Josh Poimboeuf wrote:
> Split the objtool args into commands and options, such that if no
> commands have been enabled, objtool doesn't run.
>
> This is in preparation in enabling objtool and klp-build for arm64.
>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
> arch/x86/boot/startup/Makefile | 2 +-
> scripts/Makefile.build | 4 +--
> scripts/Makefile.lib | 46 ++++++++++++++++++----------------
> scripts/Makefile.vmlinux_o | 15 ++++-------
> 4 files changed, 33 insertions(+), 34 deletions(-)
>
[...]
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 3652b85be545..8a1bdfdb2fdb 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -277,7 +277,7 @@ endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT
> is-standard-object = $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(target-stem).o)$(OBJECT_FILES_NON_STANDARD)n),$(is-kernel-object))
>
> ifdef CONFIG_OBJTOOL
> -$(obj)/%.o: private objtool-enabled = $(if $(is-standard-object),$(if $(delay-objtool),$(is-single-obj-m),y))
> +$(obj)/%.o: private objtool-enabled = $(if $(is-standard-object),$(if $(objtool-cmds-y),$(if $(delay-objtool),$(is-single-obj-m),y)))
Please use $(and a,b,c) instead of multiple nested $(if $(a),$(if
$(b),$(c)); as the last variable (is-single-obj-m) is 'y' or empty, the final 'y' can be
left-out:
$(obj)/%.o: private objtool-enabled = $(and $(is-standard-object),$(objtool-cmds-y),$(delay-objtool),$(is-single-obj-m))
> endif
>
> ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
> @@ -501,7 +501,7 @@ define rule_ld_multi_m
> $(call cmd,gen_objtooldep)
> endef
>
> -$(multi-obj-m): private objtool-enabled := $(delay-objtool)
> +$(multi-obj-m): private objtool-enabled := $(if $(objtool-cmds-y),$(delay-objtool))
Could be changed to $(and), too; but personally I think the $(if) is
easier to parse at once.
Reviewed-by: Nicolas Schier <nsc@kernel.org>
--
Nicolas
next prev parent reply other threads:[~2026-03-18 19:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 22:51 [PATCH v2 00/12] objtool/arm64: Port klp-build to arm64 Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 01/12] arm64: Annotate intra-function calls Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 02/12] arm64: head: Move boot header to .head.data Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 03/12] arm64: Fix EFI linking with -fdata-sections Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 04/12] crypto: arm64: Move data to .rodata Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 05/12] objtool: Extricate checksum calculation from validate_branch() Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 06/12] objtool: Allow setting --mnop without --mcount Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 07/12] kbuild: Only run objtool if there is at least one command Josh Poimboeuf
2026-03-18 19:54 ` Nicolas Schier [this message]
2026-03-19 0:49 ` Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 08/12] objtool: Ignore jumps to the end of the function for non-CFG arches Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 09/12] objtool: Allow empty alternatives Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 10/12] objtool: Reuse consecutive string references Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 11/12] objtool: Introduce objtool for arm64 Josh Poimboeuf
2026-03-17 22:51 ` [PATCH v2 12/12] klp-build: Support cross-compilation Josh Poimboeuf
2026-03-19 4:13 ` [PATCH v2 00/12] objtool/arm64: Port klp-build to arm64 Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=absC93h6fNgyniD4@derry.ads.avm.de \
--to=nsc@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=herbert@gondor.apana.org.au \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=song@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox