Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: gen-mach-types: don't include absolute filename
@ 2024-11-14 13:00 Marco Felsch
  2025-09-19  9:46 ` Lucas Stach
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Felsch @ 2024-11-14 13:00 UTC (permalink / raw)
  To: linux, m.felsch; +Cc: kernel, linux-arm-kernel, linux-kernel

Don't include the abosulte filename into the generated mach-types.h
header and instead make use of arm64 note. The motivation for this
change is Yocto emitting a build warning:

| File /usr/src/debug/linux-raspberrypi/6.11.7/arch/arm/include/generated/asm/mach-types.h in package linux-raspberrypi-src contains reference to TMPDIR [buildpaths]

So this change brings us one step closer to make the build result
reproducible independent of the build path.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/arm/tools/gen-mach-types | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
index cbe1c33bb871..fdc4805b9d98 100644
--- a/arch/arm/tools/gen-mach-types
+++ b/arch/arm/tools/gen-mach-types
@@ -24,8 +24,7 @@ NF == 3 {
 
 END	{
 	  printf("/*\n");
-	  printf(" * This was automagically generated from %s!\n", FILENAME);
-	  printf(" * Do NOT edit\n");
+	  printf(" * Generated file - do not edit\n");
 	  printf(" */\n\n");
 	  printf("#ifndef __ASM_ARM_MACH_TYPE_H\n");
 	  printf("#define __ASM_ARM_MACH_TYPE_H\n\n");
-- 
2.39.5



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

* Re: [PATCH] arm: gen-mach-types: don't include absolute filename
  2024-11-14 13:00 Marco Felsch
@ 2025-09-19  9:46 ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2025-09-19  9:46 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: linux-arm-kernel, kernel, linux-kernel, Marco Felsch

Hi Russell,

can I ask you to kindly reconsider this patch? The generated header
ends up in various packages, not just in compiled form where the
comment wouldn't matter, but also in its raw source code form.

For embedded build systems this mostly affects the debug packages that
carry the full source code. More general purpose distributions like
debian ship this file in the linux-headers package as it's part of the
kapi and they want to allow out-of-tree module builds with the header
package. All those distributions have to jump through various hoops to
make those header packages reproducible, while this patch would be an
easy fix from the kernel side.

I don't think the input file name carries any real value for any of the
users of this header. Especially now where mach-types is essentially
static, with no substantial changes in the last 8 years.

Best regards,
Lucas

Am Donnerstag, dem 14.11.2024 um 14:00 +0100 schrieb Marco Felsch:
> Don't include the abosulte filename into the generated mach-types.h
> header and instead make use of arm64 note. The motivation for this
> change is Yocto emitting a build warning:
> 
> > File /usr/src/debug/linux-raspberrypi/6.11.7/arch/arm/include/generated/asm/mach-types.h in package linux-raspberrypi-src contains reference to TMPDIR [buildpaths]
> 
> So this change brings us one step closer to make the build result
> reproducible independent of the build path.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
>  arch/arm/tools/gen-mach-types | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
> index cbe1c33bb871..fdc4805b9d98 100644
> --- a/arch/arm/tools/gen-mach-types
> +++ b/arch/arm/tools/gen-mach-types
> @@ -24,8 +24,7 @@ NF == 3 {
>  
>  END	{
>  	  printf("/*\n");
> -	  printf(" * This was automagically generated from %s!\n", FILENAME);
> -	  printf(" * Do NOT edit\n");
> +	  printf(" * Generated file - do not edit\n");
>  	  printf(" */\n\n");
>  	  printf("#ifndef __ASM_ARM_MACH_TYPE_H\n");
>  	  printf("#define __ASM_ARM_MACH_TYPE_H\n\n");



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

* [PATCH] arm: gen-mach-types: don't include absolute filename
@ 2026-06-03 14:12 Sascha Hauer
  2026-06-03 15:09 ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2026-06-03 14:12 UTC (permalink / raw)
  To: Russell King
  Cc: linux-arm-kernel, linux-kernel, Marco Felsch,
	Uwe Kleine-König, Alexander Stein, Ryan Eatmon, kernel,
	Sascha Hauer

mach-types.h is part of the kapi and as such shipped in the
linux-headers package. The embedded build path makes that package
non-reproducible without going through an extra step of normalizing the
path. YOCTO has similar problems in the kernel debug source package.

Make the path relative to the kernel source tree which is enough to
find the tool that has generated the file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
This topic comes up every once in a while, without any clear objection
other than "Or just leave it as is. It's in a comment, it doesn't get
into the executable, and thus is harmless.", from which I am not sure if
it actually is an objection. Cced the authors of the previous patches
that I am aware of:

https://lore.kernel.org/all/20241114130021.2802803-1-m.felsch@pengutronix.de/
https://lore.kernel.org/all/13360982.O9o76ZdvQC@steina-w/
https://lore.kernel.org/all/20240213092835.754462-2-u.kleine-koenig@pengutronix.de/
https://lore.kernel.org/all/20241002175049.15219-1-reatmon@ti.com/
---
 arch/arm/tools/gen-mach-types | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
index cbe1c33bb8710..65ec262b31e65 100644
--- a/arch/arm/tools/gen-mach-types
+++ b/arch/arm/tools/gen-mach-types
@@ -24,7 +24,7 @@ NF == 3 {
 
 END	{
 	  printf("/*\n");
-	  printf(" * This was automagically generated from %s!\n", FILENAME);
+	  printf(" * This was automagically generated from arch/arm/tools/gen-mach-types!\n");
 	  printf(" * Do NOT edit\n");
 	  printf(" */\n\n");
 	  printf("#ifndef __ASM_ARM_MACH_TYPE_H\n");

---
base-commit: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
change-id: 20260603-arm-remove-path-from-mach-types-h-a6f528d60e00

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>



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

* Re: [PATCH] arm: gen-mach-types: don't include absolute filename
  2026-06-03 14:12 [PATCH] arm: gen-mach-types: don't include absolute filename Sascha Hauer
@ 2026-06-03 15:09 ` Uwe Kleine-König
  2026-06-03 18:58   ` Ryan Eatmon
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2026-06-03 15:09 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Russell King, linux-arm-kernel, linux-kernel, Marco Felsch,
	Alexander Stein, Ryan Eatmon, kernel

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Hello Sascha,

On Wed, Jun 03, 2026 at 04:12:10PM +0200, Sascha Hauer wrote:
> mach-types.h is part of the kapi and as such shipped in the
> linux-headers package. The embedded build path makes that package
> non-reproducible without going through an extra step of normalizing the
> path. YOCTO has similar problems in the kernel debug source package.
> 
> Make the path relative to the kernel source tree which is enough to
> find the tool that has generated the file.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Compared to my old patch this is simpler, I like it.

Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Thanks
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] arm: gen-mach-types: don't include absolute filename
  2026-06-03 15:09 ` Uwe Kleine-König
@ 2026-06-03 18:58   ` Ryan Eatmon
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Eatmon @ 2026-06-03 18:58 UTC (permalink / raw)
  To: Uwe Kleine-König, Sascha Hauer
  Cc: Russell King, linux-arm-kernel, linux-kernel, Marco Felsch,
	Alexander Stein, kernel



On 6/3/2026 10:09 AM, Uwe Kleine-König wrote:
> Hello Sascha,
> 
> On Wed, Jun 03, 2026 at 04:12:10PM +0200, Sascha Hauer wrote:
>> mach-types.h is part of the kapi and as such shipped in the
>> linux-headers package. The embedded build path makes that package
>> non-reproducible without going through an extra step of normalizing the
>> path. YOCTO has similar problems in the kernel debug source package.
>>
>> Make the path relative to the kernel source tree which is enough to
>> find the tool that has generated the file.
>>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Compared to my old patch this is simpler, I like it.
> 
> Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Agreed.

Acked-by: Ryan Eatmon <reatmon@ti.com>


> Thanks
> Uwe

-- 
Ryan Eatmon                reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS


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

end of thread, other threads:[~2026-06-03 18:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03 14:12 [PATCH] arm: gen-mach-types: don't include absolute filename Sascha Hauer
2026-06-03 15:09 ` Uwe Kleine-König
2026-06-03 18:58   ` Ryan Eatmon
  -- strict thread matches above, loose matches on Subject: below --
2024-11-14 13:00 Marco Felsch
2025-09-19  9:46 ` Lucas Stach

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