summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-10-10 15:21:21 +0100
committer Vladimir Marko <vmarko@google.com> 2018-10-10 18:05:48 +0100
commit4519b9d28719a726c09ef8e02b00ea93ea9f6f03 (patch)
tree687ebaa5b5560017f67cc676b25c573d9aa434b0
parenta2da9b99fa1ea3d25d52da71308a623b2aae216c (diff)
Make the boot image always multi-image.
Deprecate the --multi-image option. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Bug: 77856493 Change-Id: I01fd02341cb4dc4fa75a388071694b51ba0bc5f7
-rw-r--r--build/Android.oat.mk38
-rw-r--r--dex2oat/dex2oat.cc28
-rwxr-xr-xtest/run-test10
-rwxr-xr-xtest/testrunner/testrunner.py4
4 files changed, 19 insertions, 61 deletions
diff --git a/build/Android.oat.mk b/build/Android.oat.mk
index 2824a099b2..e2adac1660 100644
--- a/build/Android.oat.mk
+++ b/build/Android.oat.mk
@@ -39,7 +39,6 @@ endif
# Use dex2oat debug version for better error reporting
# $(1): compiler - optimizing, interpreter or interp-ac (interpreter-access-checks).
# $(2): 2ND_ or undefined, 2ND_ for 32-bit host builds.
-# $(3): multi-image.
# NB depending on HOST_CORE_DEX_LOCATIONS so we are sure to have the dex files in frameworks for
# run-test --no-image
define create-core-oat-host-rules
@@ -66,25 +65,14 @@ define create-core-oat-host-rules
$$(error found $(1) expected interpreter, interp-ac, or optimizing)
endif
- # If $(3) is true, generate a multi-image.
- ifeq ($(3),true)
- core_multi_infix := -multi
- core_multi_param := --multi-image --no-inline-from=core-oj-hostdex.jar
- core_multi_group := _multi
- else
- core_multi_infix :=
- core_multi_param :=
- core_multi_group :=
- endif
-
- core_image_name := $($(2)HOST_CORE_IMG_OUT_BASE)$$(core_infix)$$(core_multi_infix)$(CORE_IMG_SUFFIX)
- core_oat_name := $($(2)HOST_CORE_OAT_OUT_BASE)$$(core_infix)$$(core_multi_infix)$(CORE_OAT_SUFFIX)
+ core_image_name := $($(2)HOST_CORE_IMG_OUT_BASE)$$(core_infix)$(CORE_IMG_SUFFIX)
+ core_oat_name := $($(2)HOST_CORE_OAT_OUT_BASE)$$(core_infix)$(CORE_OAT_SUFFIX)
# Using the bitness suffix makes it easier to add as a dependency for the run-test mk.
ifeq ($(2),)
- HOST_CORE_IMAGE_$(1)$$(core_multi_group)_64 := $$(core_image_name)
+ HOST_CORE_IMAGE_$(1)_64 := $$(core_image_name)
else
- HOST_CORE_IMAGE_$(1)$$(core_multi_group)_32 := $$(core_image_name)
+ HOST_CORE_IMAGE_$(1)_32 := $$(core_image_name)
endif
HOST_CORE_IMG_OUTS += $$(core_image_name)
HOST_CORE_OAT_OUTS += $$(core_oat_name)
@@ -92,7 +80,6 @@ define create-core-oat-host-rules
$$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options)
$$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name)
$$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name)
-$$(core_image_name): PRIVATE_CORE_MULTI_PARAM := $$(core_multi_param)
$$(core_image_name): $$(HOST_CORE_DEX_LOCATIONS) $$(core_dex2oat_dependency)
@echo "host dex2oat: $$@"
@mkdir -p $$(dir $$@)
@@ -106,7 +93,8 @@ $$(core_image_name): $$(HOST_CORE_DEX_LOCATIONS) $$(core_dex2oat_dependency)
--host --android-root=$$(HOST_OUT) \
--generate-debug-info --generate-build-id \
--runtime-arg -XX:SlowDebug=true \
- $$(PRIVATE_CORE_MULTI_PARAM) $$(PRIVATE_CORE_COMPILE_OPTIONS)
+ --no-inline-from=core-oj-hostdex.jar \
+ $$(PRIVATE_CORE_COMPILE_OPTIONS)
$$(core_oat_name): $$(core_image_name)
@@ -119,21 +107,17 @@ $$(core_oat_name): $$(core_image_name)
endef # create-core-oat-host-rules
# $(1): compiler - optimizing, interpreter or interp-ac (interpreter-access-checks).
-# $(2): multi-image.
define create-core-oat-host-rule-combination
- $(call create-core-oat-host-rules,$(1),,$(2))
+ $(call create-core-oat-host-rules,$(1),)
ifneq ($(HOST_PREFER_32_BIT),true)
- $(call create-core-oat-host-rules,$(1),2ND_,$(2))
+ $(call create-core-oat-host-rules,$(1),2ND_)
endif
endef
-$(eval $(call create-core-oat-host-rule-combination,optimizing,false))
-$(eval $(call create-core-oat-host-rule-combination,interpreter,false))
-$(eval $(call create-core-oat-host-rule-combination,interp-ac,false))
-$(eval $(call create-core-oat-host-rule-combination,optimizing,true))
-$(eval $(call create-core-oat-host-rule-combination,interpreter,true))
-$(eval $(call create-core-oat-host-rule-combination,interp-ac,true))
+$(eval $(call create-core-oat-host-rule-combination,optimizing))
+$(eval $(call create-core-oat-host-rule-combination,interpreter))
+$(eval $(call create-core-oat-host-rule-combination,interp-ac))
.PHONY: test-art-host-dex2oat-host
test-art-host-dex2oat-host: $(HOST_CORE_IMG_OUTS)
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 48d0b17927..71cdfd2c08 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -416,8 +416,7 @@ NO_RETURN static void Usage(const char* fmt, ...) {
UsageError(" --app-image-file=<file-name>: specify a file name for app image.");
UsageError(" Example: --app-image-file=/data/dalvik-cache/system@app@Calculator.apk.art");
UsageError("");
- UsageError(" --multi-image: specify that separate oat and image files be generated for each "
- "input dex file.");
+ UsageError(" --multi-image: obsolete, ignored");
UsageError("");
UsageError(" --force-determinism: force the compiler to emit a deterministic output.");
UsageError("");
@@ -634,7 +633,6 @@ class Dex2Oat final {
image_storage_mode_(ImageHeader::kStorageModeUncompressed),
passes_to_run_filename_(nullptr),
dirty_image_objects_filename_(nullptr),
- multi_image_(false),
is_host_(false),
elf_writers_(),
oat_writers_(),
@@ -914,20 +912,6 @@ class Dex2Oat final {
break;
}
- if (!IsBootImage() && multi_image_) {
- Usage("--multi-image can only be used when creating boot images");
- }
- if (IsBootImage() && multi_image_ && image_filenames_.size() > 1) {
- Usage("--multi-image cannot be used with multiple image names");
- }
-
- // For now, if we're on the host and compile the boot image, *always* use multiple image files.
- if (!kIsTargetBuild && IsBootImage()) {
- if (image_filenames_.size() == 1) {
- multi_image_ = true;
- }
- }
-
// Done with usage checks, enable watchdog if requested
if (parser_options->watch_dog_enabled) {
int64_t timeout = parser_options->watch_dog_timeout_in_ms > 0
@@ -973,7 +957,7 @@ class Dex2Oat final {
std::string base_oat = oat_filenames_[0];
size_t last_oat_slash = base_oat.rfind('/');
if (last_oat_slash == std::string::npos) {
- Usage("--multi-image used with unusable oat filename %s", base_oat.c_str());
+ Usage("Unusable boot image oat filename %s", base_oat.c_str());
}
// We also need to honor path components that were encoded through '@'. Otherwise the loading
// code won't be able to find the images.
@@ -985,7 +969,7 @@ class Dex2Oat final {
std::string base_img = image_filenames_[0];
size_t last_img_slash = base_img.rfind('/');
if (last_img_slash == std::string::npos) {
- Usage("--multi-image used with unusable image filename %s", base_img.c_str());
+ Usage("Unusable boot image filename %s", base_img.c_str());
}
// We also need to honor path components that were encoded through '@'. Otherwise the loading
// code won't be able to find the images.
@@ -1010,7 +994,7 @@ class Dex2Oat final {
base_symbol_oat = oat_unstripped_[0];
size_t last_symbol_oat_slash = base_symbol_oat.rfind('/');
if (last_symbol_oat_slash == std::string::npos) {
- Usage("--multi-image used with unusable symbol filename %s", base_symbol_oat.c_str());
+ Usage("Unusable boot image symbol filename %s", base_symbol_oat.c_str());
}
base_symbol_oat = base_symbol_oat.substr(0, last_symbol_oat_slash + 1);
}
@@ -1194,7 +1178,6 @@ class Dex2Oat final {
AssignTrueIfExists(args, M::Host, &is_host_);
AssignTrueIfExists(args, M::AvoidStoringInvocation, &avoid_storing_invocation_);
- AssignTrueIfExists(args, M::MultiImage, &multi_image_);
AssignIfExists(args, M::CopyDexFiles, &copy_dex_files_);
if (args.Exists(M::ForceDeterminism)) {
@@ -1258,7 +1241,7 @@ class Dex2Oat final {
PruneNonExistentDexFiles();
// Expand oat and image filenames for multi image.
- if (IsBootImage() && multi_image_) {
+ if (IsBootImage() && image_filenames_.size() == 1) {
ExpandOatAndImageFilenames();
}
@@ -2780,7 +2763,6 @@ class Dex2Oat final {
const char* dirty_image_objects_filename_;
std::unique_ptr<HashSet<std::string>> dirty_image_objects_;
std::unique_ptr<std::vector<std::string>> passes_to_run_;
- bool multi_image_;
bool is_host_;
std::string android_root_;
std::string no_inline_from_string_;
diff --git a/test/run-test b/test/run-test
index c6b88dc54f..4a4a64c764 100755
--- a/test/run-test
+++ b/test/run-test
@@ -156,7 +156,6 @@ strace="false"
always_clean="no"
never_clean="no"
have_image="yes"
-multi_image_suffix=""
android_root="/system"
bisection_search="no"
suspend_timeout="500000"
@@ -201,9 +200,6 @@ while true; do
elif [ "x$1" = "x--no-image" ]; then
have_image="no"
shift
- elif [ "x$1" = "x--multi-image" ]; then
- multi_image_suffix="-multi"
- shift
elif [ "x$1" = "x--relocate" ]; then
relocate="yes"
shift
@@ -587,12 +583,12 @@ if [ "$runtime" = "dalvik" ]; then
elif [ "$runtime" = "art" ]; then
if [ "$target_mode" = "no" ]; then
guess_host_arch_name
- run_args="${run_args} --boot ${ANDROID_HOST_OUT}/framework/core${image_suffix}${multi_image_suffix}.art"
+ run_args="${run_args} --boot ${ANDROID_HOST_OUT}/framework/core${image_suffix}.art"
run_args="${run_args} --runtime-option -Djava.library.path=${ANDROID_HOST_OUT}/lib${suffix64}:${ANDROID_HOST_OUT}/nativetest${suffix64}"
else
guess_target_arch_name
run_args="${run_args} --runtime-option -Djava.library.path=/data/nativetest${suffix64}/art/${target_arch_name}"
- run_args="${run_args} --boot /data/art-test/core${image_suffix}${multi_image_suffix}.art"
+ run_args="${run_args} --boot /data/art-test/core${image_suffix}.art"
fi
if [ "$relocate" = "yes" ]; then
run_args="${run_args} --relocate"
@@ -731,8 +727,6 @@ if [ "$usage" = "yes" ]; then
echo " --dex2oat-swap Use a dex2oat swap file."
echo " --instruction-set-features [string]"
echo " Set instruction-set-features for compilation."
- echo " --multi-image Use a set of images compiled with dex2oat multi-image for"
- echo " the boot class path."
echo " --quiet Don't print anything except failure messages"
echo " --bisection-search Perform bisection bug search."
echo " --vdex Test using vdex as in input to dex2oat. Only works with --prebuild."
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 45c3f88ecf..d1ba93f396 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -142,7 +142,7 @@ def gather_test_info():
VARIANT_TYPE_DICT['run'] = {'ndebug', 'debug'}
VARIANT_TYPE_DICT['target'] = {'target', 'host', 'jvm'}
VARIANT_TYPE_DICT['trace'] = {'trace', 'ntrace', 'stream'}
- VARIANT_TYPE_DICT['image'] = {'picimage', 'no-image', 'multipicimage'}
+ VARIANT_TYPE_DICT['image'] = {'picimage', 'no-image'}
VARIANT_TYPE_DICT['debuggable'] = {'ndebuggable', 'debuggable'}
VARIANT_TYPE_DICT['gc'] = {'gcstress', 'gcverify', 'cms'}
VARIANT_TYPE_DICT['prebuild'] = {'no-prebuild', 'prebuild'}
@@ -458,8 +458,6 @@ def run_tests(tests):
if image == 'no-image':
options_test += ' --no-image'
- elif image == 'multipicimage':
- options_test += ' --multi-image'
if debuggable == 'debuggable':
options_test += ' --debuggable'