Implement Memory64 support for AOT (#3362)
Refer to: https://github.com/bytecodealliance/wasm-micro-runtime/pull/3266 https://github.com/bytecodealliance/wasm-micro-runtime/issues/3091
This commit is contained in:
@ -1119,9 +1119,6 @@ def compile_wasm_to_aot(wasm_tempfile, aot_tempfile, runner, opts, r, output = '
|
||||
cmd.append("--enable-gc")
|
||||
cmd.append("--enable-tail-call")
|
||||
|
||||
if opts.memory64:
|
||||
cmd.append("--enable-memory64")
|
||||
|
||||
if output == 'object':
|
||||
cmd.append("--format=object")
|
||||
elif output == 'ir':
|
||||
@ -1134,9 +1131,10 @@ def compile_wasm_to_aot(wasm_tempfile, aot_tempfile, runner, opts, r, output = '
|
||||
|
||||
# Bounds checks is disabled by default for 64-bit targets, to
|
||||
# use the hardware based bounds checks. But it is not supported
|
||||
# in QEMU with NuttX.
|
||||
# Enable bounds checks explicitly for all targets if running in QEMU.
|
||||
if opts.qemu:
|
||||
# in QEMU with NuttX and in memory64 mode.
|
||||
# Enable bounds checks explicitly for all targets if running in QEMU or all targets
|
||||
# running in memory64 mode.
|
||||
if opts.qemu or opts.memory64:
|
||||
cmd.append("--bounds-checks=1")
|
||||
|
||||
# RISCV64 requires -mcmodel=medany, which can be set by --size-level=1
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
diff --git a/test/core/binary.wast b/test/core/binary.wast
|
||||
index b9fa438c..08ecee27 100644
|
||||
--- a/test/core/binary.wast
|
||||
+++ b/test/core/binary.wast
|
||||
@@ -621,15 +621,6 @@
|
||||
)
|
||||
|
||||
;; Malformed memory limits flag
|
||||
-(assert_malformed
|
||||
- (module binary
|
||||
- "\00asm" "\01\00\00\00"
|
||||
- "\05\03\01" ;; memory section with one entry
|
||||
- "\04" ;; malformed memory limits flag
|
||||
- "\00" ;; min 0
|
||||
- )
|
||||
- "malformed limits flags"
|
||||
-)
|
||||
(assert_malformed
|
||||
(module binary
|
||||
"\00asm" "\01\00\00\00"
|
||||
@ -409,6 +409,19 @@ function setup_wabt()
|
||||
fi
|
||||
}
|
||||
|
||||
function compile_reference_interpreter()
|
||||
{
|
||||
echo "compile the reference intepreter"
|
||||
pushd interpreter
|
||||
make
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed to compile the reference interpreter"
|
||||
exit 1
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
# TODO: with iwasm only
|
||||
function spec_test()
|
||||
{
|
||||
@ -457,6 +470,7 @@ function spec_test()
|
||||
|
||||
git apply ../../spec-test-script/thread_proposal_ignore_cases.patch
|
||||
git apply ../../spec-test-script/thread_proposal_fix_atomic_case.patch
|
||||
git apply ../../spec-test-script/thread_proposal_remove_memory64_flag_case.patch
|
||||
fi
|
||||
|
||||
if [ ${ENABLE_EH} == 1 ]; then
|
||||
@ -500,10 +514,7 @@ function spec_test()
|
||||
git apply ../../spec-test-script/gc_nuttx_tail_call.patch
|
||||
fi
|
||||
|
||||
echo "compile the reference intepreter"
|
||||
pushd interpreter
|
||||
make
|
||||
popd
|
||||
compile_reference_interpreter
|
||||
fi
|
||||
|
||||
# update memory64 cases
|
||||
@ -519,14 +530,11 @@ function spec_test()
|
||||
git restore . && git clean -ffd .
|
||||
# Reset to commit: "Merge remote-tracking branch 'upstream/main' into merge2"
|
||||
git reset --hard 48e69f394869c55b7bbe14ac963c09f4605490b6
|
||||
git checkout 044d0d2e77bdcbe891f7e0b9dd2ac01d56435f0b -- test/core/elem.wast
|
||||
git checkout 044d0d2e77bdcbe891f7e0b9dd2ac01d56435f0b -- test/core/elem.wast test/core/data.wast
|
||||
git apply ../../spec-test-script/ignore_cases.patch
|
||||
git apply ../../spec-test-script/memory64.patch
|
||||
|
||||
echo "compile the reference intepreter"
|
||||
pushd interpreter
|
||||
make
|
||||
popd
|
||||
compile_reference_interpreter
|
||||
fi
|
||||
|
||||
popd
|
||||
|
||||
Reference in New Issue
Block a user