From 1934927449f0de6bbc2a46324813809b59be2121 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Tue, 16 Dec 2025 20:18:18 +0100 Subject: [PATCH] kbuild: extract modules.builtin.modinfo from vmlinux.o Partially reverse https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.18.y&id=39cfd5b12160be4f57df1c3ba60139741c827616 to prevent generation of empty modules.builtin.modinfo and modules.builtin files that cause modules compilation errors. If an out-of-tree package or any kernel-install rule ran modprobe xyz while the build was still in progress, and xyz had been configured =y, a clean tree would already have xyz listed in modules.builtin; with the empty file produced by the buggy rule it was missing, so modprobe emitted "module xyz not found" even though the code was sitting inside the freshly built vmlinux. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/21078 Signed-off-by: Robert Marko --- ...dules-builtin-modinfo-from-vmlinux_o.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 target/linux/generic/hack-6.18/940-kbuild-extract-modules-builtin-modinfo-from-vmlinux_o.patch diff --git a/target/linux/generic/hack-6.18/940-kbuild-extract-modules-builtin-modinfo-from-vmlinux_o.patch b/target/linux/generic/hack-6.18/940-kbuild-extract-modules-builtin-modinfo-from-vmlinux_o.patch new file mode 100644 index 0000000000..1d5c65875d --- /dev/null +++ b/target/linux/generic/hack-6.18/940-kbuild-extract-modules-builtin-modinfo-from-vmlinux_o.patch @@ -0,0 +1,29 @@ +From: Mieczyslaw Nalewaj +Date: Tue, 16 Dec 2025 20:18:18 +0100 +Subject: [PATCH] kbuild: extract modules.builtin.modinfo from vmlinux.o + +Partially reverse https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.18.y&id=39cfd5b12160be4f57df1c3ba60139741c827616 +to prevent generation of empty modules.builtin.modinfo and modules.builtin +files that cause modules compilation errors. +If an out-of-tree package or any kernel-install rule ran modprobe xyz while +the build was still in progress, and xyz had been configured =y, a clean tree +would already have xyz listed in modules.builtin; with the empty file produced +by the buggy rule it was missing, so modprobe emitted "module xyz not found" +even though the code was sitting inside the freshly built vmlinux. + +Signed-off-by: Mieczyslaw Nalewaj +--- + scripts/Makefile.vmlinux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.vmlinux ++++ b/scripts/Makefile.vmlinux +@@ -119,7 +119,7 @@ quiet_cmd_modules_builtin_modinfo = GEN + OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary + + targets += modules.builtin.modinfo +-modules.builtin.modinfo: vmlinux.unstripped FORCE ++modules.builtin.modinfo: vmlinux.o FORCE + $(call if_changed,modules_builtin_modinfo) + + # modules.builtin