Re: [PATCH v4 0/7] kbuild: build the userspace tools in tools/ with the kernel
From: Sasha Levin
Date: Fri Nov 13 2026 - 02:50:04 EST
On Thu, Nov 12, 2026 at 12:23:47PM -0800, Andrew Morton wrote:
>So the 20-odd selftests which build modules and then modprobe them can
>find that some of the exports which they need were zapped by
>CONFIG_TRIM_UNUSED_KSYMS, so their modprobe fails.
[...]
>Does this patchset fix this CONFIG_TRIM_UNUSED_KSYMS-vs-sefltests thing?
No, not yet, but almost :)
This only builds userspace, and the selftests that build their own modules
(bpf, livepatch, mm, net/bench, sched_ext) aren't there quite yet.
It does get us closer though. With this in, a selftest is a Kconfig entry, so
the kernel build knows which ones it's going to build. For the ones with
modules we could then either build the modules together with the kernel's, so
modpost sees what they import, or generate the whitelist from them.
I haven't tried either yet. I can look at it once this foundation is in.
--
Thanks,
Sasha