From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D89EF3EEAC5; Fri, 5 Jun 2026 12:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780661056; cv=none; b=EbZUFFvnUlHVol7ZUsCnZ4TswHpCpcvfBdmPh7VEbIjcnqsldCaSFzcsG/qk2ESkl1TQCC745IzTf4xHqEZ+lyf5ONInhqQBAPZUFrL8E17gtdJacVeuBR8OcscIXSt5xBIBtIWYY+WBpff7rMFJOrEycuw80il0EjSViJ1dENQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780661056; c=relaxed/simple; bh=QLtaJ8xc8uG16z0i8uI3fpxi0eetpfLb5x4494AfSyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DxIiqH3pupA7MNL8bUWO5M+Rb6Y60/y9UtZWeQ1qXZZ1uwvOHHdKDourQBOT5VGjcPEzsjuQmIsrXwFnh6iNv+A1kmoau+CgarorVbuWfiBBnhJ8+nKrqsbmPsthZV/0qpPvKnLoZ51GpvhWzjPD/9/CB5TpO2JMfARSTQV5c4c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=bF9GNMsg; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="bF9GNMsg" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=uNGt7UQ3hKDQDW7phHSPCK/n9FxMsmhzMnjI9+EEnR4=; b=bF9GNMsg7Sjj0FgHOYeGX7P+jI 05CT4VUcUipogCEPXXr+x1HIw+8a+HfCC8krQ1M4biJNJFXw5dtytXGwnZ8G0p4STXAWsn3Ohn9cv 7/QDJGLlJ2vUefAYUVVEbdv8ZLM0fBLvmeqldxHbrLxsZIbLczuxi8kmgQWDgFoSUPGr5sydjhbh1 XfOLsRgK/cbhdbiOuaARiXYDseDQgd4F1pv7hqpmixhKpSPR5DIsuxmDm28lZQ4WVruNsNOgHb/oK outIjLchPaEUpTcSvs8eSPZyKAcSOLR6yTUKstrG0JTM4YC+CeWH2QwCm2vpCwcHjcMb9ON4EGjUx E6gATjiw==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wVTHV-005HHq-04; Fri, 05 Jun 2026 12:04:09 +0000 From: Breno Leitao Date: Fri, 05 Jun 2026 05:03:35 -0700 Subject: [PATCH v2 4/6] bootconfig: clean build-time tools/bootconfig from make clean Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260605-bootconfig_using_tools-v2-4-d309f544b5f7@debian.org> References: <20260605-bootconfig_using_tools-v2-0-d309f544b5f7@debian.org> In-Reply-To: <20260605-bootconfig_using_tools-v2-0-d309f544b5f7@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2499; i=leitao@debian.org; h=from:subject:message-id; bh=QLtaJ8xc8uG16z0i8uI3fpxi0eetpfLb5x4494AfSyQ=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqIrsf3KruBR3AMGJpK5qF9EPKPRwFk2Xw0fXVk hYKWyo3o0qJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaiK7HwAKCRA1o5Of/Hh3 bct2D/9U++USHEnCfjBrk8dUfTq93Fc6wLeWcTew4PC6KL9uwfroetoOIO5GcxKejFqoj/I5uS9 P2iVOqgX+MkqNEsZdLnEK9IrBQjr18egxMZkUzvFUXAadxa2i3TZz2kkYvTVYBXSFH4jjb5Nyzj UEHBNP6EAGr5fP9Gf+SMFbX7aarcBkDAgcmJdsyI4iZQiCr9w0gQf4YAhg2bCGHkuFZAqrjaujD xeBroPeWtz0+p4aSYhb7YbV20+AbCTvil9pV2jQ4YIvdiqoIlAqlJn97ipn+b4OlEzvqu9YYEWD Qw7MQX+xPqWXFgLuZOtb6yDuwFvmk4qiUgktxXhQ+otDL1Zy1Q6Umr4KLSJTHZ40XtOatfMEc7k rpSn5aJ5KpOLcP52bjXCfSQNOVey4LRtxvz86UdOzjbt5Hv332OCEF5EaHIbvV6ANtb9Mraac62 09/A0pqzhtlFOrxQmaLF83CnoeU9jBvr70jArgyqnJAw2uSdXTJuP7g+SRMb/KJVUE797hWLqcU p/b6mpyzrbLaRlADF8z8BkVZiBeMA0XKYWYmah98CB4GHfasKUNNzzHU49q4NgJLqnaHBhx/bqx nU2IOIH11Jxalgl8m2U+7Tivpb3dMhwGmZk+fJS5WjSWgpc/+/tRcgt3kL5Vtee+edaTpTwbqVX bA5Uj/62nU8Er6g== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The previous patch builds tools/bootconfig during 'make prepare' to render the embedded bootconfig cmdline, but nothing removes it on 'make clean', leaving the compiled tool and its objects behind. Wire a bootconfig_clean hook into the top-level clean target so the compiled tool and its objects are removed by make clean, matching the prepare-wired tools/objtool and tools/bpf/resolve_btfids. The hook runs tools/bootconfig's Makefile via $(MAKE), which the kernel build invokes with -rR (MAKEFLAGS += -rR). -rR drops the built-in $(RM) variable, so the existing "$(RM) -f ..." clean recipe would expand to a bare "-f ..." and fail. Spell the recipe with a literal "rm -f" so it keeps working both standalone and when invoked from Kbuild. Signed-off-by: Breno Leitao --- Makefile | 13 ++++++++++++- tools/bootconfig/Makefile | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e95992959f44..4f31222ff1d1 100644 --- a/Makefile +++ b/Makefile @@ -1574,6 +1574,17 @@ ifneq ($(wildcard $(objtool_O)),) $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) $(patsubst objtool_%,%,$@) endif +PHONY += bootconfig_clean + +bootconfig_O = $(abspath $(objtree))/tools/bootconfig + +# tools/bootconfig is only built (via the prepare hook above) when +# CONFIG_BOOT_CONFIG_EMBED_CMDLINE is set; skip its clean otherwise. +bootconfig_clean: +ifneq ($(wildcard $(bootconfig_O)),) + $(Q)$(MAKE) -sC $(srctree)/tools/bootconfig O=$(bootconfig_O) clean +endif + tools/: FORCE $(Q)mkdir -p $(objtree)/tools $(Q)$(MAKE) O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ @@ -1743,7 +1754,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 objtool_clean +clean: archclean vmlinuxclean resolve_btfids_clean objtool_clean bootconfig_clean # mrproper - Delete all generated files, including .config # diff --git a/tools/bootconfig/Makefile b/tools/bootconfig/Makefile index aa75a7828685..86f1a4e64f04 100644 --- a/tools/bootconfig/Makefile +++ b/tools/bootconfig/Makefile @@ -31,4 +31,4 @@ install: $(ALL_PROGRAMS) install $(OUTPUT)bootconfig $(DESTDIR)$(bindir) clean: - $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS) + rm -f $(OUTPUT)*.o $(ALL_PROGRAMS) -- 2.53.0-Meta