From: Ilya Leoshkevich Date: Fri, 9 Aug 2024 08:29:20 +0000 (+0200) Subject: IBM zSystems: Hardcode HWCAP_S390_VXRS X-Git-Tag: 2.2.2~11 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=f858914696a04cd1482f00db1e044063be0026ea;p=thirdparty%2Fzlib-ng.git 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. --- 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);