From 2b4fe4851a1a442e942ce69792f6e6d8f0a9e2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20P=C3=B6tzsch?= Date: Tue, 29 Sep 2026 14:23:48 +0200 Subject: [PATCH] elfutils: fix build for aarch64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 0.196 lib/system.h includes , which defines struct iovec when _GNU_SOURCE is set. The aarch64 backend also includes , which defines it again: linux/uio.h:17:8: error: redefinition of 'struct iovec' Apply upstream commit 64e89606ff49 ("backends: use instead of for struct iovec"). Signed-off-by: Christian Pötzsch --- recipes/libs/elfutils.yaml | 6 +- ...tead-of-linux-uio.h-for-struct-iovec.patch | 71 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 recipes/libs/elfutils/0001-backends-use-sys-uio.h-instead-of-linux-uio.h-for-struct-iovec.patch diff --git a/recipes/libs/elfutils.yaml b/recipes/libs/elfutils.yaml index 45e7c894..26c0f8e9 100644 --- a/recipes/libs/elfutils.yaml +++ b/recipes/libs/elfutils.yaml @@ -1,4 +1,4 @@ -inherit: [autotools] +inherit: [autotools, patch] metaEnvironment: PKG_VERSION: "0.196" @@ -16,6 +16,10 @@ checkoutSCM: digestSHA256: fd5cc6b77ad6773cac93cb3f415f9318ac3b3455eecf801f6b4a742c4f6c7209 stripComponents: 1 +checkoutDeterministic: True +checkoutScript: | + patchApplySeries -p1 $<@elfutils/*.patch@> + buildTools: [m4] buildScript: | mkdir -p all diff --git a/recipes/libs/elfutils/0001-backends-use-sys-uio.h-instead-of-linux-uio.h-for-struct-iovec.patch b/recipes/libs/elfutils/0001-backends-use-sys-uio.h-instead-of-linux-uio.h-for-struct-iovec.patch new file mode 100644 index 00000000..83f1c2ba --- /dev/null +++ b/recipes/libs/elfutils/0001-backends-use-sys-uio.h-instead-of-linux-uio.h-for-struct-iovec.patch @@ -0,0 +1,71 @@ +From 64e89606ff4967a647525524aec00dd33765ba2a Mon Sep 17 00:00:00 2001 +From: Daeho Ro +Date: Sun, 16 Aug 2026 16:27:56 +0900 +Subject: [PATCH] backends: use instead of for struct + iovec + +Since commit 0e8b57a3 ("elfcompress: Handle existing output files +(symlinks)") lib/system.h includes . When _GNU_SOURCE is +defined, glibc's pulls in (via +bits/fcntl-linux.h), which defines struct iovec. The kernel UAPI header + defines struct iovec unconditionally, so including it +after "system.h" now breaks the aarch64 backend build: + + In file included from aarch64_initreg.c:36: + /usr/include/linux/uio.h:17:8: error: redefinition of 'struct iovec' + 17 | struct iovec + | ^~~~~ + In file included from /usr/include/aarch64-linux-gnu/bits/fcntl-linux.h:38, + from /usr/include/aarch64-linux-gnu/bits/fcntl.h:61, + from /usr/include/fcntl.h:35, + from ../lib/system.h:42, + from aarch64_initreg.c:33: + /usr/include/aarch64-linux-gnu/bits/types/struct_iovec.h:26:8: note: originally defined here + +Seen building 0.196 on aarch64 with glibc 2.39 and gcc 13.3.0. + +Both files only need struct iovec to call ptrace (PTRACE_GETREGSET), +which glibc provides in ; that header guards the definition +with __iovec_defined, so it composes with the rest of system.h. +arm_initreg.c does not currently include "system.h" and so still builds, +but it has the same latent conflict. + +* backends/aarch64_initreg.c: Include instead of + . +* backends/arm_initreg.c: Likewise. + +Signed-off-by: Daeho Ro +--- + backends/aarch64_initreg.c | 2 +- + backends/arm_initreg.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c +index a6badbb4..539a6366 100644 +--- a/backends/aarch64_initreg.c ++++ b/backends/aarch64_initreg.c +@@ -33,7 +33,7 @@ + #include "system.h" + #include + #if defined(__aarch64__) && defined(__linux__) +-# include ++# include + # include + # include + # include +diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c +index efcabaf6..062bb9e0 100644 +--- a/backends/arm_initreg.c ++++ b/backends/arm_initreg.c +@@ -38,7 +38,7 @@ + #endif + + #ifdef __aarch64__ +-# include ++# include + # include + # include + /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */ +-- +2.43.7 +