Compare commits

..

36 Commits

Author SHA1 Message Date
liang.he
5d15f8fa2d
Update Dockerfile to install minimal Zephyr SDK (#4515)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $AOT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $MULTI_TIER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}, macos-14) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, macos-13) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
Reduce the time consumption for `docker build`.
2025-08-01 14:44:26 +08:00
liang.he
e40b05a5c6
Add smoke tests for iwasm and wamrc binaries to validate build output (#4455) 2025-08-01 14:31:36 +08:00
YAMAMOTO Takashi
29d465b44e
wasi_nn_tensorflowlite.cpp: make this compatible with wasmedge (#4517)
for wasi_ephemeral_nn,

* implement u8 input

* stop dealing with quantization.

  * wasi-nn doesn't have a concept of quantization or pre/post-processing.
    i can't think of any ways to make the backend perform zero-point/scale
    processing without risking to break other applications.

  * there seems to be applications which just use u8 inputs/outputs for
    a quantized model. (see [1] for an example.)
    for certain kinds of inputs/outputs, it usually just works.

this commit keeps the legacy wasi_nn logic intact for now.

tested with [1] with [2] applied.

WAMR with this patch:
```
Read graph weights, size in bytes: 3561598
[wasi_nn.c:297 WARNING] load_by_name_with_config() not found
[wasi_nn_tensorflowlite.cpp:272 WARNING] Default encoding is CPU.
Loaded graph into wasi-nn with ID: Graph#0
Read input tensor, size in bytes: 150528
   1.) [166](198)Aix galericulata
   2.) [34](1)Gallus gallus domesticus
   3.) [158](1)Coccothraustes coccothraustes
   4.) [778](1)Sitta europaea
   5.) [819](1)Anas platyrhynchos
```

wasmedge:
```
Read graph weights, size in bytes: 3561598
Loaded graph into wasi-nn with ID: Graph#0
Read input tensor, size in bytes: 150528
   1.) [166](198)Aix galericulata
   2.) [34](1)Gallus gallus domesticus
   3.) [158](1)Coccothraustes coccothraustes
   4.) [778](1)Sitta europaea
   5.) [819](1)Anas platyrhynchos
```

and "Aix galericulata" seems like a reasonable classification
of the image to my eyes.

[1] 67f174bab5/tflite-birds_v1-image

[2] https://github.com/second-state/WasmEdge-WASINN-examples/pull/204

Related:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3555
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2611
2025-08-01 14:31:02 +08:00
Jaco Kroon
272a41dc80
Avoid executable stack by marking that it's not required. (#4418)
Also refer to: https://github.com/fluent/fluent-bit/issues/10513

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2025-08-01 14:30:39 +08:00
Zhenwei Jin
378320b886
loader: add type index checking (#4521)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
compilation on zephyr / smoke_test (push) Waiting to run
2025-08-01 08:58:26 +08:00
Zhenwei Jin
33eff933c0
add validation for rec indices in aot loader (#4520) 2025-08-01 08:45:57 +08:00
Zhenwei Jin
aad1866260
add validation for recursive type count in loader (#4522)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
compilation on zephyr / smoke_test (push) Waiting to run
2025-07-31 16:19:08 +08:00
YAMAMOTO Takashi
a0de8c7b7d
wasi-nn: fix buffer overruns in load_by_name/load_by_name_with_config (#4491)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
compilation on zephyr / smoke_test (push) Waiting to run
also, ensure NUL terminations here to simplify backend implementations.
(note that, although names with '\0' in the middle are usually valid
in wasm, wamr doesn't support them in general. we might revisit this
later.)

also, add a missing address validation in load_by_name_with_config.

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4487
2025-07-30 10:27:20 +08:00
ChenWen
c6afa131a4
feat(core): Support pthread using SPIRAM as stack (#4509)
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2025-07-30 10:26:41 +08:00
Liu Jia
6c6447fadb
Add regression test CI (#4512)
The entire CI test run takes approximately 3 minutes.
The test run fails if there is at least one failed case (failed > 0).
2025-07-30 10:26:19 +08:00
Marcin Kolny
2685f2cae0
Use venv to install llvm dependencies and run build script (#4514)
Installing pip packages system-wide is no longer recommended, therefore
we create virtual environment for setting up the build environment for LLVM.
2025-07-30 10:25:52 +08:00
dependabot[bot]
2fe36f4516
build(deps): Bump github/codeql-action from 3.29.3 to 3.29.4 (#4519)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.3 to 3.29.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.3...v3.29.4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-30 10:25:21 +08:00
TianlongLiang
b322e297c6
Add CLI option for iwasm to create and attach shared heap to wasm app (#4499)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
compilation on zephyr / smoke_test (push) Waiting to run
2025-07-29 11:13:23 +08:00
YAMAMOTO Takashi
f34d28cfbc
lib-socket: implement gai_strerror (#4508)
cf. https://pubs.opengroup.org/onlinepubs/9799919799/functions/gai_strerror.html
2025-07-29 11:12:27 +08:00
YAMAMOTO Takashi
224b426d70
doc/build_wasm_app.md: restore the recommendation of exact version match (#4518)
the intention of the original text was to recommend to use the exactly
same version (eg. 2.4.1) regardless of AOT_CURRENT_VERSION.
2025-07-29 10:33:28 +08:00
liang.he
b124f70345
Bump version to 2.4.1 (#4513)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
compilation on zephyr / smoke_test (push) Waiting to run
2025-07-28 20:49:11 +08:00
YAMAMOTO Takashi
d298a66d38
bump AOT_CURRENT_VERSION for extended-const (#4511)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $AOT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $MULTI_TIER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}, macos-14) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, macos-13) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4504
2025-07-27 14:39:35 +08:00
liang.he
121232a995
Merge commit from fork
If `--addr-pool=1.2.3.4`, the runtime will return an error.
The value must be in the form of ADDRESS/MASK.
2025-07-27 14:38:56 +08:00
zhenweijin
c080aa80d0 add a CL option to specify shared heap size
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $AOT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $MULTI_TIER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}, macos-14) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, macos-13) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
2025-07-22 05:01:14 +02:00
dependabot[bot]
8ae3bf7080 build(deps): Bump github/codeql-action from 3.29.2 to 3.29.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.2 to 3.29.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.2...v3.29.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 04:53:52 +02:00
YAMAMOTO Takashi
a780ffdc43
lib-socket: make getaddrinfo return EAI_ values (#4498)
Some checks failed
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
compilation on zephyr / smoke_test (push) Waiting to run
hadolint dockerfiles / run-hadolint-on-dockerfiles (push) Has been cancelled
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4464
2025-07-21 09:21:31 +08:00
liang.he
952b35d11d
Add CI on Zephyr (#4336)
to run product-mini/platforms/zephyr/simple and
product-mini/platforms/zephyr/user-mode

Construct a T2 (star topology) for the current smoke test. This is not the
final topology, and we may modify it once we determine the optimal
configuration.
2025-07-21 09:21:01 +08:00
YAMAMOTO Takashi
e4d2673a7c
wasi-nn: add a comment on load_by_name_with_config (#4492)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $AOT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $MULTI_TIER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}, macos-14) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, macos-13) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
this api has been introduced by
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3709
in which i couldn't find any explanations.

this comment is my best guess.
2025-07-17 09:50:49 +08:00
YAMAMOTO Takashi
248e10b79e
nn-cli: add an option to use load_by_name (#4490)
by specifying a name for --load-graph.
for example,
```
--load-graph=name=foo
```
2025-07-17 09:47:20 +08:00
YAMAMOTO Takashi
79408e59cc
wamr-wasi-extensions: document (#4493) 2025-07-17 09:44:47 +08:00
YAMAMOTO Takashi
34f5d13444
doc/socket_api.md: some historical notes (#4494) 2025-07-17 09:43:54 +08:00
Liu Jia
704aa3e7e5
modify macro related to simde when WASM_OP_SELECT_128 (#4461)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
* remove macro of fast interpreter when WASM_OP_SELECT_128
* Modified some macros related to SIMDE
2025-07-17 08:04:41 +08:00
YAMAMOTO Takashi
46d4e248bb
posix os_socket_accept: stop assuming socklen_t is unsigned int (#4488) 2025-07-17 08:04:13 +08:00
YAMAMOTO Takashi
db942f3aaf wasi_socket_ext.c: fix error reporting
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $AOT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $MULTI_TIER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}, macos-14) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, macos-13) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
do not return __WASI_ERRNO_xxx error code where 0/-1 is more appropriate.

most of them were not harmful because the value of
__WASI_ERRNO_SUCCESS is 0.

the one with __WASI_ERRNO_NOPROTOOPT in socket() is
a user-visible bug.

tested with wamr-wasi-extensions/samples/socket-tcp-udp.

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4474
2025-07-15 09:23:46 +02:00
YAMAMOTO Takashi
2a952b371a
wasi_socket_ext.c: fix the number of getaddrinfo results (#4466)
Some checks are pending
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (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-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
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
the case of zero results was especially broken.
2025-07-14 13:12:32 +08:00
TianlongLiang
b3158e643c
Fix typos (#4472)
* leave api name unchanged so don't break API
2025-07-14 13:12:08 +08:00
Liu Jia
c8f7a7fc1a
fix regression running_config.json (#4477) 2025-07-14 13:08:58 +08:00
YAMAMOTO Takashi
2c4a660c4c
posix os_socket_addr_resolve: relax compatibility check (#4469)
some getaddrinfo implementations sometimes return results with
ai_protocol=0.

cf. https://github.com/apache/nuttx/issues/16693

standard-wise, i couldn't find anything about ai_protocol in
susv4-2018 except the following text:

> The fields ai_family, ai_socktype, and ai_protocol shall be usable
> as the arguments to the socket() function to create a socket suitable
> for use with the returned address.

because ai_protocol is usually merely used to feed socket() and
socket() usually accepts 0, it's probably standard-wise ok for
getaddrinfo to return ai_protocol=0.
the major implementations of getaddrinfo (eg. kame) seem to return
specific values like ai_protocol=IPPROTO_TCP though.

anyway, for the purpose of this function, there is little point to
be strict on the host getaddrinfo behavior. this commit just relaxes
the check to be friendly to those getaddrinfo implementations.
2025-07-14 13:06:40 +08:00
YAMAMOTO Takashi
53feadc2b0
lib-socket: implement getsockopt(SOL_SOCKET,SO_TYPE) (#4458)
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4456
2025-07-14 13:06:33 +08:00
YAMAMOTO Takashi
5d48cfdbc0
introduce wasm_runtime_instantiate_ex2 (#4444)
* introduce wasm_runtime_instantiate_ex2

at this point, just a slightly inefficiant functionality
equivalent of wasm_runtime_instantiate_ex.
however, unlike wasm_runtime_instantiate_ex, this one is designed
to be extendable without breaking the user-visible ABI.
because the definition of InstantiationArgs2 is not exposed to
users, we can safely add new members to it.

this commit also makes wasm_runtime_instantiate_ex a wrapper
of wasm_runtime_instantiate_ex2.

if this goes well, maybe it's a good idea to apply a similar
pattern to RuntimeInitArgs, LoadArgs, SharedHeapInitArgs, etc.
i started with InstantiationArgs just because i happen to have
a need to extend it for wasi-nn.

cf.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/4364
https://github.com/bytecodealliance/wasm-micro-runtime/issues/4331

* product-mini/platforms/posix: use wasm_runtime_instantiate_ex2
2025-07-14 13:06:23 +08:00
Zhenwei Jin
65d3ffa7a4
add validation for recursive type count in loader (#4440) 2025-07-14 13:06:08 +08:00
59 changed files with 1141 additions and 295 deletions

46
.github/scripts/run_qemu_arc.sh vendored Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
# THIS SCRIPT IS USED TO RUN QEMU ARC EMULATOR DIRECTLY ON CI ONLY.
# USUALLY, you SHOULD NOT RUN IT ON YOUR LOCAL MACHINE.
# INSTEAD, YOU SHOULD USE `west build -t run` COMMAND.
# Two arguments. first is the path to the zephyr-sdk, second is the path to the zephyr elf.
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <path_to_zephyr_sdk> <path_to_zephyr_elf>"
exit 1
fi
ZEPHYR_SDK_PATH=$1
ZEPHYR_ELF_PATH=$2
if [ ! -d "$ZEPHYR_SDK_PATH" ]; then
echo "Error: Zephyr SDK path does not exist: $ZEPHYR_SDK_PATH"
exit 1
fi
if [ ! -f "$ZEPHYR_ELF_PATH" ]; then
echo "Error: Zephyr ELF file does not exist: $ZEPHYR_ELF_PATH"
exit 1
fi
# this command is copied from the content of build.ninja which is generated by west build.
# please do not modify it unless synchronizing with the build.ninja file.
$ZEPHYR_SDK_PATH/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-system-arc \
-cpu arcem -m 8M \
-nographic -no-reboot -monitor none \
-global cpu.firq=false \
-global cpu.num-irqlevels=15 \
-global cpu.num-irq=25 \
-global cpu.ext-irq=20 \
-global cpu.freq_hz=10000000 \
-global cpu.timer0=true \
-global cpu.timer1=true \
-global cpu.has-mpu=true \
-global cpu.mpu-numreg=16 \
-net none \
-pidfile qemu.pid \
-chardev stdio,id=con,mux=on \
-serial chardev:con \
-mon chardev=con,mode=readline \
-icount shift=6,align=off,sleep=off \
-rtc clock=vm \
-kernel $ZEPHYR_ELF_PATH

View File

@ -97,9 +97,9 @@ jobs:
matrix:
include:
- build_options: $DEFAULT_BUILD_OPTIONS
suffix: ''
suffix: ""
- build_options: $GC_EH_BUILD_OPTIONS
suffix: '-gc-eh'
suffix: "-gc-eh"
permissions:
contents: write # for uploading release artifacts
@ -126,6 +126,30 @@ jobs:
cmake --build build --config Release --parallel 4
working-directory: ${{ inputs.cwd }}
- name: smoke test on non-Windows
if: ${{ !startsWith(inputs.runner, 'windows') }}
shell: bash
run: |
if [[ ! -f build/iwasm ]]; then
echo "iwasm binary is not found in the expected location."
exit 1
fi
build/iwasm --version
working-directory: ${{ inputs.cwd }}
- name: smoke test on Windows
if: ${{ startsWith(inputs.runner, 'windows') }}
shell: bash
run: |
if [[ ! -f build/Release/iwasm ]]; then
echo "iwasm binary is not found in the expected location."
exit 1
fi
build/Release/iwasm --version
working-directory: ${{ inputs.cwd }}
- name: Compress the binary on Windows
if: inputs.runner == 'windows-latest'
run: |

View File

@ -62,6 +62,30 @@ jobs:
cmake --build build --config Release --parallel 4
working-directory: wamr-compiler
- name: smoke test on non-windows
if: ${{ !startsWith(inputs.runner, 'windows') }}
shell: bash
run: |
if [[ ! -f build/wamrc ]]; then
echo "wamrc binary is not found in the expected location."
exit 1
fi
build/wamrc --version
working-directory: wamr-compiler
- name: smoke test on Windows
if: ${{ startsWith(inputs.runner, 'windows') }}
shell: bash
run: |
if [[ ! -f build/Release/wamrc ]]; then
echo "wamrc binary is not found in the expected location."
exit 1
fi
build/Release/wamrc --version
working-directory: wamr-compiler
- name: Compress the binary on Windows
if: inputs.runner == 'windows-latest' && inputs.release
run: |

View File

@ -53,7 +53,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.29.2
uses: github/codeql-action/init@v3.29.4
with:
languages: ${{ matrix.language }}
@ -70,7 +70,7 @@ jobs:
- run: |
./.github/scripts/codeql_buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.29.2
uses: github/codeql-action/analyze@v3.29.4
with:
category: "/language:${{matrix.language}}"
upload: false
@ -99,7 +99,7 @@ jobs:
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
- name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@v3.29.2
uses: github/codeql-action/upload-sarif@v3.29.4
with:
sarif_file: ${{ steps.step1.outputs.sarif-output }}
category: "/language:${{matrix.language}}"

View File

@ -371,6 +371,47 @@ jobs:
ctest
working-directory: tests/unit
build_regression_tests:
needs:
[build_llvm_libraries_on_ubuntu_2204]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
include:
- os: ubuntu-22.04
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v4
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.llvm_cache_key }}
- name: Quit if cache miss
if: (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Build wamrc and iwasm
run: |
./build_wamr.sh
working-directory: tests/regression/ba-issues
- name: Run regression tests
run: |
python run.py
working-directory: tests/regression/ba-issues
build_samples_wasm_c_api:
needs:
[

View File

@ -0,0 +1,129 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: compilation on zephyr
on:
# will be triggered on PR events
pull_request:
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/platforms/common/**"
- "product-mini/platforms/zephyr/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
# will be triggered on push events
push:
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/platforms/common/**"
- "product-mini/platforms/zephyr/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
# allow to be triggered manually
workflow_dispatch:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# FOR SETUP
ZEPHYR_SDK_VERSION: "0.16.9"
ZEPHYR_VERSION: "v3.7.0"
# FOR BUILD
permissions:
contents: read
jobs:
smoke_test:
runs-on: ubuntu-22.04
container:
# For Zephyr 3.7 LTS, use the v0.26-branch or the latest v0.26.x release Docker image.
# ci require a larger runner to avoid "no space left on device"
image: ghcr.io/zephyrproject-rtos/ci-base:v0.26-branch
options: --user root
steps:
# https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-application
# zephyrproject/ --> CI ROOT
# ├─── .west/
# │ └─── config
# ├─── bootloader/
# ├─── zephyr/ --> Zephyr source code
# ├─── zephyr-sdk/
# ├─── modules/
# │ |─── wasm-micro-runtime --> WAMR source code
# ├─── tools/
# ├─── vendor/
# └─── application/ --> DUMMY. keep west_lite.yml here
- name: Checkout code
uses: actions/checkout@v3
with:
path: modules/wasm-micro-runtime
- name: Prepare Zephyr environment
shell: bash
run: |
mkdir -p application
cp modules/wasm-micro-runtime/product-mini/platforms/zephyr/simple/west_lite.yml application/west_lite.yml
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: application
manifest-file-name: west_lite.yml
sdk-version: ${{ env.ZEPHYR_SDK_VERSION }}
toolchains: arc-zephyr-elf:arc64-zephyr-elf
- name: Build a sample application(simple)
shell: bash
run: |
pushd product-mini/platforms/zephyr/simple
west build . -b qemu_arc/qemu_arc_hs -p always -- -DWAMR_BUILD_TARGET=ARC
popd
# west build -t run will fork several processes, which will cause the job to hang.
# run in the background and kill it after 5 seconds
.github/scripts/run_qemu_arc.sh \
../../zephyr-sdk \
product-mini/platforms/zephyr/simple/build/zephyr/zephyr.elf &
sleep 5
pkill qemu-system-arc
working-directory: modules/wasm-micro-runtime
- name: Build a sample application(user-mode)
shell: bash
run: |
pushd product-mini/platforms/zephyr/user-mode
west build . -b qemu_arc/qemu_arc_hs -p always -- -DWAMR_BUILD_TARGET=ARC
popd
# west build -t run will fork several processes, which will cause the job to hang.
# run in the background and kill it after 5 seconds
.github/scripts/run_qemu_arc.sh \
../../zephyr-sdk \
product-mini/platforms/zephyr/user-mode/build/zephyr/zephyr.elf &
sleep 5
pkill qemu-system-arc
working-directory: modules/wasm-micro-runtime

View File

@ -60,6 +60,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b69421388d5449cc5a5e1ca344d71926bda69e07
uses: github/codeql-action/upload-sarif@701df0e49d84a24bd8f0d01f80c0dbf69ab07674
with:
sarif_file: results.sarif

View File

@ -1,3 +1,38 @@
## WAMR-2.4.1
### Breaking Changes
- wasi_socket_ext.c: fix error reporting (#4476)
- lib-socket: make getaddrinfo return EAI\_ values (#4498)
- bump AOT_CURRENT_VERSION for extended-const (#4511)
### New Features
### Bug Fixes
- modify macro related to simde when WASM_OP_SELECT_128 (#4461)
- posix os_socket_accept: stop assuming socklen_t is unsigned int (#4488)
- wasi_socket_ext.c: fix the number of getaddrinfo results (#4466)
- Fix typos (#4472)
- fix regression running_config.json (#4477)
- posix os_socket_addr_resolve: relax compatibility check (#4469)
- Add validation for recursive type count in loader (#4440)
### Enhancements
- Add CI on Zephyr (#4336)
- introduce wasm_runtime_instantiate_ex2 (#4444)
- Add a CLI option to specify shared heap size on Windows platform (#4503)
- wasi-nn: add a comment on load_by_name_with_config (#4492)
- nn-cli: add an option to use load_by_name (#4490)
- wamr-wasi-extensions: document (#4493)
- doc/socket_api.md: some historical notes (#4494)
- lib-socket: implement getsockopt(SOL_SOCKET,SO_TYPE) (#4458)
### Others
- build(deps): Bump github/codeql-action from 3.29.2 to 3.29.3 (#4507)
## WAMR-2.4.0
### Breaking Changes

View File

@ -8,7 +8,7 @@ endif()
set(WAMR_VERSION_MAJOR 2)
set(WAMR_VERSION_MINOR 4)
set(WAMR_VERSION_PATCH 0)
set(WAMR_VERSION_PATCH 1)
message("-- WAMR version: ${WAMR_VERSION_MAJOR}.${WAMR_VERSION_MINOR}.${WAMR_VERSION_PATCH}")

View File

@ -84,7 +84,7 @@
#endif
#define AOT_MAGIC_NUMBER 0x746f6100
#define AOT_CURRENT_VERSION 4
#define AOT_CURRENT_VERSION 5
#ifndef WASM_ENABLE_JIT
#define WASM_ENABLE_JIT 0

View File

@ -1786,7 +1786,8 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
read_uint32(buf, buf_end, j);
#if WASM_ENABLE_AOT_VALIDATOR != 0
if (j >= module->type_count) {
/* an equivalence type should be before the type it refers to */
if (j > i) {
set_error_buf(error_buf, error_buf_size, "invalid type index");
goto fail;
}
@ -1805,7 +1806,12 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
read_uint32(buf, buf_end, parent_type_idx);
read_uint16(buf, buf_end, rec_count);
read_uint16(buf, buf_end, rec_idx);
#if WASM_ENABLE_AOT_VALIDATOR != 0
if (rec_idx > i) {
set_error_buf(error_buf, error_buf_size, "invalid rec_idx");
goto fail;
}
#endif
if (type_flag == WASM_TYPE_FUNC) {
AOTFuncType *func_type;
@ -4415,7 +4421,7 @@ aot_compatible_version(uint32 version)
* refer to "AoT-compiled module compatibility among WAMR versions" in
* ./doc/biuld_wasm_app.md
*/
return version == 4 || version == 3;
return version == AOT_CURRENT_VERSION;
}
static bool

View File

@ -0,0 +1,3 @@
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -79,3 +79,6 @@ return:
add sp, sp, #0x30 /* restore sp */
ret
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -77,3 +77,6 @@ return:
add sp, sp, #0x30 /* restore sp */
ret
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -67,3 +67,6 @@ call_func:
j_s [blink] /* ret */
nop_s
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -73,3 +73,6 @@ return:
add sp, sp, #4
ldmfd sp!, {r4, r5, r6, r7, lr}
bx lr
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -84,3 +84,6 @@ return:
ldmfd sp!, {r4, r5, r6, r7, lr}
bx lr
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -62,3 +62,6 @@ push_args_end:
leave
ret
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -62,3 +62,6 @@ push_args_end:
leave
ret
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -35,3 +35,6 @@ skip_push_args:
leave
ret
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -72,3 +72,6 @@ done:
j $31
.end invokeNative
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -89,3 +89,6 @@ return:
pop {r4, r5, r6, r7}
mov lr, r3
bx lr
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -98,3 +98,6 @@ return:
mov lr, r3
bx lr
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -72,3 +72,6 @@ call_func:
return:
retw.n
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -199,6 +199,8 @@ wasm_runtime_create_shared_heap(SharedHeapInitArgs *init_args)
heap->heap_handle = NULL;
heap->base_addr = init_args->pre_allocated_addr;
LOG_VERBOSE("Create preallocated shared heap %p with size %u",
heap->base_addr, size);
}
else {
if (!(heap->heap_handle =
@ -225,6 +227,8 @@ wasm_runtime_create_shared_heap(SharedHeapInitArgs *init_args)
LOG_WARNING("init share heap failed");
goto fail4;
}
LOG_VERBOSE("Create pool shared heap %p with size %u", heap->base_addr,
size);
}
os_mutex_lock(&shared_heap_list_lock);
@ -509,6 +513,8 @@ wasm_runtime_attach_shared_heap_internal(WASMModuleInstanceCommon *module_inst,
os_mutex_lock(&shared_heap_list_lock);
shared_heap->attached_count++;
os_mutex_unlock(&shared_heap_list_lock);
LOG_VERBOSE("Shared heap %p is attached to module instance %p", shared_heap,
module_inst);
return true;
}
@ -570,6 +576,7 @@ wasm_runtime_detach_shared_heap_internal(WASMModuleInstanceCommon *module_inst)
e->shared_heap_base_addr_adj = NULL;
}
#endif /* end of WASM_ENABLE_AOT != 0 */
LOG_VERBOSE("Shared heap is detached from module instance %p", module_inst);
}
void

View File

@ -1654,14 +1654,70 @@ wasm_runtime_instantiate(WASMModuleCommon *module, uint32 stack_size,
error_buf_size);
}
static void
instantiation_args_set_defaults(struct InstantiationArgs2 *args)
{
memset(args, 0, sizeof(*args));
}
WASMModuleInstanceCommon *
wasm_runtime_instantiate_ex(WASMModuleCommon *module,
const InstantiationArgs *args, char *error_buf,
uint32 error_buf_size)
{
struct InstantiationArgs2 v2;
instantiation_args_set_defaults(&v2);
v2.v1 = *args;
return wasm_runtime_instantiate_ex2(module, &v2, error_buf, error_buf_size);
}
bool
wasm_runtime_instantiation_args_create(struct InstantiationArgs2 **p)
{
struct InstantiationArgs2 *args = wasm_runtime_malloc(sizeof(*args));
if (args == NULL) {
return false;
}
instantiation_args_set_defaults(args);
*p = args;
return true;
}
void
wasm_runtime_instantiation_args_destroy(struct InstantiationArgs2 *p)
{
wasm_runtime_free(p);
}
void
wasm_runtime_instantiation_args_set_default_stack_size(
struct InstantiationArgs2 *p, uint32 v)
{
p->v1.default_stack_size = v;
}
void
wasm_runtime_instantiation_args_set_host_managed_heap_size(
struct InstantiationArgs2 *p, uint32 v)
{
p->v1.host_managed_heap_size = v;
}
void
wasm_runtime_instantiation_args_set_max_memory_pages(
struct InstantiationArgs2 *p, uint32 v)
{
p->v1.max_memory_pages = v;
}
WASMModuleInstanceCommon *
wasm_runtime_instantiate_ex2(WASMModuleCommon *module,
const struct InstantiationArgs2 *args,
char *error_buf, uint32 error_buf_size)
{
return wasm_runtime_instantiate_internal(
module, NULL, NULL, args->default_stack_size,
args->host_managed_heap_size, args->max_memory_pages, error_buf,
module, NULL, NULL, args->v1.default_stack_size,
args->v1.host_managed_heap_size, args->v1.max_memory_pages, error_buf,
error_buf_size);
}
@ -3754,7 +3810,15 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
address = strtok(cp, "/");
mask = strtok(NULL, "/");
ret = addr_pool_insert(apool, address, (uint8)(mask ? atoi(mask) : 0));
if (!mask) {
snprintf(error_buf, error_buf_size,
"Invalid address pool entry: %s, must be in the format of "
"ADDRESS/MASK",
addr_pool[i]);
goto fail;
}
ret = addr_pool_insert(apool, address, (uint8)atoi(mask));
wasm_runtime_free(cp);
if (!ret) {
set_error_buf(error_buf, error_buf_size,

View File

@ -612,6 +612,10 @@ WASMExecEnv *
wasm_runtime_get_exec_env_tls(void);
#endif
struct InstantiationArgs2 {
InstantiationArgs v1;
};
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_init(void);
@ -700,6 +704,40 @@ wasm_runtime_instantiate_ex(WASMModuleCommon *module,
const InstantiationArgs *args, char *error_buf,
uint32 error_buf_size);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN
bool
wasm_runtime_instantiation_args_create(struct InstantiationArgs2 **p);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN
void
wasm_runtime_instantiation_args_destroy(struct InstantiationArgs2 *p);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN
void
wasm_runtime_instantiation_args_set_default_stack_size(
struct InstantiationArgs2 *p, uint32 v);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN
void
wasm_runtime_instantiation_args_set_host_managed_heap_size(
struct InstantiationArgs2 *p, uint32 v);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN
void
wasm_runtime_instantiation_args_set_max_memory_pages(
struct InstantiationArgs2 *p, uint32 v);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN WASMModuleInstanceCommon *
wasm_runtime_instantiate_ex2(WASMModuleCommon *module,
const struct InstantiationArgs2 *args,
char *error_buf, uint32 error_buf_size);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_set_running_mode(wasm_module_inst_t module_inst,

View File

@ -1316,13 +1316,6 @@ aot_compile_func(AOTCompContext *comp_ctx, uint32 func_index)
return false;
break;
#if WASM_ENABLE_SIMD != 0
case WASM_OP_SELECT_128:
if (!aot_compile_op_select(comp_ctx, func_ctx, true))
return false;
break;
#endif
#if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0
case WASM_OP_SELECT_T:
{

View File

@ -289,6 +289,8 @@ typedef struct InstantiationArgs {
} InstantiationArgs;
#endif /* INSTANTIATION_ARGS_OPTION_DEFINED */
struct InstantiationArgs2;
#ifndef WASM_VALKIND_T_DEFINED
#define WASM_VALKIND_T_DEFINED
typedef uint8_t wasm_valkind_t;
@ -733,6 +735,46 @@ wasm_runtime_instantiate_ex(const wasm_module_t module,
const InstantiationArgs *args, char *error_buf,
uint32_t error_buf_size);
/**
* Create an InstantiationArgs2 object with default parameters.
*
* @return true if success, false otherwise
*/
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_instantiation_args_create(struct InstantiationArgs2 **p);
/**
* Dispose an InstantiationArgs2 object.
*/
WASM_RUNTIME_API_EXTERN void
wasm_runtime_instantiation_args_destroy(struct InstantiationArgs2 *p);
/**
* Setter functions for the InstantiationArgs2 object.
*/
WASM_RUNTIME_API_EXTERN void
wasm_runtime_instantiation_args_set_default_stack_size(
struct InstantiationArgs2 *p, uint32_t v);
WASM_RUNTIME_API_EXTERN void
wasm_runtime_instantiation_args_set_host_managed_heap_size(
struct InstantiationArgs2 *p, uint32_t v);
WASM_RUNTIME_API_EXTERN void
wasm_runtime_instantiation_args_set_max_memory_pages(
struct InstantiationArgs2 *p, uint32_t v);
/**
* Instantiate a WASM module, with specified instantiation arguments
*
* Same as wasm_runtime_instantiate_ex, but this version takes
* InstantiationArgs2, which can be extended without breaking the ABI.
*/
WASM_RUNTIME_API_EXTERN wasm_module_inst_t
wasm_runtime_instantiate_ex2(const wasm_module_t module,
const struct InstantiationArgs2 *args,
char *error_buf, uint32_t error_buf_size);
/**
* Set the running mode of a WASM module instance, override the
* default running mode of the runtime. Note that it only makes sense when

View File

@ -1887,7 +1887,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
}
HANDLE_OP_END();
}
#if WASM_ENABLE_SIMD != 0
#if WASM_ENABLE_SIMDE != 0
HANDLE_OP(WASM_OP_SELECT_128)
{
cond = frame_lp[GET_OFFSET()];

View File

@ -2303,10 +2303,15 @@ load_type_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
total_size = new_total_size;
}
if (rec_count < 1) {
LOG_VERBOSE("Processing 0-entry rec group");
}
else {
LOG_VERBOSE("Processing rec group [%d-%d]",
processed_type_count,
processed_type_count + rec_count - 1);
}
}
else {
p--;
}
@ -2491,6 +2496,13 @@ load_type_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
#endif /* end of WASM_ENABLE_GC == 0 */
}
for (i = 0; i < module->type_count; i++) {
if (module->types[i] == NULL) {
set_error_buf_v(error_buf, error_buf_size, "unknown type %d", i);
return false;
}
}
if (p != p_end) {
set_error_buf(error_buf, error_buf_size, "section size mismatch");
return false;
@ -7618,7 +7630,7 @@ wasm_loader_find_block_addr(WASMExecEnv *exec_env, BlockAddr *block_addr_cache,
case WASM_OP_SELECT:
case WASM_OP_DROP_64:
case WASM_OP_SELECT_64:
#if WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
#if WASM_ENABLE_SIMDE != 0
case WASM_OP_SELECT_128:
#endif
break;
@ -13143,9 +13155,7 @@ re_scan:
#if (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) \
|| (WASM_ENABLE_FAST_INTERP != 0)
case VALUE_TYPE_V128:
#if WASM_ENABLE_FAST_INTERP == 0
*(p - 1) = WASM_OP_SELECT_128;
#else
#if WASM_ENABLE_SIMDE != 0
if (loader_ctx->p_code_compiled) {
uint8 opcode_tmp = WASM_OP_SELECT_128;
#if WASM_ENABLE_LABELS_AS_VALUES != 0
@ -13273,8 +13283,7 @@ re_scan:
uint8 opcode_tmp = WASM_OP_SELECT;
if (type == VALUE_TYPE_V128) {
#if WASM_ENABLE_JIT != 0 \
|| WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
#if WASM_ENABLE_SIMDE != 0
opcode_tmp = WASM_OP_SELECT_128;
#else
set_error_buf(error_buf, error_buf_size,

View File

@ -278,8 +278,7 @@ typedef enum WASMOpcode {
DEBUG_OP_BREAK = 0xdc, /* debug break point */
#endif
#if WASM_ENABLE_JIT != 0 || WASM_ENABLE_FAST_INTERP != 0 \
|| WASM_ENABLE_WAMR_COMPILER != 0 && WASM_ENABLE_SIMD != 0
#if WASM_ENABLE_SIMDE != 0
EXT_OP_SET_LOCAL_FAST_V128 = 0xdd,
EXT_OP_TEE_LOCAL_FAST_V128 = 0xde,
EXT_OP_COPY_STACK_TOP_V128 = 0xdf,
@ -798,7 +797,7 @@ typedef enum WASMAtomicEXTOpcode {
#define SET_GOTO_TABLE_SIMD_PREFIX_ELEM()
#endif
#if WASM_ENABLE_SIMD != 0 && WASM_ENABLE_SIMDE != 0
#if WASM_ENABLE_SIMDE != 0
#define DEF_EXT_V128_HANDLE() \
SET_GOTO_TABLE_ELEM(EXT_OP_SET_LOCAL_FAST_V128), /* 0xdd */ \
SET_GOTO_TABLE_ELEM(EXT_OP_TEE_LOCAL_FAST_V128), /* 0xde */ \

View File

@ -135,6 +135,28 @@ typedef struct __wasi_addr_info_hints_t {
#define IPV6_LEAVE_GROUP 21
#define IPV6_V6ONLY 26
/* getaddrinfo error codes.
*
* we use values compatible with wasi-libc/musl netdb.h.
* https://github.com/WebAssembly/wasi-libc/blob/4ea6fdfa288e15a57c02fe31dda78e5ddc87c3c7/libc-top-half/musl/include/netdb.h#L43-L53
*
* for now, non-posix error codes are excluded:
* EAI_PROTOCOL and EAI_BADHINTS (BSDs)
* EAI_ADDRFAMILY, EAI_NODATA
* https://github.com/WebAssembly/wasi-libc/blob/4ea6fdfa288e15a57c02fe31dda78e5ddc87c3c7/libc-top-half/musl/include/netdb.h#L145-L152
*/
#define EAI_AGAIN -3
#define EAI_BADFLAGS -1
#define EAI_FAIL -4
#define EAI_FAMILY -6
#define EAI_MEMORY -10
#define EAI_NONAME -2
#define EAI_OVERFLOW -12
#define EAI_SERVICE -8
#define EAI_SOCKTYPE -7
#define EAI_SYSTEM -11
struct addrinfo {
int ai_flags; /* Input flags. */
int ai_family; /* Protocol family for socket. */
@ -197,6 +219,9 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
void
freeaddrinfo(struct addrinfo *res);
const char *
gai_strerror(int code);
#endif
/**

View File

@ -38,6 +38,13 @@ __errno_location(void);
return -1; \
}
/* REVISIT: in many cases, EAI_SYSTEM may not be an ideal error code */
#define GAI_HANDLE_ERROR(error) \
if (error != __WASI_ERRNO_SUCCESS) { \
errno = error; \
return EAI_SYSTEM; \
}
static void
ipv4_addr_to_wasi_ip4_addr(uint32_t addr_num, __wasi_addr_ip4_t *out)
{
@ -191,7 +198,7 @@ bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
error = __wasi_sock_bind(sockfd, &wasi_addr);
HANDLE_ERROR(error)
return __WASI_ERRNO_SUCCESS;
return 0;
}
int
@ -212,7 +219,7 @@ connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
error = __wasi_sock_connect(sockfd, &wasi_addr);
HANDLE_ERROR(error)
return __WASI_ERRNO_SUCCESS;
return 0;
}
int
@ -220,7 +227,7 @@ listen(int sockfd, int backlog)
{
__wasi_errno_t error = __wasi_sock_listen(sockfd, backlog);
HANDLE_ERROR(error)
return __WASI_ERRNO_SUCCESS;
return 0;
}
ssize_t
@ -375,7 +382,7 @@ socket(int domain, int type, int protocol)
af = INET6;
}
else {
return __WASI_ERRNO_NOPROTOOPT;
HANDLE_ERROR(__WASI_ERRNO_NOPROTOOPT)
}
if (SOCK_DGRAM == type) {
@ -385,7 +392,7 @@ socket(int domain, int type, int protocol)
socktype = SOCKET_STREAM;
}
else {
return __WASI_ERRNO_NOPROTOOPT;
HANDLE_ERROR(__WASI_ERRNO_NOPROTOOPT)
}
error = __wasi_sock_open(poolfd, af, socktype, &sockfd);
@ -408,7 +415,7 @@ getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
error = wasi_addr_to_sockaddr(&wasi_addr, addr, addrlen);
HANDLE_ERROR(error)
return __WASI_ERRNO_SUCCESS;
return 0;
}
int
@ -425,7 +432,7 @@ getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
error = wasi_addr_to_sockaddr(&wasi_addr, addr, addrlen);
HANDLE_ERROR(error)
return __WASI_ERRNO_SUCCESS;
return 0;
}
struct aibuf {
@ -518,7 +525,7 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
struct aibuf *aibuf_res;
error = addrinfo_hints_to_wasi_hints(hints, &wasi_hints);
HANDLE_ERROR(error)
GAI_HANDLE_ERROR(error)
do {
if (addr_info)
@ -529,7 +536,7 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
* sizeof(__wasi_addr_info_t));
if (!addr_info) {
HANDLE_ERROR(__WASI_ERRNO_NOMEM)
return EAI_MEMORY;
}
error = __wasi_sock_addr_resolve(node, service == NULL ? "" : service,
@ -537,29 +544,25 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
&max_info_size);
if (error != __WASI_ERRNO_SUCCESS) {
free(addr_info);
HANDLE_ERROR(error);
GAI_HANDLE_ERROR(error);
}
} while (max_info_size > addr_info_size);
addr_info_size = max_info_size;
if (addr_info_size == 0) {
free(addr_info);
*res = NULL;
return __WASI_ERRNO_SUCCESS;
return EAI_NONAME;
}
aibuf_res =
(struct aibuf *)calloc(1, addr_info_size * sizeof(struct aibuf));
if (!aibuf_res) {
free(addr_info);
HANDLE_ERROR(__WASI_ERRNO_NOMEM)
return EAI_MEMORY;
}
*res = &aibuf_res[0].ai;
if (addr_info_size) {
addr_info_size = max_info_size;
}
for (i = 0; i < addr_info_size; i++) {
struct addrinfo *ai = &aibuf_res[i].ai;
ai->ai_addr = (struct sockaddr *)&aibuf_res[i].sa;
@ -568,14 +571,14 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
if (error != __WASI_ERRNO_SUCCESS) {
free(addr_info);
free(aibuf_res);
HANDLE_ERROR(error)
GAI_HANDLE_ERROR(error)
}
ai->ai_next = i == addr_info_size - 1 ? NULL : &aibuf_res[i + 1].ai;
}
free(addr_info);
return __WASI_ERRNO_SUCCESS;
return 0;
}
void
@ -587,6 +590,28 @@ freeaddrinfo(struct addrinfo *res)
free(res);
}
const char *
gai_strerror(int code)
{
switch (code) {
#define ERR(a) \
case a: \
return #a
ERR(EAI_AGAIN);
ERR(EAI_BADFLAGS);
ERR(EAI_FAIL);
ERR(EAI_FAMILY);
ERR(EAI_MEMORY);
ERR(EAI_NONAME);
ERR(EAI_OVERFLOW);
ERR(EAI_SERVICE);
ERR(EAI_SOCKTYPE);
ERR(EAI_SYSTEM);
#undef ERR
}
return "Unknown error";
}
static struct timeval
time_us_to_timeval(uint64_t time_us)
{
@ -610,6 +635,7 @@ get_sol_socket_option(int sockfd, int optname, void *__restrict optval,
uint64_t timeout_us;
bool is_linger_enabled;
int linger_s;
__wasi_fdstat_t sb;
switch (optname) {
case SO_RCVTIMEO:
@ -617,38 +643,38 @@ get_sol_socket_option(int sockfd, int optname, void *__restrict optval,
error = __wasi_sock_get_recv_timeout(sockfd, &timeout_us);
HANDLE_ERROR(error);
*(struct timeval *)optval = time_us_to_timeval(timeout_us);
return error;
return 0;
case SO_SNDTIMEO:
assert(*optlen == sizeof(struct timeval));
error = __wasi_sock_get_send_timeout(sockfd, &timeout_us);
HANDLE_ERROR(error);
*(struct timeval *)optval = time_us_to_timeval(timeout_us);
return error;
return 0;
case SO_SNDBUF:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_send_buf_size(sockfd, (size_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case SO_RCVBUF:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_recv_buf_size(sockfd, (size_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case SO_KEEPALIVE:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_keep_alive(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case SO_REUSEADDR:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_reuse_addr(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case SO_REUSEPORT:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_reuse_port(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case SO_LINGER:
assert(*optlen == sizeof(struct linger));
error =
@ -656,16 +682,32 @@ get_sol_socket_option(int sockfd, int optname, void *__restrict optval,
HANDLE_ERROR(error);
((struct linger *)optval)->l_onoff = (int)is_linger_enabled;
((struct linger *)optval)->l_linger = linger_s;
return error;
return 0;
case SO_BROADCAST:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_broadcast(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case SO_TYPE:
assert(*optlen == sizeof(int));
error = __wasi_fd_fdstat_get(sockfd, &sb);
HANDLE_ERROR(error);
switch (sb.fs_filetype) {
case __WASI_FILETYPE_SOCKET_DGRAM:
*(int *)optval = SOCK_DGRAM;
break;
case __WASI_FILETYPE_SOCKET_STREAM:
*(int *)optval = SOCK_STREAM;
break;
default:
errno = __WASI_ERRNO_NOTSOCK;
return -1;
}
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -679,32 +721,32 @@ get_ipproto_tcp_option(int sockfd, int optname, void *__restrict optval,
assert(*optlen == sizeof(uint32_t));
error = __wasi_sock_get_tcp_keep_idle(sockfd, (uint32_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_KEEPINTVL:
assert(*optlen == sizeof(uint32_t));
error = __wasi_sock_get_tcp_keep_intvl(sockfd, (uint32_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_FASTOPEN_CONNECT:
assert(*optlen == sizeof(int));
error =
__wasi_sock_get_tcp_fastopen_connect(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_NODELAY:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_tcp_no_delay(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_QUICKACK:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_tcp_quick_ack(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -720,21 +762,21 @@ get_ipproto_ip_option(int sockfd, int optname, void *__restrict optval,
error = __wasi_sock_get_ip_multicast_loop(sockfd, false,
(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IP_TTL:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_ip_ttl(sockfd, (uint8_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IP_MULTICAST_TTL:
assert(*optlen == sizeof(int));
error = __wasi_sock_get_ip_multicast_ttl(sockfd, (uint8_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -749,17 +791,17 @@ get_ipproto_ipv6_option(int sockfd, int optname, void *__restrict optval,
assert(*optlen == sizeof(int));
error = __wasi_sock_get_ipv6_only(sockfd, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IPV6_MULTICAST_LOOP:
assert(*optlen == sizeof(int));
error =
__wasi_sock_get_ip_multicast_loop(sockfd, true, (bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -781,7 +823,7 @@ getsockopt(int sockfd, int level, int optname, void *__restrict optval,
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -799,7 +841,7 @@ set_sol_socket_option(int sockfd, int optname, const void *optval,
timeout_us = timeval_to_time_us(*(struct timeval *)optval);
error = __wasi_sock_set_recv_timeout(sockfd, timeout_us);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_SNDTIMEO:
{
@ -807,42 +849,42 @@ set_sol_socket_option(int sockfd, int optname, const void *optval,
timeout_us = timeval_to_time_us(*(struct timeval *)optval);
error = __wasi_sock_set_send_timeout(sockfd, timeout_us);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_SNDBUF:
{
assert(optlen == sizeof(int));
error = __wasi_sock_set_send_buf_size(sockfd, *(size_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_RCVBUF:
{
assert(optlen == sizeof(int));
error = __wasi_sock_set_recv_buf_size(sockfd, *(size_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_KEEPALIVE:
{
assert(optlen == sizeof(int));
error = __wasi_sock_set_keep_alive(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_REUSEADDR:
{
assert(optlen == sizeof(int));
error = __wasi_sock_set_reuse_addr(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_REUSEPORT:
{
assert(optlen == sizeof(int));
error = __wasi_sock_set_reuse_port(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_LINGER:
{
@ -851,20 +893,20 @@ set_sol_socket_option(int sockfd, int optname, const void *optval,
error = __wasi_sock_set_linger(sockfd, (bool)linger_opt->l_onoff,
linger_opt->l_linger);
HANDLE_ERROR(error);
return error;
return 0;
}
case SO_BROADCAST:
{
assert(optlen == sizeof(int));
error = __wasi_sock_set_broadcast(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
}
default:
{
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
}
@ -880,32 +922,32 @@ set_ipproto_tcp_option(int sockfd, int optname, const void *optval,
assert(optlen == sizeof(int));
error = __wasi_sock_set_tcp_no_delay(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_KEEPIDLE:
assert(optlen == sizeof(uint32_t));
error = __wasi_sock_set_tcp_keep_idle(sockfd, *(uint32_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_KEEPINTVL:
assert(optlen == sizeof(uint32_t));
error = __wasi_sock_set_tcp_keep_intvl(sockfd, *(uint32_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_FASTOPEN_CONNECT:
assert(optlen == sizeof(int));
error =
__wasi_sock_set_tcp_fastopen_connect(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case TCP_QUICKACK:
assert(optlen == sizeof(int));
error = __wasi_sock_set_tcp_quick_ack(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -923,7 +965,7 @@ set_ipproto_ip_option(int sockfd, int optname, const void *optval,
error = __wasi_sock_set_ip_multicast_loop(sockfd, false,
*(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IP_ADD_MEMBERSHIP:
assert(optlen == sizeof(struct ip_mreq));
ip_mreq_opt = (struct ip_mreq *)optval;
@ -933,7 +975,7 @@ set_ipproto_ip_option(int sockfd, int optname, const void *optval,
error = __wasi_sock_set_ip_add_membership(
sockfd, &imr_multiaddr, ip_mreq_opt->imr_interface.s_addr);
HANDLE_ERROR(error);
return error;
return 0;
case IP_DROP_MEMBERSHIP:
assert(optlen == sizeof(struct ip_mreq));
ip_mreq_opt = (struct ip_mreq *)optval;
@ -943,22 +985,22 @@ set_ipproto_ip_option(int sockfd, int optname, const void *optval,
error = __wasi_sock_set_ip_drop_membership(
sockfd, &imr_multiaddr, ip_mreq_opt->imr_interface.s_addr);
HANDLE_ERROR(error);
return error;
return 0;
case IP_TTL:
assert(optlen == sizeof(int));
error = __wasi_sock_set_ip_ttl(sockfd, *(uint8_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IP_MULTICAST_TTL:
assert(optlen == sizeof(int));
error =
__wasi_sock_set_ip_multicast_ttl(sockfd, *(uint8_t *)optval);
HANDLE_ERROR(error);
return error;
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -975,13 +1017,13 @@ set_ipproto_ipv6_option(int sockfd, int optname, const void *optval,
assert(optlen == sizeof(int));
error = __wasi_sock_set_ipv6_only(sockfd, *(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IPV6_MULTICAST_LOOP:
assert(optlen == sizeof(int));
error = __wasi_sock_set_ip_multicast_loop(sockfd, true,
*(bool *)optval);
HANDLE_ERROR(error);
return error;
return 0;
case IPV6_JOIN_GROUP:
assert(optlen == sizeof(struct ipv6_mreq));
ipv6_mreq_opt = (struct ipv6_mreq *)optval;
@ -992,7 +1034,7 @@ set_ipproto_ipv6_option(int sockfd, int optname, const void *optval,
error = __wasi_sock_set_ip_add_membership(
sockfd, &imr_multiaddr, ipv6_mreq_opt->ipv6mr_interface);
HANDLE_ERROR(error);
return error;
return 0;
case IPV6_LEAVE_GROUP:
assert(optlen == sizeof(struct ipv6_mreq));
ipv6_mreq_opt = (struct ipv6_mreq *)optval;
@ -1003,11 +1045,11 @@ set_ipproto_ipv6_option(int sockfd, int optname, const void *optval,
error = __wasi_sock_set_ip_drop_membership(
sockfd, &imr_multiaddr, ipv6_mreq_opt->ipv6mr_interface);
HANDLE_ERROR(error);
return error;
return 0;
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}
@ -1029,6 +1071,6 @@ setsockopt(int sockfd, int level, int optname, const void *optval,
default:
error = __WASI_ERRNO_NOTSUP;
HANDLE_ERROR(error);
return error;
return 0;
}
}

View File

@ -507,10 +507,35 @@ fail:
return res;
}
static wasi_nn_error
copyin_and_nul_terminate(wasm_module_inst_t inst, char *name, uint32_t name_len,
char **resultp)
{
char *nul_terminated_name;
if (!wasm_runtime_validate_native_addr(inst, name, name_len)) {
return invalid_argument;
}
nul_terminated_name = wasm_runtime_malloc(name_len + 1);
if (nul_terminated_name == NULL) {
return runtime_error;
}
bh_memcpy_s(nul_terminated_name, name_len + 1, name, name_len);
nul_terminated_name[name_len] = '\0'; /* ensure NUL termination */
if (strlen(nul_terminated_name) != name_len) {
/* reject names containing '\0' for now */
wasm_runtime_free(nul_terminated_name);
return invalid_argument;
}
*resultp = nul_terminated_name;
return success;
}
wasi_nn_error
wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
graph *g)
{
WASINNContext *wasi_nn_ctx = NULL;
char *nul_terminated_name = NULL;
wasi_nn_error res;
wasm_module_inst_t instance = wasm_runtime_get_module_inst(exec_env);
@ -518,25 +543,21 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
return runtime_error;
}
if (!wasm_runtime_validate_native_addr(instance, name, name_len)) {
NN_ERR_PRINTF("name is invalid");
return invalid_argument;
}
if (!wasm_runtime_validate_native_addr(instance, g,
(uint64)sizeof(graph))) {
NN_ERR_PRINTF("graph is invalid");
return invalid_argument;
}
if (name_len == 0 || name[name_len] != '\0') {
NN_ERR_PRINTF("Invalid filename");
return invalid_argument;
res = copyin_and_nul_terminate(instance, name, name_len,
&nul_terminated_name);
if (res != success) {
goto fail;
}
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME %s...", name);
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME %s...", nul_terminated_name);
WASINNContext *wasi_nn_ctx = lock_ctx(instance);
wasi_nn_ctx = lock_ctx(instance);
if (wasi_nn_ctx == NULL) {
res = busy;
goto fail;
@ -547,14 +568,20 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
goto fail;
call_wasi_nn_func(wasi_nn_ctx->backend, load_by_name, res,
wasi_nn_ctx->backend_ctx, name, name_len, g);
wasi_nn_ctx->backend_ctx, nul_terminated_name, name_len,
g);
if (res != success)
goto fail;
wasi_nn_ctx->is_model_loaded = true;
res = success;
fail:
if (nul_terminated_name != NULL) {
wasm_runtime_free(nul_terminated_name);
}
if (wasi_nn_ctx != NULL) {
unlock_ctx(wasi_nn_ctx);
}
return res;
}
@ -563,6 +590,9 @@ wasi_nn_load_by_name_with_config(wasm_exec_env_t exec_env, char *name,
int32_t name_len, char *config,
int32_t config_len, graph *g)
{
WASINNContext *wasi_nn_ctx = NULL;
char *nul_terminated_name = NULL;
char *nul_terminated_config = NULL;
wasi_nn_error res;
wasm_module_inst_t instance = wasm_runtime_get_module_inst(exec_env);
@ -570,30 +600,27 @@ wasi_nn_load_by_name_with_config(wasm_exec_env_t exec_env, char *name,
return runtime_error;
}
if (!wasm_runtime_validate_native_addr(instance, name, name_len)) {
NN_ERR_PRINTF("name is invalid");
return invalid_argument;
}
if (!wasm_runtime_validate_native_addr(instance, g,
(uint64)sizeof(graph))) {
NN_ERR_PRINTF("graph is invalid");
return invalid_argument;
}
if (name_len == 0 || name[name_len] != '\0') {
NN_ERR_PRINTF("Invalid filename");
return invalid_argument;
res = copyin_and_nul_terminate(instance, name, name_len,
&nul_terminated_name);
if (res != success) {
goto fail;
}
res = copyin_and_nul_terminate(instance, config, config_len,
&nul_terminated_config);
if (res != success) {
goto fail;
}
if (!config || config_len == 0 || config[config_len] != '\0') {
NN_ERR_PRINTF("Invalid config");
return invalid_argument;
}
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME_WITH_CONFIG %s %s...",
nul_terminated_name, nul_terminated_config);
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME_WITH_CONFIG %s %s...", name, config);
WASINNContext *wasi_nn_ctx = lock_ctx(instance);
wasi_nn_ctx = lock_ctx(instance);
if (wasi_nn_ctx == NULL) {
res = busy;
goto fail;
@ -605,15 +632,23 @@ wasi_nn_load_by_name_with_config(wasm_exec_env_t exec_env, char *name,
;
call_wasi_nn_func(wasi_nn_ctx->backend, load_by_name_with_config, res,
wasi_nn_ctx->backend_ctx, name, name_len, config,
config_len, g);
wasi_nn_ctx->backend_ctx, nul_terminated_name, name_len,
nul_terminated_config, config_len, g);
if (res != success)
goto fail;
wasi_nn_ctx->is_model_loaded = true;
res = success;
fail:
if (nul_terminated_name != NULL) {
wasm_runtime_free(nul_terminated_name);
}
if (nul_terminated_config != NULL) {
wasm_runtime_free(nul_terminated_config);
}
if (wasi_nn_ctx != NULL) {
unlock_ctx(wasi_nn_ctx);
}
return res;
}
@ -780,6 +815,12 @@ static NativeSymbol native_symbols_wasi_nn[] = {
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
REG_NATIVE_FUNC(load, "(*iii*)i"),
REG_NATIVE_FUNC(load_by_name, "(*i*)i"),
/* load_by_name_with_config is intented to be compatible with
* a wasmedge extension.
* https://github.com/second-state/wasmedge-wasi-nn/pull/2
* https://github.com/WasmEdge/WasmEdge/blob/5553924e8cdccdc2cbd2a6a6d0ed9b11250c353e/plugins/wasi_nn/wasinnmodule.cpp#L13-L14
*/
REG_NATIVE_FUNC(load_by_name_with_config, "(*i*i*)i"),
REG_NATIVE_FUNC(init_execution_context, "(i*)i"),
REG_NATIVE_FUNC(set_input, "(ii*)i"),

View File

@ -9,6 +9,7 @@
#include "wasi_nn_backend.h"
#include "wasm_export.h"
#include <tensorflow/lite/c/c_api.h>
#include <tensorflow/lite/interpreter.h>
#include <tensorflow/lite/kernels/register.h>
#include <tensorflow/lite/model.h>
@ -279,9 +280,20 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
tensor *input_tensor)
{
TFLiteContext *tfl_ctx = (TFLiteContext *)tflite_ctx;
TfLiteType tfl_type;
if (input_tensor->type != fp32) {
NN_ERR_PRINTF("unsupported input tensor type %u", input_tensor->type);
switch (input_tensor->type) {
case fp32:
tfl_type = TfLiteType::kTfLiteFloat32;
break;
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
case u8:
tfl_type = TfLiteType::kTfLiteUInt8;
break;
#endif
default:
NN_ERR_PRINTF("unsupported input tensor type %u",
input_tensor->type);
return runtime_error;
}
@ -289,19 +301,32 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
if (success != (res = is_valid_graph_execution_context(tfl_ctx, ctx)))
return res;
uint32_t num_tensors =
tfl_ctx->interpreters[ctx].interpreter->inputs().size();
auto interpreter = tfl_ctx->interpreters[ctx].interpreter.get();
uint32_t num_tensors = interpreter->inputs().size();
NN_DBG_PRINTF("Number of tensors (%d)", num_tensors);
if (index + 1 > num_tensors) {
return runtime_error;
}
auto tensor = tfl_ctx->interpreters[ctx].interpreter->input_tensor(index);
auto tensor = interpreter->input_tensor(index);
if (tensor == NULL) {
NN_ERR_PRINTF("Missing memory");
return too_large;
}
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
if (TfLiteTensorType(tensor) != tfl_type) {
NN_ERR_PRINTF("Type mismatch");
return runtime_error;
}
if (TfLiteTensorCopyFromBuffer(tensor, input_tensor->data.buf,
input_tensor->data.size)
!= kTfLiteOk) {
return runtime_error;
}
#else
uint32_t model_tensor_size = 1;
for (int i = 0; i < tensor->dims->size; ++i)
model_tensor_size *= (uint32_t)tensor->dims->data[i];
@ -346,6 +371,7 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
it[i] = (uint8_t)(input_tensor_f[i] / scale + zero_point);
}
}
#endif
return success;
}
@ -388,14 +414,19 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
return too_large;
}
if (tensor->quantization.type == kTfLiteNoQuantization) {
NN_DBG_PRINTF("No quantization information");
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
if (output_tensor->size < tensor->bytes) {
size_t sz = TfLiteTensorByteSize(tensor);
if (output_tensor->size < sz) {
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
return too_large;
}
if (TfLiteTensorCopyToBuffer(tensor, output_tensor->buf, sz) != kTfLiteOk) {
return runtime_error;
}
*output_tensor_size = sz;
#else
if (tensor->quantization.type == kTfLiteNoQuantization) {
NN_DBG_PRINTF("No quantization information");
/*
* for now, maintain the bug-to-bug compatibility with the old abi,
* where the size here is the number of fp32, not bytes.
@ -404,18 +435,13 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
return too_large;
}
#endif
bh_memcpy_s(output_tensor->buf, output_tensor->size, tensor->data.data,
tensor->bytes);
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
*output_tensor_size = tensor->bytes;
#else
/*
* for now, maintain the bug-to-bug compatibility with the old abi,
* where the size here is the number of fp32, not bytes.
*/
*output_tensor_size = tensor->bytes / sizeof(float);
#endif
}
else { // TODO: Assuming uint8 quantized networks.
TfLiteAffineQuantization *quant_info =
@ -429,12 +455,6 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
for (int i = 0; i < (int)tensor->dims->size; ++i)
model_tensor_size *= (uint32_t)tensor->dims->data[i];
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
if (output_tensor->size / sizeof(float) < model_tensor_size) {
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
return too_large;
}
#else
/*
* for now, maintain the bug-to-bug compatibility with the old abi,
* where the size here is the number of fp32, not bytes.
@ -443,7 +463,6 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
return too_large;
}
#endif
uint8_t *ot = tfl_ctx->interpreters[ctx]
.interpreter->typed_output_tensor<uint8_t>(index);
@ -458,16 +477,13 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
output_tensor_f[i] = (ot[i] - zero_point) * scale;
}
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
*output_tensor_size = model_tensor_size * sizeof(float);
#else
/*
* for now, maintain the bug-to-bug compatibility with the old abi,
* where the size here is the number of fp32, not bytes.
*/
*output_tensor_size = model_tensor_size;
#endif
}
#endif
return success;
}

View File

@ -220,12 +220,17 @@ int
os_socket_accept(bh_socket_t server_sock, bh_socket_t *sock, void *addr,
unsigned int *addrlen)
{
*sock = accept(server_sock, addr, addrlen);
if (addr == NULL) {
*sock = accept(server_sock, NULL, NULL);
}
else {
socklen_t len = *addrlen;
*sock = accept(server_sock, addr, &len);
*addrlen = len;
}
if (*sock < 0) {
return BHT_ERROR;
}
return BHT_OK;
}
@ -373,8 +378,8 @@ is_addrinfo_supported(struct addrinfo *info)
(info->ai_family == AF_INET || info->ai_family == AF_INET6)
// Allow only UDP and TCP
&& (info->ai_socktype == SOCK_DGRAM || info->ai_socktype == SOCK_STREAM)
&& (info->ai_protocol == IPPROTO_TCP
|| info->ai_protocol == IPPROTO_UDP);
&& (info->ai_protocol == IPPROTO_TCP || info->ai_protocol == IPPROTO_UDP
|| info->ai_protocol == 0);
}
int

View File

@ -110,6 +110,13 @@ os_thread_create_with_prio(korp_tid *tid, thread_start_routine_t start,
targ->start = start;
targ->arg = arg;
#ifdef CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM
esp_pthread_cfg_t default_config = esp_pthread_get_default_config();
default_config.stack_alloc_caps = MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM;
ESP_ERROR_CHECK(esp_pthread_set_cfg(&default_config));
#endif
if (pthread_create(tid, &tattr, os_thread_wrapper, targ) != 0) {
pthread_attr_destroy(&tattr);
os_free(targ);

View File

@ -59,7 +59,7 @@ b_memcpy_wa(void *s1, unsigned int s1max, const void *s2, unsigned int n)
*dest++ = *p_byte_read++;
}
}
/* read meaning word(s) */
/* read remaining word(s) */
else {
if ((char *)p + 4 >= src + n) {
for (ps = (char *)p; ps < src + n; ps++) {

View File

@ -170,7 +170,7 @@ bh_free_msg(bh_queue_node *msg)
return;
}
// note: sometime we just use the payload pointer for a integer value
// note: sometimes we just use the payload pointer for an integer value
// len!=0 is the only indicator about the body is an allocated buffer.
if (msg->body && msg->len)
bh_queue_free(msg->body);

View File

@ -44,22 +44,22 @@ bh_get_tick_ms()
uint32
bh_get_elpased_ms(uint32 *last_system_clock)
{
uint32 elpased_ms;
/* attention: the bh_get_tick_ms() return 64 bits integer, but
the bh_get_elpased_ms() is designed to use 32 bits clock count */
uint32 elapsed_ms;
/* attention: the bh_get_tick_ms() returns a 64-bit integer, but
bh_get_elpased_ms() is designed to use a 32-bit clock count */
uint32 now = (uint32)bh_get_tick_ms();
/* system clock overrun */
if (now < *last_system_clock) {
PRINT("system clock overrun!\n");
elpased_ms = now + (UINT32_MAX - *last_system_clock) + 1;
elapsed_ms = now + (UINT32_MAX - *last_system_clock) + 1;
}
else {
elpased_ms = now - *last_system_clock;
elapsed_ms = now - *last_system_clock;
}
*last_system_clock = now;
return elpased_ms;
return elapsed_ms;
}
static app_timer_t *
@ -162,7 +162,7 @@ reschedule_timer(timer_ctx_t ctx, app_timer_t *timer)
prev->id);
}
else {
/* insert at the begin */
/* insert at the beginning */
bh_assert(ctx->app_timers == NULL);
ctx->app_timers = timer;
PRINT("rescheduled timer [%d] as first\n", timer->id);
@ -213,7 +213,7 @@ release_timer_list(app_timer_t **p_list)
timer_ctx_t
create_timer_ctx(timer_callback_f timer_handler,
check_timer_expiry_f expiery_checker, int prealloc_num,
check_timer_expiry_f expiry_checker, int prealloc_num,
unsigned int owner)
{
timer_ctx_t ctx = (timer_ctx_t)BH_MALLOC(sizeof(struct _timer_ctx));
@ -225,7 +225,7 @@ create_timer_ctx(timer_callback_f timer_handler,
ctx->timer_callback = timer_handler;
ctx->pre_allocated = prealloc_num;
ctx->refresh_checker = expiery_checker;
ctx->refresh_checker = expiry_checker;
ctx->owner = owner;
while (prealloc_num > 0) {

View File

@ -18,7 +18,7 @@
/* clang-format off */
#define WAMR_VERSION_MAJOR 2
#define WAMR_VERSION_MINOR 4
#define WAMR_VERSION_PATCH 0
#define WAMR_VERSION_PATCH 1
/* clang-format on */
#endif

View File

@ -382,17 +382,26 @@ a non-compatible`AOT_CURRENT_VERSION`.
We try our best to maintain our runtime ABI for AoT-compiled modules
compatible among WAMR versions with compatible `AOT_CURRENT_VERSION`
so that combinations of older wamrc and newer runtime usually work.
However, there might be minor incompatibilities time to time.
For productions, we recommend to use compatible versions of
wamrc and the runtime.
| WAMR version | AOT_CURRENT_VERSION | Compatible AOT version |
| ------------ | ------------------- | ---------------------- |
| 1.x | 3 | 3 |
| 2.0.0 | 3 | 3 |
| 2.1.x | 3 | 3 |
| 2.2.0 | 3 | 3 |
| next | 4 | 3,4 |
However, there might be minor incompatibilities from time to time. For
example, we usually avoid bumping the version when making a change which
affects only a small fraction of users. For productions, we recommend
using exactly same versions of wamrc and the runtime.
| WAMR version | AOT_CURRENT_VERSION | Compatible AOT version | |
| ------------ | ------------------- | ---------------------- | ---------------------- |
| 1.x | 3 | 3 | |
| 2.0.0 | 3 | 3 | |
| 2.1.x | 3 | 3 | |
| 2.2.0 | 3 | 3 | |
| 2.3.0 | 4 | 3,4 | |
| 2.4.0 | 4 | 3,4 | See the following note |
| 2.4.1 | 5 | 5 | |
Note: 2.4.0 had a broken AoT versioning. See [issue 4504] for details.
We recommend all 2.4.0 users to migrate to 2.4.1.
[issue 4504]: https://github.com/bytecodealliance/wasm-micro-runtime/issues/4504
## AoT compilation with 3rd-party toolchains

View File

@ -58,7 +58,8 @@ enabled.
_iwasm_ accepts address ranges via an option, `--addr-pool`, to implement
the capability control. All IP address the WebAssembly application may need to `bind()` or `connect()`
should be announced first. Every IP address should be in CIDR notation.
should be announced first. Every IP address should be in CIDR notation. If not, _iwasm_ will return
an error.
```bash
$ iwasm --addr-pool=1.2.3.4/15,2.3.4.6/16 socket_example.wasm
@ -87,3 +88,38 @@ $ iwasm --addr-pool=1.2.3.4/15,2.3.4.6/16 socket_example.wasm
```
Refer to [socket api sample](../samples/socket-api) for the compilation of the Wasm applications and [_iwasm_ for Intel SGX](../product-mini/platforms/linux-sgx) for the Wasm runtime.
## The background and compatibility notes
### WASIp1
The WASIp1 provides a subset of the socket API.
Namely,
* send()
* recv()
* shutdown()
* accept()
Functionalities like connect() and listen() are intentionally omitted
there to maintain the capability-based security model, inherited from
cloudabi. The common practice for applications is to make the host code
pass already connected/listening sockets to wasm module.
### WAMR extensions
WAMR extends the WASIp1 with the rest of socket API functionalities
for convenience.
* socket()
* connect()
* bind()
* listen()
* some of getsockopt/setsockopt options
* name resolution (a subset of getaddrinfo)
### Compatibilities
Many of runtimes (eg. Wasmer and WasmEdge) provide similar extensions.
Unfortunately, they are all incompatible. Thus, portable applications
should not rely on these extensions.

View File

@ -45,7 +45,7 @@ libc_wasi_print_help(void)
"path, for example:\n");
printf(" --map-dir=<guest-path1::host-path1> "
"--map-dir=<guest-path2::host-path2>\n");
printf(" --addr-pool=<addrs> Grant wasi access to the given network "
printf(" --addr-pool=<addr/mask> Grant wasi access to the given network "
"addresses in\n");
printf(" CIDR notation to the program, separated "
"with ',',\n");

View File

@ -57,6 +57,10 @@ print_help(void)
#else
printf(" --heap-size=n Set maximum heap size in bytes, default is 16 KB when libc wasi is diabled\n");
#endif
#if WASM_ENABLE_SHARED_HEAP != 0
printf(" --shared-heap-size=n Create shared heap of n bytes and attach to the wasm app.\n");
printf(" The size n will be adjusted to a minumum number aligned to page size\n");
#endif
#if WASM_ENABLE_FAST_JIT != 0
printf(" --jit-codecache-size=n Set fast jit maximum code cache size in bytes,\n");
printf(" default is %u KB\n", FAST_JIT_DEFAULT_CODE_CACHE_SIZE / 1024);
@ -578,6 +582,11 @@ main(int argc, char *argv[])
#else
uint32 heap_size = 16 * 1024;
#endif
#if WASM_ENABLE_SHARED_HEAP != 0
SharedHeapInitArgs heap_init_args;
uint32 shared_heap_size = 0;
void *shared_heap = NULL;
#endif
#if WASM_ENABLE_FAST_JIT != 0
uint32 jit_code_cache_size = FAST_JIT_DEFAULT_CODE_CACHE_SIZE;
#endif
@ -596,6 +605,7 @@ main(int argc, char *argv[])
wasm_module_inst_t wasm_module_inst = NULL;
RunningMode running_mode = 0;
RuntimeInitArgs init_args;
struct InstantiationArgs2 *inst_args;
char error_buf[128] = { 0 };
#if WASM_ENABLE_LOG != 0
int log_verbose_level = 2;
@ -684,6 +694,13 @@ main(int argc, char *argv[])
return print_help();
heap_size = atoi(argv[0] + 12);
}
#if WASM_ENABLE_SHARED_HEAP != 0
else if (!strncmp(argv[0], "--shared-heap-size=", 19)) {
if (argv[0][19] == '\0')
return print_help();
shared_heap_size = atoi(argv[0] + 19);
}
#endif
#if WASM_ENABLE_FAST_JIT != 0
else if (!strncmp(argv[0], "--jit-codecache-size=", 21)) {
if (argv[0][21] == '\0')
@ -949,10 +966,20 @@ main(int argc, char *argv[])
libc_wasi_init(wasm_module, argc, argv, &wasi_parse_ctx);
#endif
if (!wasm_runtime_instantiation_args_create(&inst_args)) {
printf("failed to create instantiate args\n");
goto fail3;
}
wasm_runtime_instantiation_args_set_default_stack_size(inst_args,
stack_size);
wasm_runtime_instantiation_args_set_host_managed_heap_size(inst_args,
heap_size);
/* instantiate the module */
if (!(wasm_module_inst =
wasm_runtime_instantiate(wasm_module, stack_size, heap_size,
error_buf, sizeof(error_buf)))) {
wasm_module_inst = wasm_runtime_instantiate_ex2(
wasm_module, inst_args, error_buf, sizeof(error_buf));
wasm_runtime_instantiation_args_destroy(inst_args);
if (!wasm_module_inst) {
printf("%s\n", error_buf);
goto fail3;
}
@ -996,6 +1023,24 @@ main(int argc, char *argv[])
}
#endif
#if WASM_ENABLE_SHARED_HEAP != 0
if (shared_heap_size > 0) {
memset(&heap_init_args, 0, sizeof(heap_init_args));
heap_init_args.size = shared_heap_size;
shared_heap = wasm_runtime_create_shared_heap(&heap_init_args);
if (!shared_heap) {
printf("Create preallocated shared heap failed\n");
goto fail6;
}
/* attach module instance 2 to the shared heap */
if (!wasm_runtime_attach_shared_heap(wasm_module_inst, shared_heap)) {
printf("Attach shared heap failed.\n");
goto fail6;
}
}
#endif
ret = 0;
const char *exception = NULL;
if (is_repl_mode) {
@ -1039,6 +1084,9 @@ main(int argc, char *argv[])
}
#endif
#if WASM_ENABLE_SHARED_HEAP != 0
fail6:
#endif
#if WASM_ENABLE_THREAD_MGR != 0
fail5:
#endif

View File

@ -53,6 +53,10 @@ print_help()
printf(" --gc-heap-size=n Set maximum gc heap size in bytes,\n");
printf(" default is %u KB\n", GC_HEAP_SIZE_DEFAULT / 1024);
#endif
#if WASM_ENABLE_SHARED_HEAP != 0
printf(" --shared-heap-size=n Create shared heap of n bytes and attach to the wasm app.\n");
printf(" The size n will be adjusted to a minumum number aligned to page size\n");
#endif
#if WASM_ENABLE_JIT != 0
printf(" --llvm-jit-size-level=n Set LLVM JIT size level, default is 3\n");
printf(" --llvm-jit-opt-level=n Set LLVM JIT optimization level, default is 3\n");
@ -364,6 +368,13 @@ main(int argc, char *argv[])
gc_heap_size = atoi(argv[0] + 15);
}
#endif
#if WASM_ENABLE_SHARED_HEAP != 0
else if (!strncmp(argv[0], "--shared-heap-size=", 19)) {
if (argv[0][19] == '\0')
return print_help();
shared_heap_size = atoi(argv[0] + 19);
}
#endif
#if WASM_ENABLE_JIT != 0
else if (!strncmp(argv[0], "--llvm-jit-size-level=", 22)) {
if (argv[0][22] == '\0')
@ -551,6 +562,23 @@ main(int argc, char *argv[])
goto fail3;
}
#if WASM_ENABLE_SHARED_HEAP != 0
if (shared_heap_size > 0) {
memset(&shared_heap_init_args, 0, sizeof(shared_heap_init_args));
shared_heap_init_args.size = shared_heap_size;
shared_heap = wasm_runtime_create_shared_heap(&shared_heap_init_args);
if (!shared_heap) {
printf("Create shared heap failed.\n");
goto fail5;
}
if (!wasm_runtime_attach_shared_heap(wasm_module_inst, shared_heap)) {
printf("Attach shared heap failed.\n");
goto fail5;
}
}
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0
if (ip_addr != NULL) {
wasm_exec_env_t exec_env =
@ -598,6 +626,9 @@ main(int argc, char *argv[])
if (exception)
printf("%s\n", exception);
#if WASM_ENABLE_SHARED_HEAP != 0
fail5:
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0
fail4:
#endif

View File

@ -3,7 +3,23 @@
# Refer to https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html
# for more information on how to set up the Zephyr development environment.
FROM ubuntu:22.04
# https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-application
# zephyrproject/ --> CI ROOT
# ├─── .west/
# │ └─── config
# ├─── bootloader/
# ├─── zephyr/ --> Zephyr source code
# ├─── zephyr-sdk/
# ├─── modules/
# │ |─── wasm-micro-runtime --> WAMR source code
# ├─── tools/
# ├─── vendor/
# └─── application/ --> DUMMY. keep west_lite.yml here
# If you modify this file, you may need to sync the modifications to the
# .github/actions/setup-zephyr/action.yml
FROM ghcr.io/zephyrproject-rtos/ci-base:v0.26-branch
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asian/Shanghai
@ -11,44 +27,31 @@ ARG ZEPHYR_SDK_VERSION=0.16.9
# In west_lite.yml, the Zephyr version is set to v3.7.0
#ARG ZEPHYR_VERSION=3.7.0
# Install dependencies for Zephyr
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Install the Zephyr Software Development Kit (SDK)
WORKDIR /opt
# Install the Zephyr Software Development Kit (SDK) minimal version
WORKDIR /root/zephyrproject/zephyr-sdk
# hadolint ignore=DL4006
RUN wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz \
RUN wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz \
&& wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/sha256.sum | shasum --check --ignore-missing \
&& tar xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz
WORKDIR /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
&& tar --strip-components=1 -xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz
# hadolint ignore=DL4006
# Install host tools and Register Zephyr SDK CMake package
RUN ./setup.sh -h -c
# Install arc tools, host tools and Register Zephyr SDK CMake package
# If you want to use other toolchains, please change the -t option
RUN ./setup.sh -t arc-zephyr-elf -h -c
# Get Zephyr
WORKDIR /root/zephyrproject/smoke-test
# hadolint ignore=DL3013
# Install west
# hadolint ignore=DL3013,DL3059
RUN pip3 install --no-cache-dir west
COPY ./west_lite.yml ./west.yml
# Setup a T2(Star topology) workspace
WORKDIR /root/zephyrproject/application
COPY ./west_lite.yml ./west_lite.yml
# init the west workspace with a minimal manifest
RUN west init -l
RUN west init -l --mf west_lite.yml .
WORKDIR /root/zephyrproject
RUN west update --stats
WORKDIR /root/zephyrproject/modules/zephyr
RUN west zephyr-export && pip install --no-cache-dir -r ./scripts/requirements.txt
ENV ZEPHYR_BASE="/root/zephyrproject/modules/zephyr"
# Git clone wamr
WORKDIR /root/zephyrproject/modules/
RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git wasm-micro-runtime

View File

@ -8,8 +8,8 @@ manifest:
url: https://github.com/zephyrproject-rtos/zephyr
revision: v3.7.0
clone-depth: 1
path: modules/zephyr
path: zephyr
west-commands: scripts/west-commands.yml
self:
path: smoke-test
path: application

View File

@ -171,6 +171,7 @@ set(WAMR_BUILD_JIT 0)
set(WAMR_BUILD_LIBC_BUILTIN 1)
set(WAMR_BUILD_LIBC_WASI 1)
set(WAMR_BUILD_LIB_PTHREAD 1)
set(WAMR_BUILD_REF_TYPES 1)
# compiling and linking flags
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang"))

View File

@ -15,7 +15,7 @@
#define WASM_CURRENT_VERSION 1
#define AOT_MAGIC_NUMBER 0x746f6100
#define AOT_CURRENT_VERSION 4
#define AOT_CURRENT_VERSION 5
/* Legal values for bin_type */
#define BIN_TYPE_ELF32L 0 /* 32-bit little endian */

View File

@ -11,6 +11,7 @@ import subprocess
import glob
import re
import argparse
import sys
from typing import Dict, Optional, List
@ -275,6 +276,11 @@ def process_and_run_test_cases(
else:
print(f" Issues not found in folder: {format_issue_ids_should_test}")
if failed > 0:
# Exit with error code if there are failed test for CI
print("Some tests failed, see log file for details.")
sys.exit(1)
def main():
parser = argparse.ArgumentParser(description="Run BA issue tests.")

View File

@ -96,7 +96,7 @@
"argument": "",
"expected return": {
"ret code": 255,
"stdout content": "WASM module load failed: END opcode expected",
"stdout content": "WASM module load failed: unexpected end opcodes from unbalanced control flow structures",
"description": "no sanitizer 'Heap Buffer Overflow'"
}
},
@ -979,7 +979,7 @@
"argument": "",
"expected return": {
"ret code": 255,
"stdout content": "WASM module load failed: unexpected end of section or function",
"stdout content": "WASM module load failed: section size mismatch: function body END opcode expected",
"description": "no 'Heap out of bound read of size 1 in wasm_loader_prepare_bytecode function'"
}
},

View File

@ -3,5 +3,17 @@
# Copyright (C) 2020 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
TEMP_DIR=$(mktemp -d)
cleanup() {
local exit_code=$?
rm -rf "$TEMP_DIR"
exit $exit_code
}
trap cleanup EXIT INT TERM
/usr/bin/env python3 -m venv --clear "$TEMP_DIR"
source "$TEMP_DIR/bin/activate"
/usr/bin/env python3 -m pip install -r ../build-scripts/requirements.txt
/usr/bin/env python3 ../build-scripts/build_llvm.py "$@"

View File

@ -3,5 +3,5 @@
# Copyright (C) 2020 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
/usr/bin/env python3 ../build-scripts/build_llvm.py --platform arc "$@"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
$SCRIPT_DIR/build_llvm.sh --platform arc "$@"

View File

@ -3,5 +3,5 @@
# Copyright (C) 2020 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
/usr/bin/env python3 ../build-scripts/build_llvm.py --platform xtensa "$@"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
$SCRIPT_DIR/build_llvm.sh --platform xtensa "$@"

View File

@ -0,0 +1,49 @@
# wasm-wasi-extensions
wasm-wasi-extensions is a set of small static libraries
which aims to help you build a wasm module using
WAMR's extensions to WASIp1.
It's expected to be used in combination with WASI-SDK.
Currently it contains bindings for the following APIs:
* wasi-nn
* lib-socket
## Usage
### Preparation
Place it somewhere in your `CMAKE_PREFIX_PATH`.
You may want to automate the process with `FetchContent`.
```
set(URL https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-2.4.0/wamr-wasi-extensions-2.4.0.zip)
include(FetchContent)
FetchContent_Declare(
wamr-wasi-extensions
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL ${URL}
)
FetchContent_MakeAvailable(wamr-wasi-extensions)
list(APPEND CMAKE_PREFIX_PATH ${wamr-wasi-extensions_SOURCE_DIR})
```
Now you can use cmake find_package and link it to your application.
You can find samples in the [samples](samples) directory.
### wasi-nn
```
find_package(wamr-wasi-nn REQUIRED)
target_link_libraries(you-app wamr-wasi-nn)
```
### lib-socket
```
find_package(wamr-wasi-socket REQUIRED)
target_link_libraries(your-app wamr-wasi-socket)
```

View File

@ -31,18 +31,18 @@ load_graph(char *options)
const char *id = "default";
wasi_ephemeral_nn_graph_builder *builders = NULL;
size_t nbuilders = 0;
const char *name = NULL;
enum {
opt_id,
opt_file,
opt_name,
opt_encoding,
opt_target,
};
static char *const keylistp[] = {
[opt_id] = "id",
[opt_file] = "file",
[opt_encoding] = "encoding",
[opt_target] = "target",
NULL,
[opt_id] = "id", [opt_file] = "file",
[opt_name] = "name", [opt_encoding] = "encoding",
[opt_target] = "target", NULL,
};
while (*options) {
extern char *suboptarg;
@ -74,6 +74,13 @@ load_graph(char *options)
exit(1);
}
break;
case opt_name:
if (value == NULL) {
fprintf(stderr, "no value for %s\n", saved);
exit(2);
}
name = value;
break;
case opt_encoding:
if (value == NULL) {
fprintf(stderr, "no value for %s\n", saved);
@ -94,14 +101,26 @@ load_graph(char *options)
}
}
if (name != NULL && nbuilders != 0) {
fprintf(stderr, "name and file are exclusive\n");
exit(1);
}
wasi_ephemeral_nn_error nnret;
wasi_ephemeral_nn_graph g;
nnret = wasi_ephemeral_nn_load(builders, nbuilders, encoding, target, &g);
if (name != NULL) {
/* we ignore encoding and target */
nnret = wasi_ephemeral_nn_load_by_name(name, strlen(name), &g);
}
else {
nnret =
wasi_ephemeral_nn_load(builders, nbuilders, encoding, target, &g);
size_t i;
for (i = 0; i < nbuilders; i++) {
wasi_ephemeral_nn_graph_builder *b = &builders[i];
unmap_file(b->buf, b->size);
}
}
if (nnret != wasi_ephemeral_nn_error_success) {
fprintf(stderr, "load failed with %d\n", (int)nnret);
exit(1);