From 6482e70bade5200230f5e204dd78e59df626fd35 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 11 Nov 2026 18:15:17 -0800 Subject: [PATCH] bpftool-native: Fix build on arm64 hosts with linux-libc-dev 7.3 Debian 13 now ships linux-libc-dev 7.3, where the arm64 UAPI headers (asm/ptrace.h, asm/sigcontext.h) use __u128 instead of __uint128_t. bpftool-native builds against the host headers but puts tools/include ahead of them, and the 6.16 tools linux/types.h does not define __u128: /usr/lib/linux/uapi/arm64/asm/sigcontext.h:81:9: error: unknown type name '__u128'; did you mean '__u32'? Backport the upstream tools/include/linux/types.h fix that adds the 128-bit types. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- .../bpftool/bpftool-native_6.16.bb | 1 + ...s.h-Add-128-bit-integer-types-for-ar.patch | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 meta-oe/recipes-kernel/bpftool/bpftool/0002-tools-linux-types.h-Add-128-bit-integer-types-for-ar.patch diff --git a/meta-oe/recipes-kernel/bpftool/bpftool-native_6.16.bb b/meta-oe/recipes-kernel/bpftool/bpftool-native_6.16.bb index edc635517a..f174414200 100644 --- a/meta-oe/recipes-kernel/bpftool/bpftool-native_6.16.bb +++ b/meta-oe/recipes-kernel/bpftool/bpftool-native_6.16.bb @@ -12,6 +12,7 @@ inherit native bash-completion SRC_URI = "\ ${KERNELORG_MIRROR}/linux/kernel/v6.x/linux-${PV}.tar.xz \ file://0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch \ + file://0002-tools-linux-types.h-Add-128-bit-integer-types-for-ar.patch \ " SRC_URI[sha256sum] = "1a4be2fe6b5246aa4ac8987a8a4af34c42a8dd7d08b46ab48516bcc1befbcd83" diff --git a/meta-oe/recipes-kernel/bpftool/bpftool/0002-tools-linux-types.h-Add-128-bit-integer-types-for-ar.patch b/meta-oe/recipes-kernel/bpftool/bpftool/0002-tools-linux-types.h-Add-128-bit-integer-types-for-ar.patch new file mode 100644 index 0000000000..2181274430 --- /dev/null +++ b/meta-oe/recipes-kernel/bpftool/bpftool/0002-tools-linux-types.h-Add-128-bit-integer-types-for-ar.patch @@ -0,0 +1,47 @@ +From 10a47fb67340bca274276faf855d7d460afd9a7a Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Fri, 26 Jun 2026 15:17:28 +0100 +Subject: [PATCH] tools: linux/types.h: Add 128-bit integer types for arm64 UAPI + structures + +The arm64 UAPI exposes some 128-bit integer types to represent things +such as fpsimd registers in the sigcontext. In preparation for defining +these using the '__u128' typedef implemented by uapi/linux/types.h, copy +that typedef over to the private linux/types.h header used by the tools +directory. + +Cc: Arnd Bergmann +Cc: Arnaldo Carvalho de Melo +Cc: David Matlack +Signed-off-by: Will Deacon + +Debian 13 now ships linux-libc-dev 7.3, whose arm64 asm/ptrace.h and +asm/sigcontext.h use __u128. bpftool-native picks up +tools/include/linux/types.h ahead of the host linux/types.h, so the +build fails on arm64 hosts with "unknown type name '__u128'". + +Upstream-Status: Backport [https://git.kernel.org/torvalds/c/10a47fb67340bca274276faf855d7d460afd9a7a] +Signed-off-by: Khem Raj +--- + tools/include/linux/types.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h +index d41f8a261bce8..b6c473b7920db 100644 +--- a/tools/include/linux/types.h ++++ b/tools/include/linux/types.h +@@ -23,6 +23,11 @@ typedef enum { + __GFP_HIGH + } gfp_t; + ++#ifdef __SIZEOF_INT128__ ++typedef __signed__ __int128 __s128 __attribute__((aligned(16))); ++typedef unsigned __int128 __u128 __attribute__((aligned(16))); ++#endif ++ + /* + * We define u64 as uint64_t for every architecture + * so that we can print it with "%"PRIx64 without getting warnings. +-- +2.53.0 +