summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/art63
-rw-r--r--tools/cpp-define-generator/globals.def1
-rw-r--r--tools/hiddenapi/hiddenapi.cc23
-rwxr-xr-xtools/run-jdwp-tests.sh5
-rwxr-xr-xtools/run-libcore-tests.sh3
5 files changed, 89 insertions, 6 deletions
diff --git a/tools/art b/tools/art
index eeb7c6872f..6e43863407 100644
--- a/tools/art
+++ b/tools/art
@@ -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)
diff --git a/tools/cpp-define-generator/globals.def b/tools/cpp-define-generator/globals.def
index 6443a0c517..10542622ac 100644
--- a/tools/cpp-define-generator/globals.def
+++ b/tools/cpp-define-generator/globals.def
@@ -26,6 +26,7 @@
#include "jit/jit.h"
#include "mirror/object.h"
#include "mirror/object_reference.h"
+#include "runtime_globals.h"
#include "stack.h"
#endif
diff --git a/tools/hiddenapi/hiddenapi.cc b/tools/hiddenapi/hiddenapi.cc
index 6af822d6b6..86e5f543a0 100644
--- a/tools/hiddenapi/hiddenapi.cc
+++ b/tools/hiddenapi/hiddenapi.cc
@@ -34,6 +34,8 @@
namespace art {
+const char kErrorHelp[] = "\nSee go/hiddenapi-error for help.";
+
static int original_argc;
static char** original_argv;
@@ -983,16 +985,27 @@ class HiddenApi final {
std::map<std::string, hiddenapi::ApiList> api_flag_map;
- for (std::string line; std::getline(api_file, line);) {
+ int line_number = 1;
+ for (std::string line; std::getline(api_file, line); line_number++) {
std::vector<std::string> values = android::base::Split(line, ",");
- CHECK_EQ(values.size(), 2u) << "Currently only signature and one flag are supported";
-
+ CHECK_GT(values.size(), 1u) << path << ":" << line_number << ": No flags found"
+ << kErrorHelp;
const std::string& signature = values[0];
- CHECK(api_flag_map.find(signature) == api_flag_map.end()) << "Duplicate entry: " << signature;
+
+ CHECK(api_flag_map.find(signature) == api_flag_map.end()) << "Duplicate entry in " << path
+ << ": " << signature << kErrorHelp;
+
+ int numFlags = values.size() - 1;
+
+ CHECK_EQ(numFlags, 1) << "\n" << path << ":" << line_number << "\n"
+ << signature << ": Expected one flag, found " << numFlags << ":\n"
+ << ::android::base::Join(std::vector<std::string>(values.begin() + 1, values.end()), ",")
+ << kErrorHelp;
const std::string& flag_str = values[1];
hiddenapi::ApiList membership = hiddenapi::ApiList::FromName(flag_str);
- CHECK(membership.IsValid()) << "Unknown ApiList name: " << flag_str;
+ CHECK(membership.IsValid()) << path << ":" << line_number << ": Unknown ApiList name: "
+ << flag_str << kErrorHelp;
api_flag_map.emplace(signature, membership);
}
diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh
index c7503bbd1b..ac9f09aa2d 100755
--- a/tools/run-jdwp-tests.sh
+++ b/tools/run-jdwp-tests.sh
@@ -125,6 +125,11 @@ while true; do
# Vogar knows which VM to use on host.
vm_command=""
shift
+ elif [[ "$1" == "--mode=device" ]]; then
+ # Remove the --mode=device from the arguments and replace it with --mode=device_testdex
+ args=${args/$1}
+ args="$args --mode=device_testdex"
+ shift
elif [[ "$1" == "--mode=jvm" ]]; then
mode="ri"
make_target_name="apache-harmony-jdwp-tests-host"
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index 68c4fd8563..ea7464ffed 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -125,6 +125,9 @@ device_mode=false
while true; do
if [[ "$1" == "--mode=device" ]]; then
device_mode=true
+ # Remove the --mode=device from the arguments and replace it with --mode=device_testdex
+ vogar_args=${vogar_args/$1}
+ vogar_args="$vogar_args --mode=device_testdex"
vogar_args="$vogar_args --vm-arg -Ximage:/data/art-test/core.art"
vogar_args="$vogar_args $(boot_classpath_arg /system/framework -testdex $BOOT_CLASSPATH_JARS)"
shift