mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
@ 2026-10-05 20:01 Denis Benato
  2026-10-06  8:11 ` Nathan Chancellor
  2026-10-07  5:45 ` Christopher Obbard
  0 siblings, 2 replies; 7+ messages in thread
From: Denis Benato @ 2026-10-05 20:01 UTC (permalink / raw)
  To: linux-kbuild
  Cc: nathan, nsc, thomas.weissschuh, chewi, abelvesa, linux-kernel,
	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"
        |          ^~~~~~~

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@linux.dev>
---
 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
  2026-10-05 20:01 [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h Denis Benato
@ 2026-10-06  8:11 ` Nathan Chancellor
  2026-10-06 19:39   ` Denis Benato
  2026-10-07  5:45 ` Christopher Obbard
  1 sibling, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2026-10-06  8:11 UTC (permalink / raw)
  To: Denis Benato, Jim Cromie, Andrew Morton
  Cc: linux-kbuild, nsc, thomas.weissschuh, chewi, abelvesa,
	linux-kernel, Kees Cook

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

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

> 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@linux.dev>
> ---
>  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
> 

-- 
Cheers,
Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
  2026-10-06  8:11 ` Nathan Chancellor
@ 2026-10-06 19:39   ` Denis Benato
  2026-10-08 16:47     ` Nathan Chancellor
  0 siblings, 1 reply; 7+ messages in thread
From: Denis Benato @ 2026-10-06 19:39 UTC (permalink / raw)
  To: Nathan Chancellor, Jim Cromie, Andrew Morton
  Cc: linux-kbuild, nsc, thomas.weissschuh, chewi, abelvesa,
	linux-kernel, Kees Cook


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@linux.dev>
>> ---
>>  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
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
  2026-10-05 20:01 [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h Denis Benato
  2026-10-06  8:11 ` Nathan Chancellor
@ 2026-10-07  5:45 ` Christopher Obbard
  1 sibling, 0 replies; 7+ messages in thread
From: Christopher Obbard @ 2026-10-07  5:45 UTC (permalink / raw)
  To: Denis Benato, linux-kbuild
  Cc: nathan, nsc, thomas.weissschuh, chewi, abelvesa, linux-kernel

Hi Denis,

On Mon, 2026-10-05 at 20:01 +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.
> 
> 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
> Signed-off-by: Denis Benato <denis.benato@linux.dev>

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.

Tested-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>


Cheers!

Chris

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
  2026-10-06 19:39   ` Denis Benato
@ 2026-10-08 16:47     ` Nathan Chancellor
  2026-10-08 22:42       ` jim.cromie
  0 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2026-10-08 16:47 UTC (permalink / raw)
  To: Denis Benato
  Cc: Jim Cromie, Andrew Morton, linux-kbuild, nsc, thomas.weissschuh,
	chewi, abelvesa, linux-kernel, Kees Cook

Hi Denis,

On Tue, Oct 06, 2026 at 09:39:51PM +0200, Denis Benato wrote:
> On 10/6/26 10:11, Nathan Chancellor wrote:
> > 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...
> 
> 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 :)

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

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

-- 
Cheers,
Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
  2026-10-08 16:47     ` Nathan Chancellor
@ 2026-10-08 22:42       ` jim.cromie
  2026-10-11  0:09         ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: jim.cromie @ 2026-10-08 22:42 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Denis Benato, Andrew Morton, linux-kbuild, nsc,
	thomas.weissschuh, chewi, abelvesa, linux-kernel, Kees Cook

On Thu, Oct 8, 2026 at 10:47 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Hi Denis,
>
> On Tue, Oct 06, 2026 at 09:39:51PM +0200, Denis Benato wrote:
> > On 10/6/26 10:11, Nathan Chancellor wrote:
> > > 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...
> >
> > 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 :)
>
> > >> 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 :)
>
> 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 ?

> --
> Cheers,
> Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h
  2026-10-08 22:42       ` jim.cromie
@ 2026-10-11  0:09         ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2026-10-11  0:09 UTC (permalink / raw)
  To: jim.cromie
  Cc: Nathan Chancellor, Denis Benato, linux-kbuild, nsc,
	thomas.weissschuh, chewi, abelvesa, linux-kernel, Kees Cook

On Thu, 8 Oct 2026 16:42:43 -0600 jim.cromie@gmail.com wrote:

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-11  0:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-05 20:01 [PATCH] kbuild: install-extmod-build: install kernel/kallsyms_internal.h Denis Benato
2026-10-06  8:11 ` Nathan Chancellor
2026-10-06 19:39   ` Denis Benato
2026-10-08 16:47     ` Nathan Chancellor
2026-10-08 22:42       ` jim.cromie
2026-10-11  0:09         ` Andrew Morton
2026-10-07  5:45 ` Christopher Obbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®