diff options
author | Brian Carlstrom <bdc@google.com> | 2014-09-08 11:13:47 -0700 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-09 21:26:56 +0100 |
commit | 87bb26f87fe33da6d372b5d5e2ad14390c67c96f (patch) | |
tree | 2cfbf39ac54eccb79ca3ebf07000970f473e2fec | |
parent | 38510082135a7fb438afb515fa3174596e644e9b (diff) | |
download | art-87bb26f87fe33da6d372b5d5e2ad14390c67c96f.zip art-87bb26f87fe33da6d372b5d5e2ad14390c67c96f.tar.gz art-87bb26f87fe33da6d372b5d5e2ad14390c67c96f.tar.bz2 |
Remove art-* targets in favor of build-art-* targets.
- Build both archs version when available.
- Add --64 and --32 command line flags to the art script.
Change-Id: I037ec94670767f1761adb26f44aafc5592ea3a2b
-rw-r--r-- | Android.mk | 24 | ||||
-rw-r--r-- | tools/art | 31 |
2 files changed, 24 insertions, 31 deletions
@@ -123,6 +123,9 @@ ART_TARGET_DEPENDENCIES := \ ifdef TARGET_2ND_ARCH ART_TARGET_DEPENDENCIES += $(2ND_TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so endif +ifdef HOST_2ND_ARCH +ART_HOST_DEPENDENCIES += $(2ND_HOST_OUT_SHARED_LIBRARIES)/libjavacore.so +endif ######################################################################## # test rules @@ -349,27 +352,10 @@ oat-target-sync: oat-target build-art: build-art-host build-art-target .PHONY: build-art-host -build-art-host: $(ART_HOST_EXECUTABLES) $(ART_HOST_GTEST_EXECUTABLES) $(HOST_CORE_IMG_OUT) $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) +build-art-host: $(HOST_OUT_EXECUTABLES)/art $(ART_HOST_DEPENDENCIES) $(HOST_CORE_IMG_OUT) $(2ND_HOST_CORE_IMG_OUT) .PHONY: build-art-target -build-art-target: $(ART_TARGET_EXECUTABLES) $(ART_TARGET_GTEST_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so - -######################################################################## -# "m art-host" for just building the files needed to run the art script on the host. -.PHONY: art-host -ifeq ($(HOST_PREFER_32_BIT),true) -art-host: $(HOST_OUT_EXECUTABLES)/art $(HOST_OUT)/bin/dalvikvm32 $(HOST_OUT)/lib/libart.so $(HOST_OUT)/bin/dex2oat $(HOST_OUT)/bin/patchoat $(HOST_CORE_IMG_OUT) $(HOST_OUT)/lib/libjavacore.so $(HOST_OUT)/bin/dalvikvm -else -art-host: $(HOST_OUT_EXECUTABLES)/art $(HOST_OUT)/bin/dalvikvm64 $(HOST_OUT)/bin/dalvikvm32 $(HOST_OUT)/lib/libart.so $(HOST_OUT)/bin/dex2oat $(HOST_OUT)/bin/patchoat $(HOST_CORE_IMG_OUT) $(HOST_OUT)/lib/libjavacore.so $(HOST_OUT)/lib64/libjavacore.so $(HOST_OUT)/bin/dalvikvm -endif - -# "m art-target" for just building the files needed to run the art script on the target. -# Note that the script can run a dalvikvm executable that is not necessarily /system/bin/dalvikvm. -.PHONY: art-target -art-target: adb build-art-target art libnativehelper libjavacore - -.PHONY: art-host-debug -art-host-debug: art-host $(HOST_OUT)/lib/libartd.so $(HOST_OUT)/bin/dex2oatd $(HOST_OUT)/bin/patchoatd +build-art-target: $(TARGET_OUT_EXECUTABLES)/art $(ART_TARGET_DEPENDENCIES) $(TARGET_CORE_IMG_OUT) $(2ND_TARGET_CORE_IMG_OUT) ######################################################################## # targets to switch back and forth from libdvm to libart @@ -28,23 +28,16 @@ function follow_links() { } function find_libdir() { - if [ "$(readlink "$DALVIKVM_EXECUTABLE")" = "dalvikvm64" ]; then + if [ "$(readlink "$ANDROID_ROOT/bin/$DALVIKVM")" = "dalvikvm64" ]; then echo "lib64" else echo "lib" fi } -PROG_NAME="$(follow_links)" -PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" -ANDROID_ROOT=$PROG_DIR/.. -ANDROID_DATA=$PWD/android-data$$ -DALVIKVM_EXECUTABLE=$ANDROID_ROOT/bin/dalvikvm -LIBDIR=$(find_libdir) -LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBDIR - -lib=-XXlib:$ANDROID_ROOT/$LIBDIR/libart.so invoke_with= +DALVIKVM=dalvikvm +LIBART=libart.so while true; do if [ "$1" = "--invoke-with" ]; then @@ -52,7 +45,13 @@ while true; do invoke_with="$1" shift elif [ "$1" = "-d" ]; then - lib="-XXlib:$LIBDIR/libartd.so" + LIBART="libartd.so" + shift + elif [ "$1" = "--32" ]; then + DALVIKVM=dalvikvm32 + shift + elif [ "$1" = "--64" ]; then + DALVIKVM=dalvikvm64 shift elif expr "$1" : "--" >/dev/null 2>&1; then echo "unknown option: $1" 1>&2 @@ -62,11 +61,19 @@ while true; do fi done +PROG_NAME="$(follow_links)" +PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" +ANDROID_ROOT=$PROG_DIR/.. +ANDROID_DATA=$PWD/android-data$$ +LIBDIR=$(find_libdir) +LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBDIR + mkdir -p $ANDROID_DATA/dalvik-cache/{arm,arm64,x86,x86_64} ANDROID_DATA=$ANDROID_DATA \ ANDROID_ROOT=$ANDROID_ROOT \ LD_LIBRARY_PATH=$LD_LIBRARY_PATH \ - $invoke_with $DALVIKVM_EXECUTABLE $lib \ + $invoke_with $ANDROID_ROOT/bin/$DALVIKVM $lib \ + -XXlib:$LIBART \ -Ximage:$ANDROID_ROOT/framework/core.art \ "$@" EXIT_STATUS=$? |