Skip to content

Commit

Permalink
Enable a native build of Crashpad handler on arm64 (#3914)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hlwarriner authored Aug 1, 2024
1 parent 21eb395 commit df7c2ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/zlib/arm_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit df7c2ac

Please sign in to comment.