Commit Graph

2280 Commits

Author SHA1 Message Date
Liu Jia
9773390537
set default value of WAMR_BUILD_REF_TYPES to 1 in standalone cases (#4227)
- set default value of WAMR_BUILD_REF_TYPES to 1 in CMakeLists.txt
2025-04-30 14:10:56 +08:00
liang.he
a9966897b6
use a selected llvm libs list to replace the full list (#4232) 2025-04-29 11:41:34 +08:00
liang.he
1d39b9c834
bypass vptr santizier (#4231)
LLVM, by default, disables the use of C++'s built-in Run-Time Type Information.
This decision is primarily driven by concerns about code size and efficiency.

But '-fsanitize=vptr' not allowed with '-fno-rtti'.
2025-04-29 10:05:02 +08:00
liang.he
791e60f533
feat(fuzz): add a new fuzzing target about aot compiler (#4121)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_BUILD_TAIL_CALL=1, $CLASSIC_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_BUILD_TAIL_CALL=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_BUILD_TAIL_CALL=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_BUILD_TAIL_CALL=1, $LLVM_LAZY_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, $AOT_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, $CLASSIC_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, $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 ($CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api ($FAST_INTERP_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 / 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
support llvm-jit running mode as another fuzzing target
2025-04-28 21:44:04 +08:00
YAMAMOTO Takashi
84767f9121
wamrc: add --disable-llvm-jump-tables option (#4224)
while ideally a user should not need to care this kind of
optimization details, in reality i guess it's sometimes useful.
both of clang and GCC expose a similar option.  (-fno-jump-tables)
2025-04-28 16:43:53 +08:00
YAMAMOTO Takashi
6593b3f347
LLVMCreateTargetMachineWithOpts: disable large data (#4220)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_BUILD_TAIL_CALL=1, $CLASSIC_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_BUILD_TAIL_CALL=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_BUILD_TAIL_CALL=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_BUILD_TAIL_CALL=1, $LLVM_LAZY_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, $AOT_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, $CLASSIC_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, $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 ($CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api ($FAST_INTERP_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 / 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
for x86-64, llvm 17 and later sometimes uses "l" prefix
for data sections.
cf. 43249378da

because our aot file emitter/loader doesn't support such
sections, it ends up with load-time errors solving symbols like ".lrodata".

this commit fixes it by avoid placing data in the large data sections.

references:
https://groups.google.com/g/x86-64-abi/c/jnQdJeabxiU
1feb00a28c
2025-04-27 11:48:57 +08:00
YAMAMOTO Takashi
c2d7fa30df
LLVM: don't verify instcombine fixpoint (#4219)
LLVM 18 and later, instcombine perfoms only one iteration.
it performs extra "verify fixpoint" operation when instcombine
is specified in certain ways, including how we do so here.
a problem is that the verification raises a fatal error when it
finds we didn't reach a fixpoint:

    LLVM ERROR: Instruction Combining did not reach a fixpoint
    after 1 iterations

while it should be rare, it's quite normal not to reach a fixpoint.
this commit fixes the issue by simply disabing the verification.

cf. 41895843b5
2025-04-27 11:30:35 +08:00
Liu Jia
af2a2040db
fix print_help when libc wasi is enabled (#4218)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_BUILD_TAIL_CALL=1, $CLASSIC_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_BUILD_TAIL_CALL=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_BUILD_TAIL_CALL=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_BUILD_TAIL_CALL=1, $LLVM_LAZY_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, $AOT_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, $CLASSIC_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, $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 ($CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api ($FAST_INTERP_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 / 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-04-25 16:46:37 +08:00
Zhenwei Jin
6d61e72344
Update unit test cases (#4214)
* Update gc unit test cases
* Update aot stack frame unit test cases
2025-04-25 14:43:24 +08:00
Marcin Kolny
c883fafead
Merge pull request #4203 from jammar1/jammar1/fix-br-v128
Add missing V128 handling in WASM_OP_BR, reported in #4173
2025-04-22 14:47:08 +01:00
TianlongLiang
ff2768775c
fix potential memory leak (#4205) 2025-04-22 12:08:25 +08:00
James Marsh
0702f788fd Add missing V128 handling in WASM_OP_BR, reported in #4173 2025-04-17 10:43:28 +01:00
liang.he
8f8c5605e9
Raise wasi-sdk to 25 and wabt to 1.0.37 (#4187)
Raise wasi-sdk to 25 and wabt to 1.0.37. It includes
  - Refactor CI workflow to install WASI-SDK and WABT from a composite action
  - Use ExternalProject to bring wasm-apps for few samples. file/ wasi-threads/
  - Refactor sample build and test steps in SGX compilation workflow for improved clarity and efficiency (workaround)

Add CMake support for EMSCRIPTEN and WAMRC, update module paths
2025-04-17 16:41:47 +08:00
liang.he
ecb47d9326
Add missing casts and improve error handling in performance map functions (#4202)
Wrong type of arguments to formatting function.
2025-04-17 15:22:23 +08:00
liang.he
996758cd4a
Remove the dlen to optimize it. (#4193)
There are two reasons for this optimization:
- The value of dlen can equal 0x1_0000_0000, even in wasm32 mode, because it is derived from (4G-0). This results in a truncation when it is passed to b_memmove_s(). Consequently, s1max becomes 0 and n is greater than s1max. To correct this, a longer type is required.
- The dlen is only used to check if there is enough space in b_memmove_s(). However, from a different angle, after confirming that both src+len and dst+len are within the memory range, we can be assured and there is no need for this explicit check.
2025-04-17 15:21:02 +08:00
liang.he
fc1527eacd
Raise CI runner to ubuntu 22.04 (#4191)
update workflows and scripts for Ubuntu 22.04 compatibility. It includes
  - install Intel SGX SDK 2.25
  - use a reusable action to install sgx required
  - keep improve error handling in AOT compilation process in runtest.py

add a workaround to fix receiving a shutdown signal problem. Refers to https://github.com/actions/runner-images/issues/6680 and https://github.com/actions/runner-images/discussions/7188
2025-04-17 15:07:46 +08:00
liang.he
955fce5664
Replace CMAKE_CURRENT_FUNCTION_LIST_DIR (#4200)
`CMAKE_CURRENT_FUNCTION_LIST_DIR` is added in version 3.17 and currently
most of `cmake_minimum_required()` with 3.14.

Refer to https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.html
2025-04-17 00:07:25 +08:00
YAMAMOTO Takashi
0ba6532636
debug-engine: fix a few type mismatches (#4189)
- use strict prototypes complained by GCC `-Wstrict-prototypes`
- use `int*` instead of `int32*`

Note: on some targets, int32_t is a long.
for example, GCC shipped with the recent ESP-IDF has such a
configuration.

- https://github.com/apache/nuttx/issues/15755#issuecomment-2635652808
- https://github.com/apache/nuttx/pull/16022
- https://docs.espressif.com/projects/esp-idf/en/stable/esp32/migration-guides/release-5.x/5.0/gcc.html#espressif-toolchain-changes
2025-04-17 00:07:08 +08:00
a seven
fc78d67e15
Fix the error of AOT mode on the "i386-windows-msvc" platform (#4183)
* Fix errors on the "i386-windows-msvc" platform
* Refactor symbol name handling for AOT COFF32 binary format
* Fix preprocessor directive placement for Windows compatibility in aot_reloc_x86_32.c

---------

Co-authored-by: liang.he@intel.com <liang.he@intel.com>
2025-04-17 00:04:27 +08:00
liang.he
d085d1ccf7
Keep fix the CMake compatibility issue (#4180)
```
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
```
2025-04-15 12:51:19 +08:00
YAMAMOTO Takashi
46ec863da3
fix false native stack overflow detections with HW_BOUND_CHECK (#4196)
In call_wasm_with_hw_bound_check/call_native_with_hw_bound_check,
ensure to set up the stack boundary (wasm_exec_env_set_thread_info)
before checking the overflow.

It seems that the problem was introduced by:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2940
2025-04-15 11:48:48 +08:00
dependabot[bot]
3bdec3c54b
build(deps): Bump github/codeql-action from 3.28.14 to 3.28.15 (#4198)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.14 to 3.28.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.14...v3.28.15)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.15
  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-04-15 09:59:20 +08:00
Huang Qi
cc1903603d
fix: Remove unused variables in SIMD_v128_const case (#4197)
Fix compiler warnings about unused variables `high` and `low` in the `SIMD_v128_const` case. These variables are only needed inside the `WASM_ENABLE_FAST_INTERP != 0` conditional block, but were incorrectly declared outside of it, causing unused variable warnings.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-04-15 09:47:18 +08:00
liang.he
751cdcf073
improve variable naming and code clarity in SIMD operations (#4157)
Fix compilation warning about shadow, like

```sh
 declaration of ‘val’ shadows a previous local [-Wshadow]
```
2025-04-10 14:36:20 +08:00
liang.he
9aaf3599ec
prevent frame_offset underflow in wasm_loader (#4165) 2025-04-10 12:06:06 +08:00
liang.he
793135b41c
Fix few integer overflowing (#4161)
- fix(interpreter): correct offset calculations in wasm_loader_get_const_offset function
- fix(mem-alloc): update offset calculation in gc_migrate for memory migration
- add pointer-overflow sanitizer
2025-04-10 12:04:56 +08:00
TianlongLiang
8fe98f64c1
Add import memory/table flag assert check for miniloader (#4179) 2025-04-10 12:00:23 +08:00
liang.he
2a2632444b
Refactor Dockerfile and update .dockerignore for wasi-nn tests; adjust map-dir parameters in smoke test script (#4158) 2025-04-10 11:59:59 +08:00
Raul Hernandez
8245aefc77
aot: add new u64 intrinsics (#4168) 2025-04-09 15:19:48 +08:00
dependabot[bot]
8f2fed4379
build(deps): Bump github/codeql-action from 3.28.13 to 3.28.14 (#4184)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.14.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.13...v3.28.14)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.14
  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-04-09 14:44:43 +08:00
Huang Qi
79f26a96a4
cmake: Enhance target selection for ARM architectures with FPU (#4185)
Improve the target selection logic for ARM architectures in the NuttX platform configuration.
* Added support for FPU detection in THUMB and ARM targets
* Ensured correct target is set based on architecture and configuration options

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-04-09 10:26:53 +08:00
dongsheng28849455
4e50d2191c
Remove indirect-load for constants on Xtensa Target to improve performance (#4162)
* Remove indirect-load for constants on Xtensa Target to improve performance
* Remove const intrinsics flags for xtensa instead of adding too much #ifdef
* Add AOT_INTRINSIC_FLAG_F32_CONST for xtensa frontend, because espressif xtensa llvm backend does not support float-point immediate for now

---------
Co-authored-by: zhanheng1 <Zhanheng.Qin@sony.com>
2025-04-02 14:39:03 +08:00
James Ring
6424122d6b
fix format specifier warning on 32bit builds (#4177) 2025-04-02 12:30:45 +08:00
liang.he
159b69da38
Update cmake min to 3.14 (#4175)
3.14 is used and tested by linux mini-product

to fix

```
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
```
2025-04-02 07:13:53 +08:00
TianlongLiang
b8dde7246d
dwarf_extractor.cpp: use macro control to be compatible with lower version toolchain (#4169) 2025-04-01 12:05:13 +08:00
dependabot[bot]
fb69699909
build(deps): Bump github/codeql-action from 3.28.12 to 3.28.13 (#4170)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.12 to 3.28.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.12...v3.28.13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  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-04-01 10:39:31 +08:00
liang.he
4082e53dda
docs: Update build instructions suggestions for using Valgrind (#4164) 2025-03-27 15:01:54 +08:00
Huang Qi
1931f2e5d5
nuttx: remove the up_x API for kernel build (#4154)
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Co-authored-by: buxiasen <buxiasen@xiaomi.com>
2025-03-27 14:56:02 +08:00
Huang Qi
4a17741670 test: temporarily skip 'skip-stack-guard-page' test case until issue is resolved 2025-03-26 15:14:12 +08:00
dependabot[bot]
8acaaa2892
build(deps): Bump actions/upload-artifact from 4.6.1 to 4.6.2 (#4159)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.6.1...v4.6.2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  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-03-25 10:06:32 +08:00
dependabot[bot]
c257692f55
build(deps): Bump github/codeql-action from 3.28.11 to 3.28.12 (#4160)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.11 to 3.28.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.11...v3.28.12)

---
updated-dependencies:
- dependency-name: github/codeql-action
  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-03-25 10:06:24 +08:00
Huang Qi
5d8fe5dcfd
platform/nuttx: Flush icache/dcache properly (#4147)
Enhance the os_dcache_flush and os_icache_flush functions to ensure
proper cache invalidation, improving memory management efficiency.
* Added cache invalidation for data cache
* Implemented cache invalidation for instruction cache

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 07:09:57 +08:00
Huang Qi
3e20194ecd
Update NuttX and NuttX Apps references to releases/12.9 in workflow f… (#4148)
* Update NuttX and NuttX Apps references to releases/12.9 in workflow files
* Remove Kconfig modification step for NuttX in spec test workflow
2025-03-24 07:09:22 +08:00
dependabot[bot]
913c2227ba
build(deps): Bump esbuild, @vitejs/plugin-react and vite (#4149)
Bumps [esbuild](https://github.com/evanw/esbuild) to 0.25.1 and updates ancestor dependencies [esbuild](https://github.com/evanw/esbuild), [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) and [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). These dependencies need to be updated together.


Updates `esbuild` from 0.14.54 to 0.25.1
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2022.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.14.54...v0.25.1)

Updates `@vitejs/plugin-react` from 2.0.1 to 4.3.4
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/v4.3.4/packages/plugin-react)

Updates `vite` from 3.0.9 to 6.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.2/packages/vite)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: indirect
- dependency-name: "@vitejs/plugin-react"
  dependency-type: direct:development
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-20 20:07:13 +08:00
liang.he
06ea960e76
fix(runtest.py): A workaround to bypass errors that occur when deleting temporary files (#4093)
- Replace sys.exit with exceptions for better error handling in test assertions
- Update exception handling in compile_wast_to_wasm to catch all exceptions
- Improve error messages and logging
- Use `--ignore-whitespace` option for git apply in spec_test function
- Use raw string notation for regex patterns.  *The "SyntaxWarning: invalid escape sequence" in Python The warning has been upgraded to SyntaxWarning since Python 3.12, and it is expected to become a SyntaxError in future versions.*
- Add early return for non-loadable AOT compilation to prevent unnecessary assertions
- Redirect stderr to stdout in test_case for unified output
- Update `create_tmpfiles()`  to improve clarity and handling of temporary files
2025-03-20 14:25:13 +08:00
peter-tatrai
1f14f4ec0a
Fix build issues when compiling WAMRC as a cross-compiler (#4112)
* Use CMAKE_INSTALL_BINDIR for wamrc installation
* Fix wamrc build failure for 32bit non-x86 targets
* Handle PIC flags by cmake in wamrc
* Use dummy AOT reloc functions when building wamrc

AOT reloc functions are used only when loading AOT WebAssembly modules
on target, not during AOT compilation. Original code led to build issues
when building wamrc as cross-compiler, using arm header on x86 build.

* Add option to turn off SIMD support in wamrc
2025-03-20 14:24:30 +08:00
Marcin Kolny
efa8019bdb
Merge dev/simd for fast-interp (#4131)
* Implement the first few SIMD opcodes for fast interpreter (v128.const, v128.any_true) (#3818)

Tested on the following code:
```
(module
  (import "wasi_snapshot_preview1" "proc_exit" (func $proc_exit (param i32)))
  (memory (export "memory") 1)

  ;; WASI entry point
  (func $main (export "_start")
    v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    v128.any_true
    if
      unreachable
    end
    
    v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15     
    v128.any_true
    i32.const 0
    i32.eq
    if
      unreachable
    end

    i32.const 0
    call $proc_exit
  )
)
```

* implement POP_V128()

This is to simplify the simd implementation for fast interpreter

* Add all SIMD operations into wasm_interp_fast switch

* Add V128 comparison operations

Tested using
```
(module
  (import "wasi_snapshot_preview1" "proc_exit" (func $proc_exit (param i32)))

  (memory (export "memory") 1)

  (func $assert_true (param v128)
    local.get 0
    v128.any_true
    i32.eqz
    if
      unreachable
    end
  )

  (func $main (export "_start")
    ;; Test v128.not
    v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    v128.not
    v128.const i8x16 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
    i8x16.eq
    call $assert_true

    ;; Test v128.and
    v128.const i8x16 255 255 255 255 0 0 0 0 255 255 255 255 0 0 0 0
    v128.const i8x16 255 255 0 0 255 255 0 0 255 255 0 0 255 255 0 0
    v128.and
    v128.const i8x16 255 255 0 0 0 0 0 0 255 255 0 0 0 0 0 0
    i8x16.eq
    call $assert_true

    ;; Test v128.andnot
    v128.const i8x16 255 255 255 255 0 0 0 0 255 255 255 255 0 0 0 0
    v128.const i8x16 255 255 0 0 255 255 0 0 255 255 0 0 255 255 0 0
    v128.andnot
    v128.const i8x16 0 0 255 255 0 0 0 0 0 0 255 255 0 0 0 0
    i8x16.eq
    call $assert_true

    ;; Test v128.or
    v128.const i8x16 255 255 0 0 0 0 255 255 255 255 0 0 0 0 255 0
    v128.const i8x16 0 0 255 255 255 255 0 0 0 0 255 255 255 255 0 0
    v128.or
    v128.const i8x16 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
    i8x16.eq
    call $assert_true

    ;; Test v128.xor
    v128.const i8x16 255 255 0 0 255 255 0 0 255 255 0 0 255 255 0 0
    v128.const i8x16 255 255 255 255 0 0 0 0 255 255 255 255 0 0 0 0
    v128.xor
    v128.const i8x16 0 0 255 255 255 255 0 0 0 0 255 255 255 255 0 0
    i8x16.eq
    call $assert_true

    i32.const 0
    call $proc_exit
  )
)
```

* Add first NEON SIMD opcode implementations to fast interpreter (#3859)

Add some implementations of SIMD opcodes using NEON instructions.
Tested using:
```wast
(module
  (import "wasi_snapshot_preview1" "proc_exit" (func $proc_exit (param i32)))
  (memory (export "memory") 1)

  (func $assert_true (param v128)
    local.get 0
    v128.any_true 
    i32.eqz
    if
      unreachable
    end
  )
  (func $main (export "_start")
    i32.const 0
    i32.const 32
    memory.grow
    drop

    i32.const 0
    v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    v128.store

    i32.const 0
    v128.load

    v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    i8x16.eq
    call $assert_true

    i32.const 16
    v128.const i8x16 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    v128.store

    i32.const 16
    v128.load
    v128.const i8x16 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    i8x16.eq
    call $assert_true

    i32.const 0
    v128.load
    v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    i8x16.eq
    call $assert_true
    drop

    i32.const 0
    i32.const 1
    memory.grow
    drop

    i32.const 0
    i64.const 0x7F80FF017E02FE80
    i64.store

    i32.const 0
    v128.load8x8_s

    v128.const i16x8 127 -128 -1 1 126 2 -2 -128

    i16x8.eq
    call $assert_true

    i32.const 0
    i64.const 0x80FE027E01FF807F
    i64.store

    i32.const 0
    v128.load8x8_u

    v128.const i16x8 128 254 2 126 1 255 128 127

    i16x8.eq
    call $assert_true

    i32.const 0
    i64.const 0x8000FFFE7FFF0001
    i64.store

    i32.const 0
    v128.load16x4_s

    v128.const i32x4 -32768 -2 32767 1

    i32x4.eq
    call $assert_true

    i32.const 0
    i64.const 0x8000FFFE7FFF0001 
    i64.store

    i32.const 0
    v128.load16x4_u

    v128.const i32x4 32768 65534 32767 1   

    i32x4.eq
    call $assert_true

    i32.const 0
    i64.const 0x8000000000000001
    i64.store

    i32.const 0
    v128.load32x2_s

    v128.const i64x2 -2147483648 1 

    i64x2.eq
    call $assert_true

    i32.const 0
    i64.const 0x8000000000000001
    i64.store

    i32.const 0
    v128.load32x2_u

    v128.const i64x2 2147483648 1

    i64x2.eq
    call $assert_true

    call $proc_exit
  )
)
```

* Emit imm for lane extract and replace (#3906)

* Fix replacement value not being correct (#3919)

* Implement load lanes opcodes for wasm (#3942)

* Implement final SIMD opcodes: store lane (#4001)

* Fix load/store (#4054)

* Correctly use unsigned functions  (#4055)

* implement local and function calls for v128 in the fast interpreter

* Fix splat opcodes, add V128 handling in preserve_referenced_local and reserve_block_ret

* Fix incorrect memory overflow values + SIMD ifdefs

* Fix load/load_splat macros

* correct endif wasm loader

* Update core/iwasm/interpreter/wasm_opcode.h

* Fix spec tests when WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS is 0

* Resolve merge conflicts arising from main -> dev/simd_for_interp and implement fast interpreter const offset loader support for V128

* Enable SIMDe tests on CI

* Document WAMR_BUILD_LIB_SIMDE

---------

Co-authored-by: James Marsh <mrshnja@amazon.co.uk>
Co-authored-by: jammar1 <108334558+jammar1@users.noreply.github.com>
Co-authored-by: Maks Litskevich <makslit@amazon.com>
Co-authored-by: Marcin Kolny <marcin.kolny@gmail.com>
Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
2025-03-20 14:23:20 +08:00
James Ring
c30e65ba5d
include bh_platform.h (#4135)
This should guarantee that the various macros required by
wasm_proposal.c are defined even if the build system does not supply
them to the compiler command.
2025-03-17 14:22:46 +08:00
liang.he
e27e5380c6
Fix iwasm build error when WAMR_BUILD_WASI_NN enabled (#4138) 2025-03-14 13:38:17 +08:00
Zhen Kong
dde6477fa5 Fix iwasm build error when WAMR_BUILD_WASI_NN enabled
A recent change on ./product-mini/platforms/linux/CMakeLists.txt renamed
libiwasm to vmlib, but wasi-nn.cmake still wants to link libiwasm.so.
Replace libiwasm with vmlib in wasi-nn.cmake to resolve iwasm build error
when WAMR_BUILD_WASI_NN enabled.
2025-03-13 17:08:22 +00:00