Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch main into dev/instantiate_linking #4100

Open
wants to merge 1 commit into
base: dev/instantiate_linking
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading