diff options
author | 2019-01-09 09:14:10 +0000 | |
---|---|---|
committer | 2019-01-09 09:14:10 +0000 | |
commit | 458a948d4fc954d767103b5a95803a0a60be9f1c (patch) | |
tree | c36714f1762d406001a24d8479a05116ab2d2ab7 | |
parent | 2fb49ebea175b7ec047da6944eede43317df8686 (diff) | |
parent | bf68e573dc9fcf57ebc34d68bf16e71e90e770b7 (diff) |
Merge "Revert "Move conscrypt back to core image to unblock Golem.""
-rw-r--r-- | build/Android.common_path.mk | 5 | ||||
-rw-r--r-- | tools/art | 63 |
2 files changed, 64 insertions, 4 deletions
diff --git a/build/Android.common_path.mk b/build/Android.common_path.mk index c73b988b54..5208d64ff3 100644 --- a/build/Android.common_path.mk +++ b/build/Android.common_path.mk @@ -74,8 +74,7 @@ HOST_CORE_IMG_LOCATION := $(HOST_OUT_JAVA_LIBRARIES)/core.art TARGET_CORE_IMG_LOCATION := $(ART_TARGET_TEST_OUT)/core.art # Modules to compile for core.art. -# TODO: Move conscrypt from CORE_IMG_JARS to TEST_CORE_JARS and adjust scripts to fix Golem. -CORE_IMG_JARS := core-oj core-libart core-simple okhttp bouncycastle apache-xml conscrypt +CORE_IMG_JARS := core-oj core-libart core-simple okhttp bouncycastle apache-xml HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS)) TARGET_CORE_IMG_JARS := $(addsuffix -testdex,$(CORE_IMG_JARS)) HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) @@ -88,7 +87,7 @@ HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call interm TARGET_CORE_IMG_DEX_FILES := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar) # Jar files for the boot class path for testing. Must start with CORE_IMG_JARS. -TEST_CORE_JARS := $(CORE_IMG_JARS) +TEST_CORE_JARS := $(CORE_IMG_JARS) conscrypt HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(TEST_CORE_JARS)) TARGET_TEST_CORE_JARS := $(addsuffix -testdex,$(TEST_CORE_JARS)) HOST_CORE_DEX_LOCATIONS := $(foreach jar,$(HOST_TEST_CORE_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) @@ -222,6 +222,8 @@ function run_dex2oat() { # -Xcompiler-options arguments are stored in DEX2OAT_FLAGS array # -cp argument is split by ':' and stored in DEX2OAT_CLASSPATH # -Ximage argument is stored in DEX2OAT_BOOT_IMAGE +# -Xbootclasspath argument is stored in DEX2OAT_BCP +# -Xbootclasspath-locations argument is stored in DEX2OAT_BCP_LOCS function extract_dex2oat_flags() { while [ $# -gt 0 ]; do case $1 in @@ -234,6 +236,16 @@ function extract_dex2oat_flags() { # Remove '-Ximage:' from the argument. DEX2OAT_BOOT_IMAGE=${DEX2OAT_BOOT_IMAGE##-Ximage:} ;; + -Xbootclasspath:*) + DEX2OAT_BCP=$1 + # Remove '-Xbootclasspath:' from the argument. + DEX2OAT_BCP=${DEX2OAT_BCP##-Xbootclasspath:} + ;; + -Xbootclasspath-locations:*) + DEX2OAT_BCP_LOCS=$1 + # Remove '-Xbootclasspath-locations:' from the argument. + DEX2OAT_BCP_LOCS=${DEX2OAT_BCP_LOCS##-Xbootclasspath-locations:} + ;; -cp) # Reset any previously parsed classpath, just like dalvikvm # only supports one -cp argument. @@ -386,7 +398,7 @@ while [ -h "$PROG_NAME" ]; do done PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" -ANDROID_ROOT=$PROG_DIR/.. +ANDROID_ROOT="$(cd $PROG_DIR/..; pwd -P)" ANDROID_RUNTIME_ROOT=$ANDROID_ROOT/com.android.runtime ART_BINARY_PATH=$ANDROID_ROOT/bin/$ART_BINARY @@ -439,6 +451,55 @@ if [ "$ANDROID_DATA" = "/data" ] || [ "$ANDROID_DATA" = "" ]; then DELETE_ANDROID_DATA="yes" fi +if [[ "$DEX2OAT_BCP" = "" && "$DEX2OAT_BCP_LOCS" != "" ]]; then + echo "Cannot use -Xbootclasspath-locations without -Xbootclasspath" + exit 1 +fi + +if [[ "$DEX2OAT_BOOT_IMAGE" = *core.art && "$DEX2OAT_BCP" = "" ]]; then + # Note: This must start with the CORE_IMG_JARS in Android.common_path.mk + # because that's what we use for compiling the core.art image. + # It may contain additional modules from TEST_CORE_JARS. + core_jars_list="core-oj core-libart core-simple okhttp bouncycastle apache-xml conscrypt" + core_jars_suffix= + if [[ -e $ANDROID_ROOT/framework/core-oj-hostdex.jar ]]; then + core_jars_suffix=-hostdex + core_locations_dir=$ANDROID_ROOT/framework + prefix=$PWD/ + if [[ ${core_locations_dir:0:${#prefix}} = $prefix ]]; then + core_locations_dir="${core_locations_dir##$prefix}" + fi + elif [[ -e $ANDROID_ROOT/framework/core-oj-testdex.jar ]]; then + core_jars_suffix=-testdex + core_locations_dir=/system/framework + fi + if [[ $core_jars_suffix != "" ]]; then + boot_separator="" + for boot_module in ${core_jars_list}; do + DEX_FILENAME="$boot_module$core_jars_suffix.jar" + DEX2OAT_BCP+="$boot_separator$ANDROID_ROOT/framework/${DEX_FILENAME}" + DEX2OAT_BCP_LOCS+="$boot_separator$core_locations_dir/${DEX_FILENAME}" + boot_separator=":" + done + if [ "$VERBOSE" = "yes" ]; then + echo "Using predefined -Xbootclasspath for image $DEX2OAT_BOOT_IMAGE:" + echo DEX2OAT_BOOT_IMAGE=$DEX2OAT_BOOT_IMAGE + echo DEX2OAT_BCP=$DEX2OAT_BCP + echo DEX2OAT_BCP_LOCS=$DEX2OAT_BCP_LOCS + fi + fi +fi + +if [ "$DEX2OAT_BCP" != "" ]; then + EXTRA_OPTIONS+=("-Xbootclasspath:$DEX2OAT_BCP") + DEX2OAT_FLAGS+=("--runtime-arg" "-Xbootclasspath:$DEX2OAT_BCP") + if [ "$DEX2OAT_BCP_LOCS" != "" ]; then + EXTRA_OPTIONS+=("-Xbootclasspath-locations:$DEX2OAT_BCP_LOCS") + DEX2OAT_FLAGS+=("--runtime-arg" \ + "-Xbootclasspath-locations:$DEX2OAT_BCP_LOCS") + fi +fi + if [ "$PERF" != "" ]; then LAUNCH_WRAPPER="perf record -g --call-graph dwarf -F 10000 -o $ANDROID_DATA/perf.data -e cycles:u $LAUNCH_WRAPPER" DEX2OAT_FLAGS+=(--generate-debug-info) |