Skip to content

Commit 44bb804

Browse files
derekmaurocopybara-github
authored andcommitted
CRC: Ensure SupportsArmCRC32PMULL() is defined
This fixes the build on arm64 macOS. Note that hardware acceleration is not yet enabled on arm64 when not running under Linux. Addresses the report from abseil/abseil-cpp@1687dbf#commitcomment-89529264 PiperOrigin-RevId: 487655295 Change-Id: I168dfc863c960d0b694b26dfcb85ff0fd0e95a1e
1 parent 0465837 commit 44bb804

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

absl/crc/internal/cpu_detect.cc

+4
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ CpuType GetCpuType() {
206206
}
207207
}
208208

209+
bool SupportsArmCRC32PMULL() { return false; }
210+
209211
#elif defined(__aarch64__) && defined(__linux__)
210212

211213
#define ABSL_INTERNAL_AARCH64_ID_REG_READ(id, val) \
@@ -240,6 +242,8 @@ bool SupportsArmCRC32PMULL() {
240242

241243
CpuType GetCpuType() { return CpuType::kUnknown; }
242244

245+
bool SupportsArmCRC32PMULL() { return false; }
246+
243247
#endif
244248

245249
} // namespace crc_internal

absl/crc/internal/cpu_detect.h

-2
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ enum class CpuType {
4343
// the host CPU is of unknown type, or if detection otherwise fails.
4444
CpuType GetCpuType();
4545

46-
#if defined(__aarch64__)
4746
// Returns whether the host CPU supports the CPU features needed for our
4847
// accelerated implementations. The CpuTypes enumerated above apart from
4948
// kUnknown support the required features. On unknown CPUs, we can use
5049
// this to see if it's safe to use hardware acceleration, though without any
5150
// tuning.
5251
bool SupportsArmCRC32PMULL();
53-
#endif
5452

5553
} // namespace crc_internal
5654
ABSL_NAMESPACE_END

0 commit comments

Comments
 (0)