The `os_mremap` and `os_getpagesize` were missing in the `core/shared/platform/riot`
and were preventing RIOT from compiling if using WAMR v2.x.x. This PR is adding
both functions and should allow RIOT to update WAMR version to v2.x.x.
Signed-off-by:: mewen.berthelot <mewen.berthelot@orange.com>
This PR fixes compilation error when building with
`-DWAMR_BUILD_MINI_LOADER=1 -DWAMR_BUILD_JIT=1` or
`-DWAMR_BUILD_MINI_LOADER=1 -DWAMR_BUILD_MULTI_MODULE=1`,
though normally we don't use wasm mini loader when JIT or multi-module
is enabled.
This change supports building with `-DWAMR_BUILD_LIBC_WASI=0` and
`-DWAMR_BUILD_DEBUG_INTERP=1`, otherwise the os_socket_* functions
will be undefined.
Support to get `wasm_memory_type_t memory_type` from API
`wasm_runtime_get_import_type` and `wasm_runtime_get_export_type`,
and then get shared flag, initial page cout, maximum page count
from the memory_type:
```C
bool
wasm_memory_type_get_shared(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_init_page_count(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_max_page_count(const wasm_memory_type_t memory_type);
```
When datacount section exists, loader will check whether the data count
read from data segment section is same with the data count read from
datacount section, but the value of latter can be 0, loader should not
skip the check when the latter is 0. This fixes#3491.
And fix handle_name_section return value not checked issue and early
return true issue after handle_name_section.
And also add the failed case in #3491 to ba-issues.
Fix several issues in wasm loader:
- Parse a block's type index with leb int32 instead leb uint32
- Correct dst dynamic offset of loop block arguments for opcode br
when copying the stack operands to the arguments of loop block
- Free each frame_csp's param_frame_offsets when destroy loader ctx
- Fix compilation error in wasm_mini_loader.c
- Add test cases of failed issues
This PR fixes issue #3467 and #3468.
- Add a marco to limit the maxi allocable memory size of fuzz test to
2GB to avoid libFuzzer out-of-memory
- Check global type in load_global_import and load_global_section
Although I don't know what exactly the esp32s3 rom version of memset is,
it seems that the current code crashes only with a small "len". I guess
it changes the logic depending on the size.
Anyway, it's safer to use dbus here.
It looks like the preferred preprocessor check for Android is `__ANDROID__`
instead of `ANDROID`:
https://groups.google.com/g/android-ndk/c/cf9_f1SLXls
Change `(defined(ANDROID) && __ANDROID_API__ < 28)` to
`((defined(ANDROID) || defined(__ANDROID__)) && (__ANDROID_API__ < 28))`.
- Update spec test cases to commit bc76fd79cfe61033d7f4ad4a7e8fc4f996dc5ba8 on Apr. 3
- Update wabt binary to 1.0.34 to support newer spec cases
- Add comparison between table declared elem type and table elem segment value type
- Add a function to decide whether to execute test cases in a running mode
- Keep using interpreter in GC spec because wat2wasm in wabt can't compile if.wast w/o errors
- Re-factoring threads spec test case processing
- Since wabt 1.0.34 release isn't compatible with ubuntu 20.04, compile it from source code
- Disable CI to run aot multi-module temporarily, and will enable it in another PR
Add flag `LoadArgs.clone_wasm_binary` to control whether to clone the wasm/aot
binary in wasm-c-api module. If false, API `wasm_module_new_ex` won't clone the
binary, which may reduce the footprint.
Add flag `LoadArgs.wasm_binary_freeable` to control whether the wasm/aot binary
may be freed after instantiation for wamr API `wasm_runtime_load_ex`, if yes, then
for some running modes, the wasm/aot module doesn't refer to the input binary
again so developer can free it after instantiation to reduce the footprint.
And add API `wasm_module_is_underlying_binary_freeable` and
`wasm_runtime_is_underlying_binary_freeable` to check whether the input binary
can be freed after instantiation for wasm-c-api and wamr api.
And add sample to illustrate it.
When copying two cells from src offsets to dst offsets in RECOVER_BR_INFO,
the offsets may be overlapped and the src data may be overwritten, use
GET_I64_FROM_ADDR and then SET_I64_FROM_ADDR instead to resolve it.
And handling VALUE_TYPE_FUNCREF/VALUE_TYPE_EXTERNREF for opcode
local.set and local.tee when reference types feature is enabled.
This PR fixes issue #3401 and #3402.