From: Tao Tang <[email protected]>
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 <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-ID: <[email protected]>
---
util/cpuinfo-aarch64.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/util/cpuinfo-aarch64.c b/util/cpuinfo-aarch64.c
index 4ce6deb7c82..e3446762149 100644
--- a/util/cpuinfo-aarch64.c
+++ b/util/cpuinfo-aarch64.c
@@ -16,6 +16,9 @@
# ifndef HWCAP2_BTI
# define HWCAP2_BTI 0 /* added in glibc 2.32 */
# endif
+# ifndef HWCAP2_CSSC
+# define HWCAP2_CSSC 0 /* added in glibc 2.38 */
+# endif
#endif
#ifdef CONFIG_ELF_AUX_INFO
#include <sys/auxv.h>
--
2.53.0