From 3f30eb47bd989bb9fdce49967d03987af83a50ed Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Tue, 28 Apr 2026 16:00:15 +0200 Subject: [PATCH] net/vpp: fix build on aarch64 The usual elf_aux_info() polyfill. Reported by: thj --- net/vpp/files/patch-src_vppinfra_cpu.h | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 net/vpp/files/patch-src_vppinfra_cpu.h diff --git a/net/vpp/files/patch-src_vppinfra_cpu.h b/net/vpp/files/patch-src_vppinfra_cpu.h new file mode 100644 index 000000000000..8e77c2a6b53c --- /dev/null +++ b/net/vpp/files/patch-src_vppinfra_cpu.h @@ -0,0 +1,32 @@ +--- src/vppinfra/cpu.h.orig 2026-04-28 12:28:57 UTC ++++ src/vppinfra/cpu.h +@@ -207,6 +207,7 @@ foreach_x86_64_flags + #undef _ + #endif /* __x86_64__ */ + #if defined(__aarch64__) ++#if defined(__linux__) + #include + #define _(flag, bit) \ + static inline int \ +@@ -217,6 +218,21 @@ clib_cpu_supports_ ## flag() \ + } + foreach_aarch64_flags + #undef _ ++#elif defined(__FreeBSD__) ++#include ++#define _(flag, bit) \ ++static inline int \ ++clib_cpu_supports_ ## flag() \ ++{ \ ++ unsigned long hwcap = 0; \ ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); \ ++ return (hwcap & (1 << bit)); \ ++} ++ foreach_aarch64_flags ++#undef _ ++#else ++#error please add code path to get hardware capabilities ++#endif /* defined(__linux) */ + #else /* ! __x86_64__ && !__aarch64__ */ + #define _(flag, bit) \ + static inline int clib_cpu_supports_ ## flag() { return 0; } -- 2.53.0