Enable ref types and bulk memory by default for wamrc (#838)
Enable ref types feature and bulk memory feature by default for wamrc and provide "--disable-ref-types", "--disable-bulk-memory" to disable them. And remove the ref_type_flag option in wasm_loader.c which is used to control whether to enable ref types or not when ENABLE_REF_TYPES macro is enabled in wamrc. As the wasm binary format with ref types is compatible with the binary format before, we can remove the option. Also update the spec test scripts.
This commit is contained in:
@ -38,9 +38,6 @@ ENABLE_SIMD=0
|
||||
#unit test case arrary
|
||||
TEST_CASE_ARR=()
|
||||
SGX_OPT=""
|
||||
# enable reference-types and bulk-memory by default
|
||||
# as they are finished and merged into spec
|
||||
ENABLE_REF_TYPES=1
|
||||
PLATFORM=$(uname -s | tr A-Z a-z)
|
||||
PARALLELISM=0
|
||||
|
||||
@ -104,9 +101,6 @@ do
|
||||
p)
|
||||
echo "enable multi thread feature"
|
||||
ENABLE_MULTI_THREAD=1
|
||||
# Disable reference-types when multi-thread is enabled
|
||||
echo "disable reference-types for multi thread"
|
||||
ENABLE_REF_TYPES=0
|
||||
;;
|
||||
S)
|
||||
echo "enable SIMD feature"
|
||||
@ -162,7 +156,6 @@ readonly CLASSIC_INTERP_COMPILE_FLAGS="\
|
||||
-DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_INTERP=0 \
|
||||
-DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 \
|
||||
-DWAMR_BUILD_SPEC_TEST=1 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=${ENABLE_MULTI_MODULE} \
|
||||
-DCOLLECT_CODE_COVERAGE=${COLLECT_CODE_COVERAGE}"
|
||||
|
||||
readonly FAST_INTERP_COMPILE_FLAGS="\
|
||||
@ -170,7 +163,6 @@ readonly FAST_INTERP_COMPILE_FLAGS="\
|
||||
-DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_INTERP=1 \
|
||||
-DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 \
|
||||
-DWAMR_BUILD_SPEC_TEST=1 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=${ENABLE_MULTI_MODULE} \
|
||||
-DCOLLECT_CODE_COVERAGE=${COLLECT_CODE_COVERAGE}"
|
||||
|
||||
# jit: report linking error if set COLLECT_CODE_COVERAGE,
|
||||
@ -179,15 +171,13 @@ readonly JIT_COMPILE_FLAGS="\
|
||||
-DWAMR_BUILD_TARGET=${TARGET} \
|
||||
-DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_FAST_INTERP=0 \
|
||||
-DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1 \
|
||||
-DWAMR_BUILD_SPEC_TEST=1 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=${ENABLE_MULTI_MODULE}"
|
||||
-DWAMR_BUILD_SPEC_TEST=1"
|
||||
|
||||
readonly AOT_COMPILE_FLAGS="\
|
||||
-DWAMR_BUILD_TARGET=${TARGET} \
|
||||
-DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_FAST_INTERP=0 \
|
||||
-DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=1 \
|
||||
-DWAMR_BUILD_SPEC_TEST=1 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=${ENABLE_MULTI_MODULE} \
|
||||
-DCOLLECT_CODE_COVERAGE=${COLLECT_CODE_COVERAGE}"
|
||||
|
||||
readonly COMPILE_FLAGS=(
|
||||
@ -387,9 +377,8 @@ function spec_test()
|
||||
fi
|
||||
fi
|
||||
|
||||
# reference type in all mode
|
||||
if [[ ${ENABLE_REF_TYPES} == 1 ]]; then
|
||||
ARGS_FOR_SPEC_TEST+="-r "
|
||||
if [[ ${ENABLE_MULTI_THREAD} == 1 ]]; then
|
||||
ARGS_FOR_SPEC_TEST+="-p "
|
||||
fi
|
||||
|
||||
# require warmc only in aot mode
|
||||
@ -536,20 +525,26 @@ function collect_coverage()
|
||||
function trigger()
|
||||
{
|
||||
local EXTRA_COMPILE_FLAGS=""
|
||||
# default enabled features
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_BULK_MEMORY=1"
|
||||
|
||||
if [[ ${ENABLE_MULTI_MODULE} == 1 ]];then
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_MULTI_MODULE=1"
|
||||
else
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_MULTI_MODULE=0"
|
||||
fi
|
||||
|
||||
if [[ ${ENABLE_MULTI_THREAD} == 1 ]];then
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_LIB_PTHREAD=1"
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_REF_TYPES=0"
|
||||
else
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_REF_TYPES=1"
|
||||
fi
|
||||
|
||||
if [[ ${ENABLE_SIMD} == 1 ]]; then
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_SIMD=1"
|
||||
fi
|
||||
|
||||
if [[ ${ENABLE_REF_TYPES} == 1 ]]; then
|
||||
# spec test cases for reference type depends on
|
||||
# multi-module and bulk memory
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_REF_TYPES=1"
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_MULTI_MODULE=1"
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_BULK_MEMORY=1"
|
||||
else
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_SIMD=0"
|
||||
fi
|
||||
|
||||
for t in "${TYPE[@]}"; do
|
||||
|
||||
Reference in New Issue
Block a user