[compiler-rt] b36b163 - [scudo][standalone] Define hasHardwareCRC32 for other archs

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 07:42:28 PST 2019


Author: Kostya Kortchinsky
Date: 2019-12-10T07:41:46-08:00
New Revision: b36b16372d5f3aa0d1390eeaefd3600595b22e6d

URL: https://github.com/llvm/llvm-project/commit/b36b16372d5f3aa0d1390eeaefd3600595b22e6d
DIFF: https://github.com/llvm/llvm-project/commit/b36b16372d5f3aa0d1390eeaefd3600595b22e6d.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/checksum.cpp b/compiler-rt/lib/scudo/standalone/checksum.cpp
index f713f5a81609..5de049a0931b 100644
--- a/compiler-rt/lib/scudo/standalone/checksum.cpp
+++ b/compiler-rt/lib/scudo/standalone/checksum.cpp
@@ -44,7 +44,6 @@ bool hasHardwareCRC32() {
   __get_cpuid(1, &Eax, &Ebx, &Ecx, &Edx);
   return !!(Ecx & bit_SSE4_2);
 }
-
 #elif defined(__arm__) || defined(__aarch64__)
 #ifndef AT_HWCAP
 #define AT_HWCAP 16
@@ -65,6 +64,9 @@ bool hasHardwareCRC32() {
   return !!(getauxval(AT_HWCAP) & HWCAP_CRC32);
 #endif // SCUDO_FUCHSIA
 }
+#else
+// No hardware CRC32 implemented in Scudo for other architectures.
+bool hasHardwareCRC32() { return false; }
 #endif // defined(__x86_64__) || defined(__i386__)
 
 } // namespace scudo


        


More information about the llvm-commits mailing list