Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
From: Denis Benato
Date: Tue Oct 06 2026 - 15:44:11 EST
On 10/6/26 10:11, Nathan Chancellor wrote:
> Hi Denis,
>
> On Mon, Oct 05, 2026 at 08:01:23PM +0000, Denis Benato wrote:
>> The tree staged by install-extmod-build contains no kernel/ files, but
>> since commit 4fafd1165b33 ("kallsyms: increase marker density to 16:1
>> to accelerate lookups") scripts/kallsyms.c includes
>> ../kernel/kallsyms_internal.h.
> You did not add either the author or the committer of 4fafd1165b33, I
> have done so now. This would need to be handled by them. However...
Hello Nathan,
Apologies. I used whatever came back from get_maintainers.pl without
much thinking given this is not the area of kernel I lurk in, but thanks
for taking care of that.
>> install-extmod-build rebuilds the host programs inside the staged tree
>> whenever CC differs from HOSTCC (cross builds, or a ccache-wrapped CC).
>> scripts/kallsyms is hostprogs-always-y, so that rebuild fails with:
>>
>> scripts/kallsyms.c:39:10: fatal error: '../kernel/kallsyms_internal.h' file not found
>> 39 | #include "../kernel/kallsyms_internal.h"
>> | ^~~~~~~
> I would rather not ship an internal kernel header in the external module
> build. If these defines are needed to build scripts/kallsyms.c, they
> should live in a separate header that is included in
> {kernel,scripts}/kallsyms.c that is safe to expose to the external
> module build but I defer to the 4fafd1165b33 folks.
Fair. This is something I spotted compiling our training/testing kernel
at OGC using the github CI and my main goal was raising awareness
on this issue so I simply started that by sending whatever glm did
to make it build ahah.
Please when something better comes up CC me as well so I can use
the proper fix rather than this llm-cooked thing :)
Best regards,
Denis Benato
>> Stage the header so the linux-headers-* and kernel-devel style packages
>> can rebuild scripts/kallsyms.
>>
>> Fixes: 4fafd1165b33 ("kallsyms: increase marker density to 16:1 to accelerate lookups")
>> Assisted-by: ZCode:glm-5.3
>> Signed-off-by: Denis Benato <denis.benato@xxxxxxxxx>
>> ---
>> scripts/package/install-extmod-build | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
>> index f12e1ffe409eb..aad2cd59a37ba 100755
>> --- a/scripts/package/install-extmod-build
>> +++ b/scripts/package/install-extmod-build
>> @@ -20,6 +20,8 @@ mkdir -p "${destdir}"
>> (
>> cd "${srctree}"
>> echo Makefile
>> + # scripts/kallsyms.c includes this header
>> + echo kernel/kallsyms_internal.h
>> find "arch/${SRCARCH}" -maxdepth 1 -name 'Makefile*'
>> find "arch/${SRCARCH}" -name generated -prune -o -name include -type d -print
>> find "arch/${SRCARCH}" -name Kbuild.platforms -o -name Platform
>> --
>> 2.47.3
>>