]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
IBM zSystems: Hardcode HWCAP_S390_VXRS
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 9 Aug 2024 08:29:20 +0000 (10:29 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 16 Aug 2024 09:52:11 +0000 (11:52 +0200)
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
cmake/detect-intrinsics.cmake

index 629025d5bb14707f3f9c0881e681df5ae9a9170d..1f90a926c0596e4d62c943ac39e9c927c7d65421 100644 (file)
@@ -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) {
index 14f82fcbf588fefd5a5a40dd0be671871bc1973a..d2a591234b4e44cefe7fc4c2233a8a5b33cbdd9c 100644 (file)
@@ -433,7 +433,7 @@ macro(check_s390_intrinsics)
     check_c_source_compiles(
         "#include <sys/auxv.h>
         #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);