summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin Zhang <zhangkelvin@google.com>2021-01-14 15:04:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-01-14 15:04:35 +0000
commit0a3c0efda6c8145f3a5d9ab3794b35dad1dfbfb0 (patch)
treee731e1b39185e58a7a993cfa532d5fff75985293
parent4fa66caa136303294cabb33a634c6ccf18926280 (diff)
parente6a6dbd05cbeea0f20a77095b98a4817a3708a87 (diff)
downloadzlib-0a3c0efda6c8145f3a5d9ab3794b35dad1dfbfb0.tar.gz
Merge "Add a libz_stable variant"
-rw-r--r--Android.bp66
1 files changed, 48 insertions, 18 deletions
diff --git a/Android.bp b/Android.bp
index 206bad9..b136616 100644
--- a/Android.bp
+++ b/Android.bp
@@ -65,6 +65,25 @@ srcs_x86 = [
// This optimization is applicable to arm64 and x86-64.
cflags_64 = ["-DINFLATE_CHUNK_READ_64LE"]
+libz_srcs = [
+ "adler32.c",
+ "compress.c",
+ "cpu_features.c",
+ "crc32.c",
+ "deflate.c",
+ "gzclose.c",
+ "gzlib.c",
+ "gzread.c",
+ "gzwrite.c",
+ "infback.c",
+ "inffast.c",
+ "inflate.c",
+ "inftrees.c",
+ "trees.c",
+ "uncompr.c",
+ "zutil.c",
+]
+
cc_defaults {
name: "libz_defaults",
@@ -80,24 +99,7 @@ cc_defaults {
],
stl: "none",
export_include_dirs: ["."],
- srcs: [
- "adler32.c",
- "compress.c",
- "cpu_features.c",
- "crc32.c",
- "deflate.c",
- "gzclose.c",
- "gzlib.c",
- "gzread.c",
- "gzwrite.c",
- "infback.c",
- "inffast.c",
- "inflate.c",
- "inftrees.c",
- "trees.c",
- "uncompr.c",
- "zutil.c",
- ],
+ srcs: libz_srcs,
arch: {
arm: {
@@ -172,6 +174,34 @@ cc_library {
},
}
+// A more stable build of libz. Build configuration of this library should be
+// the same for different targets. This is only used by imgdiff.
+
+cc_library {
+ name: "libz_stable",
+ visibility: [
+ "//bootable/recovery/applypatch",
+ "//bootable/recovery/tests",
+ ],
+ cflags: [
+ // We do support hidden visibility, so turn that on.
+ "-DHAVE_HIDDEN",
+ // We do support const, so turn that on.
+ "-DZLIB_CONST",
+ "-Wall",
+ "-Werror",
+ "-Wno-unused",
+ "-Wno-unused-parameter",
+ ],
+ stl: "none",
+ export_include_dirs: ["."],
+ srcs: libz_srcs,
+
+ host_supported: true,
+ vendor_available: true,
+ recovery_available: true,
+}
+
cc_binary_host {
name: "minigzip",
srcs: ["contrib/minigzip/minigzip.c"],