From: Nathan Chancellor <nathan@kernel.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Nicolas Schier <nsc@kernel.org>,
linux-kbuild@vger.kernel.org, Jens Remus <jremus@linux.ibm.com>
Subject: Re: [PATCH] kbuild: Add objtool to top-level clean target
Date: Tue, 10 Feb 2026 15:17:34 -0700 [thread overview]
Message-ID: <20260210221734.GB1148627@ax162> (raw)
In-Reply-To: <968faf2ed30fa8b3519f79f01a1ecfe7929553e5.1770759919.git.jpoimboe@kernel.org>
On Tue, Feb 10, 2026 at 01:45:22PM -0800, Josh Poimboeuf wrote:
> Objtool is an integral part of the build, make sure it gets cleaned by
> "make clean" and "make mrproper".
>
> Fixes: 442f04c34a1a ("objtool: Add tool to perform compile-time stack metadata validation")
> Reported-by: Jens Remus <jremus@linux.ibm.com>
> Link: https://lore.kernel.org/15f2af3b-be33-46fc-b972-6b8e7e0aa52e@linux.ibm.com
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Indeed, I have noticed some funkiness in this area but not frequently
enough to have the time to investigate it. This appears to work fine for
me.
I will likely have a kbuild-fixes pull request before -rc1 so I can take
this unless you want to have it in a different tree?
> ---
> Makefile | 11 ++++++++++-
> tools/objtool/Makefile | 2 ++
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index d3a8482bdbd0..ed850044491d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1474,6 +1474,15 @@ ifneq ($(wildcard $(resolve_btfids_O)),)
> $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
> endif
>
> +PHONY += objtool_clean
> +
> +objtool_O = $(abspath $(objtree))/tools/objtool
> +
> +objtool_clean:
> +ifneq ($(wildcard $(objtool_O)),)
> + $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) clean
> +endif
> +
> tools/: FORCE
> $(Q)mkdir -p $(objtree)/tools
> $(Q)$(MAKE) O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
> @@ -1637,7 +1646,7 @@ vmlinuxclean:
> $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
> $(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean)
>
> -clean: archclean vmlinuxclean resolve_btfids_clean
> +clean: archclean vmlinuxclean resolve_btfids_clean objtool_clean
>
> # mrproper - Delete all generated files, including .config
> #
> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index a40f30232929..6964175abdfd 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -29,6 +29,8 @@ srctree := $(patsubst %/,%,$(dir $(CURDIR)))
> srctree := $(patsubst %/,%,$(dir $(srctree)))
> endif
>
> +RM ?= rm -f
> +
> LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/
> ifneq ($(OUTPUT),)
> LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd
> --
> 2.53.0
>
next prev parent reply other threads:[~2026-02-10 22:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 21:45 Josh Poimboeuf
2026-02-10 22:17 ` Nathan Chancellor [this message]
2026-02-11 0:08 ` Josh Poimboeuf
2026-02-11 9:39 ` Jens Remus
2026-02-18 20:48 ` Nathan Chancellor
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=20260210221734.GB1148627@ax162 \
--to=nathan@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=jremus@linux.ibm.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nsc@kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®