mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexis Lothoré (eBPF Foundation)" <alexis.lothore@bootlin.com>
To: Nathan Chancellor <nathan@kernel.org>, Nicolas Schier <nsc@kernel.org>
Cc: ebpf@linuxfoundation.org,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Bastien Curutchet" <bastien.curutchet@bootlin.com>,
	"Alexis Lothoré (eBPF Foundation)" <alexis.lothore@bootlin.com>
Subject: [PATCH] kbuild: drop dependency on .config for tools/
Date: Fri, 11 Sep 2026 12:42:33 +0200	[thread overview]
Message-ID: <20260911-tools-build-output-v1-1-4f9938a4f83c@bootlin.com> (raw)

When trying to build some tooling from tools/ in an unconfigured kernel
tree, the build fails to start because of missing .config:

  $ make tools/bpf
  ***
  *** Configuration file ".config" not found!
  ***
  *** Please run some configurator (e.g. "make oldconfig" or
  *** "make menuconfig" or "make xconfig").
  ***
  /home/alexis/src/linux/Makefile:810: include/config/auto.conf: No such file or directory
  make[1]: *** [/home/alexis/src/linux/Makefile:892: .config] Error 1
  make: *** [Makefile:248: __sub-make] Error 2

The failure is due to the tools/<foo> targets having need-config=1 set.
With a proper .config present, a standard `make tools/bpf` works, but:
  - those tools don't need a .config to build and run, they are built
    independently of the kernel configuration
  - when trying to build some tools in a specific output directory
    (O=foo), we still end up having to configure a kernel first in this
    directory

Rather than having to systematically configure the kernel to only build
those tools, add the tools/% pattern to the no-dot-config-targets listing.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 570f0c68aadd..eb4bdf4a52cc 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,8 @@ no-dot-config-targets := $(clean-targets) \
 			 %asm-generic kernelversion %src-pkg dt_binding_check \
 			 dt_style_selftest \
 			 outputmakefile rustavailable rustfmt rustfmtcheck \
-			 run-command
+			 run-command \
+			 tools/%
 no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
 			  image_name
 single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %/

---
base-commit: 51794b107d54b3c9a8ebbe12a3b81d8495bd482c
change-id: 20260911-tools-build-output-18157e524114

Best regards,
--  
Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>


             reply	other threads:[~2026-09-11 10:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 10:42 Alexis Lothoré (eBPF Foundation) [this message]
2026-09-11 19:24 ` Nicolas Schier

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=20260911-tools-build-output-v1-1-4f9938a4f83c@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=bastien.curutchet@bootlin.com \
    --cc=ebpf@linuxfoundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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®