util/cpuinfo-aarch64.c | 3 +++ 1 file changed, 3 insertions(+)
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>
---
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.34.1
On 26/8/26 18:37, Tao Tang wrote:
> 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>
> ---
> util/cpuinfo-aarch64.c | 3 +++
> 1 file changed, 3 insertions(+)
Merged as 01e1455139196cc8d6bcde7d2f918348a90f7f26.
On 8/26/26 09:37, Tao Tang wrote:
> 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>
> ---
> 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>
Queued, thanks.
r~
On 26/8/26 18:37, Tao Tang wrote:
> 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>
> ---
> util/cpuinfo-aarch64.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
© 2016 - 2026 Red Hat, Inc.