mac/arm64: Make zlib actually link.

This is a follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/2271018
which made the initialization at arm_cpu_enable_crc32 build-time constant for mac/arm64.
However, since there are a few callers of cpu_check_features() in cross-platform
zlib code, we still need to give cpu_check_features() an (empty) implementation
on mac/arm. (...or add preprocessor checks for mac/arm at each calling site,
which seems worse.)

Bug: 1099892
Change-Id: I65785c2e815d80d7e50f25280963ed5aba66304c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284145
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#785570}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 64cf0064494d35e48dcb9cf253e18b270fa58c57
diff --git a/cpu_features.c b/cpu_features.c
index 5628549..70f01be 100644
--- a/cpu_features.c
+++ b/cpu_features.c
@@ -56,11 +56,19 @@
 static void _cpu_check_features(void);
 #endif
 
-#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA) || defined(X86_NOT_WINDOWS)
+#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_MACOS) || defined(ARMV8_OS_FUCHSIA) || defined(X86_NOT_WINDOWS)
+#if !defined(ARMV8_OS_MACOS)
+// _cpu_check_features() doesn't need to do anything on mac/arm since all
+// features are known at build time, so don't call it.
+// Do provide cpu_check_features() (with a no-op implementation) so that we
+// don't have to make all callers of it check for mac/arm.
 static pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT;
+#endif
 void ZLIB_INTERNAL cpu_check_features(void)
 {
+#if !defined(ARMV8_OS_MACOS)
     pthread_once(&cpu_check_inited_once, _cpu_check_features);
+#endif
 }
 #elif defined(ARMV8_OS_WINDOWS) || defined(X86_WINDOWS)
 static INIT_ONCE cpu_check_inited_once = INIT_ONCE_STATIC_INIT;