Skip to contentSkip to conversation

kbuild: install-extmod-build: install kernel/kallsyms_internal.h

PATCH In review Denis Benato 5 participants 7 messages Oct 5 – Oct 11 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: install-extmod-build: install kernel/kallsyms_internal.h

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.

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"
        |          ^~~~~~~

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
---
 scripts/package/install-extmod-build | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/install-extmod-build +2 -0
index f12e1ffe409eb..aad2cd59a37ba 100755
@@ -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
Signature · 1 line
2.47.3
#1 lore raw

Hi Denis,

Quoted 4 lines · Denis Benato

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...

Quoted 7 lines

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.

Quoted 26 lines

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
---
 scripts/package/install-extmod-build | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/install-extmod-build +2 -0
index f12e1ffe409eb..aad2cd59a37ba 100755
@@ -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
Signature · 1 line
2.47.3
Signature · 2 lines
Cheers,
Nathan
#2 lore raw
Quoted 9 lines · Nathan Chancellor

Hi Denis,

Quoted 4 lines · Denis Benato

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.

Quoted 4 lines
Quoted 4 lines

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:

Quoted 8 lines
Quoted 3 lines

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

Quoted 26 lines
Quoted 26 lines

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
---
 scripts/package/install-extmod-build | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/install-extmod-build +2 -0
index f12e1ffe409eb..aad2cd59a37ba 100755
@@ -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
Signature · 1 line
2.47.3
#3 lore raw

Hi Denis,

Quoted 6 lines · Denis Benato
Quoted 5 lines · Nathan Chancellor
Quoted 4 lines · Denis Benato

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.

Quoted 6 lines
Quoted 2 lines

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...

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.

No worries, that was a little unfair of me to put on you since this is a bit of a weird situation that most contributors won't run into (a patch living in one maintainer's tree that needs a follow up in code maintained by another). A good rule of thumb is if you have bisected to a particular change, always include the author and committer of said change in the report, in addition to whatever get_maintainers.pl spits out :)

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines

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:

Quoted 8 lines
Quoted 3 lines

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.

Quoted 7 lines

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 :)

Indeed, thanks for the report raising the issue, I hope Andrew and/or Jim can comment on it soon.

Signature · 2 lines
Cheers,
Nathan
#4 lore raw
Quoted 43 lines · Nathan Chancellor

Hi Denis,

Quoted 6 lines · Denis Benato
Quoted 5 lines · Nathan Chancellor
Quoted 4 lines · Denis Benato

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.

Quoted 6 lines
Quoted 2 lines

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...

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.

No worries, that was a little unfair of me to put on you since this is a bit of a weird situation that most contributors won't run into (a patch living in one maintainer's tree that needs a follow up in code maintained by another). A good rule of thumb is if you have bisected to a particular change, always include the author and committer of said change in the report, in addition to whatever get_maintainers.pl spits out :)

Quoted 18 lines
Quoted 4 lines
Quoted 4 lines

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:

Quoted 8 lines
Quoted 3 lines

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.

Quoted 6 lines
Quoted 2 lines

Please when something better comes up CC me as well so I can use the proper fix rather than this llm-cooked thing :)

Indeed, thanks for the report raising the issue, I hope Andrew and/or Jim can comment on it soon.

The easiest fix is to just copy the 3 macro defs over to scripts/kallsyms.c, with a suitably explicit msg about the coupling.

Andrew, do you want it as a fixup ?

Quoted 3 lines

--
Cheers,
Nathan

#5 lore raw
Quoted 9 lines · On Thu, 8 Oct 2026 16:42:43 -0600 [email protected] wrote:
Quoted 4 lines

Indeed, thanks for the report raising the issue, I hope Andrew and/or Jim can comment on it soon.

The easiest fix is to just copy the 3 macro defs over to scripts/kallsyms.c, with a suitably explicit msg about the coupling.

Andrew, do you want it as a fixup ?

I think a v2 patch, please. To give a clean history and to give reviewers a second chance to go through it.

Tested-by on v1 1/1
#6 lore raw
In reply to Denis Benato

Hi Denis,

Quoted 13 lines · Denis Benato

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.

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"
        |          ^~~~~~~
Quoted 6 lines

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

I can confirm that this fixes the build failure introduced in "kallsyms:
increase marker density to 16:1 to accelerate lookups" when building with CC != HOSTCC.

Whether we should expose kallsyms_internal.h as part of the external module build is a separate question, but your patch as posted does resolve the issue I was seeing.

Please keep me in CC.

Cheers!

Chris

Quoted 17 lines
---
 scripts/package/install-extmod-build | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/install-extmod-build +2 -0
index f12e1ffe409eb..aad2cd59a37ba 100755
@@ -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