]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
IBM zSystems: Use HWCAP_S390_VXRS
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 6 Mar 2023 22:25:04 +0000 (23:25 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 10 Mar 2023 12:14:09 +0000 (13:14 +0100)
glibc defines HWCAP_S390_VX and, since v2.33, its alias
HWCAP_S390_VXRS; musl has only HWCAP_S390_VXRS.

Use the common HWCAP_S390_VXRS, define it as HWCAP_S390_VX if
necessary.

arch/s390/s390_features.c
cmake/detect-intrinsics.cmake

index 711b7dd46083d7ed44aba927f35d652a84a44773..82901060ebbb2dbc63dcba388b18d3bfc78e37f8 100644 (file)
@@ -5,6 +5,10 @@
 #  include <sys/auxv.h>
 #endif
 
+#ifndef HWCAP_S390_VXRS
+#define HWCAP_S390_VXRS HWCAP_S390_VX
+#endif
+
 void Z_INTERNAL s390_check_features(struct s390_cpu_features *features) {
-    features->has_vx = getauxval(AT_HWCAP) & HWCAP_S390_VX;
+    features->has_vx = getauxval(AT_HWCAP) & HWCAP_S390_VXRS;
 }
index 3e932d83b2117904b44fde54a048667adfbed3a2..6ce0f3e3c2aeeadb3f559f1cc1ac0ad2147f57eb 100644 (file)
@@ -344,8 +344,11 @@ endmacro()
 macro(check_s390_intrinsics)
     check_c_source_compiles(
         "#include <sys/auxv.h>
+        #ifndef HWCAP_S390_VXRS
+        #define HWCAP_S390_VXRS HWCAP_S390_VX
+        #endif
         int main() {
-            return (getauxval(AT_HWCAP) & HWCAP_S390_VX);
+            return (getauxval(AT_HWCAP) & HWCAP_S390_VXRS);
         }"
         HAVE_S390_INTRIN
     )