Merge "Warn about the use of `COVERAGE_PATHS` and `COVERAGE_EXCLUDE_PATHS`."
diff --git a/core/Makefile b/core/Makefile
index 39b3b95..db42af9 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -206,7 +206,7 @@
define copy-and-strip-kernel-module
$(2): $(1)
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) -o $(2) --strip-debug $(1)
+ $(LLVM_STRIP) -o $(2) --strip-debug $(1)
endef
# $(1): modules list
@@ -813,7 +813,7 @@
$(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES))
-INTERNAL_VENDOR_RAMDISK_TARGET := $(call intermediates-dir-for,PACKAGING,vendor-boot)/vendor-ramdisk.cpio.gz
+INTERNAL_VENDOR_RAMDISK_TARGET := $(call intermediates-dir-for,PACKAGING,vendor-boot)/vendor-ramdisk.cpio$(RAMDISK_EXT)
$(INTERNAL_VENDOR_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_VENDOR_RAMDISK_FILES) | $(COMPRESSION_COMMAND_DEPS)
$(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_VENDOR_RAMDISK_OUT) | $(COMPRESSION_COMMAND) > $@
@@ -1201,6 +1201,10 @@
$(if $(PRODUCT_SYSTEM_HEADROOM),$(hide) echo "system_headroom=$(PRODUCT_SYSTEM_HEADROOM)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "system_reserved_size=$(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
$(hide) echo "system_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_system_image=$(BUILDING_SYSTEM_IMAGE)" >> $(1)
+)
+$(if $(filter $(2),system_other),\
+ $(hide) echo "building_system_other_image=$(BUILDING_SYSTEM_OTHER_IMAGE)" >> $(1)
)
$(if $(filter $(2),userdata),\
$(if $(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "userdata_fs_type=$(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
@@ -1208,11 +1212,13 @@
$(if $(PRODUCT_FS_CASEFOLD),$(hide) echo "needs_casefold=$(PRODUCT_FS_CASEFOLD)" >> $(1))
$(if $(PRODUCT_QUOTA_PROJID),$(hide) echo "needs_projid=$(PRODUCT_QUOTA_PROJID)" >> $(1))
$(hide) echo "userdata_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_userdata_image=$(BUILDING_USERDATA_IMAGE)" >> $(1)
)
$(if $(filter $(2),cache),\
$(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1))
$(hide) echo "cache_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_cache_image=$(BUILDING_CACHE_IMAGE)" >> $(1)
)
$(if $(filter $(2),vendor),\
$(if $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "vendor_fs_type=$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
@@ -1227,6 +1233,7 @@
$(if $(PRODUCT_VENDOR_BASE_FS_PATH),$(hide) echo "vendor_base_fs_file=$(PRODUCT_VENDOR_BASE_FS_PATH)" >> $(1))
$(if $(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "vendor_reserved_size=$(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
$(hide) echo "vendor_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_vendor_image=$(BUILDING_VENDOR_IMAGE)" >> $(1)
)
$(if $(filter $(2),product),\
$(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "product_fs_type=$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
@@ -1241,6 +1248,7 @@
$(if $(PRODUCT_PRODUCT_BASE_FS_PATH),$(hide) echo "product_base_fs_file=$(PRODUCT_PRODUCT_BASE_FS_PATH)" >> $(1))
$(if $(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "product_reserved_size=$(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
$(hide) echo "product_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_product_image=$(BUILDING_PRODUCT_IMAGE)" >> $(1)
)
$(if $(filter $(2),system_ext),\
$(if $(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_ext_fs_type=$(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
@@ -1254,6 +1262,7 @@
$(if $(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "system_ext_squashfs_disable_4k_align=$(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1))
$(if $(BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "system_ext_reserved_size=$(BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
$(hide) echo "system_ext_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_system_ext_image=$(BUILDING_SYSTEM_EXT_IMAGE)" >> $(1)
)
$(if $(filter $(2),odm),\
$(if $(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "odm_fs_type=$(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
@@ -1268,6 +1277,7 @@
$(if $(PRODUCT_ODM_BASE_FS_PATH),$(hide) echo "odm_base_fs_file=$(PRODUCT_ODM_BASE_FS_PATH)" >> $(1))
$(if $(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "odm_reserved_size=$(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
$(hide) echo "odm_selinux_fc=$(SELINUX_FC)" >> $(1)
+ $(hide) echo "building_odm_image=$(BUILDING_ODM_IMAGE)" >> $(1)
)
$(if $(filter $(2),oem),\
$(if $(BOARD_OEMIMAGE_PARTITION_SIZE),$(hide) echo "oem_size=$(BOARD_OEMIMAGE_PARTITION_SIZE)" >> $(1))
@@ -1362,6 +1372,9 @@
ifdef BUILDING_SYSTEM_IMAGE
PROP_DICTIONARY_IMAGES += system
endif
+ifdef BUILDING_SYSTEM_OTHER_IMAGE
+ PROP_DICTIONARY_IMAGES += system_other
+endif
ifdef BUILDING_USERDATA_IMAGE
PROP_DICTIONARY_IMAGES += userdata
endif
@@ -3057,6 +3070,9 @@
# configured as a chained partition, if BOARD_AVB_<partition>_KEY_PATH is defined. Otherwise the
# image descriptor will be included into vbmeta.img, unless it has been already added to any chained
# VBMeta image.
+# Multiple boot images can be generated based on BOARD_KERNEL_BINARIES
+# but vbmeta would capture the image descriptor of only the first boot
+# image specified in BUILT_BOOTIMAGE_TARGET.
# $(1): Partition name, e.g. boot or system.
define check-and-set-avb-args
$(eval _in_chained_vbmeta := $(filter $(1),$(INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES)))
@@ -3065,8 +3081,11 @@
$(error Chaining partition "$(1)" in chained VBMeta image is not supported)) \
$(call _check-and-set-avb-chain-args,$(1)),\
$(if $(_in_chained_vbmeta),,\
- $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
- --include_descriptors_from_image $(call images-for-partitions,$(1)))))
+ $(if $(filter boot,$(1)),\
+ $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
+ --include_descriptors_from_image $(firstword $(call images-for-partitions,$(1)))),\
+ $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
+ --include_descriptors_from_image $(call images-for-partitions,$(1))))))
endef
# Checks and sets build variables for a custom chained partition to include it into vbmeta.img.
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 9818d60..d604480 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -452,12 +452,33 @@
# Set up phony targets that covers all modules under the given paths.
# This allows us to build everything in given paths by running mmma/mma.
-my_path_components := $(subst /,$(space),$(LOCAL_PATH))
-my_path_prefix := MODULES-IN
-$(foreach c, $(my_path_components),\
- $(eval my_path_prefix := $(my_path_prefix)-$(c))\
- $(eval .PHONY : $(my_path_prefix))\
- $(eval $(my_path_prefix) : $(my_all_targets)))
+define my_path_comp
+parent := $(patsubst %/,%,$(dir $(1)))
+parent_target := MODULES-IN-$$(subst /,-,$$(parent))
+.PHONY: $$(parent_target)
+$$(parent_target): $(2)
+ifndef $$(parent_target)
+ $$(parent_target) := true
+ ifneq (,$$(findstring /,$$(parent)))
+ $$(eval $$(call my_path_comp,$$(parent),$$(parent_target)))
+ endif
+endif
+endef
+
+_local_path := $(patsubst %/,%,$(LOCAL_PATH))
+_local_path_target := MODULES-IN-$(subst /,-,$(_local_path))
+
+.PHONY: $(_local_path_target)
+$(_local_path_target): $(my_register_name)
+
+ifndef $(_local_path_target)
+ $(_local_path_target) := true
+ $(eval $(call my_path_comp,$(_local_path),$(_local_path_target)))
+endif
+
+_local_path :=
+_local_path_target :=
+my_path_comp :=
###########################################################
## Module installation rule
diff --git a/core/config.mk b/core/config.mk
index 504e5d5..2ec0cfd 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -675,7 +675,7 @@
# Path to tools.jar
HOST_JDK_TOOLS_JAR := $(ANDROID_JAVA8_HOME)/lib/tools.jar
-APICHECK_COMMAND := $(JAVA) -Xmx4g -jar $(APICHECK) --no-banner --compatible-output=yes
+APICHECK_COMMAND := $(JAVA) -Xmx4g -jar $(APICHECK) --no-banner --compatible-output=no
# Boolean variable determining if the allow list for compatible properties is enabled
PRODUCT_COMPATIBLE_PROPERTY := false
diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk
index 30bcc2c..289d16f 100644
--- a/core/install_jni_libs_internal.mk
+++ b/core/install_jni_libs_internal.mk
@@ -57,9 +57,9 @@
# Make sure the JNI libraries get installed
my_shared_library_path := $(call get_non_asan_path,\
$($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES))
- my_installed_library := $(addprefix $(my_shared_library_path)/, $(my_jni_filenames))
- ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed_library)
+ bit_suffix := $(if $(filter %64,$(TARGET_$(my_2nd_arch_prefix)ARCH)),:64,:32)
+ ALL_MODULES.$(my_register_name).REQUIRED_FROM_TARGET += $(addsuffix $(bit_suffix),$(LOCAL_JNI_SHARED_LIBRARIES))
# Create symlink in the app specific lib path
# Skip creating this symlink when running the second part of a target sanitization build.
diff --git a/core/line_coverage.mk b/core/line_coverage.mk
index b920e28..babcb30 100644
--- a/core/line_coverage.mk
+++ b/core/line_coverage.mk
@@ -8,8 +8,7 @@
# packs them into another zip file called `line_coverage_profiles.zip`.
#
# To run the make target set the coverage related envvars first:
-# NATIVE_LINE_COVERAGE=true NATIVE_COVERAGE=true \
-# NATIVE_COVERAGE_PATHS=* make haiku-line-coverage
+# NATIVE_COVERAGE=true NATIVE_COVERAGE_PATHS=* make haiku-line-coverage
# -----------------------------------------------------------------
# TODO(b/148306195): Due this issue some fuzz targets cannot be built with
@@ -47,7 +46,6 @@
libinputflinger \
libopus \
libstagefright \
- libunwind \
libvixl:com.android.art.debug
# Use the intermediates directory to avoid installing libraries to the device.
@@ -68,7 +66,7 @@
fuzz_target_inputs := $(foreach fuzz,$(fuzz_targets), \
$(call intermediates-dir-for,EXECUTABLES,$(fuzz))/$(fuzz))
-# When line coverage is enabled (NATIVE_LINE_COVERAGE is set), make creates
+# When coverage is enabled (NATIVE_COVERAGE is set), make creates
# a "coverage" directory and stores all profile (*.gcno) files in inside.
# We need everything that is stored inside this directory.
$(line_coverage_profiles): $(fuzz_target_inputs)
diff --git a/core/main.mk b/core/main.mk
index 582f422..8738fd0 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1713,6 +1713,11 @@
$(call dist-for-goals, dist_files, $(api_xmls))
api_xmls :=
+ ifdef CLANG_COVERAGE
+ $(foreach f,$(SOONG_NDK_API_XML), \
+ $(call dist-for-goals,droidcore,$(f):ndk_apis/$(notdir $(f))))
+ endif
+
# Building a full system-- the default is to build droidcore
droid_targets: droidcore dist_files
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 1ed81d7..b9e7a27 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -40,6 +40,7 @@
$(call add_json_bool, Allow_missing_dependencies, $(ALLOW_MISSING_DEPENDENCIES))
$(call add_json_bool, Unbundled_build, $(TARGET_BUILD_UNBUNDLED))
+$(call add_json_bool, Unbundled_build_apps, $(TARGET_BUILD_APPS))
$(call add_json_bool, Unbundled_build_sdks_from_source, $(UNBUNDLED_BUILD_SDKS_FROM_SOURCE))
$(call add_json_bool, Pdk, $(filter true,$(TARGET_BUILD_PDK)))
@@ -110,8 +111,10 @@
$(call add_json_bool, ClangTidy, $(filter 1 true,$(WITH_TIDY)))
$(call add_json_str, TidyChecks, $(WITH_TIDY_CHECKS))
-$(call add_json_bool, NativeLineCoverage, $(filter true,$(NATIVE_LINE_COVERAGE)))
-$(call add_json_bool, Native_coverage, $(filter true,$(NATIVE_COVERAGE)))
+$(call add_json_list, JavaCoveragePaths, $(JAVA_COVERAGE_PATHS))
+$(call add_json_list, JavaCoverageExcludePaths, $(JAVA_COVERAGE_EXCLUDE_PATHS))
+
+$(call add_json_bool, GcovCoverage, $(filter true,$(NATIVE_COVERAGE)))
$(call add_json_bool, ClangCoverage, $(filter true,$(CLANG_COVERAGE)))
# TODO(b/158212027): Remove `$(COVERAGE_PATHS)` from this list when all users have been moved to
# `NATIVE_COVERAGE_PATHS`.
diff --git a/core/tasks/check_boot_jars/check_boot_jars.py b/core/tasks/check_boot_jars/check_boot_jars.py
index 6904a77..cf4ef27 100755
--- a/core/tasks/check_boot_jars/check_boot_jars.py
+++ b/core/tasks/check_boot_jars/check_boot_jars.py
@@ -49,8 +49,10 @@
if p.returncode != 0:
return False
items = stdout.split()
+ classes = 0
for f in items:
if f.endswith('.class'):
+ classes += 1
package_name = os.path.dirname(f)
package_name = package_name.replace('/', '.')
if not package_name or not allow_list_re.match(package_name):
@@ -58,6 +60,9 @@
' not in the allow list %s of packages allowed on the bootclasspath.'
% (jar, f, package_name, allow_list_path))
return False
+ if classes == 0:
+ print >> sys.stderr, ('Error: %s does not contain any class files.' % jar)
+ return False
return True
diff --git a/core/tasks/general-tests.mk b/core/tasks/general-tests.mk
index cb84a5c..a820a28 100644
--- a/core/tasks/general-tests.mk
+++ b/core/tasks/general-tests.mk
@@ -14,12 +14,10 @@
.PHONY: general-tests
-# TODO(b/149249068): Remove vts10-tradefed.jar after all VTS tests are converted
general_tests_tools := \
$(HOST_OUT_JAVA_LIBRARIES)/cts-tradefed.jar \
$(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \
$(HOST_OUT_JAVA_LIBRARIES)/vts-tradefed.jar \
- $(HOST_OUT_JAVA_LIBRARIES)/vts10-tradefed.jar
intermediates_dir := $(call intermediates-dir-for,PACKAGING,general-tests)
general_tests_zip := $(PRODUCT_OUT)/general-tests.zip
diff --git a/target/product/gsi/gsi_skip_mount.cfg b/target/product/gsi/gsi_skip_mount.cfg
index 3f812cb..ad3c7d9 100644
--- a/target/product/gsi/gsi_skip_mount.cfg
+++ b/target/product/gsi/gsi_skip_mount.cfg
@@ -1,2 +1,3 @@
+/oem
/product
/system_ext
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
old mode 100755
new mode 100644
index 490b44a..723fe94
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -741,23 +741,32 @@
# target_files.zip as a prebuilt blob. We consider either of them as
# {vendor,product,system_ext}.img being available, which could be
# used when generating vbmeta.img for AVB.
- has_vendor = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) or
- os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES",
- "vendor.img")))
- has_odm = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "ODM")) or
- os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES",
- "odm.img")))
- has_product = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "PRODUCT")) or
- os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES",
- "product.img")))
- has_system_ext = (os.path.isdir(os.path.join(OPTIONS.input_tmp,
- "SYSTEM_EXT")) or
- os.path.exists(os.path.join(OPTIONS.input_tmp,
- "IMAGES",
- "system_ext.img")))
- has_system = os.path.isdir(os.path.join(OPTIONS.input_tmp, "SYSTEM"))
- has_system_other = os.path.isdir(os.path.join(OPTIONS.input_tmp,
- "SYSTEM_OTHER"))
+ has_vendor = ((os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) and
+ OPTIONS.info_dict.get("building_vendor_image") == "true") or
+ os.path.exists(
+ os.path.join(OPTIONS.input_tmp, "IMAGES", "vendor.img")))
+ has_odm = ((os.path.isdir(os.path.join(OPTIONS.input_tmp, "ODM")) and
+ OPTIONS.info_dict.get("building_odm_image") == "true") or
+ os.path.exists(
+ os.path.join(OPTIONS.input_tmp, "IMAGES", "odm.img")))
+ has_product = ((os.path.isdir(os.path.join(OPTIONS.input_tmp, "PRODUCT")) and
+ OPTIONS.info_dict.get("building_product_image") == "true") or
+ os.path.exists(
+ os.path.join(OPTIONS.input_tmp, "IMAGES", "product.img")))
+ has_system_ext = (
+ (os.path.isdir(os.path.join(OPTIONS.input_tmp, "SYSTEM_EXT")) and
+ OPTIONS.info_dict.get("building_system_ext_image") == "true") or
+ os.path.exists(
+ os.path.join(OPTIONS.input_tmp, "IMAGES", "system_ext.img")))
+ has_system = (
+ os.path.isdir(os.path.join(OPTIONS.input_tmp, "SYSTEM")) and
+ OPTIONS.info_dict.get("building_system_image") == "true")
+
+ has_system_other = (
+ os.path.isdir(os.path.join(OPTIONS.input_tmp, "SYSTEM_OTHER")) and
+ OPTIONS.info_dict.get("building_system_other_image") == "true")
+ has_userdata = OPTIONS.info_dict.get("building_userdata_image") == "true"
+ has_cache = OPTIONS.info_dict.get("building_cache_image") == "true"
# Set up the output destination. It writes to the given directory for dir
# mode; otherwise appends to the given ZIP.
@@ -788,16 +797,16 @@
boot_images = OPTIONS.info_dict.get("boot_images")
if boot_images is None:
boot_images = "boot.img"
- for b in boot_images.split():
+ for index,b in enumerate(boot_images.split()):
# common.GetBootableImage() returns the image directly if present.
boot_image = common.GetBootableImage(
"IMAGES/" + b, b, OPTIONS.input_tmp, "BOOT")
# boot.img may be unavailable in some targets (e.g. aosp_arm64).
if boot_image:
boot_image_path = os.path.join(OPTIONS.input_tmp, "IMAGES", b)
- # vbmeta does not need to include boot.img with multiple boot.img files,
- # which is only used for aosp_arm64 for GKI
- if len(boot_images.split()) == 1:
+ # Although multiple boot images can be generated, include the image
+ # descriptor of only the first boot image in vbmeta
+ if index == 0:
partitions['boot'] = boot_image_path
if not os.path.exists(boot_image_path):
boot_image.WriteToDir(OPTIONS.input_tmp)
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index d9d3854..ed42b20 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -175,6 +175,9 @@
'ab_update',
'default_system_dev_certificate',
'system_size',
+ 'building_system_image',
+ 'building_system_ext_image',
+ 'building_product_image',
)
# DEFAULT_VENDOR_ITEM_LIST is a list of items to extract from the partial