diff --git a/Makefile b/Makefile index c92175eb9a5ac4cd9c9fa98e426dccaf3e2fc0e3..6d2dbaca704ea176d0a3bff75a50be93a6482e46 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,9 @@ install: maple dex2mpl_install irbuild rsync -a -L $(MAPLE_BIN_DIR)/java2jar $(INSTALL_DIR)/bin/; \ rsync -a -L $(MAPLE_BIN_DIR)/jbc2mpl $(INSTALL_DIR)/bin/;) +.PHONY: all +all: install mplfe libcore + ifeq ($(OPS_ANDROID),0) .PHONY: dex2mpl_install dex2mpl_install: diff --git a/build/envsetup.sh b/build/envsetup.sh index c70616c9eb0815fbc2d6f5bcebe5d7b4f2a266ef..25e438e8f53a30b98e197d02ea4e8bde88c7cd9f 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -41,6 +41,9 @@ fi export GCOV_PREFIX=${MAPLE_ROOT}/report/gcda export GCOV_PREFIX_STRIP=7 +# display OS version +lsb_release -d + OS_VERSION=`lsb_release -r | sed -e "s/^[^0-9]*//" -e "s/\..*//"` if [ "$OS_VERSION" = "16" ] || [ "$OS_VERSION" = "18" ]; then OLD_OS=1 @@ -112,6 +115,7 @@ export TARGET_TOOLCHAIN=clang unset MAPLE_BUILD_TYPE export MAPLE_BUILD_TYPE=${TARGET_PROCESSOR}-${TARGET_TOOLCHAIN}-${TARGET_SCOPE} +echo "Build: $MAPLE_BUILD_TYPE" unset MAPLE_BUILD_OUTPUT export MAPLE_BUILD_OUTPUT=${MAPLE_ROOT}/output/${MAPLE_BUILD_TYPE} @@ -120,3 +124,9 @@ unset MAPLE_EXECUTE_BIN export MAPLE_EXECUTE_BIN=${MAPLE_ROOT}/output/${MAPLE_BUILD_TYPE}/bin export PATH=$PATH:${MAPLE_EXECUTE_BIN} + +if [ ! -f $MAPLE_ROOT/tools/qemu/package/usr/bin/qemu-aarch64 ] && [ "$OLD_OS" = "0" ]; then + echo " " + echo "!!! please run \"make setup\" to get proper qemu-aarch64" + echo " " +fi diff --git a/build/jenkins/main.sh b/build/jenkins/main.sh old mode 100644 new mode 100755 index 7763aa4023013a6514e446c19843585a4ee68f7c..f128a23c5c84da29a357b98cc77e37961785e450 --- a/build/jenkins/main.sh +++ b/build/jenkins/main.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + # Note:copy main.sh to the MAPLE_ROOT directory. sample_list="exceptiontest helloworld iteratorandtemplate polymorphismtest rccycletest threadtest" @@ -7,63 +9,28 @@ opt=O2 function debug_test { source build/envsetup.sh arm debug - make clean - make - if [[ $? != 0 ]]; then - exit 1 - fi - make irbuild - if [[ $? != 0 ]]; then - exit 1 - fi - make mplfe - if [[ $? != 0 ]]; then - exit 1 - fi } function release_test { source build/envsetup.sh arm release make clean - make - if [[ $? != 0 ]]; then - exit 1 - fi - make irbuild - if [[ $? != 0 ]]; then - exit 1 - fi - make mplfe - if [[ $? != 0 ]]; then - exit 1 - fi - make libcore OPT=${opt} - if [[ $? != 0 ]]; then - exit 1 - fi for dir in $sample_list do cd $MAPLE_ROOT/samples/$dir make OPT=O0 - if [[ $? != 0 ]]; then - exit 1 - fi make clean make OPT=O2 - if [[ $? != 0 ]]; then - exit 1 - fi make clean done @@ -73,12 +40,14 @@ function release_test { cd $MAPLE_ROOT make testall - if [[ $? != 0 ]]; then - exit 1 - fi } function main { + # clean and setup env + source build/envsetup.sh arm release + make clobber + make setup + debug_test release_test diff --git a/test/testsuite/run.py b/test/testsuite/run.py index 8b4b430682573d3a73a5a44b353ca8c0bdf032dc..26f5f70382d85d93a91a693b0ddbbe8530f4921d 100644 --- a/test/testsuite/run.py +++ b/test/testsuite/run.py @@ -69,12 +69,16 @@ def construct_qemu_cmd(execute_cmd, execute_option): RUNTIME_SO = maple_out_path + "/ops/host-x86_64-" + execute_option["mrt_type"] APP_SO = os.getcwd() MPLSH = maple_out_path + "/ops/mplsh" + QEMU = "/usr/bin/qemu-aarch64" + if "OLD_OS" in os.environ.keys(): + if os.environ.get("OLD_OS") == "0": + QEMU = maple_root + "/tools/qemu/package/usr/bin/qemu-aarch64" execute_cmd["run_case"] = ( - "/usr/bin/qemu-aarch64 " + "{QEMU} " "-L /usr/aarch64-linux-gnu -E LD_LIBRARY_PATH={LIBZ_SO}:{RUNTIME_SO}:{APP_SO} " "{MPLSH} -Xbootclasspath:libcore-all.so -cp {execute_files} " "{execute_class} {execute_args}".format( - LIBZ_SO=LIBZ_SO, RUNTIME_SO=RUNTIME_SO, APP_SO=APP_SO, + QEMU=QEMU, LIBZ_SO=LIBZ_SO, RUNTIME_SO=RUNTIME_SO, APP_SO=APP_SO, MPLSH=MPLSH, **execute_option ) ) diff --git a/tools/setup_tools.sh b/tools/setup_tools.sh index bcbf805b47bff0ef0b1b201af8c05f0df5549426..a5a29d6153ef3bf764a036423367bba2d92c8461 100755 --- a/tools/setup_tools.sh +++ b/tools/setup_tools.sh @@ -134,26 +134,14 @@ if [ ! -f $MAPLE_ROOT/third_party/libdex/prebuilts/aarch64-linux-gnu/libz.so.1.2 fi # install qemu-user 2.5.0 -installQemu="false"; -if [ ! -f /usr/bin/qemu-aarch64 ]; then - installQemu="true"; -else - version=`/usr/bin/qemu-aarch64 -version | sed "s/^.*version.\([0-9.]*\).*/\1/" | head -1` - if [ "$version" != "2.5.0" ]; then - installQemu="true"; - fi -fi -if [ "$installQemu" == "true" ]; then +if [ ! -f $TOOLS/qemu/package/usr/bin/qemu-aarch64 ]; then cd $TOOLS echo Start wget qemu-user ... rm -rf qemu git clone https://gitee.com/hu-_-wen/qemu.git cd qemu - echo Install qemu-aarch64 ... - # use the following to make sure only the specific version of qemu-user is isstalled - # the first version sometimes insists to install the system default qemu-user. - # sudo apt install ./qemu-user_2.5+dfsg-5ubuntu10.48_amd64.deb - sudo dpkg -i ./qemu-user_2.5+dfsg-5ubuntu10.48_amd64.deb || sudo apt install -f + mkdir -p package + dpkg-deb -R qemu-user_2.5+dfsg-5ubuntu10.48_amd64.deb package echo Installed qemu-aarch64 fi