Commit Graph

273 Commits

Author SHA1 Message Date
dongsheng28849455
6e727dc18d
Support more features for rt-thread (#3661)
1, enable thread mgr
2, enable libc wasi
3, enable libc wasi threads
4, specify a function name of the module to run rather main
2024-07-26 10:34:15 +08:00
Benbuck Nason
5be8f3580d
Set compile symbol visibility to hidden in cmake (#3655)
Some checks are pending
compilation on SGX / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_JIT_BUILD_OPTIONS, ubuntu-20.04, linux-sgx) (push) Waiting to run
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://github.com/WebA… (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://gith… (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://github.… (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://github.com… (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, aot, -x -p -s spec -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, aot, -x -p -s spec -S -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, aot, -x -p -s spec -X -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, classic-interp, -x -p -s spec -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, fast-interp, -x -p -s spec -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, fast-jit, -x -p -s spec -P) (push) Blocked by required conditions
compilation on windows-latest / build (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
Set compile symbol visibility to hidden in cmake of root folder and
product-mini/platforms/linux.
2024-07-24 11:37:41 +08:00
liang.he
f844b33b2d
Make wasi-nn backends as separated shared libraries (#3509)
Some checks failed
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://github.com/WebA… (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://gith… (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://github.… (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-20.04, linux-sgx, https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz, https://github.com… (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, aot, -x -p -s spec -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, aot, -x -p -s spec -S -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, aot, -x -p -s spec -X -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, classic-interp, -x -p -s spec -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, fast-interp, -x -p -s spec -P) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, fast-jit, -x -p -s spec -P) (push) Blocked by required conditions
compilation on windows-latest / build (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
hadolint dockerfiles / run-hadolint-on-dockerfiles (push) Has been cancelled
- All files under *core/iwasm/libraries/wasi-nn* are compiled as shared libraries
- *wasi-nn.c* is shared between backends
- Every backend has a separated shared library
- If wasi-nn feature is enabled, iwasm will depend on shared library libiwasm.so
  instead of linking static library libvmlib.a
2024-06-14 12:06:56 +08:00
Wenyong Huang
f635ab9655
Enable building static library on Android platform (#3488)
ps. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3486
2024-05-31 12:11:11 +08:00
YAMAMOTO Takashi
1f8a78d61a
posix iwasm: Make the timeout logic a bit more robust (#3478)
Use an absolute timeout calculation to avoid being affected much
by CPU scheduling.
2024-05-30 15:55:24 +08:00
YAMAMOTO Takashi
267eaa1747
product-mini/platforms/posix/main.c: Adapt to WASM_MEM_DUAL_BUS_MIRROR (#3427) 2024-05-14 12:16:19 +08:00
Marcin Kolny
fe5e7a9981
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
2024-05-13 11:03:38 +08:00
Benbuck Nason
ca61184ced
Fix some spelling issues (#3385)
Fix some of the spelling issues found by CSpell.
2024-05-06 07:56:48 +08:00
Wenyong Huang
e11eae93e2
Fix aot debugger compilation error on windows (#3370)
Fix aot debugger compilation error on windows as reported in #3184.

And update the stack size configuration for product-mini zephyr sample
since the native stack overflow check was enhanced and the zephyr-sdk
was also upgraded.
2024-04-29 10:38:43 +08:00
dongsheng28849455
ba59e56e19
User defined memory allocator for different purposes (#3316)
Some issues are related with memory fragmentation, which may cause
the linear memory cannot be allocated. In WAMR, the memory managed
by the system is often trivial, but linear memory usually directly allocates
a large block and often remains unchanged for a long time. Their sensitivity
and contribution to fragmentation are different, which is suitable for
different allocation strategies. If we can control the linear memory's allocation,
do not make it from system heap, the overhead of heap management might
be avoided.

Add `mem_alloc_usage_t usage` as the first argument for user defined
malloc/realloc/free functions when `WAMR_BUILD_ALLOC_WITH_USAGE` cmake
variable is set as 1, and make passing `Alloc_For_LinearMemory` to the
argument when allocating the linear memory.
2024-04-18 19:40:57 +08:00
dongheng
9b28a8a80e
Update esp-idf platform support in main (#3304)
1. Fix API "futimens" and "utimensat" compiling error in different esp-idf version
2. Update component registry description file

ps. refer to PR #3296 on branch release/1.3x
2024-04-11 19:46:34 +08:00
dongheng
dacb3c4105
Add wamr to esp-idf components registry (#3287)
This PR is for the main branch, but only the released branch will be pushed
into Espressif component registry.

See also similar fixes in branch release/1.3.x:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3264
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3288
2024-04-08 12:34:08 +08:00
Wenyong Huang
b11dbcba0a
thread mgr: Free aux stack only when it was allocated (#3282)
When thread manager is enabled, the aux stack of exec_env may be allocated
by wasm_cluster_allocate_aux_stack or disabled by setting aux_stack_bottom
as UINTPTR_MAX directly. For the latter, no need to free it.

And fix an issue when paring `--gc-heap-size=n` argument for iwasm, and
fix a variable shadowed warning in fast-jit.
2024-04-08 09:06:49 +08:00
Wenyong Huang
2013f1f7d7
Fix warnings/issues reported in Windows and by CodeQL/Coverity (#3275)
Fix the warnings and issues reported:
- in Windows platform
- by CodeQL static code analyzing
- by Coverity static code analyzing

And update CodeQL script to build exception handling and memory features.
2024-04-07 11:57:31 +08:00
Xin Xu
bad9a2a231
nuttx: Migrate NuttX CMake build for WAMR (#3256)
Add NuttX CMake build support for platforms.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-02 08:53:30 +08:00
Wenyong Huang
76254183f9
Make android platform's cmake flags configurable (#3239)
Don't hardcode the cmake configurations in the Android platform's CMakeLists.txt.

Fixes https://github.com/bytecodealliance/wasm-micro-runtime/issues/3238
2024-03-21 11:08:40 +08:00
Tao Xiong
29d83224a8
Add esp32c6 support (#3234)
This PR adds support for ESP32 C6, which has been mentioned in #3208.
2024-03-19 08:15:46 +08:00
TianlongLiang
c3e33a96ea
Remove unused argument in wasm_runtime_lookup_function and refactor WASMModuleInstance (#3218)
Remove the unused parameter `signature` from `wasm_runtime_lookup_function`.

Refactor the layout of WASMModuleInstance structure:
- move common data members `c_api_func_imports` and `cur_exec_env` from
  `WASMModuleInstanceExtraCommon` to `WASMModuleInstance`
- In `WASMModuleInstance`, enlarge `reserved[3]` to `reserved[5]` in case that
  we need to add more fields in the future

ps.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2530
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3202
2024-03-13 12:28:45 +08:00
mkolchurin
c949f3d2aa
zephyr: Implement Alloc_With_System_Allocator (#3179)
Add zephyr libc malloc/realloc/free which were introduced since version 1.13.0.
2024-02-28 11:18:23 +08:00
zoraaver
92bd3ba17d
Implement the remaining Windows filesystem functions (#3166)
Now that the filesystem implementation is now complete, the previous
test filters on Windows can be removed. Some of the tests only pass when
certain environment variables have been set on Windows so an extra step
has been added in the wasi test runner script to modify the test config
files before the tests begin.
2024-02-28 11:02:42 +08:00
Wenyong Huang
b6adec373e
shared-platform: Remove dependency on shared-utils' bh_memory_remap_slow (#3153)
As an original design rule, the code in `core/shared/platform` should not
rely on the code in `core/share/utils`. In the current implementation,
platform layer calls function `bh_memory_remap_slow` in utils layer.

This PR adds inline function `os_mremap_slow` in platform_api_vmcore.h,
and lets os_remap call it if mremap fails. And remove bh_memutils.h/c as
as they are unused.

And resolve the compilation warning in wamrc:
```bash
core/shared/platform/common/posix/posix_memmap.c:255:16:
warning: implicit declaration of function ‘bh_memory_remap_slow’
  255 |         return bh_memory_remap_slow(old_addr, old_size, new_size);
```
2024-02-17 13:44:33 +08:00
Wenyong Huang
16a4d71b34
Implement GC (Garbage Collection) feature for interpreter, AOT and LLVM-JIT (#3125)
Implement the GC (Garbage Collection) feature for interpreter mode,
AOT mode and LLVM-JIT mode, and support most features of the latest
spec proposal, and also enable the stringref feature.

Use `cmake -DWAMR_BUILD_GC=1/0` to enable/disable the feature,
and `wamrc --enable-gc` to generate the AOT file with GC supported.

And update the AOT file version from 2 to 3 since there are many AOT
ABI breaks, including the changes of AOT file format, the changes of
AOT module/memory instance layouts, the AOT runtime APIs for the
AOT code to invoke and so on.
2024-02-06 20:47:11 +08:00
Marcin Kolny
a27ddece7f
Always allocate linear memory using mmap (#3052)
With this approach we can omit using memset() for the newly allocated memory
therefore the physical pages are not being used unless touched by the program.

This also simplifies the implementation.
2024-02-02 22:17:44 +08:00
Wenyong Huang
af318bac81
Implement Exception Handling for classic interpreter (#3096)
This PR adds the initial support for WASM exception handling:
* Inside the classic interpreter only:
  * Initial handling of Tags
  * Initial handling of Exceptions based on W3C Exception Proposal
  * Import and Export of Exceptions and Tags
* Add `cmake -DWAMR_BUILD_EXCE_HANDLING=1/0` option to enable/disable
  the feature, and by default it is disabled
* Update the wamr-test-suites scripts to test the feature
* Additional CI/CD changes to validate the exception spec proposal cases

Refer to:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/1884
587513f3c6
8bebfe9ad7
59bccdfed8

Signed-off-by: Ricardo Aguilar <ricardoaguilar@siemens.com>
Co-authored-by: Chris Woods <chris.woods@siemens.com>
Co-authored-by: Rene Ermler <rene.ermler@siemens.com>
Co-authored-by: Trenner Thomas <trenner.thomas@siemens.com>
2024-01-31 08:27:17 +08:00
Gavin Hayes
bf9fb2e680
cosmopolitan: Update compiler and update platform_internal.h (#3079)
This fixes the cosmopolitan platform.
- Switch `build_cosmocc.sh` and platform documentation to
  explicitly use the x86_64 cosmocc compiler as multi-arch
  cosmocc won't work here. Older version `cosmocc` just did
  a x86_64 build.
- Add missing items from `platform_internal.h` to fix build.
2024-01-24 16:04:48 +08:00
YAMAMOTO Takashi
4bafa40052
nuttx: If STACK_GUARD_SIZE is not set, leave it to config.h (#2927)
cf. https://github.com/apache/nuttx-apps/pull/2241
2024-01-23 11:52:25 +08:00
Huang Qi
dcaaed0160
nuttx: Add option to enable quick aot entry (#3040) 2024-01-17 16:26:53 +08:00
Wenyong Huang
3198018214
Fix linux-sgx build error when libc-wasi is disabled (#2997)
Compilation error was reported when `cmake -DWAMR_BUILD_LIBC_WASI=0`
on linux-sgx platform:
```
core/shared/platform/linux-sgx/sgx_socket.c:8:10:
fatal error: libc_errno.h: No such file or directory
    8 | #include "libc_errno.h"
      |          ^~~~~~~~~~~~~~
```
After fixing, both `cmake -DWAMR_BUILD_LIBC_WASI=1` and
`WAMR_BUILD_LIBC_WASI=0` work good.
2024-01-11 14:26:39 +08:00
Wenyong Huang
b21f17dd6d
Refine AOT/JIT code call wasm-c-api import process (#2982)
Allow to invoke the quick call entry wasm_runtime_quick_invoke_c_api_import to
call the wasm-c-api import functions to speedup the calling process, which reduces
the data copying.

Use `wamrc --invoke-c-api-import` to generate the optimized AOT code, and set
`jit_options->quick_invoke_c_api_import` true in wasm_engine_new when LLVM JIT
is enabled.
2024-01-10 18:37:02 +08:00
liang.he
5c3ad0279a
Enable AOT linux perf support (#2930)
And refactor the original perf support
- use WAMR_BUILD_LINUX_PERF as the cmake compilation control
- use WASM_ENABLE_LINUX_PERF as the compiler macro
- use `wamrc --enable-linux-perf` to generate aot file which contains fp operations
- use `iwasm --enable-linux-perf` to create perf map for `perf record`
2024-01-02 15:58:17 +08:00
YAMAMOTO Takashi
8318333304
nuttx: Add CONFIG_INTERPRETERS_WAMR_DEBUG_AOT (#2929)
At least it's sometimes useful for nuttx sim.

eg. (modified a bit to avoid github autolinks)
```
spacetanuki% lldb ./nuttx
(lldb) target create "./nuttx"
Current executable set to '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64).
(lldb) settings set plugin.jit-loader.gdb.enable on
(lldb) b foo
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 37011 launched: '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64)

NuttShell (NSH) NuttX-10.4.0
nsh> mount -t hostfs -o fs=/tmp/wasm /mnt
nsh> iwasm /mnt/test.aot
1 location added to breakpoint 1
Process 37011 stopped
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
   2
   3    __attribute__((noinline))
   4    void foo()
-> 5    {
   6        printf("hello from %s\n", __func__);
   7    }
   8
Target 0: (nuttx) stopped.
(lldb) bt
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
    frame #_1: 0x000000010580077a JIT(0x1058002d4)`bar(exenv=0x0000000101284280) at test.c:12:2
    frame #_2: 0x000000010580086a JIT(0x1058002d4)`baz(exenv=0x0000000101284280) at test.c:19:2
    frame #_3: 0x0000000105800972 JIT(0x1058002d4)`__main_argc_argv(exenv=<unavailable>, argc=<unavailable>, argv=<unavailable>) at test.c:26:3
    frame #_4: 0x00000001058061aa JIT(0x1058002d4)`aot_func#14 + 278
    ...
```
2023-12-26 16:56:34 +08:00
Daniel Mangum
157c289d07
Fix typos of CIDR in docs and help text (#2851)
Fixes typos of CIDR in socket documentation and libc WASI help text.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-12-04 11:38:54 +08:00
liang.he
8aa813f44a
Generate jitdump to support linux perf for LLVM JIT (#2788) 2023-11-27 15:42:00 +08:00
Huang Qi
d7608690c0
Run spec test for classic/fast-interp in NuttX CI (#2817) 2023-11-27 15:24:02 +08:00
liang.he
5377e18623
iwasm: Print help when meeting unknown cmd options (#2824) 2023-11-27 11:16:54 +08:00
Daniel Mangum
2175910bac
Update Zephyr support to v3.5.0 and make instructions generic to boards (#2805)
Includes a number of updates to the Zephyr example, including removing a fair
amount of stale configuration. This is part of moving towards supporting WAMR
as a Zephyr module as described in #2782. Some functionality is removed as
part of this diff (e.g. AOT XTENSA support), but it had become stale while not
being actively maintained. It is anticipated that it (and AOT support for other
platforms) will be added back, along with CI support for ensuring they do not
become stale again.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-11-23 09:56:04 +08:00
Huang Qi
0b29904f26
Fix configurable bounds checks typo (#2809) 2023-11-21 17:32:45 +08:00
Huang Qi
73cd1969f4
Add support for custom sections in nuttx (#2795) 2023-11-20 11:37:51 +08:00
YAMAMOTO Takashi
562a5dd1b6
Fix data/elem drop (#2747)
Currently, `data.drop` instruction is implemented by directly modifying the
underlying module. It breaks use cases where you have multiple instances
sharing a single loaded module. `elem.drop` has the same problem too.

This PR  fixes the issue by keeping track of which data/elem segments have
been dropped by using bitmaps for each module instances separately, and
add a sample to demonstrate the issue and make the CI run it.

Also add a missing check of dropped elements to the fast-jit `table.init`.

Fixes: https://github.com/bytecodealliance/wasm-micro-runtime/issues/2735
Fixes: https://github.com/bytecodealliance/wasm-micro-runtime/issues/2772
2023-11-18 08:50:16 +08:00
Wenyong Huang
a3349cc8c1
Fix compilation errors on zephyr platform (#2777)
Add dummy korp_rwlock struct and fix os_dir_stream definition on
platform zephyr/riot/rt-thread/alios to fix the compilation errors.
2023-11-16 18:39:41 +08:00
Huang Qi
24aa1cb408
Extend os_mmap to support map file from fd (#2763)
Add an extra argument `os_file_handle file` for `os_mmap` to support
mapping file from a file fd, and remove `os_get_invalid_handle` from
`posix_file.c` and `win_file.c`, instead, add it in the `platform_internal.h`
files to remove the dependency on libc-wasi.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-16 08:28:54 +08:00
Daniel Mangum
fc03bc073e
Fix log messages in Zephyr example (#2761)
Fixes typo of function in log messages in Zephyr example.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-11-14 09:27:57 +08:00
Wenyong Huang
20f1a8c86c Merge branch main into dev/wasi-libc-windows 2023-11-09 10:13:59 +08:00
Daniel Mangum
797e534cec
Fix typo in Zephyr simple example (#2738)
Fixes small typo of elapsed in Zephyr simple example.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-11-09 09:09:31 +08:00
Wenyong Huang
7f8292ffd1
Add more buffer boundary checks in wasm loader (#2734)
And fix exception not printed in `iwasm --repl` mode and resize the memory
data size to UINT32_MAX if the initial page number is 65536.
2023-11-09 08:42:05 +08:00
zoraaver
13875f43c6
Enable WASI tests on Windows CI (#2699)
Most of the WASI filesystem tests require at least creating/deleting a
file to test filesystem functionality so some additional filesystem APIs
have been implemented on Windows so we can test what has been
implemented so far. For those WASI functions which haven't been
implemented, we skip the tests. These will be implemented in a future PR
after which we can remove the relevant filters.

Additionally, in order to run the WASI socket and thread tests, we need
to install the wasi-sdk in CI and build the test source code prior to
running the tests.
2023-11-06 19:24:06 +08:00
Wenyong Huang
cc23c7ee7d
Use user defined malloc/free functions for user defined memory allocator (#2717)
Reported in #2617.
2023-11-03 15:23:31 +08:00
Wenyong Huang
3570a94a08
Fix issues reported by Coverity (#2681)
Fix multi-module issues and gui sample issues reported by Coverity.
And refine the build script of go language-binding sample.
2023-10-31 10:48:51 +08:00
Alfred E. Neumayer
9b8fe049b3
core/iwasm: Support mapped file system access on non-libuv WASI (#2628)
This patch enables mapping host directories to guest directories by parsing
the `map_dir_list` argument in API `wasm_runtime_init_wasi` for libc-wasi. It
follows the format `<guest-path>::<host-path>`.

It also adds argument `--map-dir=<guest::host>` argument for `iwasm`
common line tool, and allows to add multiple mappings:
```bash
iwasm --map-dir=<guest-path1::host-path1> --map-dir=<guest-path2::host-path2> ...
```
2023-10-27 12:48:10 +08:00
zoraaver
e7a62d2099
Refactor clock functions to use WASI types (#2666)
Refactoring the clock functions to use WASI types so we can simplify the
code and remove some unnecessary boilerplate. See
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2637#discussion_r1362202879
for details.
2023-10-25 18:06:04 +08:00