mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: Add objtool to top-level clean target
@ 2026-02-10 21:45 Josh Poimboeuf
  2026-02-10 22:17 ` Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Josh Poimboeuf @ 2026-02-10 21:45 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, Peter Zijlstra, Nathan Chancellor, Nicolas Schier,
	linux-kbuild, Jens Remus

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>
---
 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add objtool to top-level clean target
  2026-02-10 21:45 [PATCH] kbuild: Add objtool to top-level clean target Josh Poimboeuf
@ 2026-02-10 22:17 ` Nathan Chancellor
  2026-02-11  0:08   ` Josh Poimboeuf
  2026-02-11  9:39 ` Jens Remus
  2026-02-18 20:48 ` Nathan Chancellor
  2 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2026-02-10 22:17 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, Peter Zijlstra, Nicolas Schier, linux-kbuild,
	Jens Remus

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
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add objtool to top-level clean target
  2026-02-10 22:17 ` Nathan Chancellor
@ 2026-02-11  0:08   ` Josh Poimboeuf
  0 siblings, 0 replies; 5+ messages in thread
From: Josh Poimboeuf @ 2026-02-11  0:08 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: x86, linux-kernel, Peter Zijlstra, Nicolas Schier, linux-kbuild,
	Jens Remus

On Tue, Feb 10, 2026 at 03:17:34PM -0700, Nathan Chancellor wrote:
> 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?

If you can take it that would be great, thanks!

-- 
Josh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add objtool to top-level clean target
  2026-02-10 21:45 [PATCH] kbuild: Add objtool to top-level clean target Josh Poimboeuf
  2026-02-10 22:17 ` Nathan Chancellor
@ 2026-02-11  9:39 ` Jens Remus
  2026-02-18 20:48 ` Nathan Chancellor
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Remus @ 2026-02-11  9:39 UTC (permalink / raw)
  To: Josh Poimboeuf, x86
  Cc: linux-kernel, Peter Zijlstra, Nathan Chancellor, Nicolas Schier,
	linux-kbuild

On 2/10/2026 10:45 PM, 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>

Tested-by: Jens Remus <jremus@linux.ibm.com>

Thank you for fixing!

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add objtool to top-level clean target
  2026-02-10 21:45 [PATCH] kbuild: Add objtool to top-level clean target Josh Poimboeuf
  2026-02-10 22:17 ` Nathan Chancellor
  2026-02-11  9:39 ` Jens Remus
@ 2026-02-18 20:48 ` Nathan Chancellor
  2 siblings, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2026-02-18 20:48 UTC (permalink / raw)
  To: x86, Josh Poimboeuf
  Cc: linux-kernel, Peter Zijlstra, Nathan Chancellor, Nicolas Schier,
	linux-kbuild, Jens Remus

On Tue, 10 Feb 2026 13:45:22 -0800, Josh Poimboeuf wrote:
> Objtool is an integral part of the build, make sure it gets cleaned by
> "make clean" and "make mrproper".
> 
> 

Applied to

  https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-fixes

Thanks!

[1/1] kbuild: Add objtool to top-level clean target
      https://git.kernel.org/kbuild/c/68b4fe32d7378

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped or
reverted. Patches applied to an "unstable" branch are accepted pending
wider testing in -next and any post-commit review; they will generally
be moved to the main branch in a week if no issues are found.

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-18 20:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-10 21:45 [PATCH] kbuild: Add objtool to top-level clean target Josh Poimboeuf
2026-02-10 22:17 ` Nathan Chancellor
2026-02-11  0:08   ` Josh Poimboeuf
2026-02-11  9:39 ` Jens Remus
2026-02-18 20:48 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome