diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-09-29 14:09:01 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-09-29 14:09:01 +0200 |
commit | 1d44513f9b34f2a59c794474752025430285a68b (patch) | |
tree | 17db66823db814baeccdb6bf224f85a9869f1fdd /src | |
parent | 90c0f267bdedc261d8fdab188e96ca58c206652a (diff) | |
download | bitcoin-1d44513f9b34f2a59c794474752025430285a68b.tar.xz |
Squashed 'src/crc32c/' changes from b5ef9be675..0d624261ef
0d624261ef Merge bitcoin-core/crc32c#2: Merge upstream
cac7ca830b Merge commit 'fa5ade41ee480003d9c5af6f43567ba22e4e17e6' into bitcoin-fork
fa5ade41ee Fix compilation warnings on ARM64 with old GCC versions. (#52)
db08d22129 Updated Travis-CI configuration. (#51)
e31619a5b7 Fix GitHub links. (#50)
7fa4c263e8 Update Travis CI config. (#49)
a3d9e6d1a4 Updated third_party/ and Travis CI config. (#48)
git-subtree-dir: src/crc32c
git-subtree-split: 0d624261ef83ab08c953c196540ed18f355add4c
Diffstat (limited to 'src')
-rw-r--r-- | src/crc32c_arm64_check.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/crc32c_arm64_check.h b/src/crc32c_arm64_check.h index 62a07aba09..6b80f70037 100644 --- a/src/crc32c_arm64_check.h +++ b/src/crc32c_arm64_check.h @@ -40,7 +40,15 @@ inline bool CanUseArm64Crc32() { // From 'arch/arm64/include/uapi/asm/hwcap.h' in Linux kernel source code. constexpr unsigned long kHWCAP_PMULL = 1 << 4; constexpr unsigned long kHWCAP_CRC32 = 1 << 7; - unsigned long hwcap = (&getauxval != nullptr) ? getauxval(AT_HWCAP) : 0; + unsigned long hwcap = +#if HAVE_STRONG_GETAUXVAL + // Some compilers warn on (&getauxval != nullptr) in the block below. + getauxval(AT_HWCAP); +#elif HAVE_WEAK_GETAUXVAL + (&getauxval != nullptr) ? getauxval(AT_HWCAP) : 0; +#else +#error This is supposed to be nested inside a check for HAVE_*_GETAUXVAL. +#endif // HAVE_STRONG_GETAUXVAL return (hwcap & (kHWCAP_PMULL | kHWCAP_CRC32)) == (kHWCAP_PMULL | kHWCAP_CRC32); #elif defined(__APPLE__) |