Index: compiler-rt/lib/scudo/scudo_utils.cpp =================================================================== --- compiler-rt/lib/scudo/scudo_utils.cpp +++ compiler-rt/lib/scudo/scudo_utils.cpp @@ -23,6 +23,11 @@ # endif #endif +#if SANITIZER_FUCHSIA +#include +#include +#endif + #include // TODO(kostyak): remove __sanitizer *Printf uses in favor for our own less @@ -110,9 +115,18 @@ } bool hasHardwareCRC32() { +#if SANITIZER_FUCHSIA + uint32_t hwcap; + zx_status_t rc = zx_system_get_features(ZX_FEATURE_KIND_CPU, &hwcap); + if (rc != ZX_OK || (hwcap & ZX_ARM64_FEATURE_ISA_CRC32) == 0) { + return false; + } + return true; +#else if (&getauxval && areBionicGlobalsInitialized()) return !!(getauxval(AT_HWCAP) & HWCAP_CRC32); return hasHardwareCRC32ARMPosix(); +#endif // !SANITIZER_FUCHSIA } #else bool hasHardwareCRC32() { return false; }