Re: [RFC PATCH v2 0/7] kbuild: build the userspace tools in tools/ with the kernel

From: Thorsten Leemhuis

Date: Tue Oct 20 2026 - 07:53:50 EST


On 10/16/26 16:31, Sasha Levin wrote:
> The userspace programs under tools/ are disconnected from the rest of the
> kernel's build system. Each has its own makefiles and build framework, and
> "make" never builds them: apart from the few host tools the build itself needs,
> such as objtool and resolve_btfids, nothing under tools/ is compiled as part of
> a kernel build.
>
> That makes them easy to break. Most people, and most of the build bots, check a
> change with "make allmodconfig && make", which doesn't cover tools/ at all. A
> change that breaks a tool passes every build check and is only noticed when
> someone happens to build that tool by hand, often much later.
>
> We keep seeing this in tools/testing/: selftests that stop building after a
> change elsewhere in the tree, or after a backport to a stable tree, and stay
> broken until someone tries to build them. Others brought up the same concern at
> LPC. [...]

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?

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?

Anyway: many thx for this, as I occasionally run into issues with my
builds of linux-next and stable-rc rpms when while building perf or
selftests -- and thx to these patches, submitters with a bit of luck in
the future will notice more of those problems themselves. :-D

Ciao, Thorsten