From df7c2ac7c3712d5b851d995d7fac5e84cb218af4 Mon Sep 17 00:00:00 2001 From: Holden Warriner Date: Thu, 1 Aug 2024 07:39:35 -0400 Subject: [PATCH] Enable a native build of Crashpad handler on arm64 (#3914) It can't be assumed that a native target running on Android has access to the JNI, which android_getCpuFeatures() uses to get the device's CPU features. It should be ok to do nothing here; upstream only uses the CPU features to set arm_cpu_enable_pmull for this OS and architecture, and the value of arm_cpu_enable_pmull is actually unused. b/355499070 Change-Id: Idac308a2a8e42d4a0d5edf3f004b3e0dd204db10 --- third_party/zlib/arm_features.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/zlib/arm_features.c b/third_party/zlib/arm_features.c index 2e90dd7df24f4..0b314919b90d6 100644 --- a/third_party/zlib/arm_features.c +++ b/third_party/zlib/arm_features.c @@ -85,10 +85,10 @@ static void _arm_check_features(void) arm_cpu_enable_neon, arm_cpu_enable_pmull); SbLogFlush(); } -#elif defined(ARMV8_OS_ANDROID) && defined(__aarch64__) +#elif defined(ARMV8_OS_ANDROID) && defined(__aarch64__) && !defined(NATIVE_TARGET_BUILD) uint64_t features = android_getCpuFeatures(); arm_cpu_enable_pmull = !!(features & ANDROID_CPU_ARM64_FEATURE_PMULL); -#elif defined(ARMV8_OS_ANDROID) /* aarch32 */ +#elif defined(ARMV8_OS_ANDROID) && !defined(NATIVE_TARGET_BUILD) /* aarch32 */ uint64_t features = android_getCpuFeatures(); arm_cpu_enable_crc32 = !!(features & ANDROID_CPU_ARM_FEATURE_CRC32); arm_cpu_enable_pmull = !!(features & ANDROID_CPU_ARM_FEATURE_PMULL);