Merge "Add support for a partial ubsan build."
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 51cdc5b..ea68402 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -96,7 +96,6 @@
LOCAL_STRIP_MODULE:=
LOCAL_JNI_SHARED_LIBRARIES:=
LOCAL_JNI_SHARED_LIBRARIES_ABI:=
-LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS:=
LOCAL_PREBUILT_JNI_LIBS:=
LOCAL_JAR_MANIFEST:=
LOCAL_INSTRUMENTATION_FOR:=
diff --git a/core/definitions.mk b/core/definitions.mk
index 4f0daae..6114395 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1903,7 +1903,8 @@
$(foreach abi,$(PRIVATE_JNI_SHARED_LIBRARIES_ABI),\
$(call _add-jni-shared-libs-to-package-per-abi,$(abi),\
$(patsubst $(abi):%,%,$(filter $(abi):%,$(PRIVATE_JNI_SHARED_LIBRARIES)))))
-$(hide) (cd $(dir $@) && zip -r $(PRIVATE_JNI_SHARED_LIBRARIES_ZIP_OPTIONS) $(notdir $@) lib)
+$(hide) (cd $(dir $@) && zip -r \
+ $(if $(filter true, $(PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES)),-0,) $(notdir $@) lib)
$(hide) rm -rf $(dir $@)lib
endef
@@ -1937,7 +1938,7 @@
$(hide) mv $@ $@.unaligned
$(hide) $(ZIPALIGN) \
-f \
- $(if $(findstring true, $(PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES)),-p ,) \
+ $(if $(filter true, $(PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES)),-p,) \
4 \
$@.unaligned $@.aligned
$(hide) mv $@.aligned $@
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 016e23f..d52997b 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -369,7 +369,6 @@
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis)
# PRIVATE_JNI_SHARED_LIBRARIES_ABI is a list of ABI names.
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abis)
-$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ZIP_OPTIONS := $(LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS)
$(LOCAL_BUILT_MODULE): PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES := $(LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES)
ifneq ($(TARGET_BUILD_APPS),)
# Include all resources for unbundled apps.
diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py
index 75379cd..8eb249a 100644
--- a/tools/releasetools/blockimgdiff.py
+++ b/tools/releasetools/blockimgdiff.py
@@ -396,6 +396,12 @@
xf.style,
xf.tgt_ranges.to_string_raw(), src_str))
elif self.version >= 3:
+ # take into account automatic stashing of overlapping blocks
+ if xf.src_ranges.overlaps(xf.tgt_ranges):
+ temp_stash_usage = stashed_blocks + xf.src_ranges.size();
+ if temp_stash_usage > max_stashed_blocks:
+ max_stashed_blocks = temp_stash_usage
+
out.append("%s %s %s %s\n" % (
xf.style,
self.HashBlocks(self.tgt, xf.tgt_ranges),
@@ -414,6 +420,12 @@
xf.style, xf.patch_start, xf.patch_len,
xf.tgt_ranges.to_string_raw(), src_str))
elif self.version >= 3:
+ # take into account automatic stashing of overlapping blocks
+ if xf.src_ranges.overlaps(xf.tgt_ranges):
+ temp_stash_usage = stashed_blocks + xf.src_ranges.size();
+ if temp_stash_usage > max_stashed_blocks:
+ max_stashed_blocks = temp_stash_usage
+
out.append("%s %d %d %s %s %s %s\n" % (
xf.style,
xf.patch_start, xf.patch_len,