From b8c2114d51ca120f76e0cdad706c8f0c15d1f829 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Mon, 6 Mar 2023 23:25:04 +0100 Subject: [PATCH] IBM zSystems: Use HWCAP_S390_VXRS 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 | 6 +++++- cmake/detect-intrinsics.cmake | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/s390/s390_features.c b/arch/s390/s390_features.c index 711b7dd4..82901060 100644 --- a/arch/s390/s390_features.c +++ b/arch/s390/s390_features.c @@ -5,6 +5,10 @@ # include #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; } diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index 3e932d83..6ce0f3e3 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -344,8 +344,11 @@ endmacro() macro(check_s390_intrinsics) check_c_source_compiles( "#include + #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 ) -- 2.47.3