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/wasi-libc-windows #2426

Merged
merged 30 commits into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fbcf8c2
Fix some static scan issues (#2362)
xujuntwt95329 Jul 18, 2023
57abdfd
Fix typo (dwarf) in the codebase (#2367)
cngzhnp Jul 19, 2023
fbe072c
Bring up WAMR on esp32-s3 device (#2348)
dongsheng28849455 Jul 20, 2023
0f4edf9
Implement suspend flags as atomic variable (#2361)
loganek Jul 21, 2023
24c6c69
Fix llvm jit failed to lookup aot_stack_sizes symbol issue (#2384)
wenyongh Jul 24, 2023
1cafa37
Update Docker image for latest version of external libraries & tools …
cngzhnp Jul 24, 2023
ada7e3f
ESP-IDF platform supports to load AOT to PSRAM and run it (#2385)
donghengqaz Jul 27, 2023
6110ea3
Add hadolint CI for Dockerfile linting (#2387)
TianlongLiang Jul 27, 2023
228417a
Move generic parts of wasm_suspend_flags.h to bh_atomic.h (#2393)
yamt Jul 27, 2023
59b2099
Fix some check issues on table operations (#2392)
wenyongh Jul 27, 2023
7db4815
bh_atomic.h: Add comments (#2398)
yamt Jul 28, 2023
10b18d8
Fix ExpandMemoryOpPass doesn't work properly (#2399)
no1wudi Jul 29, 2023
6d6cea1
Fix non-builtin BH_ATOMIC_32_FETCH_OR and BH_ATOMIC_32_FETCH_AND (#2400)
yamt Jul 30, 2023
151600f
Fix wasi-sockets tests (#2389)
loganek Jul 30, 2023
b1fa27e
bh_atomic.h: Add BH_ATOMIC_32_FETCH_ADD/BH_ATOMIC_32_FETCH_SUB (#2408)
yamt Jul 31, 2023
45a4e77
Upgrade cJSON version to v1.7.16 (#2404)
cngzhnp Jul 31, 2023
edea32b
Fix result arity check on select_t opcode (#2406)
wenyongh Jul 31, 2023
84ecf15
Update libuv version to v1.46.0 (#2405)
cngzhnp Jul 31, 2023
8518197
Remove a few unused functions (#2409)
yamt Jul 31, 2023
4b1f027
Re-organize intrinsics in aot_reloc_riscv.c to fix some FPU issues (#…
no1wudi Aug 1, 2023
b88f2c0
Add initial stress test (#2364)
Zzzabiyaka Aug 1, 2023
cb6d850
Fix lib-pthread issues (#2410)
wenyongh Aug 1, 2023
ecd4fcc
Upgrade XNNPACK workload (#2394)
lum1n0us Aug 1, 2023
43a3cbf
Build more benchmarks in workload XNNPACK (#2417)
wenyongh Aug 3, 2023
28125ec
Move wasm_runtime_destroy_wasi and wasi_nn_destroy calls together (#2…
yamt Aug 3, 2023
bdd9913
embed_wamr.md: Improvements about threads (#2420)
yamt Aug 4, 2023
29761c7
Fix typo in test_wamr.sh (#2421)
Zzzabiyaka Aug 4, 2023
9159242
Fix memory sharing (#2415)
yamt Aug 4, 2023
8fc621a
Add runtime inited checks in Enclave command handlings to improve sec…
wenyongh Aug 4, 2023
ebd9466
Add some relocation symbols for xtensa target (#2422)
dongsheng28849455 Aug 6, 2023
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
78 changes: 47 additions & 31 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp/.devcontainer/base.Dockerfile
# [Choice] Debian / Ubuntu version (use Debian 11/9, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT=ubuntu-20.04
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/cpp/.devcontainer/base.Dockerfile
# [Choice] Debian / Ubuntu version (use Debian 12/11/9, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-12, debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT=debian-12
FROM mcr.microsoft.com/vscode/devcontainers/cpp:${VARIANT}

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asian/Shanghai

# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y apt-transport-https apt-utils build-essential \
ca-certificates ccache curl g++-multilib git gnupg \
libgcc-9-dev lib32gcc-9-dev lsb-release \
ninja-build ocaml ocamlbuild python2.7 \
ca-certificates ccache cmake curl g++-multilib git gnupg \
libgcc-12-dev lib32gcc-12-dev lsb-release \
ninja-build ocaml ocamlbuild \
software-properties-common tree tzdata \
unzip valgrind vim wget zip --no-install-recommends \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

#
# binaryen
ARG BINARYEN_VER=111
ARG BINARYEN_VER=114
WORKDIR /opt
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VER}/binaryen-version_${BINARYEN_VER}-x86_64-linux.tar.gz \
&& tar xf binaryen-version_${BINARYEN_VER}-x86_64-linux.tar.gz \
&& ln -sf /opt/binaryen-version_111 /opt/binaryen \
&& ln -sf /opt/binaryen-version_${BINARYEN_VER} /opt/binaryen \
&& rm binaryen-version_${BINARYEN_VER}-x86_64-linux.tar.gz

#
# CMAKE (https://apt.kitware.com/)
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN wget --progress=dot:giga -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null \
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update \
&& rm /usr/share/keyrings/kitware-archive-keyring.gpg \
&& apt-get install -y kitware-archive-keyring --no-install-recommends \
&& apt-get install -y cmake --no-install-recommends \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ARG CMAKE_VER=3.27.0
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh \
-q -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /opt/cmake-${CMAKE_VER} \
&& /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-${CMAKE_VER} \
&& rm /tmp/cmake-install.sh \
&& ln -s /opt/cmake-${CMAKE_VER}/bin/* /usr/local/bin

#
# install emsdk
WORKDIR /opt
RUN git clone https://github.com/emscripten-core/emsdk.git

ARG EMSDK_VER=3.0.0
ARG EMSDK_VER=3.1.43
WORKDIR /opt/emsdk
RUN git pull \
&& ./emsdk install ${EMSDK_VER} \
Expand All @@ -56,40 +57,54 @@ RUN git pull \

#
# install wasi-sdk
ARG WASI_SDK_VER=19
ARG WASI_SDK_VER=20
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER}/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -P /opt \
&& tar xf /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -C /opt \
&& ln -sf /opt/wasi-sdk-${WASI_SDK_VER}.0 /opt/wasi-sdk \
&& rm /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz

#
#install wabt
ARG WABT_VER=1.0.29
ARG WABT_VER=1.0.33
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt \
&& tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
&& ln -sf /opt/wabt-${WABT_VER} /opt/wabt \
&& rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz

#
# install bazelisk
ARG BAZELISK_VER=1.12.0
ARG BAZELISK_VER=1.17.0
RUN mkdir /opt/bazelisk \
&& wget -c --progress=dot:giga https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk \
&& chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
&& ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel

#
# install clang+llvm
ARG LLVM_VER=14
RUN apt-get purge -y clang-10 llvm-10 && apt-get autoremove -y
ARG LLVM_VER=16
RUN apt-get purge -y clang-14 llvm-14 && apt-get autoremove -y
WORKDIR /etc/apt/apt.conf.d
RUN touch 99verfiy-peer.conf \
&& echo "Acquire { https::Verify-Peer false }" > 99verfiy-peer.conf

WORKDIR /tmp
RUN wget --progress=dot:giga https://apt.llvm.org/llvm.sh \
&& chmod a+x ./llvm.sh \
&& ./llvm.sh ${LLVM_VER} all
#RUN wget --progress=dot:giga https://apt.llvm.org/llvm.sh \
# && chmod a+x ./llvm.sh \
# && ./llvm.sh ${LLVM_VER} all

# Workaround due to https://github.com/llvm/llvm-project/issues/62475
# hadolint ignore=DL3008
RUN set -ex \
&& echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${LLVM_VER} main" > /etc/apt/sources.list.d/apt.llvm.org.list \
&& wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \
&& apt-get update \
&& apt-get install -y \
clang-${LLVM_VER} lldb-${LLVM_VER} lld-${LLVM_VER} clangd-${LLVM_VER} clang-tidy-${LLVM_VER} clang-format-${LLVM_VER} clang-tools-${LLVM_VER} \
llvm-${LLVM_VER}-dev lld-${LLVM_VER} lldb-${LLVM_VER} llvm-${LLVM_VER}-tools libomp-${LLVM_VER}-dev libc++-${LLVM_VER}-dev libc++abi-${LLVM_VER}-dev \
libclang-common-${LLVM_VER}-dev libclang-${LLVM_VER}-dev libclang-cpp${LLVM_VER}-dev libunwind-${LLVM_VER}-dev \
libclang-rt-${LLVM_VER}-dev libpolly-${LLVM_VER}-dev --no-install-recommends \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

#
# [Optional]
Expand All @@ -105,18 +120,19 @@ RUN apt-get update \
#
# Install required python packages
# hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& pip3 install --no-cache-dir black nose pycparser pylint
RUN python3 -m pip install --no-cache-dir --break-system-packages --upgrade pip \
&& pip3 install --no-cache-dir --break-system-packages black nose pycparser pylint

#
# Install github-cli. It doens't work as a feature of devcontainer.json
ARG GH_CLI_VER=2.32.0
WORKDIR /tmp
RUN wget -q https://github.com/cli/cli/releases/download/v2.20.2/gh_2.20.2_linux_amd64.deb \
&& dpkg -i gh_2.20.2_linux_amd64.deb
RUN wget -q https://github.com/cli/cli/releases/download/v${GH_CLI_VER}/gh_${GH_CLI_VER}_linux_amd64.deb \
&& dpkg -i gh_${GH_CLI_VER}_linux_amd64.deb

#
# Install NodeJS
RUN wget -qO- https://deb.nodesource.com/setup_19.x | bash -
RUN wget -qO- https://deb.nodesource.com/setup_20.x | bash -
# hadolint ignore=DL3008
RUN apt-get install -y nodejs --no-install-recommends

Expand Down
23 changes: 13 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
// Copyright (C) 2019 Intel Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/cpp
{
"name": "WAMR-Dev",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
// Use Debian 11, Debian 9, Ubuntu 18.04 or Ubuntu 21.04 on local arm64/Apple Silicon
// Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-12, debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
// Use Debian 12, Debian 11, Debian 9, Ubuntu 18.04 or Ubuntu 21.04 on local arm64/Apple Silicon
"args": {
"BINARYEN_VER": "111",
"EMSDK_VER": "3.0.0",
"LLVM_VER": "15",
"VARIANT": "ubuntu-20.04",
"WASI_SDK_VER": "19",
"WABT_VER": "1.0.31"
"BINARYEN_VER": "114",
"BAZELISK_VER": "1.17.0",
"CMAKE_VER": "3.27.0",
"EMSDK_VER": "3.1.43",
"GH_CLI_VER": "2.32.0",
"LLVM_VER": "16",
"VARIANT": "debian-12",
"WASI_SDK_VER": "20",
"WABT_VER": "1.0.33"
}
},
"runArgs": [
Expand All @@ -34,7 +37,7 @@
"llvm-vs-code-extensions.vscode-clangd",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-vscode.cmake-tools",
"ms-vscode.cmake-tools"
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ jobs:
working-directory: ./core/iwasm/libraries/lib-socket/test/

- name: run tests
timeout-minutes: 10
timeout-minutes: 20
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites

Expand All @@ -543,7 +543,7 @@ jobs:
sudo apt install -y g++-multilib lib32gcc-9-dev

- name: run tests x86_32
timeout-minutes: 10
timeout-minutes: 20
if: env.TEST_ON_X86_32 == 'true'
run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/hadolint_dockerfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: hadolint dockerfiles

on:
# will be triggered on PR events
pull_request:
types:
- opened
- synchronize
paths:
- "**/Dockerfile*"
- ".github/workflows/hadolint_dockerfiles.yml"
push:
branches:
- main
- "dev/**"
paths:
- "**/Dockerfile*"
- ".github/workflows/hadolint_dockerfiles.yml"
# 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

jobs:
run-hadolint-on-dockerfiles:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

# on default, hadolint will fail on warnings and errors
- name: Run hadolint on dockerfiles
run: |
docker pull hadolint/hadolint:latest-debian
find . -name "*Dockerfile*" | while read dockerfile; do
echo "run hadolint on $dockerfile:"
docker run --rm -i hadolint/hadolint:latest-debian hadolint - <"$dockerfile"
echo "successful"
done
4 changes: 2 additions & 2 deletions .github/workflows/nightly_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ jobs:
working-directory: ./core/iwasm/libraries/lib-socket/test/

- name: run tests
timeout-minutes: 10
timeout-minutes: 20
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites

Expand All @@ -611,7 +611,7 @@ jobs:
sudo apt install -y g++-multilib lib32gcc-9-dev

- name: run tests x86_32
timeout-minutes: 10
timeout-minutes: 20
if: env.TEST_ON_X86_32 == 'true'
run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites
4 changes: 2 additions & 2 deletions ATTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the

| third party components | version number | latest release | vendor pages | CVE details |
| --- | --- | --- | --- | --- |
| cjson | 1.7.10 | 1.7.14 | https://github.com/DaveGamble/cJSON | https://www.cvedetails.com/vendor/19164/Cjson-Project.html |
| cjson | 1.7.16 | 1.7.16 | https://github.com/DaveGamble/cJSON | https://www.cvedetails.com/vendor/19164/Cjson-Project.html |
| contiki-ng (er-coap) | unspecified | 3.0 | https://github.com/contiki-os/contiki | https://www.cvedetails.com/vendor/16528/Contiki-os.html |
| freebsd libm | unspecified | 13.0 | https://www.freebsd.org/ | https://www.cvedetails.com/vendor/6/Freebsd.html |
| LVGL | 6.0.1 | 7.11.0 | https://lvgl.io/ | |
Expand All @@ -31,7 +31,7 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the
| wasmtime | unspecified | v0.26.0 | https://github.com/bytecodealliance/wasmtime | |
| zephyr | unspecified | v2.5.0 | https://www.zephyrproject.org/ | https://www.cvedetails.com/vendor/19255/Zephyrproject.html |
| WebAssembly debugging patch for LLDB | unspecified | unspecified | https://reviews.llvm.org/D78801 | |
| libuv | v1.42.0 | v1.44.1 | https://github.com/libuv/libuv | https://www.cvedetails.com/vendor/15402/Libuv-Project.html |
| libuv | v1.46.0 | v1.46.0 | https://github.com/libuv/libuv | https://www.cvedetails.com/vendor/15402/Libuv-Project.html |
| uvwasi | unspecified | v0.0.12 | https://github.com/nodejs/uvwasi | |
| asmjit | unspecified | unspecified | https://github.com/asmjit/asmjit | |
| zydis | unspecified | e14a07895136182a5b53e181eec3b1c6e0b434de | https://github.com/zyantific/zydis | |
Expand Down
11 changes: 11 additions & 0 deletions core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,15 @@
#define WASM_CONFIGURABLE_BOUNDS_CHECKS 0
#endif

/* Some chip cannot support external ram with rwx attr at the same time,
it has to map it into 2 spaces of idbus and dbus, code in dbus can be
read/written and read/executed in ibus. so there are 2 steps to execute
the code, first, copy&do relocaiton in dbus space, and second execute
it in ibus space, since in the 2 spaces the contents are the same,
so we call it bus mirror.
*/
#ifndef WASM_MEM_DUAL_BUS_MIRROR
#define WASM_MEM_DUAL_BUS_MIRROR 0
#endif

#endif /* end of _CONFIG_H_ */
12 changes: 12 additions & 0 deletions core/iwasm/aot/aot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -3013,6 +3013,9 @@ create_sections(AOTModule *module, const uint8 *buf, uint32 size,
uint32 section_size;
uint64 total_size;
uint8 *aot_text;
#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
uint8 *mirrored_text;
#endif

if (!resolve_execute_mode(buf, size, &is_indirect_mode, error_buf,
error_buf_size)) {
Expand Down Expand Up @@ -3071,8 +3074,17 @@ create_sections(AOTModule *module, const uint8 *buf, uint32 size,
bh_assert((uintptr_t)aot_text < INT32_MAX);
#endif
#endif

#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
mirrored_text = os_get_dbus_mirror(aot_text);
bh_assert(mirrored_text != NULL);
bh_memcpy_s(mirrored_text, (uint32)total_size,
section->section_body, (uint32)section_size);
os_dcache_flush();
#else
bh_memcpy_s(aot_text, (uint32)total_size,
section->section_body, (uint32)section_size);
#endif
section->section_body = aot_text;
destroy_aot_text = true;

Expand Down
Loading
Loading