Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ec2c615 authored by Colin Cross's avatar Colin Cross
Browse files

Pass --avoid-storing-invocation to dex2oat

Pass --avoid-storing-invocation to dex2oat, which will remove the
command line from the final .odex files.  This will help make the
.odex files reproducible across devices and build system changes,
simplifying comparisons.

Bug: 119412419
Test: m checkbuild
Change-Id: I46cedadab9a87addc0f9e35f7bbe578beae1df60
parent 07d639a4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -173,6 +173,9 @@ my_2nd_arch_prefix :=
# In the case where LOCAL_ENFORCE_USES_LIBRARIES is true, PRIVATE_DEX2OAT_CLASS_LOADER_CONTEXT
# contains the normalized path list of the libraries. This makes it easier to conditionally prepend
# org.apache.http.legacy.impl based on the SDK level if required.
#
# Pass --avoid-storing-invocation to make the output deterministics between
# different products that may have different paths on the command line.
define dex2oat-one-file
$(hide) rm -f $(2)
$(hide) mkdir -p $(dir $(2))
@@ -188,6 +191,7 @@ source build/make/core/verify_uses_libraries.sh "$(1)" && \
source build/make/core/construct_context.sh "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_HOST)" "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_TARGET)" && \
,) \
ANDROID_LOG_TAGS="*:e" $(DEX2OAT) \
	--avoid-storing-invocation \
	--runtime-arg -Xms$(DEX2OAT_XMS) --runtime-arg -Xmx$(DEX2OAT_XMX) \
	$${class_loader_context_arg} \
	$${stored_class_loader_context_arg} \
+3 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ endif
$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_BOOT_IMAGE_FLAGS := $(my_boot_image_flags)
$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix)
# Use dex2oat debug version for better error reporting
# Pass --avoid-storing-invocation to make the output deterministics between
# different products that may have different paths on the command line.
$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(DIRTY_IMAGE_OBJECTS) $(DEX2OAT_DEPENDENCY) $(my_out_boot_image_profile_location)
	@echo "target dex2oat: $@"
	@mkdir -p $(dir $@)
@@ -94,6 +96,7 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE
	@rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.art
	@rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.oat
	$(hide) $(DEX2OAT_BOOT_IMAGE_LOG_TAGS) $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \
		--avoid-storing-invocation \
		--runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \
		$(PRIVATE_BOOT_IMAGE_FLAGS) \
		$(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \