Skip to content

Commit

Permalink
Merge branch 'bytecodealliance:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsmc authored Aug 30, 2024
2 parents 993ee55 + eab409a commit 15ffcae
Show file tree
Hide file tree
Showing 32 changed files with 2,049 additions and 406 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_wamr_vscode_ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x

- name: set vscode extension to correct version
run: |
Expand All @@ -33,7 +33,7 @@ jobs:

- name: generate wamr ide vscode extension
run: |
npm install -g vsce
npm install -g @vscode/vsce
rm -rf node_modules
npm install
vsce package
Expand Down
44 changes: 36 additions & 8 deletions .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ env:
WAMR_COMPILER_TEST_OPTIONS: "-s wamr_compiler -S -b -P"
GC_TEST_OPTIONS: "-s spec -G -b -P"
MEMORY64_TEST_OPTIONS: "-s spec -W -b -P"
MULTI_MEMORY_TEST_OPTIONS: "-s spec -E -b -P"

jobs:
build_llvm_libraries_on_ubuntu_2204:
Expand Down Expand Up @@ -148,6 +149,7 @@ jobs:
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
]
os: [ubuntu-22.04]
platform: [android, linux]
Expand Down Expand Up @@ -206,11 +208,9 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
# Memory64 only on CLASSIC INTERP mode, and only on 64-bit platform
# Memory64 only on CLASSIC INTERP and AOT mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
Expand All @@ -221,6 +221,21 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
# Multi memory only on CLASSIC INTERP mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
# Fast-JIT and Multi-Tier-JIT mode don't support android
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
platform: android
Expand Down Expand Up @@ -593,6 +608,7 @@ jobs:
$WASI_TEST_OPTIONS,
$GC_TEST_OPTIONS,
$MEMORY64_TEST_OPTIONS,
$MULTI_MEMORY_TEST_OPTIONS,
]
wasi_sdk_release:
[
Expand Down Expand Up @@ -640,18 +656,30 @@ jobs:
test_option: $MEMORY64_TEST_OPTIONS
- running_mode: "multi-tier-jit"
test_option: $MEMORY64_TEST_OPTIONS
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
- running_mode: "aot"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "fast-interp"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "fast-jit"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "jit"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "multi-tier-jit"
test_option: $MULTI_MEMORY_TEST_OPTIONS

steps:
- name: checkout
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option == '$GC_TEST_OPTIONS'
with:
ocaml-compiler: 4.13

- name: Set-up Ocamlbuild
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option == '$GC_TEST_OPTIONS'
run: opam install ocamlbuild dune menhir

- name: download and install wasi-sdk
Expand Down Expand Up @@ -717,13 +745,13 @@ jobs:

- name: run tests
timeout-minutes: 30
if: matrix.test_option != '$GC_TEST_OPTIONS' && matrix.test_option != '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option != '$GC_TEST_OPTIONS'
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites

- name: run gc or memory64 tests
- name: run gc tests
timeout-minutes: 20
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option == '$GC_TEST_OPTIONS'
run: |
eval $(opam env)
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
Expand Down
44 changes: 25 additions & 19 deletions .github/workflows/compilation_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,17 @@ jobs:
# arm64
"boards/arm64/qemu/qemu-armv8a/configs/nsh",
]
wamr_config_option: [
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
]

wamr_config_option:
- "CONFIG_INTERPRETERS_WAMR_AOT"
- "CONFIG_INTERPRETERS_WAMR_FAST"
- "CONFIG_INTERPRETERS_WAMR_CLASSIC"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST CONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC CONFIG_INTERPRETERS_WAMR_LIBC_WASI"

steps:
- name: Checkout NuttX
Expand All @@ -102,23 +101,30 @@ jobs:
repository: ${{ github.repository }}
path: apps/interpreters/wamr/wamr

- name: Enable WAMR for NuttX
- name: Configure WAMR
working-directory: nuttx
run: |
find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\n${{ matrix.wamr_config_option }}'
find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
tools/configure.sh ${{ matrix.nuttx_board_config }}
kconfig-tweak --enable CONFIG_PSEUDOFS_SOFTLINKS
kconfig-tweak --enable CONFIG_INTERPRETERS_WAMR
kconfig-tweak --enable CONFIG_INTERPRETERS_IWASM_TASK
kconfig-tweak --set-val CONFIG_INTERPRETERS_WAMR_PRIORITY 100
kconfig-tweak --set-val CONFIG_INTERPRETERS_WAMR_STACKSIZE 8192
for x in ${{ matrix.wamr_config_option }}; do
kconfig-tweak --enable $x
done
- name: Build
run: |
cd nuttx
tools/configure.sh ${{ matrix.nuttx_board_config }}
make -j$(nproc) EXTRAFLAGS=-Werror
working-directory: nuttx
run: make -j$(nproc) EXTRAFLAGS=-Werror

- name: Checkout Bloaty
uses: actions/checkout@v3
with:
repository: google/bloaty
submodules: recursive
path: bloaty
ref: 34f4a66559ad4938c1e629e9b5f54630b2b4d7b0

- name: Build Bloaty
run: |
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/nightly_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
]
os: [ubuntu-20.04]
platform: [android, linux]
Expand Down Expand Up @@ -190,11 +191,9 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
# Memory64 only on CLASSIC INTERP mode, and only on 64-bit platform
# Memory64 only on CLASSIC INTERP and AOT mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
Expand All @@ -205,6 +204,21 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
# Multi memory only on CLASSIC INTERP mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
# Fast-JIT and Multi-Tier-JIT mode don't support android
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
platform: android
Expand Down Expand Up @@ -289,6 +303,7 @@ jobs:
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
]
exclude:
# incompatible feature and platform
Expand Down Expand Up @@ -322,6 +337,11 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
# Memory64 only on CLASSIC INTERP mode
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
steps:
- name: Install dependencies
run: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/spec_test_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ jobs:
- target_config: { config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh64" }
wamr_test_option: { mode: "-t aot -X" }

# XIP is not fully supported yet on RISCV32 ILP32F, some relocations can not be resolved
- target_config: { config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh", fpu_type: "fp" }
wamr_test_option: { mode: "-t aot -X" }

# Our xtensa environment doesn't have enough memory
- target_config: { target: "xtensa" }
wamr_feature_option: { mode: "-G" }
Expand Down
74 changes: 74 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
## WAMR-2.1.2

### Breaking Changes
- wasi-nn: Apply new architecture (#3692)

### New Features
- [wasi-nn] Add a new wasi-nn backend openvino (#3603)
- Add APIs into wasm_c_api.h to summary wasm function execution duration (#3639)
- Add support for RISCV32 ILP32F (#3708)

### Bug Fixes
- libc-builtin: Fix function prototype for wasm_runtime_module_realloc (#3702)
- Fix potential memory leak in insert_native_symbol (#3712)
- aot compiler: Fix NaN handling for opcode f32/f64.const in XIP mode (#3721)
- Fix table idx resolving in op call_indirect/return_call_indirect (#3726)

### Enhancements
- Remove a few hardcoded spec test knowledge from the core library (#3648)
- Change log of import function to be consistent (#3656)
- libc-builtin: Fix a printf format (#3652)
- Set compile symbol visibility to hidden in cmake (#3655)
- wamrc: Add --mllvm= option (#3658)
- wamr-compiler: Avoid size-level tweak if target is specified (#3659)
- aot runtime: Add missing arm/thumb relocations (#3660)
- aot compiler: Enlarge AOTNativeSymbol->symbol (#3662)
- aot compiler: Bail out on too long native symbol names (#3663)
- Support more features for rt-thread (#3661)
- Zephyr User Mode Support (#3650)
- Set posix thread name for debug build (#3657)
- Add emscripten_sleep() wrapper to libc-emcc (#3669)
- Fix a compilation warning (#3682)
- wamrc: Add some help text for --size-level (#3689)
- Restore linux iwasm default visibility (#3691)
- posix_thread.c: Restore old signal alternate stack before thread exit (#3693)
- libc-wasi: Make rights of STDIN/STDOUT/STDERR fixed and overlook their access modes (#3694)
- [refactoring] Extract read leb to a separate file, share the code between loader and mini loader (#3701)
- debug-interp: Only add lock when signal_flag is SIG_SINGSTEP (#3704)
- Fix compilation warnings (#3707)
- Add missing headers in bh_atomic.h and aot_llvm_extra.cpp (#3715)
- Update std atomic check and simd compatibility check for arc compiler (#3716)
- aot compiler: Track non-0x00 tableindex as ref types use (#3695)
- compilation: Use the dedicated stack-sizes section only for AOT (#3732)
- riscv: Add missing relocation intrinsics for __fixdfsi/__ltdf2 (#3733)

### Others
- Fix night run CI (#3640)
- spec-test-script/runtest.py: Don't assume the tmp dir path (#3632)
- wamr-test-suites: Remove dead code (wasi_test) (#3634)
- wamr-test-suites/test_wamr.sh: Add an option to specify wamrc binary (#3635)
- CI: Build llvm for xtensa (#3637)
- spec-test-script/runtest.py: Avoid specifying -v=0 unnecessarily (#3642)
- spec-test-script: Add xtensa case (#3643)
- spec-test-script/runtest.py: Move "--size-level=1" to common place for RISCV64 (#3644)
- spec-test-script/runtest.py: Use a shorter timeout when expected to fail (#3647)
- spec-test-script: Make case_last_words larger (#3651)
- spec-test-script/runtest.py: Reduce stack size for aot w/o gc (#3653)
- spec-test-script: Skip a few tests for xtensa qemu (#3664)
- spec-test-script: Use -mtext-section-literals for xtensa xip (#3666)
- spec_test_on_nuttx.yml: Add xtensa (#3665)
- spec_test_on_nuttx.yml: Enable xip (#3671)
- spec_test_on_nuttx.yml: Record more logs (#3670)
- spec_test_on_nuttx.yml: Replace sed with kconfig-tweak (#3672)
- spec_test_on_nuttx.yml: Retire CONFIG_EOL_IS_LF (#3676)
- spec-test-script/runtest.py: Use wamrc --xip option for xip (#3683)
- CI: Bump NuttX version to 12.6 (#3684)
- wamr-test-suites: Clean up generated tmp files after spec test (#3700)
- test_wamr.sh: Fix build wabt tool (#3703)
- NuttX: Retire CONFIG_ARCH_RV32IM and CONFIG_ARCH_RV64GC (#3717)
- runtest.py: Normallize option handling for XIP mode (#3722)
- CI: Enable XIP spectest for RISCV32 ILP32F (#3727)
- CI: Unify configuration stage for NuttX (#3725)

---

## WAMR-2.1.1

### Breaking Changes
Expand Down
5 changes: 5 additions & 0 deletions build-scripts/config_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ if (WAMR_BUILD_MEMORY64 EQUAL 1)
set (WAMR_DISABLE_HW_BOUND_CHECK 1)
message (" Memory64 memory enabled")
endif ()
if (WAMR_BUILD_MULTI_MEMORY EQUAL 1)
add_definitions (-DWASM_ENABLE_MULTI_MEMORY=1)
message (" Multi memory enabled")
set (WAMR_BUILD_DEBUG_INTERP 0)
endif ()
if (WAMR_BUILD_THREAD_MGR EQUAL 1)
message (" Thread manager enabled")
endif ()
Expand Down
5 changes: 5 additions & 0 deletions core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,11 @@
#define WASM_ENABLE_MEMORY64 0
#endif

/* Disable multi-memory by default */
#ifndef WASM_ENABLE_MULTI_MEMORY
#define WASM_ENABLE_MULTI_MEMORY 0
#endif

#ifndef WASM_TABLE_MAX_SIZE
#define WASM_TABLE_MAX_SIZE 1024
#endif
Expand Down
Loading

0 comments on commit 15ffcae

Please sign in to comment.