Skip to content

Commit

Permalink
Merge branch main into dev/instantiate_linking
Browse files Browse the repository at this point in the history
- fix: when load aot init expr,no type_idx set. (#4094)
- Cmake improvements (#4076)
- fix(aot_emit_aot_file): prevent buffer emission for zero byte_count (#4095)
- fix(unit-test): libc_builtin_test issues (#4073)
- feat: add support for EXTERNREF value type and enable AOT validator in fuzz tests (#4083)
- [gc] Subtyping fix (#4075)
- Add a conditional check for the macro __STDC_VERSION__ (#4080)
- Unit test:type matching issue and code redundancy (#4079)
- build(deps): Bump github/codeql-action from 3.28.8 to 3.28.9 (#4074)
- fix(aot): ensure value_cmp does not exceed br_count in branch table compilation (#4065)
- In wasm32, fix potential conversion overflow when enlarging 65536 pages (#4064)
- [fuzzing] execute every exported function (#3959)
- Update memory allocation functions to use allocator user data (#4043)
- Show wasm proposals status during compilation and execution (#3989)
- add a validator for aot module (#3995)
- Use wasm32-wasip1 instead of wasm32-wasi target for rust code (#4057)
- Update Rust target from 'wasm32-wasi' to 'wasm32-wasip1' in CI (#4050)
- Fix wasm loader check data segment count (#4039)
- Synchronize the GC spec tests to the commit from December 9. 2024. (#4022)
- Refine getting const offsets in wasm loader of fast-interp (#4012)
- fixes for compiling on windows (#4026)
- .github: Add shared lib builds (#3975)
- Refine read leb int wasm loader of fast interpreter (#4017)
- build(deps): Bump github/codeql-action from 3.28.0 to 3.28.1 (#4020)
- build(deps): Bump actions/upload-artifact from 4.5.0 to 4.6.0 (#4021)
- Enable shrunk memory by default and add related configurations (#4008)
- Add documentation regarding security issues and the status of Wasm proposals (#3972)
- Improve stack consistency by ensuring sufficient space for dummy offsets (#4011)
- Check whether related table has funcref elem in opcode call_indirect (#3999)
- [fuzzing] Use software bound-check during fuzzing (#4003)
- Add an example of how to embed WAMR in Zephyr user mode  (#3998)
- Fix table index calculations in wasm_loader and wasm_mini_loader (#4004)
- Ensure __heap_base and __data_end global indices are validated against import count (#3996)
- Error message improvement (#4000)
- Handle a new scenario where an item is both exported and imported. (#3984)
- Optimize memory initialization handling in AOT loader (#3983)
- build(deps): Bump actions/upload-artifact from 4.4.3 to 4.5.0 (#3981)
- build(deps): Bump github/codeql-action from 3.27.9 to 3.28.0 (#3982)
- Add Tianlong into code owners (#3970)
- Set thread information earlier in exec_env creation (#3967)
- top-level cmake: link llvm libraries to our shared library (#3973)
- add reference type support by default for darwin to support WASI-SDK-25 (#3978)
- CMakeLists.txt: Do not require C++ (#3956)
- [fuzzing] Enable instantiation (#3958)
- use a random secret key (#3971)
- top-level cmakefile: fix macOS build (#3968)
- Only access Zephyr thread stats info when it's available (#3962)
- build(deps): Bump github/codeql-action from 3.27.6 to 3.27.9 (#3960)
- wasm_export.h: Use "default" visibility for gcc and clang (#3957)
- set alignment 4 when loading multi return value (#3955)
- Fix aot table instantiate (#3946)
- Consume the placeholders that were put when emitting table info (#3940)
- Refactor SConscript and add file checks in iwasm.c (#3945)
- Improvements for platform thread APIs on Windows and Zephyr (#3941)
- Fix incorrect assignment in win_file.c (#3939)
- don't return an uninitialized trap if argv_to_results fails (#3935)
- support WASM_FUNCREF return type in argv_to_results (#3936)
- add thread cpu time for zephyr (#3937)
- build(deps): bump github/codeql-action from 3.27.4 to 3.27.5 (#3931)
- Update README.md to clarify Windows toolchain support and ESP-IDF reference (#3917)
- Enable ref types by default (#3894)
- Fix loader small bug (#3928)
- add testcases for shared heap and fix POP_MEM_OFFSET of memory64 (#3916)
- Use plain assignment rather than bh_memcpy_s (#3924)
- Fix WASI Path Mapping Processing (#3923)
- Drop declarative elements on module instantiation (#3922)
- Check possible integer overflow in aot memory boundary check (#3920)
- Fix CI wamr-ide error (#3913)
- Support external toolchain on Windows for aot compiler (#3911)
- build(deps): bump github/codeql-action from 3.27.1 to 3.27.4 (#3912)
- Correct the table index calculation in aot_instantiation (#3903)
- Fix a leak in wasm_loader_emit_br_info (#3900)
- GlobalValueSet was moved to IRPartitionLayer recently, but we have a local definition anyway (#3899)
- build(deps): bump github/codeql-action from 3.27.0 to 3.27.1 (#3902)
- Fix linked global initialization in multimodule (#3905)
- Wasm loader enhancement: check code size in code entry  (#3892)
- Refactor AOT loader to support compatible versions (#3891)
- Fix out of bounds issue in is_native_addr_in_shared_heap function (#3886)
- Fix mmap flags for AOT loader on non-Linux SGX platforms (#3890)
- Bump AOT_CURRENT_VERSION for WAMR 2.x (gc, memory64) (#3880)
- Refine looking up aot function with index (#3882)
- build(deps): bump github/codeql-action from 3.26.13 to 3.27.0 (#3888)
- fix(ios): Remove `float-abi` flag (#3889)
- Fix out of bounds issues after memory.grow on non-aot non-threads builds (#3872)
- Exclude fuzz test python and npm packages in scoreboard scan (#3871)

Author: Chris Woods <[email protected]>
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Author: Dylan Johnston <[email protected]>
Author: edoardo <[email protected]>
Author: eric <[email protected]>
Author: Fadumina Barre <[email protected]>
Author: Huang Qi <[email protected]>
Author: James Ring <[email protected]>
Author: Jérôme Vouillon <[email protected]>
Author: kk <[email protected]>
Author: [email protected] <[email protected]>
Author: liang.he <[email protected]>
Author: Maks Litskevich <[email protected]>
Author: Marcin Kolny <[email protected]>
Author: peter-tatrai <[email protected]>
Author: TianlongLiang <[email protected]>
Author: Tomáš Malý <[email protected]>
Author: Viacheslav Palchikov <[email protected]>
Author: WenLY1 <[email protected]>
Author: Wenyong Huang <[email protected]>
Author: Xavier Del Campo <[email protected]>
Author: YAMAMOTO Takashi <[email protected]>
Author: yangkun27 <[email protected]>
  • Loading branch information
lum1n0us committed Feb 23, 2025
1 parent 918b364 commit d005aa9
Show file tree
Hide file tree
Showing 113 changed files with 3,783 additions and 1,639 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_llvm_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
shell: bash
run: |
echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --llvm-ver)" >> $GITHUB_OUTPUT
working-directory: build-scripts

# Bump the prefix number to evict all previous caches and
# enforce a clean build, in the unlikely case that some
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/check_version_h.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: confirm version.h stay in sync

on:
workflow_call:

permissions:
contents: read

jobs:
confirm_version:
runs-on: ubuntu-latest

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

- name: cmake execute to generate version.h
run: cmake -B build_version -S .

- name: confirm version.h
run: |
if [ -z "$(git status --porcelain | grep version.h)" ]; then
echo "version.h is in sync"
else
echo "version.h is not in sync"
exit 1
fi
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.27.4
uses: github/codeql-action/init@v3.28.9
with:
languages: ${{ matrix.language }}

Expand All @@ -70,7 +70,7 @@ jobs:
- run: |
./.github/scripts/codeql_buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.27.4
uses: github/codeql-action/analyze@v3.28.9
with:
category: "/language:${{matrix.language}}"
upload: false
Expand Down Expand Up @@ -99,14 +99,14 @@ jobs:
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif

- name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@v3.27.4
uses: github/codeql-action/upload-sarif@v3.28.9
with:
sarif_file: ${{ steps.step1.outputs.sarif-output }}
category: "/language:${{matrix.language}}"

- name: Upload CodeQL results as an artifact
if: success() || failure()
uses: actions/upload-artifact@v4.4.3
uses: actions/upload-artifact@v4.6.0
with:
name: codeql-results
path: ${{ steps.step1.outputs.sarif-output }}
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ permissions:
contents: read

jobs:
check_version_h:
permissions:
contents: read
actions: write
uses: ./.github/workflows/check_version_h.yml

build_llvm_libraries_on_ubuntu_2204:
permissions:
contents: read
Expand Down Expand Up @@ -156,6 +162,7 @@ jobs:
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
"-DWAMR_BUILD_SHARED=1",
]
os: [ubuntu-22.04]
platform: [android, linux]
Expand Down Expand Up @@ -253,6 +260,9 @@ jobs:
platform: android
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
platform: android
# android does not support WAMR_BUILD_SHARED in its CMakeLists.txt.
- make_options_feature: "-DWAMR_BUILD_SHARED=1"
platform: android
include:
- os: ubuntu-22.04
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
Expand Down Expand Up @@ -671,7 +681,7 @@ 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
# 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"
Expand Down Expand Up @@ -813,7 +823,7 @@ jobs:

- name: install dependencies
run: |
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
sudo apt update && sudo apt-get install -y lld ninja-build
npm install
working-directory: test-tools/wamr-ide/VSCode-Extension
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ jobs:
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
"-DWAMR_BUILD_SHARED=1",
]
os: [ubuntu-20.04]
platform: [android, linux]
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/spec_test_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ jobs:
wamr_feature_option:
# Empty option for default
- { option: "", mode: "" }
- { option: "CONFIG_INTERPRETERS_WAMR_GC CONFIG_INTERPRETERS_WAMR_AOT_STACK_FRAME", mode: "-G" }
# need to install menhir
# - { option: "CONFIG_INTERPRETERS_WAMR_GC CONFIG_INTERPRETERS_WAMR_AOT_STACK_FRAME", mode: "-G" }

exclude:
# XIP is not fully supported yet on RISCV64, some relocations can not be resolved
Expand Down Expand Up @@ -208,7 +209,7 @@ jobs:
if: contains(matrix.wamr_test_option.mode, 'aot')
working-directory: apps/interpreters/wamr/wamr/wamr-compiler
run: |
cmake -Bbuild .
cmake -B build -DWAMR_BUILD_SHRUNK_MEMORY=0 -S .
cmake --build build
# the nuttx version we use for xtensa requires esptool.py newer than
Expand Down Expand Up @@ -350,7 +351,7 @@ jobs:
- name: upload the log
if: always()
uses: actions/upload-artifact@v4.4.3
uses: actions/upload-artifact@v4.6.0
with:
name: spec-test-log-${{ github.run_id }}-${{ strategy.job-index }}-${{ matrix.target_config.target }}
path: log
4 changes: 2 additions & 2 deletions .github/workflows/supply_chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@184d73b71b93c222403b2e7f1ffebe4508014249 # v3.1.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v3.1.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@a1695c562bbfa68dc5ab58c9b5e9f616b52bf5be # v2.2.4
uses: github/codeql-action/upload-sarif@0a35e8f6866a39b001e5f7ad1d0daf9836786896 # v2.2.4
with:
sarif_file: results.sarif
87 changes: 36 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,23 @@

cmake_minimum_required (VERSION 3.0)

option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)

if(ESP_PLATFORM)
include (${COMPONENT_DIR}/build-scripts/esp-idf/wamr/CMakeLists.txt)
return()
endif()

project (iwasm)
project (iwasm LANGUAGES C)

set(CMAKE_CXX_STANDARD 17)

set (CMAKE_VERBOSE_MAKEFILE OFF)

if (NOT DEFINED WAMR_BUILD_PLATFORM)
string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
endif ()

if (NOT DEFINED WAMR_BUILD_STATIC)
set (WAMR_BUILD_STATIC 1)
endif ()
if (NOT DEFINED WAMR_BUILD_SHARED)
set (WAMR_BUILD_SHARED 1)
endif ()

# Reset default linker flags
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
Expand Down Expand Up @@ -113,8 +110,8 @@ if (NOT DEFINED WAMR_BUILD_SIMD)
endif ()

if (NOT DEFINED WAMR_BUILD_REF_TYPES)
# Disable reference types by default
set (WAMR_BUILD_REF_TYPES 0)
# Enable reference types by default
set (WAMR_BUILD_REF_TYPES 1)
endif ()

set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down Expand Up @@ -154,52 +151,40 @@ if (MSVC)
add_definitions(-DCOMPILING_WASM_RUNTIME_API=1)
endif ()

# STATIC LIBRARY
if (WAMR_BUILD_STATIC)
add_library(iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE})
set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib)
target_include_directories(iwasm_static INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include)
target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl ${CMAKE_THREAD_LIBS_INIT})
if (WAMR_BUILD_WASM_CACHE EQUAL 1)
target_link_libraries(iwasm_static INTERFACE boringssl_crypto)
endif ()
add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE})
set_target_properties (vmlib PROPERTIES OUTPUT_NAME iwasm)
target_include_directories(vmlib INTERFACE
$<BUILD_INTERFACE:${WAMR_ROOT_DIR}/core/iwasm/include>
$<INSTALL_INTERFACE:include/iwasm>
)

if (MINGW)
target_link_libraries (iwasm_static PRIVATE ws2_32)
endif ()

if (WIN32)
target_link_libraries(iwasm_static PRIVATE ntdll)
endif()
target_link_libraries (vmlib PUBLIC ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl ${CMAKE_THREAD_LIBS_INIT})
if (WAMR_BUILD_WASM_CACHE EQUAL 1)
target_link_libraries(vmlib INTERFACE boringssl_crypto)
endif ()

install (TARGETS iwasm_static ARCHIVE DESTINATION lib)
if (MINGW)
target_link_libraries(vmlib INTERFACE -lWs2_32 -lwsock32)
target_link_libraries(vmlib PRIVATE ws2_32)
endif ()

# SHARED LIBRARY
if (WAMR_BUILD_SHARED)
add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE})
set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm)
target_include_directories(iwasm_shared INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include)
target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl ${CMAKE_THREAD_LIBS_INIT})
if (WAMR_BUILD_WASM_CACHE EQUAL 1)
target_link_libraries(iwasm_shared INTERFACE boringssl_crypto)
endif ()
if (WIN32)
target_link_libraries(vmlib PRIVATE ntdll)
endif()

if (MINGW)
target_link_libraries(iwasm_shared INTERFACE -lWs2_32 -lwsock32)
target_link_libraries(iwasm_shared PRIVATE ws2_32)
endif ()
set (WAMR_PUBLIC_HEADERS
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_export.h
${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h
)
set_target_properties (vmlib PROPERTIES PUBLIC_HEADER "${WAMR_PUBLIC_HEADERS}")

if (WIN32)
target_link_libraries(iwasm_shared PRIVATE ntdll)
endif()
set_version_info (vmlib)

install (TARGETS iwasm_shared LIBRARY DESTINATION lib)
endif ()
install (TARGETS vmlib
EXPORT iwasmTargets
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/iwasm
)

# HEADERS
install (FILES
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_export.h
${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h
DESTINATION include)
install_iwasm_package ()
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# If none of the later patterns match, assign to anyone. This team is the
# parent of all the other teams and automatically includes everyone on those
# teams.
* @loganek @lum1n0us @no1wudi @wenyongh @xujuntwt95329 @yamt
* @loganek @lum1n0us @no1wudi @TianlongLiang @wenyongh @xujuntwt95329 @yamt

# Some parts of the project require more specialized knowledge. In those areas
# we designate smaller groups who are more likely to be aware of who's working
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ The WAMR VMcore supports the following architectures:
- XTENSA, MIPS, ARC

The following platforms are supported, click each link below for how to build iwasm on that platform. Refer to [WAMR porting guide](./doc/port_wamr.md) for how to port WAMR to a new platform.
- [Linux](./product-mini/README.md#linux), [Linux SGX (Intel Software Guard Extension)](./doc/linux_sgx.md), [MacOS](./product-mini/README.md#macos), [Android](./product-mini/README.md#android), [Windows](./product-mini/README.md#windows), [Windows (MinGW)](./product-mini/README.md#mingw)
- [Zephyr](./product-mini/README.md#zephyr), [AliOS-Things](./product-mini/README.md#alios-things), [VxWorks](./product-mini/README.md#vxworks), [NuttX](./product-mini/README.md#nuttx), [RT-Thread](./product-mini/README.md#RT-Thread), [ESP-IDF](./product-mini/README.md#esp-idf)
- [Linux](./product-mini/README.md#linux), [Linux SGX (Intel Software Guard Extension)](./doc/linux_sgx.md), [MacOS](./product-mini/README.md#macos), [Android](./product-mini/README.md#android), [Windows](./product-mini/README.md#windows), [Windows (MinGW, MSVC)](./product-mini/README.md#mingw)
- [Zephyr](./product-mini/README.md#zephyr), [AliOS-Things](./product-mini/README.md#alios-things), [VxWorks](./product-mini/README.md#vxworks), [NuttX](./product-mini/README.md#nuttx), [RT-Thread](./product-mini/README.md#RT-Thread), [ESP-IDF(FreeRTOS)](./product-mini/README.md#esp-idf)


## Getting started
Expand Down
Loading

0 comments on commit d005aa9

Please sign in to comment.