public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list
@ 2026-03-20 16:36 Thomas Weißschuh
  2026-03-20 16:36 ` [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation Thomas Weißschuh
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-20 16:36 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: linux-kbuild, linux-kernel, Thomas Weißschuh

This list is incomplete. Instead of maintaining it manually,
detect a vDSO with build ID automatically and handle it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (4):
      kbuild: vdso_install: split out the readelf invocation
      kbuild: vdso_install: hide readelf warnings
      kbuild: vdso_install: gracefully handle images without build ID
      kbuild: vdso_install: drop build ID architecture allow-list

 scripts/Makefile.vdsoinst | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
base-commit: 5acf9666477e24e026c54ded89e69cff6596ced8
change-id: 20260318-kbuild-vdso-install-44a55817ef7f

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


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

* [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation
  2026-03-20 16:36 [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
@ 2026-03-20 16:36 ` Thomas Weißschuh
  2026-03-31 15:15   ` Nicolas Schier
  2026-03-20 16:36 ` [PATCH 2/4] kbuild: vdso_install: hide readelf warnings Thomas Weißschuh
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-20 16:36 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: linux-kbuild, linux-kernel, Thomas Weißschuh

Some upcoming changes to the readelf invocation would create a
very long line otherwise.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 scripts/Makefile.vdsoinst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
index ac85f9a4a569..214c561651cf 100644
--- a/scripts/Makefile.vdsoinst
+++ b/scripts/Makefile.vdsoinst
@@ -21,7 +21,8 @@ $$(dest): $(1) FORCE
 
 # Some architectures create .build-id symlinks
 ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
-link := $(install-dir)/.build-id/$$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p').debug
+build-id-file := $$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
+link := $(install-dir)/.build-id/$$(build-id-file).debug
 
 __default: $$(link)
 $$(link): $$(dest) FORCE

-- 
2.53.0


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

* [PATCH 2/4] kbuild: vdso_install: hide readelf warnings
  2026-03-20 16:36 [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
  2026-03-20 16:36 ` [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation Thomas Weißschuh
@ 2026-03-20 16:36 ` Thomas Weißschuh
  2026-03-31 15:15   ` Nicolas Schier
  2026-03-20 16:36 ` [PATCH 3/4] kbuild: vdso_install: gracefully handle images without build ID Thomas Weißschuh
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-20 16:36 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: linux-kbuild, linux-kernel, Thomas Weißschuh

If 'readelf -n' encounters a note it does not recognize it emits a
warning. This for example happen when inspecting a compat vDSO for
which the main kernel toolchain was not used.
However the relevant build ID note is always readable, so the
warnings are pointless.

Hide the warnings to make it possible to extrace build IDs for more
architectures in the future.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 scripts/Makefile.vdsoinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
index 214c561651cf..aed153b3120b 100644
--- a/scripts/Makefile.vdsoinst
+++ b/scripts/Makefile.vdsoinst
@@ -21,7 +21,7 @@ $$(dest): $(1) FORCE
 
 # Some architectures create .build-id symlinks
 ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
-build-id-file := $$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
+build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
 link := $(install-dir)/.build-id/$$(build-id-file).debug
 
 __default: $$(link)

-- 
2.53.0


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

* [PATCH 3/4] kbuild: vdso_install: gracefully handle images without build ID
  2026-03-20 16:36 [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
  2026-03-20 16:36 ` [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation Thomas Weißschuh
  2026-03-20 16:36 ` [PATCH 2/4] kbuild: vdso_install: hide readelf warnings Thomas Weißschuh
@ 2026-03-20 16:36 ` Thomas Weißschuh
  2026-03-31 15:15   ` Nicolas Schier
  2026-03-20 16:36 ` [PATCH 4/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
  2026-03-31 16:09 ` [PATCH 0/4] " Nicolas Schier
  4 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-20 16:36 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: linux-kbuild, linux-kernel, Thomas Weißschuh

If the vDSO does not contains a build ID, skip the symlink step.
This will allow the removal of the explicit list of architectures.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 scripts/Makefile.vdsoinst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
index aed153b3120b..3de70218b8d4 100644
--- a/scripts/Makefile.vdsoinst
+++ b/scripts/Makefile.vdsoinst
@@ -22,12 +22,15 @@ $$(dest): $(1) FORCE
 # Some architectures create .build-id symlinks
 ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
 build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
+
+ifneq ($$(build-id-file),)
 link := $(install-dir)/.build-id/$$(build-id-file).debug
 
 __default: $$(link)
 $$(link): $$(dest) FORCE
 	$$(call cmd,symlink)
 endif
+endif
 
 endef
 

-- 
2.53.0


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

* [PATCH 4/4] kbuild: vdso_install: drop build ID architecture allow-list
  2026-03-20 16:36 [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
                   ` (2 preceding siblings ...)
  2026-03-20 16:36 ` [PATCH 3/4] kbuild: vdso_install: gracefully handle images without build ID Thomas Weißschuh
@ 2026-03-20 16:36 ` Thomas Weißschuh
  2026-03-31 15:15   ` Nicolas Schier
  2026-03-31 16:09 ` [PATCH 0/4] " Nicolas Schier
  4 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-20 16:36 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: linux-kbuild, linux-kernel, Thomas Weißschuh

Many architectures which do generate build IDs are missing from this
list. For example arm64, riscv, loongarch, mips.

Now that errors from readelf and binaries without any build ID are
handled gracefully, the allow-list is not necessary anymore, drop it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 scripts/Makefile.vdsoinst | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
index 3de70218b8d4..d9f7243217bc 100644
--- a/scripts/Makefile.vdsoinst
+++ b/scripts/Makefile.vdsoinst
@@ -19,8 +19,6 @@ __default: $$(dest)
 $$(dest): $(1) FORCE
 	$$(call cmd,install)
 
-# Some architectures create .build-id symlinks
-ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
 build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
 
 ifneq ($$(build-id-file),)
@@ -30,7 +28,6 @@ __default: $$(link)
 $$(link): $$(dest) FORCE
 	$$(call cmd,symlink)
 endif
-endif
 
 endef
 

-- 
2.53.0


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

* Re: [PATCH 2/4] kbuild: vdso_install: hide readelf warnings
  2026-03-20 16:36 ` [PATCH 2/4] kbuild: vdso_install: hide readelf warnings Thomas Weißschuh
@ 2026-03-31 15:15   ` Nicolas Schier
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Schier @ 2026-03-31 15:15 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Nathan Chancellor, Nicolas Schier, linux-kbuild, linux-kernel

On Fri, 20 Mar 2026 17:36:54 +0100, Thomas Weißschuh <linux@weissschuh.net> wrote:
> If 'readelf -n' encounters a note it does not recognize it emits a

,

> warning. This for example happen when inspecting a compat vDSO for

happen -> happens

> which the main kernel toolchain was not used.
> However the relevant build ID note is always readable, so the
> warnings are pointless.
> 
> Hide the warnings to make it possible to extrace build IDs for more

extrace -> extract

>
>
> diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst
> index 214c561651cf..aed153b3120b 100644
> --- a/scripts/Makefile.vdsoinst
> +++ b/scripts/Makefile.vdsoinst
> @@ -21,7 +21,7 @@ $$(dest): $(1) FORCE
>  
>  # Some architectures create .build-id symlinks
>  ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
> -build-id-file := $$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
> +build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
>  link := $(install-dir)/.build-id/$$(build-id-file).debug
>  
>  __default: $$(link)

Sound reasonable and the diff looks appropriate.  Thanks!

Reviewed-by: Nicolas Schier <nsc@kernel.org>

-- 
Nicolas


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

* Re: [PATCH 3/4] kbuild: vdso_install: gracefully handle images without build ID
  2026-03-20 16:36 ` [PATCH 3/4] kbuild: vdso_install: gracefully handle images without build ID Thomas Weißschuh
@ 2026-03-31 15:15   ` Nicolas Schier
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Schier @ 2026-03-31 15:15 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Nathan Chancellor, Nicolas Schier, linux-kbuild, linux-kernel

On Fri, 20 Mar 2026 17:36:55 +0100, Thomas Weißschuh <linux@weissschuh.net> wrote:
> If the vDSO does not contains a build ID, skip the symlink step.

s/contains/contain/

Reviewed-by: Nicolas Schier <nsc@kernel.org>

-- 
Nicolas


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

* Re: [PATCH 4/4] kbuild: vdso_install: drop build ID architecture allow-list
  2026-03-20 16:36 ` [PATCH 4/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
@ 2026-03-31 15:15   ` Nicolas Schier
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Schier @ 2026-03-31 15:15 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Nathan Chancellor, Nicolas Schier, linux-kbuild, linux-kernel

On Fri, 20 Mar 2026 17:36:56 +0100, Thomas Weißschuh <linux@weissschuh.net> wrote:
> Many architectures which do generate build IDs are missing from this
> list. For example arm64, riscv, loongarch, mips.
> 
> Now that errors from readelf and binaries without any build ID are
> handled gracefully, the allow-list is not necessary anymore, drop it.
> 
> 
> [...]

Reviewed-by: Nicolas Schier <nsc@kernel.org>

-- 
Nicolas


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

* Re: [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation
  2026-03-20 16:36 ` [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation Thomas Weißschuh
@ 2026-03-31 15:15   ` Nicolas Schier
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Schier @ 2026-03-31 15:15 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Nathan Chancellor, Nicolas Schier, linux-kbuild, linux-kernel

On Fri, 20 Mar 2026 17:36:53 +0100, Thomas Weißschuh <linux@weissschuh.net> wrote:
> Some upcoming changes to the readelf invocation would create a
> very long line otherwise.

(I get confused frequently if commit description is not self-contained
but only completing the subject.)

Reviewed-by: Nicolas Schier <nsc@kernel.org>

-- 
Nicolas


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

* Re: [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list
  2026-03-20 16:36 [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
                   ` (3 preceding siblings ...)
  2026-03-20 16:36 ` [PATCH 4/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
@ 2026-03-31 16:09 ` Nicolas Schier
  2026-03-31 17:09   ` Nicolas Schier
  4 siblings, 1 reply; 11+ messages in thread
From: Nicolas Schier @ 2026-03-31 16:09 UTC (permalink / raw)
  To: Nathan Chancellor, Thomas Weißschuh
  Cc: Nicolas Schier, linux-kbuild, linux-kernel

On Fri, 20 Mar 2026 17:36:52 +0100, Thomas Weißschuh wrote:
> This list is incomplete. Instead of maintaining it manually,
> detect a vDSO with build ID automatically and handle it.

Applied to kbuild/linux.git (kbuild-next-unstable), thanks!

[1/4] kbuild: vdso_install: split out the readelf invocation
      https://git.kernel.org/kbuild/c/9780cef0
[2/4] kbuild: vdso_install: hide readelf warnings
      https://git.kernel.org/kbuild/c/6ba86c59
[3/4] kbuild: vdso_install: gracefully handle images without build ID
      https://git.kernel.org/kbuild/c/5cd6177e
[4/4] kbuild: vdso_install: drop build ID architecture allow-list
      https://git.kernel.org/kbuild/c/80b1f3e6

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped,
reverted or modified (e.g. trailers). Patches applied to the
kbuild-next-unstable branch are accepted pending wider testing in
linux-next and any post-commit review; they will generally be moved
to the kbuild-next branch in about a week if no issues are found.

Best regards,
-- 
Nicolas


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

* Re: [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list
  2026-03-31 16:09 ` [PATCH 0/4] " Nicolas Schier
@ 2026-03-31 17:09   ` Nicolas Schier
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Schier @ 2026-03-31 17:09 UTC (permalink / raw)
  To: Nathan Chancellor, Thomas Weißschuh; +Cc: linux-kbuild, linux-kernel

On Tue, Mar 31, 2026 at 06:09:39PM +0200, Nicolas Schier wrote:
> On Fri, 20 Mar 2026 17:36:52 +0100, Thomas Weißschuh wrote:
> > This list is incomplete. Instead of maintaining it manually,
> > detect a vDSO with build ID automatically and handle it.
> 
> Applied to kbuild/linux.git (kbuild-next-unstable), thanks!
> 
> [1/4] kbuild: vdso_install: split out the readelf invocation
>       https://git.kernel.org/kbuild/c/9780cef0
> [2/4] kbuild: vdso_install: hide readelf warnings
>       https://git.kernel.org/kbuild/c/6ba86c59
> [3/4] kbuild: vdso_install: gracefully handle images without build ID
>       https://git.kernel.org/kbuild/c/5cd6177e
> [4/4] kbuild: vdso_install: drop build ID architecture allow-list
>       https://git.kernel.org/kbuild/c/80b1f3e6
> 
> Please look out for regression or issue reports or other follow up
> comments, as they may result in the patch/series getting dropped,
> reverted or modified (e.g. trailers). Patches applied to the
> kbuild-next-unstable branch are accepted pending wider testing in
> linux-next and any post-commit review; they will generally be moved
> to the kbuild-next branch in about a week if no issues are found.
> 
> Best regards,
> -- 
> Nicolas
> 

I didn't want to merge that already; please ignore.  Sorry for the
noise.

-- 
Nicolas

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

end of thread, other threads:[~2026-03-31 17:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 16:36 [PATCH 0/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
2026-03-20 16:36 ` [PATCH 1/4] kbuild: vdso_install: split out the readelf invocation Thomas Weißschuh
2026-03-31 15:15   ` Nicolas Schier
2026-03-20 16:36 ` [PATCH 2/4] kbuild: vdso_install: hide readelf warnings Thomas Weißschuh
2026-03-31 15:15   ` Nicolas Schier
2026-03-20 16:36 ` [PATCH 3/4] kbuild: vdso_install: gracefully handle images without build ID Thomas Weißschuh
2026-03-31 15:15   ` Nicolas Schier
2026-03-20 16:36 ` [PATCH 4/4] kbuild: vdso_install: drop build ID architecture allow-list Thomas Weißschuh
2026-03-31 15:15   ` Nicolas Schier
2026-03-31 16:09 ` [PATCH 0/4] " Nicolas Schier
2026-03-31 17:09   ` Nicolas Schier

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