Skip to content

Commit b36b163

Browse files
author
Kostya Kortchinsky
committed
[scudo][standalone] Define hasHardwareCRC32 for other archs
Summary: The function was only defined for x86 and arm families, which ends up being an issue for PPC in g3. Define the function, simply returning `false` for "other" architectures. Reviewers: hctim, pcc, cferris, eugenis, vitalybuka Subscribers: kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71223
1 parent 396d18a commit b36b163

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/scudo/standalone/checksum.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ bool hasHardwareCRC32() {
4444
__get_cpuid(1, &Eax, &Ebx, &Ecx, &Edx);
4545
return !!(Ecx & bit_SSE4_2);
4646
}
47-
4847
#elif defined(__arm__) || defined(__aarch64__)
4948
#ifndef AT_HWCAP
5049
#define AT_HWCAP 16
@@ -65,6 +64,9 @@ bool hasHardwareCRC32() {
6564
return !!(getauxval(AT_HWCAP) & HWCAP_CRC32);
6665
#endif // SCUDO_FUCHSIA
6766
}
67+
#else
68+
// No hardware CRC32 implemented in Scudo for other architectures.
69+
bool hasHardwareCRC32() { return false; }
6870
#endif // defined(__x86_64__) || defined(__i386__)
6971

7072
} // namespace scudo

0 commit comments

Comments
 (0)