@samitouri / QOSamiQemu / commits / 01e1455139

util/cpuinfo-aarch64: Fix build with older glibc headers

Commit 761bfe07b2c9 ("util/cpuinfo-aarch64: Detect FEAT_CSSC") started using HWCAP2_CSSC unconditionally. This macro was added to glibc's AArch64 bits/hwcap.h during the glibc 2.38 development cycle, so AArch64 hosts with older headers fail to build. Follow the existing HWCAP2_BTI handling and define HWCAP2_CSSC to zero when it is not provided by system headers. Such environments simply do not use FEAT_CSSC host optimizations. This has been tested on an Ubuntu 22.04 aarch64 host with glibc 2.35. Fixes: 761bfe07b2c9 ("util/cpuinfo-aarch64: Detect FEAT_CSSC") Signed-off-by: Tao Tang <tangtao1634@phytium.com.cn> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20260826163753.459661-1-tangtao1634@phytium.com.cn>

Tao Tang committed Aug 27, 2026 at 00:37 UTC 01e1455139196cc8d6bcde7d2f918348a90f7f26
1 file changed +3
util/cpuinfo-aarch64.c
+3
@@ -16,6 +16,9 @@
16 # ifndef HWCAP2_BTI
17 # define HWCAP2_BTI 0 /* added in glibc 2.32 */
18 # endif
19 +# ifndef HWCAP2_CSSC
20 +# define HWCAP2_CSSC 0 /* added in glibc 2.38 */
21 +# endif
22 #endif
23 #ifdef CONFIG_ELF_AUX_INFO
24 #include <sys/auxv.h>