diff options
author | Michael Hoisie <hoisie@google.com> | 2023-02-18 06:50:48 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-02-18 06:50:48 +0000 |
commit | 23f76b8986b60d79bad992f884b718f00e56cd0d (patch) | |
tree | 68a6c0cbe1a905867622b496756959e6ac14d9e3 | |
parent | ee60e455c3b8d8448cc18b6dd07b6ed0ea2f6c0b (diff) | |
parent | e5d14f19e86a1d5bd524ed6415c04421737b5e1c (diff) | |
download | zlib-android12-hostruntime-dev.tar.gz |
Merge "Support Darwin+Arm64" into android12-hostruntime-devandroid12-hostruntime-dev
-rw-r--r-- | Android.bp | 60 |
1 files changed, 44 insertions, 16 deletions
@@ -17,18 +17,14 @@ license { srcs_opt = [ "adler32_simd.c", // See https://chromium-review.googlesource.com/749732. -// TODO: causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures. -// "contrib/optimizations/inffast_chunk.c", -// "contrib/optimizations/inflate.c", + // TODO: causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures. + // "contrib/optimizations/inffast_chunk.c", + // "contrib/optimizations/inflate.c", // This file doesn't build for non-neon, so it can't be in the main srcs. "crc32_simd.c", ] cflags_arm = [ - // Since we're building for the platform, we claim to be Linux rather than - // Android so we use getauxval() directly instead of the NDK - // android_getCpuFeatures which isn't available to us anyway. - "-DARMV8_OS_LINUX", // Testing with zlib_bench shows -O3 is a win for ARM but a bit of a wash // for x86, so match the BUILD file in only enabling this for ARM. "-O3", @@ -41,8 +37,8 @@ cflags_arm_neon = [ "-UCPU_NO_SIMD", // We no longer support non-Neon platform builds, but the NDK just has one libz. "-DADLER32_SIMD_NEON", -// TODO: causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures. -// "-DINFLATE_CHUNK_SIMD_NEON", + // TODO: causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures. + // "-DINFLATE_CHUNK_SIMD_NEON", // HWCAP_CRC32 is checked at runtime, so it's okay to turn crc32 // acceleration on for both 32- and 64-bit. "-DCRC32_ARMV8_CRC32", @@ -53,8 +49,8 @@ cflags_arm64 = cflags_arm + cflags_arm_neon cflags_x86 = [ // See ARMV8_OS_LINUX above. "-DX86_NOT_WINDOWS", -// TODO: see arm above. -// "-DINFLATE_CHUNK_SIMD_SSE2", + // TODO: see arm above. + // "-DINFLATE_CHUNK_SIMD_SSE2", // Android's host CPU feature requirements are *lower* than the // corresponding device CPU feature requirements, so it's easier to just // say "no SIMD for you" rather than specificially disable SSSE3. @@ -128,7 +124,7 @@ cc_defaults { neon: { cflags: cflags_arm_neon, srcs: srcs_opt, - } + }, }, arm64: { cflags: cflags_arm64 + cflags_64, @@ -144,12 +140,33 @@ cc_defaults { }, }, target: { + android_arm: { + cflags: [ + // Since we're building for the platform, we claim to be Linux rather than + // Android so we use getauxval() directly instead of the NDK + // android_getCpuFeatures which isn't available to us anyway. + "-DARMV8_OS_LINUX", + ], + }, android_x86: { cflags: cflags_android_x86, }, android_x86_64: { cflags: cflags_android_x86, }, + darwin_arm64: { + cflags: [ + "-DARMV8_OS_MACOS", + ], + }, + linux_arm64: { + cflags: [ + // Since we're building for the platform, we claim to be Linux rather than + // Android so we use getauxval() directly instead of the NDK + // android_getCpuFeatures which isn't available to us anyway. + "-DARMV8_OS_LINUX", + ], + }, }, } @@ -221,7 +238,11 @@ cc_library { cc_binary_host { name: "minigzip", srcs: ["contrib/minigzip/minigzip.c"], - cflags: ["-Wall", "-Werror", "-DUSE_MMAP"], + cflags: [ + "-Wall", + "-Werror", + "-DUSE_MMAP", + ], static_libs: ["libz"], stl: "none", } @@ -229,14 +250,21 @@ cc_binary_host { cc_binary { name: "zlib_bench", srcs: ["contrib/bench/zlib_bench.cc"], - cflags: ["-Wall", "-Werror"], + cflags: [ + "-Wall", + "-Werror", + ], host_supported: true, shared_libs: ["libz"], // We build zlib_bench32 and zlib_bench64 so it's easy to test LP32. compile_multilib: "both", multilib: { - lib32: { suffix: "32", }, - lib64: { suffix: "64", }, + lib32: { + suffix: "32", + }, + lib64: { + suffix: "64", + }, }, } |