Skip to content

Commit

Permalink
IBM zSystems: Hardcode HWCAP_S390_VXRS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iii-i committed Aug 9, 2024
1 parent d54e376 commit 4b653be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/s390/s390_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion cmake/detect-intrinsics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4b653be

Please sign in to comment.