@@ -20,7 +20,7 @@ function help()
2020 echo " unit|wamr_compiler)"
2121 echo " -m set compile target of iwasm(x86_64|x86_32|armv7|armv7_vfp|thumbv7|thumbv7_vfp|"
2222 echo " riscv32|riscv32_ilp32f|riscv32_ilp32d|riscv64|"
23- echo " riscv64_lp64f|riscv64_lp64d|aarch64|aarch64_vfp)"
23+ echo " riscv64_lp64f|riscv64_lp64d|aarch64|aarch64_vfp|hexagon )"
2424 echo " -t set compile type of iwasm(classic-interp|fast-interp|jit|aot|fast-jit|multi-tier-jit)"
2525 echo " -M enable multi module feature"
2626 echo " -p enable multi thread feature"
8383 PLATFORM=$( uname -s | tr A-Z a-z)
8484 PYTHON_EXE=python3
8585fi
86+ HOST_PLATFORM=${PLATFORM}
8687PARALLELISM=0
8788ENABLE_QEMU=0
8889QEMU_FIRMWARE=" "
8990WAMRC_CMD=" "
9091# prod/testsuite-all branch
9192WASI_TESTSUITE_COMMIT=" ee807fc551978490bf1c277059aabfa1e589a6c2"
9293TARGET_LIST=(" AARCH64" " AARCH64_VFP" " ARMV7" " ARMV7_VFP" " THUMBV7" " THUMBV7_VFP" \
93- " RISCV32" " RISCV32_ILP32F" " RISCV32_ILP32D" " RISCV64" " RISCV64_LP64F" " RISCV64_LP64D" " XTENSA" )
94+ " RISCV32" " RISCV32_ILP32F" " RISCV32_ILP32D" " RISCV64" " RISCV64_LP64F" " RISCV64_LP64D" \
95+ " HEXAGON" " XTENSA" )
9496REQUIREMENT_NAME=" "
9597# Initialize an empty array for subrequirement IDs
9698SUBREQUIREMENT_IDS=()
@@ -380,7 +382,7 @@ function sightglass_test()
380382function setup_wabt()
381383{
382384 # please sync with .github/actions/install-wasi-sdk-wabt/action.yml
383- case ${PLATFORM } in
385+ case ${HOST_PLATFORM } in
384386 cosmopolitan)
385387 ;;
386388 linux)
@@ -396,7 +398,7 @@ function setup_wabt()
396398 WABT_VERSION=1.0.37
397399 ;;
398400 * )
399- echo " wabt platform for ${PLATFORM } in unknown"
401+ echo " wabt platform for ${HOST_PLATFORM } in unknown"
400402 exit 1
401403 ;;
402404 esac
@@ -603,6 +605,11 @@ function spec_test()
603605 # set the current running target
604606 ARGS_FOR_SPEC_TEST+=" -m ${TARGET} "
605607
608+ # For cross-compilation targets, pass the iwasm path explicitly
609+ if [[ " ${TARGET_LIST[*]} " =~ " ${TARGET} " ]]; then
610+ ARGS_FOR_SPEC_TEST+=" --interpreter ${IWASM_CMD} "
611+ fi
612+
606613 # require warmc only in aot mode
607614 if [[ $1 == ' aot' ]]; then
608615 ARGS_FOR_SPEC_TEST+=" -t "
@@ -637,7 +644,7 @@ function spec_test()
637644 ARGS_FOR_SPEC_TEST+=" --qemu-firmware ${QEMU_FIRMWARE} "
638645 fi
639646
640- if [[ ${PLATFORM } == " windows" ]]; then
647+ if [[ ${HOST_PLATFORM } == " windows" ]]; then
641648 ARGS_FOR_SPEC_TEST+=" --no-pty "
642649 fi
643650
@@ -831,7 +838,7 @@ function build_iwasm_with_cfg()
831838 exit 1
832839 fi
833840
834- if [[ ${PLATFORM } == " cosmopolitan" ]]; then
841+ if [[ ${HOST_PLATFORM } == " cosmopolitan" ]]; then
835842 # convert from APE to ELF so it can be ran easier
836843 # HACK: link to linux so tests work when platform is detected by uname
837844 cp iwasm.com iwasm \
@@ -1124,7 +1131,7 @@ function trigger()
11241131 " classic-interp" )
11251132 # classic-interp
11261133 BUILD_FLAGS=" $CLASSIC_INTERP_COMPILE_FLAGS $EXTRA_COMPILE_FLAGS "
1127- if [[ ${ENABLE_QEMU} == 0 ]]; then
1134+ if [[ ${ENABLE_QEMU} == 0 ]] && ! [[ " ${TARGET_LIST[*]} " =~ " ${TARGET} " ]] ; then
11281135 build_iwasm_with_cfg $BUILD_FLAGS
11291136 fi
11301137 for suite in " ${TEST_CASE_ARR[@]} " ; do
@@ -1136,7 +1143,7 @@ function trigger()
11361143 " fast-interp" )
11371144 # fast-interp
11381145 BUILD_FLAGS=" $FAST_INTERP_COMPILE_FLAGS $EXTRA_COMPILE_FLAGS "
1139- if [[ ${ENABLE_QEMU} == 0 ]]; then
1146+ if [[ ${ENABLE_QEMU} == 0 ]] && ! [[ " ${TARGET_LIST[*]} " =~ " ${TARGET} " ]] ; then
11401147 build_iwasm_with_cfg $BUILD_FLAGS
11411148 fi
11421149 for suite in " ${TEST_CASE_ARR[@]} " ; do
@@ -1167,7 +1174,7 @@ function trigger()
11671174 echo " work in aot mode"
11681175 # aot
11691176 BUILD_FLAGS=" $AOT_COMPILE_FLAGS $EXTRA_COMPILE_FLAGS "
1170- if [[ ${ENABLE_QEMU} == 0 ]]; then
1177+ if [[ ${ENABLE_QEMU} == 0 ]] && ! [[ " ${TARGET_LIST[*]} " =~ " ${TARGET} " ]] ; then
11711178 build_iwasm_with_cfg $BUILD_FLAGS
11721179 fi
11731180 if [ -z " ${WAMRC_CMD} " ]; then
0 commit comments