mirror of
https://github.com/GerbilSoft/zlib-ng.git
synced 2025-06-18 19:45:37 -04:00

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.
15 lines
307 B
C
15 lines
307 B
C
#include "zbuild.h"
|
|
#include "s390_features.h"
|
|
|
|
#ifdef HAVE_SYS_AUXV_H
|
|
# include <sys/auxv.h>
|
|
#endif
|
|
|
|
#ifndef HWCAP_S390_VXRS
|
|
#define HWCAP_S390_VXRS (1 << 11)
|
|
#endif
|
|
|
|
void Z_INTERNAL s390_check_features(struct s390_cpu_features *features) {
|
|
features->has_vx = getauxval(AT_HWCAP) & HWCAP_S390_VXRS;
|
|
}
|