Merge "Revert "Revert "Revert "Print full diagnostics file when Java process crashes.""""
diff --git a/Changes.md b/Changes.md
index 6b3095c..461de97 100644
--- a/Changes.md
+++ b/Changes.md
@@ -1,5 +1,23 @@
# Build System Changes for Android.mk Writers
+## PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete {#PRODUCT_STATIC_BOOT_CONTROL_HAL}
+
+`PRODUCT_STATIC_BOOT_CONTROL_HAL` was the workaround to allow sideloading with
+statically linked boot control HAL, before shared library HALs were supported
+under recovery. Android Q has added such support (HALs will be loaded in
+passthrough mode), and the workarounds are being removed. Targets should build
+and install the recovery variant of boot control HAL modules into recovery
+image, similar to the ones installed for normal boot. See the change to
+crosshatch for example of this:
+
+* [device/google/crosshatch/bootctrl/Android.bp] for `bootctrl.sdm845` building
+ rules
+* [device/google/crosshatch/device.mk] for installing `bootctrl.sdm845.recovery`
+ and `android.hardware.boot@1.0-impl.recovery` into recovery image
+
+[device/google/crosshatch/bootctrl/Android.bp]: https://android.googlesource.com/device/google/crosshatch/+/master/bootctrl/Android.bp
+[device/google/crosshatch/device.mk]: https://android.googlesource.com/device/google/crosshatch/+/master/device.mk
+
## Deprecation of `BUILD_*` module types
See [build/make/Deprecation.md](Deprecation.md) for the current status.
@@ -194,11 +212,9 @@
## `export` and `unexport` deprecation {#export_keyword}
-The `export` and `unexport` keywords have been deprecated, and will throw
-warnings or errors depending on where they are used.
+The `export` and `unexport` keywords are obsolete, and will throw errors when
+used.
-Early in the make system, during product configuration and BoardConfig.mk
-reading: these will throw a warnings, and will be an error in the future.
Device specific configuration should not be able to affect common core build
steps -- we're looking at triggering build steps to be invalidated if the set
of environment variables they can access changes. If device specific
@@ -206,10 +222,9 @@
output directory could become significantly more expensive than it already can
be.
-Later, during Android.mk files, and later tasks: these will throw errors, since
-it is increasingly likely that they are being used incorrectly, attempting to
-change the environment for a single build step, and instead setting it for
-hundreds of thousands.
+If used during Android.mk files, and later tasks, it is increasingly likely
+that they are being used incorrectly. Attempting to change the environment for
+a single build step, and instead setting it for hundreds of thousands.
It is not recommended to just move the environment variable setting outside of
the build (in vendorsetup.sh, or some other configuration script or wrapper).
@@ -373,7 +388,7 @@
| instead of | use |
|--------------------------------------------------------------|----------------------|
-| OUT {#OUT} | OUT_DIR |
+| OUT {#OUT} | PRODUCT_OUT |
| ANDROID_HOST_OUT {#ANDROID_HOST_OUT} | HOST_OUT |
| ANDROID_PRODUCT_OUT {#ANDROID_PRODUCT_OUT} | PRODUCT_OUT |
| ANDROID_HOST_OUT_TESTCASES {#ANDROID_HOST_OUT_TESTCASES} | HOST_OUT_TESTCASES |
diff --git a/Deprecation.md b/Deprecation.md
index 0d925cb..131ec0d 100644
--- a/Deprecation.md
+++ b/Deprecation.md
@@ -14,16 +14,16 @@
| Module type | State |
| -------------------------------- | --------- |
-| `BUILD_AUX_EXECUTABLE` | Warning |
-| `BUILD_AUX_STATIC_LIBRARY` | Warning |
-| `BUILD_HOST_FUZZ_TEST` | Warning |
-| `BUILD_HOST_NATIVE_TEST` | Warning |
+| `BUILD_AUX_EXECUTABLE` | Error |
+| `BUILD_AUX_STATIC_LIBRARY` | Error |
+| `BUILD_HOST_FUZZ_TEST` | Error |
+| `BUILD_HOST_NATIVE_TEST` | Error |
| `BUILD_HOST_SHARED_TEST_LIBRARY` | Error |
-| `BUILD_HOST_STATIC_TEST_LIBRARY` | Warning |
+| `BUILD_HOST_STATIC_TEST_LIBRARY` | Error |
| `BUILD_HOST_TEST_CONFIG` | Error |
-| `BUILD_NATIVE_BENCHMARK` | Warning |
+| `BUILD_NATIVE_BENCHMARK` | Error |
| `BUILD_SHARED_TEST_LIBRARY` | Error |
-| `BUILD_STATIC_TEST_LIBRARY` | Warning |
+| `BUILD_STATIC_TEST_LIBRARY` | Error |
| `BUILD_TARGET_TEST_CONFIG` | Error |
| `BUILD_*` | Available |
diff --git a/core/Makefile b/core/Makefile
index f92e25a..a4825e1 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1224,19 +1224,9 @@
# The kernel isn't really a module, so to get its module file in there, we
# make the target NOTICE files depend on this particular file too, which will
# then be in the right directory for the find in combine-notice-files to work.
-$(kernel_notice_file): \
- $(BUILD_SYSTEM)/LINUX_KERNEL_COPYING \
- | $(ACP)
- @echo Copying: $@
- $(hide) mkdir -p $(dir $@)
- $(hide) $(ACP) $< $@
+$(eval $(call copy-one-file,$(BUILD_SYSTEM)/LINUX_KERNEL_COPYING,$(kernel_notice_file)))
-$(winpthreads_notice_file): \
- $(BUILD_SYSTEM)/WINPTHREADS_COPYING \
- | $(ACP)
- @echo Copying: $@
- $(hide) mkdir -p $(dir $@)
- $(hide) $(ACP) $< $@
+$(eval $(call copy-one-file,$(BUILD_SYSTEM)/WINPTHREADS_COPYING,$(winpthreads_notice_file)))
# #################################################################
@@ -4081,7 +4071,7 @@
endif
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
@# If breakpad symbols have been generated, add them to the zip.
- $(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD
+ $(hide) cp -R $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD
endif
ifdef BOARD_PREBUILT_VENDORIMAGE
$(hide) mkdir -p $(zip_root)/IMAGES
diff --git a/core/app_prebuilt_internal.mk b/core/app_prebuilt_internal.mk
index dd263dd..69f411c 100644
--- a/core/app_prebuilt_internal.mk
+++ b/core/app_prebuilt_internal.mk
@@ -92,6 +92,32 @@
endif
endif
+# Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES
+# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
+# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
+# Will change the default to true unconditionally in the future.
+ifndef LOCAL_ENFORCE_USES_LIBRARIES
+ ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES)))
+ LOCAL_ENFORCE_USES_LIBRARIES := true
+ endif
+endif
+
+my_enforced_uses_libraries :=
+ifdef LOCAL_ENFORCE_USES_LIBRARIES
+ my_enforced_uses_libraries := $(intermediates.COMMON)/enforce_uses_libraries.timestamp
+ $(my_enforced_uses_libraries): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES)
+ $(my_enforced_uses_libraries): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES)
+ $(my_enforced_uses_libraries): $(BUILD_SYSTEM)/verify_uses_libraries.sh $(AAPT)
+ $(my_enforced_uses_libraries): $(my_prebuilt_src_file)
+ @echo Verifying uses-libraries: $<
+ aapt_binary=$(AAPT) \
+ uses_library_names="$(strip $(PRIVATE_USES_LIBRARIES))" \
+ optional_uses_library_names="$(strip $(PRIVATE_OPTIONAL_USES_LIBRARIES))" \
+ $(BUILD_SYSTEM)/verify_uses_libraries.sh $<
+ touch $@
+ $(built_module) : $(my_enforced_uses_libraries)
+endif
+
dex_preopt_profile_src_file := $(my_prebuilt_src_file)
rs_compatibility_jni_libs :=
diff --git a/core/board_config.mk b/core/board_config.mk
index 851bf8a..9c9e8b1 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -85,7 +85,6 @@
_board_strip_readonly_list += $(_dynamic_partitions_var_list)
_build_broken_var_list := \
- BUILD_BROKEN_ANDROIDMK_EXPORTS \
BUILD_BROKEN_DUP_RULES \
BUILD_BROKEN_USES_NETWORK \
@@ -229,10 +228,6 @@
TARGET_CPU_ABI_LIST_32_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_32_BIT)))
TARGET_CPU_ABI_LIST_64_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_64_BIT)))
-ifneq ($(BUILD_BROKEN_ANDROIDMK_EXPORTS),true)
-$(KATI_obsolete_export It is a global setting. See $(CHANGES_URL)#export_keyword)
-endif
-
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_RAMDISK
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
diff --git a/core/config.mk b/core/config.mk
index 8d08495..ee2db4f 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -98,9 +98,9 @@
$(KATI_obsolete_var BUILD_BROKEN_PHONY_TARGETS)
$(KATI_obsolete_var BUILD_BROKEN_DUP_COPY_HEADERS)
$(KATI_obsolete_var BUILD_BROKEN_ENG_DEBUG_TAGS)
-
-# This is marked as obsolete in envsetup.mk after reading the BoardConfig.mk
-$(KATI_deprecate_export It is a global setting. See $(CHANGES_URL)#export_keyword)
+$(KATI_obsolete_export It is a global setting. See $(CHANGES_URL)#export_keyword)
+$(KATI_obsolete_var BUILD_BROKEN_ANDROIDMK_EXPORTS)
+$(KATI_obsolete_var PRODUCT_STATIC_BOOT_CONTROL_HAL,Use shared library module instead. See $(CHANGES_URL)#PRODUCT_STATIC_BOOT_CONTROL_HAL)
# Used to force goals to build. Only use for conditionally defined goals.
.PHONY: FORCE
@@ -808,6 +808,7 @@
26.0 \
27.0 \
28.0 \
+ 29.0 \
.KATI_READONLY := \
PLATFORM_SEPOLICY_COMPAT_VERSIONS \
@@ -1119,8 +1120,11 @@
endif
# Missing optional uses-libraries so that the platform doesn't create build rules that depend on
-# them. See setup_one_odex.mk.
-INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := com.google.android.ble com.google.android.wearable
+# them.
+INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := \
+ com.google.android.ble \
+ com.google.android.media.effects \
+ com.google.android.wearable \
# This is the standard way to name a directory containing prebuilt target
# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
diff --git a/core/construct_context.sh b/core/construct_context.sh
index 399c15d..794795a 100755
--- a/core/construct_context.sh
+++ b/core/construct_context.sh
@@ -22,6 +22,11 @@
# class_loader_context_arg: final class loader conext arg
# stored_class_loader_context_arg: final stored class loader context arg
+if [ -z "${target_sdk_version}" ]; then
+ echo "ERROR: target_sdk_version not set"
+ exit 2
+fi
+
# The hidl.manager shared library has a dependency on hidl.base. We'll manually
# add that information to the class loader context if we see those libraries.
hidl_manager="android.hidl.manager-V1.0-java"
diff --git a/core/definitions.mk b/core/definitions.mk
index af6248d..5d3227a 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -425,8 +425,8 @@
define find-subdir-assets
$(sort $(if $(1),$(patsubst ./%,%, \
- $(shell if [ -d $(1) ] ; then cd $(1) ; find -L ./ -not -name '.*' -and -type f ; fi)), \
- $(warning Empty argument supplied to find-subdir-assets in $(LOCAL_PATH)) \
+ $(shell if [ -d $(1) ] ; then cd $(1) ; find -L ./ -not -name '.*' -and -type f ; fi)), \
+ $(warning Empty argument supplied to find-subdir-assets in $(LOCAL_PATH)) \
))
endef
@@ -782,8 +782,8 @@
#TODO(jbq): as of 20100106 nobody uses the second parameter
define get-tagged-modules
$(filter-out \
- $(call modules-for-tag-list,$(2)), \
- $(call modules-for-tag-list,$(1)))
+ $(call modules-for-tag-list,$(2)), \
+ $(call modules-for-tag-list,$(1)))
endef
###########################################################
@@ -950,16 +950,16 @@
@echo "Renderscript compatibility: $(notdir $@) <= $(notdir $<)"
$(hide) mkdir -p $(dir $@)
$(hide) $(BCC_COMPAT) -O3 -o $(dir $@)/$(notdir $(<:.bc=.o)) -fPIC -shared \
- -rt-path $(RS_PREBUILT_CLCORE) -mtriple $(RS_COMPAT_TRIPLE) $<
+ -rt-path $(RS_PREBUILT_CLCORE) -mtriple $(RS_COMPAT_TRIPLE) $<
$(hide) $(PRIVATE_CXX) -shared -Wl,-soname,$(notdir $@) -nostdlib \
- -Wl,-rpath,\$$ORIGIN/../lib \
- $(dir $@)/$(notdir $(<:.bc=.o)) \
- $(RS_PREBUILT_COMPILER_RT) \
- -o $@ $(CLANG_TARGET_GLOBAL_LDFLAGS) -Wl,--hash-style=sysv \
- -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib64 \
- -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib \
- $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport)/libRSSupport.so \
- -lm -lc
+ -Wl,-rpath,\$$ORIGIN/../lib \
+ $(dir $@)/$(notdir $(<:.bc=.o)) \
+ $(RS_PREBUILT_COMPILER_RT) \
+ -o $@ $(CLANG_TARGET_GLOBAL_LDFLAGS) -Wl,--hash-style=sysv \
+ -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib64 \
+ -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib \
+ $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport)/libRSSupport.so \
+ -lm -lc
endef
###########################################################
@@ -1093,10 +1093,10 @@
@echo "Protoc: $@ <= $<"
@mkdir -p $(dir $@)
$(hide) \
- $(PROTOC) \
- $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
- $(PRIVATE_PROTOC_FLAGS) \
- $<
+ $(PROTOC) \
+ $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
+ $(PRIVATE_PROTOC_FLAGS) \
+ $<
@# aprotoc outputs only .cc. Rename it to .cpp if necessary.
$(if $(PRIVATE_RENAME_CPP_EXT),\
$(hide) mv $(basename $@).cc $@)
@@ -1122,19 +1122,19 @@
###########################################################
define transform-cpp-to-o-compiler-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
- $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \
- $(PRIVATE_ARM_CFLAGS) \
- ) \
- $(PRIVATE_RTTI_FLAG) \
- $(PRIVATE_CFLAGS) \
- $(PRIVATE_CPPFLAGS) \
- $(PRIVATE_DEBUG_CFLAGS) \
- $(PRIVATE_CFLAGS_NO_OVERRIDE) \
- $(PRIVATE_CPPFLAGS_NO_OVERRIDE)
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \
+ $(PRIVATE_ARM_CFLAGS) \
+ ) \
+$(PRIVATE_RTTI_FLAG) \
+$(PRIVATE_CFLAGS) \
+$(PRIVATE_CPPFLAGS) \
+$(PRIVATE_DEBUG_CFLAGS) \
+$(PRIVATE_CFLAGS_NO_OVERRIDE) \
+$(PRIVATE_CPPFLAGS_NO_OVERRIDE)
endef
# PATH_TO_CLANG_TIDY is defined in build/soong
@@ -1172,14 +1172,14 @@
# $(1): extra flags
define transform-c-or-s-to-o-compiler-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
- $(PRIVATE_TARGET_GLOBAL_CONLYFLAGS) \
- $(PRIVATE_ARM_CFLAGS) \
- ) \
- $(1)
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CONLYFLAGS) \
+ $(PRIVATE_ARM_CFLAGS) \
+ ) \
+ $(1)
endef
define transform-c-to-o-compiler-args
@@ -1245,17 +1245,17 @@
###########################################################
define transform-host-cpp-to-o-compiler-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_CFLAGS) \
- $(PRIVATE_HOST_GLOBAL_CPPFLAGS) \
- ) \
- $(PRIVATE_CFLAGS) \
- $(PRIVATE_CPPFLAGS) \
- $(PRIVATE_DEBUG_CFLAGS) \
- $(PRIVATE_CFLAGS_NO_OVERRIDE) \
- $(PRIVATE_CPPFLAGS_NO_OVERRIDE)
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_CFLAGS) \
+ $(PRIVATE_HOST_GLOBAL_CPPFLAGS) \
+ ) \
+$(PRIVATE_CFLAGS) \
+$(PRIVATE_CPPFLAGS) \
+$(PRIVATE_DEBUG_CFLAGS) \
+$(PRIVATE_CFLAGS_NO_OVERRIDE) \
+$(PRIVATE_CPPFLAGS_NO_OVERRIDE)
endef
define clang-tidy-host-cpp
@@ -1285,12 +1285,12 @@
###########################################################
define transform-host-c-or-s-to-o-common-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_CFLAGS) \
- $(PRIVATE_HOST_GLOBAL_CONLYFLAGS) \
- )
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_CFLAGS) \
+ $(PRIVATE_HOST_GLOBAL_CONLYFLAGS) \
+ )
endef
# $(1): extra flags
@@ -1534,15 +1534,15 @@
define transform-o-to-aux-executable-inner
$(hide) $(PRIVATE_CXX) -pie \
- -Bdynamic \
- -Wl,--gc-sections \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(PRIVATE_LDFLAGS) \
- -o $@
+ -Bdynamic \
+ -Wl,--gc-sections \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(PRIVATE_LDFLAGS) \
+ -o $@
endef
define transform-o-to-aux-executable
@@ -1553,16 +1553,16 @@
define transform-o-to-aux-static-executable-inner
$(hide) $(PRIVATE_CXX) \
- -Bstatic \
- -Wl,--gc-sections \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(PRIVATE_LDFLAGS) \
- -Wl,-Map=$(@).map \
- -o $@
+ -Bstatic \
+ -Wl,--gc-sections \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(PRIVATE_LDFLAGS) \
+ -Wl,-Map=$(@).map \
+ -o $@
endef
define transform-o-to-aux-static-executable
@@ -1654,25 +1654,25 @@
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-shared-lib-inner
$(hide) $(PRIVATE_CXX) \
- -Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
- -Wl,-rpath,\$$ORIGIN/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
- -shared -Wl,-soname,$(notdir $@) \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
- ) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- -o $@ \
- $(PRIVATE_LDLIBS)
+ -Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
+ -Wl,-rpath,\$$ORIGIN/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
+ -shared -Wl,-soname,$(notdir $@) \
+ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
+ ) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ -o $@ \
+ $(PRIVATE_LDLIBS)
endef
endif
@@ -1695,27 +1695,27 @@
define transform-o-to-shared-lib-inner
$(hide) $(PRIVATE_CXX) \
- -nostdlib -Wl,-soname,$(notdir $@) \
- -Wl,--gc-sections \
- -shared \
- $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
- $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
- $(PRIVATE_TARGET_LIBATOMIC) \
- $(PRIVATE_TARGET_LIBGCC) \
- $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- -o $@ \
- $(PRIVATE_TARGET_CRTEND_SO_O) \
- $(PRIVATE_LDLIBS)
+ -nostdlib -Wl,-soname,$(notdir $@) \
+ -Wl,--gc-sections \
+ -shared \
+ $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
+ $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
+ $(PRIVATE_TARGET_LIBATOMIC) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ -o $@ \
+ $(PRIVATE_TARGET_CRTEND_SO_O) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-shared-lib
@@ -1730,28 +1730,28 @@
define transform-o-to-executable-inner
$(hide) $(PRIVATE_CXX) -pie \
- -nostdlib -Bdynamic \
- -Wl,-dynamic-linker,$(PRIVATE_LINKER) \
- -Wl,--gc-sections \
- -Wl,-z,nocopyreloc \
- $(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
- $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
- $(PRIVATE_TARGET_LIBATOMIC) \
- $(PRIVATE_TARGET_LIBGCC) \
- $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- -o $@ \
- $(PRIVATE_TARGET_CRTEND_O) \
- $(PRIVATE_LDLIBS)
+ -nostdlib -Bdynamic \
+ -Wl,-dynamic-linker,$(PRIVATE_LINKER) \
+ -Wl,--gc-sections \
+ -Wl,-z,nocopyreloc \
+ $(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
+ $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
+ $(PRIVATE_TARGET_LIBATOMIC) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ -o $@ \
+ $(PRIVATE_TARGET_CRTEND_O) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-executable
@@ -1773,28 +1773,28 @@
define transform-o-to-static-executable-inner
$(hide) $(PRIVATE_CXX) \
- -nostdlib -Bstatic \
- $(if $(filter $(PRIVATE_LDFLAGS),-shared),,-static) \
- -Wl,--gc-sections \
- -o $@ \
- $(PRIVATE_TARGET_CRTBEGIN_STATIC_O) \
- $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(filter-out %libcompiler_rt.hwasan.a %libc_nomalloc.hwasan.a %libc.hwasan.a %libcompiler_rt.a %libc_nomalloc.a %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- -Wl,--start-group \
- $(filter %libc.a %libc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(filter %libc_nomalloc.a %libc_nomalloc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
- $(PRIVATE_TARGET_LIBATOMIC) \
- $(filter %libcompiler_rt.a %libcompiler_rt.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
- $(PRIVATE_TARGET_LIBGCC) \
- -Wl,--end-group \
- $(PRIVATE_TARGET_CRTEND_O)
+ -nostdlib -Bstatic \
+ $(if $(filter $(PRIVATE_LDFLAGS),-shared),,-static) \
+ -Wl,--gc-sections \
+ -o $@ \
+ $(PRIVATE_TARGET_CRTBEGIN_STATIC_O) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(filter-out %libcompiler_rt.hwasan.a %libc_nomalloc.hwasan.a %libc.hwasan.a %libcompiler_rt.a %libc_nomalloc.a %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ -Wl,--start-group \
+ $(filter %libc.a %libc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(filter %libc_nomalloc.a %libc_nomalloc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
+ $(PRIVATE_TARGET_LIBATOMIC) \
+ $(filter %libcompiler_rt.a %libcompiler_rt.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ -Wl,--end-group \
+ $(PRIVATE_TARGET_CRTEND_O)
endef
define transform-o-to-static-executable
@@ -1811,24 +1811,24 @@
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-executable-inner
$(hide) $(PRIVATE_CXX) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- $(foreach path,$(PRIVATE_RPATHS), \
- -Wl,-rpath,\$$ORIGIN/$(path)) \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
- ) \
- $(PRIVATE_LDFLAGS) \
- -o $@ \
- $(PRIVATE_LDLIBS)
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ $(foreach path,$(PRIVATE_RPATHS), \
+ -Wl,-rpath,\$$ORIGIN/$(path)) \
+ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
+ ) \
+ $(PRIVATE_LDFLAGS) \
+ -o $@ \
+ $(PRIVATE_LDLIBS)
endef
endif
@@ -1853,15 +1853,15 @@
-name Manifest.java 2> /dev/null`; do \
dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \
mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
- $(ACP) -fp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
+ cp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
done;
$(hide) for GENERATED_R_FILE in `find $(1) \
-name R.java 2> /dev/null`; do \
dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \
mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
- $(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
+ cp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
|| exit 31; \
- $(ACP) -fp $$GENERATED_R_FILE $(2) || exit 32; \
+ cp $$GENERATED_R_FILE $(2) || exit 32; \
done;
@# Ensure that the target file is always created, i.e. also in case we did not
@# enter the GENERATED_R_FILE-loop above. This avoids unnecessary rebuilding.
@@ -2724,60 +2724,6 @@
###########################################################
-# Override the package defined in $(1), setting the
-# variables listed below differently.
-#
-# $(1): The makefile to override (relative to the source
-# tree root)
-# $(2): Old LOCAL_PACKAGE_NAME value.
-# $(3): New LOCAL_PACKAGE_NAME value.
-# $(4): New LOCAL_MANIFEST_PACKAGE_NAME value.
-# $(5): New LOCAL_CERTIFICATE value.
-# $(6): New LOCAL_INSTRUMENTATION_FOR value.
-# $(7): New LOCAL_MANIFEST_INSTRUMENTATION_FOR value.
-# $(8): New LOCAL_COMPATIBILITY_SUITE value.
-#
-# Note that LOCAL_PACKAGE_OVERRIDES is NOT cleared in
-# clear_vars.mk.
-###########################################################
-define inherit-package
- $(eval $(call inherit-package-internal,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8)))
-endef
-
-define inherit-package-internal
- LOCAL_PACKAGE_OVERRIDES \
- := $(strip $(1))||$(strip $(2))||$(strip $(3))||$(strip $(4))||&&$(strip $(5))||&&$(strip $(6))||&&$(strip $(7))||&&$(strip $(8)) $(LOCAL_PACKAGE_OVERRIDES)
- include $(1)
- LOCAL_PACKAGE_OVERRIDES \
- := $(wordlist 1,$(words $(LOCAL_PACKAGE_OVERRIDES)), $(LOCAL_PACKAGE_OVERRIDES))
-endef
-
-# To be used with inherit-package above
-# Evalutes to true if the package was overridden
-define set-inherited-package-variables
-$(strip $(call set-inherited-package-variables-internal))
-endef
-
-define keep-or-override
-$(eval $(1) := $(if $(2),$(2),$($(1))))
-endef
-
-define set-inherited-package-variables-internal
- $(eval _o := $(subst ||, ,$(lastword $(LOCAL_PACKAGE_OVERRIDES))))
- $(eval _n := $(subst ||, ,$(firstword $(LOCAL_PACKAGE_OVERRIDES))))
- $(if $(filter $(word 2,$(_n)),$(LOCAL_PACKAGE_NAME)), \
- $(eval LOCAL_PACKAGE_NAME := $(word 3,$(_o))) \
- $(eval LOCAL_MANIFEST_PACKAGE_NAME := $(word 4,$(_o))) \
- $(call keep-or-override,LOCAL_CERTIFICATE,$(patsubst &&%,%,$(word 5,$(_o)))) \
- $(call keep-or-override,LOCAL_INSTRUMENTATION_FOR,$(patsubst &&%,%,$(word 6,$(_o)))) \
- $(call keep-or-override,LOCAL_MANIFEST_INSTRUMENTATION_FOR,$(patsubst &&%,%,$(word 7,$(_o)))) \
- $(call keep-or-override,LOCAL_COMPATIBILITY_SUITE,$(patsubst &&%,%,$(word 8,$(_o)))) \
- $(eval LOCAL_OVERRIDES_PACKAGES := $(sort $(LOCAL_OVERRIDES_PACKAGES) $(word 2,$(_o)))) \
- true \
- ,)
-endef
-
-###########################################################
## API Check
###########################################################
@@ -3309,7 +3255,8 @@
$(KATI_obsolete_var \
create-empty-package \
initialize-package-file \
- add-jni-shared-libs-to-package,\
+ add-jni-shared-libs-to-package \
+ inherit-package,\
These functions have been removed)
###########################################################
@@ -3323,7 +3270,7 @@
define verify-vndk-libs-identical
@echo "Checking VNDK vendor variant: $(2)"
$(hide) CLANG_BIN="$(LLVM_PREBUILTS_PATH)" \
- CROSS_COMPILE="$(strip $(3))" \
- XZ="$(XZ)" \
- $(LIBRARY_IDENTITY_CHECK_SCRIPT) $(SOONG_STRIP_PATH) $(1) $(2)
+ CROSS_COMPILE="$(strip $(3))" \
+ XZ="$(XZ)" \
+ $(LIBRARY_IDENTITY_CHECK_SCRIPT) $(SOONG_STRIP_PATH) $(1) $(2)
endef
diff --git a/core/deprecation.mk b/core/deprecation.mk
index 11fe290..f1e198d 100644
--- a/core/deprecation.mk
+++ b/core/deprecation.mk
@@ -28,19 +28,19 @@
# relevant BUILD_BROKEN_USES_BUILD_* variables, then these would move to
# DEFAULT_ERROR_BUILD_MODULE_TYPES.
DEFAULT_WARNING_BUILD_MODULE_TYPES :=$= \
- BUILD_AUX_EXECUTABLE \
- BUILD_AUX_STATIC_LIBRARY \
- BUILD_HOST_FUZZ_TEST \
- BUILD_HOST_NATIVE_TEST \
- BUILD_HOST_STATIC_TEST_LIBRARY \
- BUILD_NATIVE_BENCHMARK \
- BUILD_STATIC_TEST_LIBRARY \
# These are BUILD_* variables that are errors to reference, but you can set
# BUILD_BROKEN_USES_BUILD_* in your BoardConfig.mk in order to turn them back
# to warnings.
DEFAULT_ERROR_BUILD_MODULE_TYPES :=$= \
+ BUILD_AUX_EXECUTABLE \
+ BUILD_AUX_STATIC_LIBRARY \
+ BUILD_HOST_FUZZ_TEST \
+ BUILD_HOST_NATIVE_TEST \
+ BUILD_HOST_STATIC_TEST_LIBRARY \
BUILD_HOST_TEST_CONFIG \
+ BUILD_NATIVE_BENCHMARK \
+ BUILD_STATIC_TEST_LIBRARY \
BUILD_TARGET_TEST_CONFIG \
# These are BUILD_* variables that are always errors to reference.
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index c44e4bd..5693147 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -116,7 +116,6 @@
$(call add_json_bool, NeverSystemServerDebugInfo, $(filter false,$(PRODUCT_SYSTEM_SERVER_DEBUG_INFO)))
$(call add_json_bool, AlwaysOtherDebugInfo, $(filter true,$(PRODUCT_OTHER_JAVA_DEBUG_INFO)))
$(call add_json_bool, NeverOtherDebugInfo, $(filter false,$(PRODUCT_OTHER_JAVA_DEBUG_INFO)))
- $(call add_json_list, MissingUsesLibraries, $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES))
$(call add_json_bool, IsEng, $(filter eng,$(TARGET_BUILD_VARIANT)))
$(call add_json_bool, SanitizeLite, $(SANITIZE_LITE))
$(call add_json_bool, DefaultAppImages, $(WITH_DEX_PREOPT_APP_IMAGE))
@@ -152,7 +151,7 @@
$(call add_json_str, Aapt, $(SOONG_HOST_OUT_EXECUTABLES)/aapt)
$(call add_json_str, SoongZip, $(SOONG_ZIP))
$(call add_json_str, Zip2zip, $(ZIP2ZIP))
- $(call add_json_str, VerifyUsesLibraries, $(BUILD_SYSTEM)/verify_uses_libraries.sh)
+ $(call add_json_str, ManifestCheck, $(SOONG_HOST_OUT_EXECUTABLES)/manifest_check)
$(call add_json_str, ConstructContext, $(BUILD_SYSTEM)/construct_context.sh)
$(call end_json_map)
@@ -175,7 +174,6 @@
$(SOONG_HOST_OUT_EXECUTABLES)/aapt \
$(SOONG_ZIP) \
$(ZIP2ZIP) \
- $(BUILD_SYSTEM)/verify_uses_libraries.sh \
$(BUILD_SYSTEM)/construct_context.sh \
DEXPREOPT_STRIP_DEPS := \
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 266ebd2..9832c2f 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -103,18 +103,6 @@
endif
endif
-# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
-# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
-ifeq (,$(LOCAL_ENFORCE_USES_LIBRARIES))
- # Will change the default to true unconditionally in the future.
- ifneq (,$(LOCAL_OPTIONAL_USES_LIBRARIES))
- LOCAL_ENFORCE_USES_LIBRARIES := true
- endif
- ifneq (,$(LOCAL_USES_LIBRARIES))
- LOCAL_ENFORCE_USES_LIBRARIES := true
- endif
-endif
-
my_dexpreopt_archs :=
my_dexpreopt_images :=
my_dexpreopt_infix := boot
@@ -183,6 +171,22 @@
endif # TARGET_2ND_ARCH
endif # LOCAL_MODULE_CLASS
+ my_filtered_optional_uses_libraries := $(filter-out $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES), \
+ $(LOCAL_OPTIONAL_USES_LIBRARIES))
+
+ # dexpreopt needs the paths to the dex jars of these libraries in case
+ # construct_context.sh needs to pass them to dex2oat.
+ my_extra_dexpreopt_libs := \
+ org.apache.http.legacy \
+ android.hidl.base-V1.0-java \
+ android.hidl.manager-V1.0-java \
+
+ my_dexpreopt_libs := $(sort \
+ $(LOCAL_USES_LIBRARIES) \
+ $(my_filtered_optional_uses_libraries) \
+ $(my_extra_dexpreopt_libs) \
+ )
+
# Record dex-preopt config.
DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT)
DEXPREOPT.$(LOCAL_MODULE).MULTILIB := $(LOCAL_MULTILIB)
@@ -202,6 +206,7 @@
$(call add_json_str, Name, $(LOCAL_MODULE))
$(call add_json_str, DexLocation, $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)))
$(call add_json_str, BuildPath, $(LOCAL_BUILT_MODULE))
+ $(call add_json_str, ManifestPath, $(full_android_manifest))
$(call add_json_str, ExtrasOutputPath, $$2)
$(call add_json_bool, Privileged, $(filter true,$(LOCAL_PRIVILEGED_MODULE)))
$(call add_json_bool, UncompressedDex, $(filter true,$(LOCAL_UNCOMPRESS_DEX)))
@@ -210,10 +215,10 @@
$(call add_json_str, ProfileClassListing, $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE)))
$(call add_json_bool, ProfileIsTextListing, $(my_profile_is_text_listing))
$(call add_json_bool, EnforceUsesLibraries, $(LOCAL_ENFORCE_USES_LIBRARIES))
- $(call add_json_list, OptionalUsesLibraries, $(LOCAL_OPTIONAL_USES_LIBRARIES))
+ $(call add_json_list, OptionalUsesLibraries, $(my_filtered_optional_uses_libraries))
$(call add_json_list, UsesLibraries, $(LOCAL_USES_LIBRARIES))
$(call add_json_map, LibraryPaths)
- $(foreach lib,$(sort $(LOCAL_USES_LIBRARIES) $(LOCAL_OPTIONAL_USES_LIBRARIES) org.apache.http.legacy android.hidl.base-V1.0-java android.hidl.manager-V1.0-java),\
+ $(foreach lib,$(my_dexpreopt_libs),\
$(call add_json_str, $(lib), $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar))
$(call end_json_map)
$(call add_json_list, Archs, $(my_dexpreopt_archs))
@@ -256,7 +261,7 @@
my_dexpreopt_deps := $(my_dex_jar)
my_dexpreopt_deps += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE))
my_dexpreopt_deps += \
- $(foreach lib,$(sort $(LOCAL_USES_LIBRARIES) $(LOCAL_OPTIONAL_USES_LIBRARIES) org.apache.http.legacy android.hidl.base-V1.0-java android.hidl.manager-V1.0-java),\
+ $(foreach lib, $(my_dexpreopt_libs), \
$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar)
my_dexpreopt_deps += $(my_dexpreopt_images)
my_dexpreopt_deps += $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)
diff --git a/core/dumpvar.mk b/core/dumpvar.mk
index 2f1023f..b2ee8fd 100644
--- a/core/dumpvar.mk
+++ b/core/dumpvar.mk
@@ -27,6 +27,6 @@
.PHONY: dump-many-vars
dump-many-vars :
@$(foreach v, $(DUMP_MANY_VARS),\
- echo "$(DUMP_VAR_PREFIX)$(v)='$($(v))'";)
+ printf "%s='%s'\n" '$(DUMP_VAR_PREFIX)$(v)' '$($(v))';)
endif # CALLED_FROM_SETUP
diff --git a/core/host_java_library.mk b/core/host_java_library.mk
index 1225fa9..a29a1b8 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -52,6 +52,8 @@
$(filter %.java,$(LOCAL_GENERATED_SOURCES))
all_java_sources := $(java_sources)
+ALL_MODULES.$(my_register_name).SRCS := $(ALL_MODULES.$(my_register_name).SRCS) $(all_java_sources)
+
include $(BUILD_SYSTEM)/java_common.mk
# The layers file allows you to enforce a layering between java packages.
diff --git a/core/main.mk b/core/main.mk
index 1afa950..5cb1d34 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1327,15 +1327,18 @@
ifeq (true,$(PRODUCT_ENFORCE_PACKAGES_EXIST))
_whitelist := $(PRODUCT_ENFORCE_PACKAGES_EXIST_WHITELIST)
_modules := $(PRODUCT_PACKAGES)
+ # Strip :32 and :64 suffixes
+ _modules := $(patsubst %:32,%,$(_modules))
+ _modules := $(patsubst %:64,%,$(_modules))
# Sanity check all modules in PRODUCT_PACKAGES exist. We check for the
# existence if either <module> or the <module>_32 variant.
- _nonexistant_modules := $(filter-out $(ALL_MODULES),$(_modules))
- _nonexistant_modules := $(foreach m,$(_nonexistant_modules),\
+ _nonexistent_modules := $(filter-out $(ALL_MODULES),$(_modules))
+ _nonexistent_modules := $(foreach m,$(_nonexistent_modules),\
$(if $(call get-32-bit-modules,$(m)),,$(m)))
- $(call maybe-print-list-and-error,$(filter-out $(_whitelist),$(_nonexistant_modules)),\
- $(INTERNAL_PRODUCT) includes non-existant modules in PRODUCT_PACKAGES)
- $(call maybe-print-list-and-error,$(filter-out $(_nonexistant_modules),$(_whitelist)),\
- $(INTERNAL_PRODUCT) includes redundant whitelist entries for nonexistant PRODUCT_PACKAGES)
+ $(call maybe-print-list-and-error,$(filter-out $(_whitelist),$(_nonexistent_modules)),\
+ $(INTERNAL_PRODUCT) includes non-existent modules in PRODUCT_PACKAGES)
+ $(call maybe-print-list-and-error,$(filter-out $(_nonexistent_modules),$(_whitelist)),\
+ $(INTERNAL_PRODUCT) includes redundant whitelist entries for nonexistent PRODUCT_PACKAGES)
endif
# Check to ensure that all modules in PRODUCT_HOST_PACKAGES exist
@@ -1344,10 +1347,13 @@
# maybe it would make sense to have PRODUCT_HOST_PACKAGES_LINUX/_DARWIN?
ifneq ($(HOST_OS),darwin)
_modules := $(PRODUCT_HOST_PACKAGES)
- _nonexistant_modules := $(foreach m,$(_modules),\
+ # Strip :32 and :64 suffixes
+ _modules := $(patsubst %:32,%,$(_modules))
+ _modules := $(patsubst %:64,%,$(_modules))
+ _nonexistent_modules := $(foreach m,$(_modules),\
$(if $(ALL_MODULES.$(m).REQUIRED_FROM_HOST)$(filter $(HOST_OUT_ROOT)/%,$(ALL_MODULES.$(m).INSTALLED)),,$(m)))
- $(call maybe-print-list-and-error,$(_nonexistant_modules),\
- $(INTERNAL_PRODUCT) includes non-existant modules in PRODUCT_HOST_PACKAGES)
+ $(call maybe-print-list-and-error,$(_nonexistent_modules),\
+ $(INTERNAL_PRODUCT) includes non-existent modules in PRODUCT_HOST_PACKAGES)
endif
endif
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 493a0f1..fcaf947 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -25,18 +25,6 @@
## be set for you.
###########################################################
-# If this makefile is being read from within an inheritance,
-# use the new values.
-skip_definition:=
-ifdef LOCAL_PACKAGE_OVERRIDES
- package_overridden := $(call set-inherited-package-variables)
- ifeq ($(strip $(package_overridden)),)
- skip_definition := true
- endif
-endif
-
-ifndef skip_definition
-
LOCAL_PACKAGE_NAME := $(strip $(LOCAL_PACKAGE_NAME))
ifeq ($(LOCAL_PACKAGE_NAME),)
$(error $(LOCAL_PATH): Package modules must define LOCAL_PACKAGE_NAME)
@@ -483,6 +471,31 @@
$(LOCAL_BUILT_MODULE): $(additional_certificates)
$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(additional_certificates)
+# Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES
+# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
+# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
+# Will change the default to true unconditionally in the future.
+ifndef LOCAL_ENFORCE_USES_LIBRARIES
+ ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES)))
+ LOCAL_ENFORCE_USES_LIBRARIES := true
+ endif
+endif
+
+my_enforced_uses_libraries :=
+ifdef LOCAL_ENFORCE_USES_LIBRARIES
+ my_manifest_check := $(intermediates.COMMON)/manifest/AndroidManifest.xml.check
+ $(my_manifest_check): $(MANIFEST_CHECK)
+ $(my_manifest_check): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES)
+ $(my_manifest_check): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES)
+ $(my_manifest_check): $(full_android_manifest)
+ @echo Checking manifest: $<
+ $(MANIFEST_CHECK) --enforce-uses-libraries \
+ $(addprefix --uses-library ,$(PRIVATE_USES_LIBRARIES)) \
+ $(addprefix --optional-uses-library ,$(PRIVATE_OPTIONAL_USES_LIBRARIES)) \
+ $< -o $@
+ $(LOCAL_BUILT_MODULE): $(my_manifest_check)
+endif
+
# Define the rule to build the actual package.
# PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>.
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis)
@@ -524,7 +537,7 @@
$(LOCAL_BUILT_MODULE) : $(jni_shared_libraries)
$(LOCAL_BUILT_MODULE) : $(JAR_ARGS) $(SOONG_ZIP) $(MERGE_ZIPS) $(ZIP2ZIP)
$(LOCAL_BUILT_MODULE): PRIVATE_RES_PACKAGE := $(my_res_package)
-$(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2) | $(ACP)
+$(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2)
ifdef LOCAL_COMPRESSED_MODULE
$(LOCAL_BUILT_MODULE) : $(MINIGZIP)
endif
@@ -692,8 +705,6 @@
PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME)
-endif # skip_definition
-
# Reset internal variables.
all_res_assets :=
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 220e2c8..ac3cfb3 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -156,7 +156,7 @@
$(call add_json_list, PgoAdditionalProfileDirs, $(PGO_ADDITIONAL_PROFILE_DIRS))
-$(call add_json_list, BoardVendorSepolicyDirs, $(BOARD_SEPOLICY_DIRS))
+$(call add_json_list, BoardVendorSepolicyDirs, $(BOARD_VENDOR_SEPOLICY_DIRS) $(BOARD_SEPOLICY_DIRS))
$(call add_json_list, BoardOdmSepolicyDirs, $(BOARD_ODM_SEPOLICY_DIRS))
$(call add_json_list, BoardPlatPublicSepolicyDirs, $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))
$(call add_json_list, BoardPlatPrivateSepolicyDirs, $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
@@ -183,6 +183,8 @@
$(call add_json_list, TargetFSConfigGen, $(TARGET_FS_CONFIG_GEN))
+$(call add_json_list, MissingUsesLibraries, $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES))
+
$(call add_json_map, VendorVars)
$(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\
$(call add_json_map, $(namespace))\
diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk
index 93db1de..62d9aa6 100644
--- a/core/tasks/sdk-addon.mk
+++ b/core/tasks/sdk-addon.mk
@@ -114,20 +114,20 @@
$(full_target): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_leaf))
-$(full_target): $(sdk_addon_deps) | $(ACP) $(SOONG_ZIP)
+$(full_target): $(sdk_addon_deps) | $(SOONG_ZIP)
@echo Packaging SDK Addon: $@
$(hide) mkdir -p $(PRIVATE_STAGING_DIR)/docs
$(hide) for d in $(PRIVATE_DOCS_DIRS); do \
- $(ACP) -r $$d $(PRIVATE_STAGING_DIR)/docs ;\
+ cp -R $$d $(PRIVATE_STAGING_DIR)/docs ;\
done
$(hide) mkdir -p $(dir $@)
$(hide) $(SOONG_ZIP) -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR)
$(full_target_img): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_img))/images/$(TARGET_CPU_ABI)
-$(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) $(SOONG_ZIP)
+$(full_target_img): $(full_target) $(addon_img_source_prop) | $(SOONG_ZIP)
@echo Packaging SDK Addon System-Image: $@
$(hide) mkdir -p $(dir $@)
- $(ACP) -r $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data
+ cp -R $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data
$(hide) $(SOONG_ZIP) -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR)
diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk
index 57a5cf9..f480300 100644
--- a/core/tasks/tools/compatibility.mk
+++ b/core/tasks/tools/compatibility.mk
@@ -53,8 +53,8 @@
$(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
$(hide) echo $(BUILD_NUMBER_FROM_FILE) > $(PRIVATE_OUT_DIR)/tools/version.txt
# Copy tools
- $(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
- $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) $(ACP) -fp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
+ $(hide) cp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
+ $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) cp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
$(hide) find $(dir $@)/$(PRIVATE_NAME) | sort >$@.list
$(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@) -l $@.list
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 2714f83..62c91f8 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -73,11 +73,6 @@
# Update this value when the platform version changes (rather
# than overriding it somewhere else). Can be an arbitrary string.
-# When you add a new PLATFORM_VERSION which will result in a new
-# PLATFORM_SDK_VERSION please ensure you add a corresponding isAtLeast*
-# method in the following java file:
-# frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java
-
# When you change PLATFORM_VERSION for a given PLATFORM_SDK_VERSION
# please add that PLATFORM_VERSION as well as clean up obsolete PLATFORM_VERSION's
# in the following text file:
@@ -116,10 +111,6 @@
# SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
# the code-name of the new development work.
- # When you change PLATFORM_SDK_VERSION please ensure you also update the
- # corresponding methods for isAtLeast* in the following java file:
- # frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java
-
# When you increment the PLATFORM_SDK_VERSION please ensure you also
# clear out the following text file of all older PLATFORM_VERSION's:
# cts/tests/tests/os/assets/platform_versions.txt
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index 584a0ca..e936d45 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -169,6 +169,7 @@
VNDK-core: android.hidl.memory.block@1.0.so
VNDK-core: android.hidl.token@1.0.so
VNDK-core: android.hidl.token@1.0-utils.so
+VNDK-core: android.system.ashmem@1.0.so
VNDK-core: android.system.net.netd@1.0.so
VNDK-core: android.system.net.netd@1.1.so
VNDK-core: android.system.suspend@1.0.so
diff --git a/tools/fs_config/Android.mk b/tools/fs_config/Android.mk
index 96db0f3..af0da46 100644
--- a/tools/fs_config/Android.mk
+++ b/tools/fs_config/Android.mk
@@ -99,7 +99,7 @@
--aid-header $(PRIVATE_ANDROID_FS_HDR) \
--capability-header $(PRIVATE_ANDROID_CAP_HDR) \
--partition system \
- --all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \
+ --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
--dirs \
--out_file $@ \
$(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
@@ -124,7 +124,7 @@
--aid-header $(PRIVATE_ANDROID_FS_HDR) \
--capability-header $(PRIVATE_ANDROID_CAP_HDR) \
--partition system \
- --all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \
+ --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
--files \
--out_file $@ \
$(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py
index dccff92..4400466 100755
--- a/tools/fs_config/fs_config_generator.py
+++ b/tools/fs_config/fs_config_generator.py
@@ -1004,10 +1004,6 @@
self._partition = args['partition']
self._all_partitions = args['all_partitions']
- if self._partition == 'system' and self._all_partitions is None:
- sys.exit(
- 'All other partitions must be provided if generating output'
- ' for the system partition')
self._out_file = args['out_file']
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 9d67c49..80f8002 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -99,6 +99,9 @@
AVB_PARTITIONS = ('boot', 'dtbo', 'odm', 'product', 'product_services',
'recovery', 'system', 'vendor')
+# Chained VBMeta partitions.
+AVB_VBMETA_PARTITIONS = ('vbmeta_system', 'vbmeta_vendor')
+
# Partitions that should have their care_map added to META/care_map.pb
PARTITIONS_WITH_CARE_MAP = ('system', 'vendor', 'product', 'product_services',
'odm')
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index e8c3cf7..f900b12 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -27,11 +27,11 @@
--system-item-list system-item-list-file
The optional path to a newline-separated config file that replaces the
- contents of default_system_item_list if provided.
+ contents of DEFAULT_SYSTEM_ITEM_LIST if provided.
--system-misc-info-keys system-misc-info-keys-file
The optional path to a newline-separated config file that replaces the
- contents of default_system_misc_info_keys if provided.
+ contents of DEFAULT_SYSTEM_MISC_INFO_KEYS if provided.
--other-target-files other-target-files-zip-archive
The input target files package containing other bits. This is a zip
@@ -39,7 +39,7 @@
--other-item-list other-item-list-file
The optional path to a newline-separated config file that replaces the
- contents of default_other_item_list if provided.
+ contents of DEFAULT_OTHER_ITEM_LIST if provided.
--output-target-files output-target-files-package
If provided, the output merged target files package. Also a zip archive.
@@ -107,12 +107,12 @@
OPTIONS.rebuild_recovery = False
OPTIONS.keep_tmp = False
-# default_system_item_list is a list of items to extract from the partial
+# DEFAULT_SYSTEM_ITEM_LIST is a list of items to extract from the partial
# system target files package as is, meaning these items will land in the
# output target files package exactly as they appear in the input partial
# system target files package.
-default_system_item_list = [
+DEFAULT_SYSTEM_ITEM_LIST = (
'META/apkcerts.txt',
'META/filesystem_config.txt',
'META/root_filesystem_config.txt',
@@ -122,21 +122,19 @@
'PRODUCT/*',
'ROOT/*',
'SYSTEM/*',
-]
+)
-# system_extract_special_item_list is a list of items to extract from the
+# SYSTEM_EXTRACT_SPECIAL_ITEM_LIST is a list of items to extract from the
# partial system target files package that need some special processing, such
# as some sort of combination with items from the partial other target files
# package.
-system_extract_special_item_list = [
- 'META/*',
-]
+SYSTEM_EXTRACT_SPECIAL_ITEM_LIST = ('META/*',)
-# default_system_misc_info_keys is a list of keys to obtain from the system
+# DEFAULT_SYSTEM_MISC_INFO_KEYS is a list of keys to obtain from the system
# instance of META/misc_info.txt. The remaining keys from the other instance.
-default_system_misc_info_keys = [
+DEFAULT_SYSTEM_MISC_INFO_KEYS = (
'avb_system_hashtree_enable',
'avb_system_add_hashtree_footer_args',
'avb_system_key_path',
@@ -151,14 +149,14 @@
'ab_update',
'default_system_dev_certificate',
'system_size',
-]
+)
-# default_other_item_list is a list of items to extract from the partial
+# DEFAULT_OTHER_ITEM_LIST is a list of items to extract from the partial
# other target files package as is, meaning these items will land in the output
# target files package exactly as they appear in the input partial other target
# files package.
-default_other_item_list = [
+DEFAULT_OTHER_ITEM_LIST = (
'META/boot_filesystem_config.txt',
'META/otakeys.txt',
'META/releasetools.py',
@@ -172,16 +170,33 @@
'PREBUILT_IMAGES/*',
'RADIO/*',
'VENDOR/*',
-]
+)
-# other_extract_special_item_list is a list of items to extract from the
+# OTHER_EXTRACT_SPECIAL_ITEM_LIST is a list of items to extract from the
# partial other target files package that need some special processing, such as
# some sort of combination with items from the partial system target files
# package.
-other_extract_special_item_list = [
- 'META/*',
-]
+OTHER_EXTRACT_SPECIAL_ITEM_LIST = ('META/*',)
+
+# The merge config lists should not attempt to extract items from both
+# builds for any of the following partitions. The partitions in
+# SINGLE_BUILD_PARTITIONS should come entirely from a single build (either
+# system or other, but not both).
+
+SINGLE_BUILD_PARTITIONS = (
+ 'BOOT/',
+ 'DATA/',
+ 'ODM/',
+ 'PRODUCT/',
+ 'PRODUCT_SERVICES/',
+ 'RADIO/',
+ 'RECOVERY/',
+ 'ROOT/',
+ 'SYSTEM/',
+ 'SYSTEM_OTHER/',
+ 'VENDOR/',
+)
def write_sorted_data(data, path):
@@ -295,8 +310,10 @@
Returns:
False if a validation fails, otherwise true.
"""
- default_combined_item_set = set(default_system_item_list)
- default_combined_item_set.update(default_other_item_list)
+ has_error = False
+
+ default_combined_item_set = set(DEFAULT_SYSTEM_ITEM_LIST)
+ default_combined_item_set.update(DEFAULT_OTHER_ITEM_LIST)
combined_item_set = set(system_item_list)
combined_item_set.update(other_item_list)
@@ -309,15 +326,25 @@
logger.error('Please ensure missing items are in either the '
'system-item-list or other-item-list files provided to '
'this script.')
- return False
+ has_error = True
+
+ for partition in SINGLE_BUILD_PARTITIONS:
+ in_system = any(item.startswith(partition) for item in system_item_list)
+ in_other = any(item.startswith(partition) for item in other_item_list)
+ if in_system and in_other:
+ logger.error(
+ 'Cannot extract items from {0} for both the system and other builds. '
+ 'Please ensure only one merge config item list includes {0}.'.format(
+ partition))
+ has_error = True
if ('dynamic_partition_list' in system_misc_info_keys) or (
'super_partition_groups' in system_misc_info_keys):
logger.error('Dynamic partition misc info keys should come from '
'the other instance of META/misc_info.txt.')
- return False
+ has_error = True
- return True
+ return not has_error
def process_ab_partitions_txt(system_target_files_temp_dir,
@@ -619,18 +646,22 @@
def copy_file_contexts(system_target_files_dir, other_target_files_dir,
output_target_files_dir):
"""Creates named copies of each build's file_contexts.bin in output META/."""
- system_fc_path = os.path.join(system_target_files_dir, 'META', 'system_file_contexts.bin')
+ system_fc_path = os.path.join(system_target_files_dir, 'META',
+ 'system_file_contexts.bin')
if not os.path.exists(system_fc_path):
- system_fc_path = os.path.join(system_target_files_dir, 'META', 'file_contexts.bin')
+ system_fc_path = os.path.join(system_target_files_dir, 'META',
+ 'file_contexts.bin')
if not os.path.exists(system_fc_path):
raise ValueError('Missing system file_contexts.bin.')
shutil.copyfile(
system_fc_path,
os.path.join(output_target_files_dir, 'META', 'system_file_contexts.bin'))
- other_fc_path = os.path.join(other_target_files_dir, 'META', 'other_file_contexts.bin')
+ other_fc_path = os.path.join(other_target_files_dir, 'META',
+ 'other_file_contexts.bin')
if not os.path.exists(other_fc_path):
- other_fc_path = os.path.join(other_target_files_dir, 'META', 'file_contexts.bin')
+ other_fc_path = os.path.join(other_target_files_dir, 'META',
+ 'file_contexts.bin')
if not os.path.exists(other_fc_path):
raise ValueError('Missing other file_contexts.bin.')
shutil.copyfile(
@@ -776,7 +807,7 @@
extract_items(
target_files=system_target_files,
target_files_temp_dir=system_target_files_temp_dir,
- extract_item_list=system_extract_special_item_list)
+ extract_item_list=SYSTEM_EXTRACT_SPECIAL_ITEM_LIST)
# Extract "special" items from the input other partial target files package.
# We extract these items to different directory since they require special
@@ -785,7 +816,7 @@
extract_items(
target_files=other_target_files,
target_files_temp_dir=other_target_files_temp_dir,
- extract_item_list=other_extract_special_item_list)
+ extract_item_list=OTHER_EXTRACT_SPECIAL_ITEM_LIST)
# Now that the temporary directories contain all the extracted files, perform
# special case processing on any items that need it. After this function
@@ -1004,17 +1035,17 @@
if OPTIONS.system_item_list:
system_item_list = read_config_list(OPTIONS.system_item_list)
else:
- system_item_list = default_system_item_list
+ system_item_list = DEFAULT_SYSTEM_ITEM_LIST
if OPTIONS.system_misc_info_keys:
system_misc_info_keys = read_config_list(OPTIONS.system_misc_info_keys)
else:
- system_misc_info_keys = default_system_misc_info_keys
+ system_misc_info_keys = DEFAULT_SYSTEM_MISC_INFO_KEYS
if OPTIONS.other_item_list:
other_item_list = read_config_list(OPTIONS.other_item_list)
else:
- other_item_list = default_other_item_list
+ other_item_list = DEFAULT_OTHER_ITEM_LIST
if OPTIONS.output_item_list:
output_item_list = read_config_list(OPTIONS.output_item_list)
diff --git a/tools/releasetools/test_merge_target_files.py b/tools/releasetools/test_merge_target_files.py
index 1e29fde..978f679 100644
--- a/tools/releasetools/test_merge_target_files.py
+++ b/tools/releasetools/test_merge_target_files.py
@@ -19,9 +19,9 @@
import common
import test_utils
from merge_target_files import (read_config_list, validate_config_lists,
- default_system_item_list,
- default_other_item_list,
- default_system_misc_info_keys, copy_items,
+ DEFAULT_SYSTEM_ITEM_LIST,
+ DEFAULT_OTHER_ITEM_LIST,
+ DEFAULT_SYSTEM_MISC_INFO_KEYS, copy_items,
merge_dynamic_partition_info_dicts,
process_apex_keys_apk_certs_common)
@@ -101,35 +101,42 @@
self.assertItemsEqual(system_item_list, expected_system_item_list)
def test_validate_config_lists_ReturnsFalseIfMissingDefaultItem(self):
- system_item_list = default_system_item_list[:]
+ system_item_list = list(DEFAULT_SYSTEM_ITEM_LIST)
system_item_list.remove('SYSTEM/*')
self.assertFalse(
- validate_config_lists(system_item_list, default_system_misc_info_keys,
- default_other_item_list))
+ validate_config_lists(system_item_list, DEFAULT_SYSTEM_MISC_INFO_KEYS,
+ DEFAULT_OTHER_ITEM_LIST))
def test_validate_config_lists_ReturnsTrueIfDefaultItemInDifferentList(self):
- system_item_list = default_system_item_list[:]
+ system_item_list = list(DEFAULT_SYSTEM_ITEM_LIST)
system_item_list.remove('ROOT/*')
- other_item_list = default_other_item_list[:]
+ other_item_list = list(DEFAULT_OTHER_ITEM_LIST)
other_item_list.append('ROOT/*')
self.assertTrue(
- validate_config_lists(system_item_list, default_system_misc_info_keys,
+ validate_config_lists(system_item_list, DEFAULT_SYSTEM_MISC_INFO_KEYS,
other_item_list))
def test_validate_config_lists_ReturnsTrueIfExtraItem(self):
- system_item_list = default_system_item_list[:]
+ system_item_list = list(DEFAULT_SYSTEM_ITEM_LIST)
system_item_list.append('MY_NEW_PARTITION/*')
self.assertTrue(
- validate_config_lists(system_item_list, default_system_misc_info_keys,
- default_other_item_list))
+ validate_config_lists(system_item_list, DEFAULT_SYSTEM_MISC_INFO_KEYS,
+ DEFAULT_OTHER_ITEM_LIST))
+
+ def test_validate_config_lists_ReturnsFalseIfSharedExtractedPartition(self):
+ other_item_list = list(DEFAULT_OTHER_ITEM_LIST)
+ other_item_list.append('SYSTEM/my_system_file')
+ self.assertFalse(
+ validate_config_lists(DEFAULT_SYSTEM_ITEM_LIST,
+ DEFAULT_SYSTEM_MISC_INFO_KEYS, other_item_list))
def test_validate_config_lists_ReturnsFalseIfBadSystemMiscInfoKeys(self):
for bad_key in ['dynamic_partition_list', 'super_partition_groups']:
- system_misc_info_keys = default_system_misc_info_keys[:]
+ system_misc_info_keys = list(DEFAULT_SYSTEM_MISC_INFO_KEYS)
system_misc_info_keys.append(bad_key)
self.assertFalse(
- validate_config_lists(default_system_item_list, system_misc_info_keys,
- default_other_item_list))
+ validate_config_lists(DEFAULT_SYSTEM_ITEM_LIST, system_misc_info_keys,
+ DEFAULT_OTHER_ITEM_LIST))
def test_merge_dynamic_partition_info_dicts_ReturnsMergedDict(self):
system_dict = {
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 1c856a8..37d5d27 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -327,11 +327,14 @@
cmd = ['avbtool', 'verify_image', '--image', image, '--key', key]
# Append the args for chained partitions if any.
- for partition in common.AVB_PARTITIONS:
+ for partition in common.AVB_PARTITIONS + common.AVB_VBMETA_PARTITIONS:
key_name = 'avb_' + partition + '_key_path'
if info_dict.get(key_name) is not None:
+ # Use the key file from command line if specified; otherwise fall back
+ # to the one in info dict.
+ key_file = options.get(key_name, info_dict[key_name])
chained_partition_arg = common.GetAvbChainedPartitionArg(
- partition, info_dict, options[key_name])
+ partition, info_dict, key_file)
cmd.extend(["--expected_chain_partition", chained_partition_arg])
proc = common.Run(cmd)
@@ -357,7 +360,7 @@
help='the verity public key to verify the bootable images (Verified '
'Boot 1.0), or the vbmeta image (Verified Boot 2.0, aka AVB), where '
'applicable')
- for partition in common.AVB_PARTITIONS:
+ for partition in common.AVB_PARTITIONS + common.AVB_VBMETA_PARTITIONS:
parser.add_argument(
'--avb_' + partition + '_key_path',
help='the public or private key in PEM format to verify AVB chained '