summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-01-16 21:43:28 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-01-16 21:43:28 +0000
commit4f7242fcf2ebcb9d3a39d43bbdd7cb1022874212 (patch)
treea913e49d27ee556972f2998051ab01e139969ba4
parent5e8476a4436b59e04f3ce2fbdb70fece8313efe4 (diff)
parent29d63d4417426db5853c65049f9291598f6b49f8 (diff)
downloadzlib-4f7242fcf2ebcb9d3a39d43bbdd7cb1022874212.tar.gz
Merge "Revert "Enable the various chrome zlib optimizations."" am: 8dda271246 am: fb0bd5710c am: 29d63d4417
Change-Id: I80538d6e157d99a4c4c2ee926721596633131646
-rw-r--r--Android.bp87
1 files changed, 9 insertions, 78 deletions
diff --git a/Android.bp b/Android.bp
index 3e060b0..2937ca3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,62 +1,9 @@
-srcs_opt = [
- "adler32_simd.c",
- // See https://chromium-review.googlesource.com/749732.
- "contrib/optimizations/inffast_chunk.c",
- "contrib/optimizations/inflate.c",
- "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",
- // We no longer support non-Neon platform builds.
- "-DADLER32_SIMD_NEON",
- "-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",
- // 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",
-]
-srcs_arm = [
- "arm_features.c",
-] + srcs_opt
-
-cflags_x86 = []
-srcs_x86 = ["inflate.c"]
-
-/* TODO: this should work, but fails some tests on cuttlefish.
-cflags_x86 = [
- // Android's x86/x86-64 ABI includes SSE2 and SSSE3.
- "-DADLER32_SIMD_SSSE3",
- "-DINFLATE_CHUNK_SIMD_SSE2",
- // TODO: ...but the host build system defaults don't match our official ABI.
- "-mssse3",
- // PCLMUL isn't in the ABI, but it won't actually be used unless CPUID
- // reports that the processor really does have the instruction.
- "-mpclmul",
- "-DCRC32_SIMD_SSE42_PCLMUL",
-]
-srcs_x86 = [
- "crc_folding.c",
- "fill_window_sse.c",
- "x86.c",
-] + srcs_opt
-*/
-
-// This optimization is applicable to arm64 and x86-64.
-cflags_64 = ["-DINFLATE_CHUNK_READ_64LE"]
-
cc_defaults {
name: "libz_defaults",
cflags: [
- // We do support hidden visibility, so turn that on.
+ "-O3",
"-DHAVE_HIDDEN",
- // We do support const, so turn that on.
"-DZLIB_CONST",
"-Wall",
"-Werror",
@@ -75,35 +22,27 @@ cc_defaults {
"gzread.c",
"gzwrite.c",
"infback.c",
+ "inflate.c",
"inftrees.c",
"inffast.c",
- "simd_stub.c",
"trees.c",
"uncompr.c",
"zutil.c",
+
+ "simd_stub.c",
],
arch: {
arm: {
+ // measurements show that the ARM version of ZLib is about x1.17 faster
+ // than the thumb one...
+ // TODO: re-test with zlib_bench after SIMD is enabled.
+ instruction_set: "arm",
+
// TODO: This is to work around b/24465209. Remove after root cause
// is fixed.
pack_relocations: false,
ldflags: ["-Wl,--hash-style=both"],
-
- cflags: cflags_arm,
- srcs: srcs_arm,
- },
- arm64: {
- cflags: cflags_arm + cflags_64,
- srcs: srcs_arm,
- },
- x86: {
- cflags: cflags_x86,
- srcs: srcs_x86,
- },
- x86_64: {
- cflags: cflags_x86 + cflags_64,
- srcs: srcs_x86,
},
},
}
@@ -134,8 +73,6 @@ cc_library {
},
}
-// libz_current allows modules building against the NDK to have access to zlib
-// API that's not available from the NDK libz.
cc_library_static {
name: "libz_current",
defaults: ["libz_defaults"],
@@ -156,12 +93,6 @@ cc_binary {
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", },
- },
}
// This module is defined in development/ndk/Android.bp. Updating these headers