From f858914696a04cd1482f00db1e044063be0026ea Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Fri, 9 Aug 2024 10:29:20 +0200 Subject: [PATCH] IBM zSystems: Hardcode HWCAP_S390_VXRS Compiling zlib-ng with glibc 2.17 (minimum version still supported by crosstool-ng) fails due to the lack of HWCAP_S390_VX - it was introduced in glibc 2.23. Strictly speaking, this is a problem with the feature detection logic in cmake. However, it's not worth disabling the s390x vectorized CRC32 if the hwcap constant is missing and the compiler intrinsics are available. So fix by hardcoding the constant. It's a part of the kernel ABI, which does not change. --- arch/s390/s390_features.c | 2 +- cmake/detect-intrinsics.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/s390_features.c b/arch/s390/s390_features.c index 629025d5..1f90a926 100644 --- a/arch/s390/s390_features.c +++ b/arch/s390/s390_features.c @@ -6,7 +6,7 @@ #endif #ifndef HWCAP_S390_VXRS -#define HWCAP_S390_VXRS HWCAP_S390_VX +#define HWCAP_S390_VXRS (1 << 11) #endif void Z_INTERNAL s390_check_features(struct s390_cpu_features *features) { diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index 14f82fcb..d2a59123 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -433,7 +433,7 @@ macro(check_s390_intrinsics) check_c_source_compiles( "#include #ifndef HWCAP_S390_VXRS - #define HWCAP_S390_VXRS HWCAP_S390_VX + #define HWCAP_S390_VXRS (1 << 11) #endif int main() { return (getauxval(AT_HWCAP) & HWCAP_S390_VXRS); -- 2.47.2