Re: [RFC PATCH v2 0/7] kbuild: build the userspace tools in tools/ with the kernel
From: Sasha Levin
Date: Tue Oct 20 2026 - 08:48:18 EST
On Tue, Oct 20, 2026 at 01:52:17PM +0200, Thorsten Leemhuis wrote:
>I noticed that "keeps what is built the same on every machine" in 3/6.
>But is it explained anywhere why this is the done?
>
>I wonder, as the overall goal of this patch set is to increase build
>coverage. So why disable optional features that could be built on
>machines that have the required userland libs installed?
Only allmodconfig and allyesconfig turn TOOLS_BUILD_PERF_MINIMAL on. It is off
by default, and then perf is built as a standalone build would build it, with
every feature whose libraries are installed.
For allmodconfig the main reason is that perf's feature detection does not
always turn a feature off when its library is missing: without libelf,
libtraceevent, pkg-config, or python for jevents, the build stops with an
error. Building perf with everything it detects would make those a requirement
for "make allmodconfig all" on every machine, and cross builds would fail
unless the target's libraries are installed as well.
The rest is about reproducing failures: when a bot reports that allmodconfig
breaks perf, the same build should break on the developer's machine too,
whatever libraries it has.
>Isn't that in a very limited scope what we do for the kernel itself
>already, as some small aspects of the build environment (like the
>versions of gcc or rust installed or the availability of things like
>gcc-plugins) already influence somewhat what is built when you run "make
>allmodconfig all"? Or do I misremember this bit?
You remember it right. The difference is that Kconfig probes for those, so a
missing tool turns the option off rather than failing the build, and the result
is recorded in .config.
That is how I'd like to add the selftests that need libraries: a Kconfig
probe per library, so allmodconfig builds them where the libraries are
installed and .config says which ones were built.
--
Thanks,
Sasha