summaryrefslogtreecommitdiff
path: root/Android.bp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-06-06 12:47:16 -0700
committerElliott Hughes <enh@google.com>2019-06-07 09:03:26 -0700
commite7091dd0b78998ae9184b2df10336eef41b5e663 (patch)
treefd77a18b4dcf0d7f779bd637ef6ba005a4633ef5 /Android.bp
parent6b6e20f61377df3a532d95087f9fc1324650974b (diff)
parentdfa0646a03b4e1707469e04dc931b09774968fe6 (diff)
downloadzlib-e7091dd0b78998ae9184b2df10336eef41b5e663.tar.gz
Switch to chromium zlib.
For now without the optimized assembler, to avoid changing too many variables at once... This also builds the zlib_bench benchmarking tool. I've retained the "true" upstream minigzip.c which was removed from the chromium upstream but is used by the AOSP build. The shell script to update from the "true" upstream is gone, and replaced by a METADATA file. I've also removed zlib_example because that's not in the chromium upstream, and zlib_bench is a better sanity check of "can we build a caller?" anyway. Bug: https://issuetracker.google.com/115695768 Change-Id: Ia51809963933b247b2434bb84ae10b3249555041
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp112
1 files changed, 112 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..140547e
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,112 @@
+cc_library {
+ name: "libz",
+
+ host_supported: true,
+ unique_host_soname: true,
+ static_ndk_lib: true,
+
+ vendor_available: true,
+ vndk: {
+ enabled: true,
+ support_system_process: true,
+ },
+ recovery_available: true,
+ native_bridge_supported: true,
+
+ cflags: [
+ "-O3",
+ "-DHAVE_HIDDEN",
+ "-DZLIB_CONST",
+ "-Wall",
+ "-Werror",
+ "-Wno-unused",
+ "-Wno-unused-parameter",
+ ],
+ stl: "none",
+ export_include_dirs: ["."],
+ srcs: [
+ "adler32.c",
+ "compress.c",
+ "crc32.c",
+ "deflate.c",
+ "gzclose.c",
+ "gzlib.c",
+ "gzread.c",
+ "gzwrite.c",
+ "infback.c",
+ "inflate.c",
+ "inftrees.c",
+ "inffast.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"],
+ },
+ },
+
+ target: {
+ linux_bionic: {
+ enabled: true,
+ },
+ windows: {
+ enabled: true,
+ },
+ },
+}
+
+cc_binary_host {
+ name: "minigzip",
+ srcs: ["contrib/minigzip/minigzip.c"],
+ cflags: ["-Wall", "-Werror", "-DUSE_MMAP"],
+ static_libs: ["libz"],
+ stl: "none",
+}
+
+cc_binary {
+ name: "zlib_bench",
+ srcs: ["contrib/bench/zlib_bench.cc"],
+ cflags: ["-Wall", "-Werror"],
+ host_supported: true,
+ shared_libs: ["libz"],
+}
+
+// This module is defined in development/ndk/Android.bp. Updating these headers
+// to be usable for any API level is going to be some work (at the very least,
+// there's a ZLIB_VERNUM that will need to be handled since early versions of
+// Android did not have all the APIs that calling code will use if this is set
+// to the current value.
+//
+// The NDK never updated the zlib headers when the platform updated, so until we
+// solve this the NDK will continue shipping the old headers.
+//
+// ndk_headers {
+// name: "libz_headers",
+// from: "src",
+// to: "",
+// srcs: [
+// "src/zconf.h",
+// "src/zlib.h",
+// ],
+// license: "NOTICE",
+// }
+
+ndk_library {
+ name: "libz",
+ symbol_file: "libz.map.txt",
+ first_version: "9",
+ unversioned_until: "current",
+}