Compare commits

...

11 Commits

Author SHA1 Message Date
liang.he
52196450a7
Merge 688200a6f2 into 17be90d8f0 2025-07-10 14:40:54 +08:00
YAMAMOTO Takashi
17be90d8f0
posix os_socket_addr_resolve: return the consistent max_info_size (#4467)
Some checks are pending
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) Blocked by required conditions
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) Blocked by required conditions
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) Blocked by required conditions
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) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build_llvm_libraries_on_windows (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
return the same value for max_info_size regardless of addr_info_size.
2025-07-10 13:42:57 +08:00
Zhenwei Jin
9e92f5ebe1
fix a wamrc debug mode compile issue (#4470) 2025-07-10 08:29:31 +08:00
Zhenwei Jin
334b4f8cb5
Add readme for extended const (#4471) 2025-07-10 08:29:03 +08:00
YAMAMOTO Takashi
56f87b7ee9
wasi-nn: do not pretend to support legacy abi in openvino and llamacpp (#4468)
as tested by core/iwasm/libraries/wasi-nn/test/test_tensorflow.c,
the legacy "wasi_nn" abi uses the number of fp32 for get_output.
because these backends don't implement the abi, bail out explicitly
in build time.

cf.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/4376
2025-07-10 08:28:08 +08:00
YAMAMOTO Takashi
933e49df18
appease a few compiler warnings (-Wstrict-prototypes) (#4465) 2025-07-10 08:28:00 +08:00
Zhenwei Jin
d6fc18e197
enable aux stack frame for aot compiler fuzz test (#4462) 2025-07-10 08:27:42 +08:00
dependabot[bot]
cd4712d939
build(deps): Bump github/codeql-action from 3.29.1 to 3.29.2 (#4459)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.1 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.1...v3.29.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.2
  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-07-10 08:27:32 +08:00
Liu Jia
903a5c1f8c
improve logic of heap_type validation when ref.null (#4372)
* Follow-up to PR #4300: prevent potential overflow

PR #4300 introduced the rationale for validating heap_type.
This patch moves the validation before the computation of
type1 to prevent potential overflow.
2025-07-10 08:27:11 +08:00
liang.he@intel.com
688200a6f2 test zephyrproject-rtos/ci-base image
Construct a T2 (star topology) for the current smoke test. This is not the
final topology, and we may modify it once we determine the optimal
configuration.
2025-07-06 18:22:42 +00:00
liang.he@intel.com
9271ec3ca5 Add a new CI on Zephyr
to run product-mini/platforms/zephyr/simple and
product-mini/platforms/zephyr/user-mode
2025-07-01 11:47:35 +00:00
16 changed files with 259 additions and 56 deletions

46
.github/scripts/run_qemu_arc.sh vendored Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
# THIS SCRIPT IS USED TO RUN QEMU ARC EMULATOR DIRECTLY ON CI ONLY.
# USUALLY, you SHOULD NOT RUN IT ON YOUR LOCAL MACHINE.
# INSTEAD, YOU SHOULD USE `west build -t run` COMMAND.
# Two arguments. first is the path to the zephyr-sdk, second is the path to the zephyr elf.
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <path_to_zephyr_sdk> <path_to_zephyr_elf>"
exit 1
fi
ZEPHYR_SDK_PATH=$1
ZEPHYR_ELF_PATH=$2
if [ ! -d "$ZEPHYR_SDK_PATH" ]; then
echo "Error: Zephyr SDK path does not exist: $ZEPHYR_SDK_PATH"
exit 1
fi
if [ ! -f "$ZEPHYR_ELF_PATH" ]; then
echo "Error: Zephyr ELF file does not exist: $ZEPHYR_ELF_PATH"
exit 1
fi
# this command is copied from the content of build.ninja which is generated by west build.
# please do not modify it unless synchronizing with the build.ninja file.
$ZEPHYR_SDK_PATH/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-system-arc \
-cpu arcem -m 8M \
-nographic -no-reboot -monitor none \
-global cpu.firq=false \
-global cpu.num-irqlevels=15 \
-global cpu.num-irq=25 \
-global cpu.ext-irq=20 \
-global cpu.freq_hz=10000000 \
-global cpu.timer0=true \
-global cpu.timer1=true \
-global cpu.has-mpu=true \
-global cpu.mpu-numreg=16 \
-net none \
-pidfile qemu.pid \
-chardev stdio,id=con,mux=on \
-serial chardev:con \
-mon chardev=con,mode=readline \
-icount shift=6,align=off,sleep=off \
-rtc clock=vm \
-kernel $ZEPHYR_ELF_PATH

View File

@ -53,7 +53,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3.29.1 uses: github/codeql-action/init@v3.29.2
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
@ -70,7 +70,7 @@ jobs:
- run: | - run: |
./.github/scripts/codeql_buildscript.sh ./.github/scripts/codeql_buildscript.sh
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.29.1 uses: github/codeql-action/analyze@v3.29.2
with: with:
category: "/language:${{matrix.language}}" category: "/language:${{matrix.language}}"
upload: false upload: false
@ -99,7 +99,7 @@ jobs:
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
- name: Upload CodeQL results to code scanning - name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@v3.29.1 uses: github/codeql-action/upload-sarif@v3.29.2
with: with:
sarif_file: ${{ steps.step1.outputs.sarif-output }} sarif_file: ${{ steps.step1.outputs.sarif-output }}
category: "/language:${{matrix.language}}" category: "/language:${{matrix.language}}"

View File

@ -0,0 +1,129 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: compilation on zephyr
on:
# will be triggered on PR events
pull_request:
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/platforms/common/**"
- "product-mini/platforms/zephyr/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
# will be triggered on push events
push:
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/platforms/common/**"
- "product-mini/platforms/zephyr/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
# 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
env:
# FOR SETUP
ZEPHYR_SDK_VERSION: "0.16.9"
ZEPHYR_VERSION: "v3.7.0"
# FOR BUILD
permissions:
contents: read
jobs:
smoke_test:
runs-on: ubuntu-22.04
container:
# For Zephyr 3.7 LTS, use the v0.26-branch or the latest v0.26.x release Docker image.
# ci require a larger runner to avoid "no space left on device"
image: ghcr.io/zephyrproject-rtos/ci-base:v0.26-branch
options: --user root
steps:
# https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-application
# zephyrproject/ --> CI ROOT
# ├─── .west/
# │ └─── config
# ├─── bootloader/
# ├─── zephyr/ --> Zephyr source code
# ├─── zephyr-sdk/
# ├─── modules/
# │ |─── wasm-micro-runtime --> WAMR source code
# ├─── tools/
# ├─── vendor/
# └─── application/ --> DUMMY. keep west_lite.yml here
- name: Checkout code
uses: actions/checkout@v3
with:
path: modules/wasm-micro-runtime
- name: Prepare Zephyr environment
shell: bash
run: |
mkdir -p application
cp modules/wasm-micro-runtime/product-mini/platforms/zephyr/simple/west_lite.yml application/west_lite.yml
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: application
manifest-file-name: west_lite.yml
sdk-version: ${{ env.ZEPHYR_SDK_VERSION }}
toolchains: arc-zephyr-elf:arc64-zephyr-elf
- name: Build a sample application(simple)
shell: bash
run: |
pushd product-mini/platforms/zephyr/simple
west build . -b qemu_arc/qemu_arc_hs -p always -- -DWAMR_BUILD_TARGET=ARC
popd
# west build -t run will fork several processes, which will cause the job to hang.
# run in the background and kill it after 5 seconds
.github/scripts/run_qemu_arc.sh \
../../zephyr-sdk \
product-mini/platforms/zephyr/simple/build/zephyr/zephyr.elf &
sleep 5
pkill qemu-system-arc
working-directory: modules/wasm-micro-runtime
- name: Build a sample application(user-mode)
shell: bash
run: |
pushd product-mini/platforms/zephyr/user-mode
west build . -b qemu_arc/qemu_arc_hs -p always -- -DWAMR_BUILD_TARGET=ARC
popd
# west build -t run will fork several processes, which will cause the job to hang.
# run in the background and kill it after 5 seconds
.github/scripts/run_qemu_arc.sh \
../../zephyr-sdk \
product-mini/platforms/zephyr/user-mode/build/zephyr/zephyr.elf &
sleep 5
pkill qemu-system-arc
working-directory: modules/wasm-micro-runtime

View File

@ -60,6 +60,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard. # Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@4c57370d0304fbff638216539f81d9163f77712a uses: github/codeql-action/upload-sarif@b69421388d5449cc5a5e1ca344d71926bda69e07
with: with:
sarif_file: results.sarif sarif_file: results.sarif

View File

@ -48,6 +48,7 @@ WebAssembly Micro Runtime (WAMR) is a lightweight standalone WebAssembly (Wasm)
- [Reference Types](https://github.com/WebAssembly/reference-types), ref to [document](doc/ref_types.md) and [sample](samples/ref-types) - [Reference Types](https://github.com/WebAssembly/reference-types), ref to [document](doc/ref_types.md) and [sample](samples/ref-types)
- [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations), [Shared memory](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory), [Memory64](https://github.com/WebAssembly/memory64) - [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations), [Shared memory](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory), [Memory64](https://github.com/WebAssembly/memory64)
- [Tail-call](https://github.com/WebAssembly/tail-call), [Garbage Collection](https://github.com/WebAssembly/gc), [Exception Handling](https://github.com/WebAssembly/exception-handling) - [Tail-call](https://github.com/WebAssembly/tail-call), [Garbage Collection](https://github.com/WebAssembly/gc), [Exception Handling](https://github.com/WebAssembly/exception-handling)
- [Extended Constant Expressions](https://github.com/WebAssembly/extended-const)
### Supported architectures and platforms ### Supported architectures and platforms
The WAMR VMcore supports the following architectures: The WAMR VMcore supports the following architectures:

View File

@ -4711,7 +4711,7 @@ aot_unload(AOTModule *module)
} }
uint32 uint32
aot_get_plt_table_size() aot_get_plt_table_size(void)
{ {
return get_plt_table_size(); return get_plt_table_size();
} }

View File

@ -8,7 +8,7 @@
static char aot_error[128]; static char aot_error[128];
char * char *
aot_get_last_error() aot_get_last_error(void)
{ {
return aot_error[0] == '\0' ? "" : aot_error; return aot_error[0] == '\0' ? "" : aot_error;
} }

View File

@ -1905,7 +1905,7 @@ aot_emit_init_expr(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
{ {
WASMArrayType *array_type = NULL; WASMArrayType *array_type = NULL;
bh_assert(expr->u.array_new_default.type_index bh_assert(expr->u.unary.v.array_new_default.type_index
< module->type_count); < module->type_count);
array_type = array_type =
(WASMArrayType *) (WASMArrayType *)

View File

@ -98,10 +98,10 @@ void
aot_destroy_aot_file(uint8_t *aot_file); aot_destroy_aot_file(uint8_t *aot_file);
char * char *
aot_get_last_error(); aot_get_last_error(void);
uint32_t uint32_t
aot_get_plt_table_size(); aot_get_plt_table_size(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -999,12 +999,10 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
/* ref.null */ /* ref.null */
case INIT_EXPR_TYPE_REFNULL_CONST: case INIT_EXPR_TYPE_REFNULL_CONST:
{ {
uint8 type1;
#if WASM_ENABLE_GC == 0 #if WASM_ENABLE_GC == 0
uint8 type1;
CHECK_BUF(p, p_end, 1); CHECK_BUF(p, p_end, 1);
type1 = read_uint8(p); type1 = read_uint8(p);
cur_value.ref_index = NULL_REF; cur_value.ref_index = NULL_REF;
if (!push_const_expr_stack(&const_expr_ctx, flag, type1, if (!push_const_expr_stack(&const_expr_ctx, flag, type1,
&cur_value, &cur_value,
@ -1014,23 +1012,34 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
error_buf, error_buf_size)) error_buf, error_buf_size))
goto fail; goto fail;
#else #else
/*
* According to the current GC SPEC rules, the heap_type must be
* validated when ref.null is used. It can be an absheaptype,
* or the type C.types[type_idx] must be defined in the context.
*/
int32 heap_type; int32 heap_type;
read_leb_int32(p, p_end, heap_type); read_leb_int32(p, p_end, heap_type);
type1 = (uint8)((int32)0x80 + heap_type);
cur_value.gc_obj = NULL_REF; cur_value.gc_obj = NULL_REF;
if (!is_byte_a_type(type1) /*
|| !wasm_is_valid_heap_type(heap_type) * The current check of heap_type can deterministically infer
|| wasm_is_type_multi_byte_type(type1)) { * the result of the previous condition
p--; * `(!is_byte_a_type(type1) ||
read_leb_uint32(p, p_end, type_idx); * wasm_is_type_multi_byte_type(type1))`. Therefore, the
if (!check_type_index(module, module->type_count, type_idx, * original condition is redundant and has been removed.
error_buf, error_buf_size)) *
goto fail; * This logic is consistent with the implementation of the
* `WASM_OP_REF_NULL` case in the `wasm_loader_prepare_bytecode`
* function.
*/
if (heap_type >= 0) {
if (!check_type_index(module, module->type_count, heap_type,
error_buf, error_buf_size)) {
goto fail;
}
wasm_set_refheaptype_typeidx(&cur_ref_type.ref_ht_typeidx, wasm_set_refheaptype_typeidx(&cur_ref_type.ref_ht_typeidx,
true, type_idx); true, heap_type);
if (!push_const_expr_stack(&const_expr_ctx, flag, if (!push_const_expr_stack(&const_expr_ctx, flag,
cur_ref_type.ref_type, cur_ref_type.ref_type,
&cur_ref_type, 0, &cur_value, &cur_ref_type, 0, &cur_value,
@ -1041,8 +1050,16 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
goto fail; goto fail;
} }
else { else {
if (!push_const_expr_stack(&const_expr_ctx, flag, type1, if (!wasm_is_valid_heap_type(heap_type)) {
NULL, 0, &cur_value, set_error_buf_v(error_buf, error_buf_size,
"unknown type %d", heap_type);
goto fail;
}
cur_ref_type.ref_ht_common.ref_type =
(uint8)((int32)0x80 + heap_type);
if (!push_const_expr_stack(&const_expr_ctx, flag,
cur_ref_type.ref_type, NULL, 0,
&cur_value,
#if WASM_ENABLE_EXTENDED_CONST_EXPR != 0 #if WASM_ENABLE_EXTENDED_CONST_EXPR != 0
NULL, NULL,
#endif #endif

View File

@ -17,6 +17,10 @@ extern char const *LLAMA_COMMIT;
extern char const *LLAMA_COMPILER; extern char const *LLAMA_COMPILER;
extern char const *LLAMA_BUILD_TARGET; extern char const *LLAMA_BUILD_TARGET;
#if WASM_ENABLE_WASI_EPHEMERAL_NN == 0
#error This backend doesn't support legacy "wasi_nn" abi. Please enable WASM_ENABLE_WASI_EPHEMERAL_NN.
#endif
// compatible with WasmEdge // compatible with WasmEdge
// https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/wasmedge-ggml/README.md#parameters // https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/wasmedge-ggml/README.md#parameters
// https://github.com/WasmEdge/WasmEdge/blob/master/plugins/wasi_nn/ggml.cpp // https://github.com/WasmEdge/WasmEdge/blob/master/plugins/wasi_nn/ggml.cpp

View File

@ -9,6 +9,10 @@
#include "openvino/c/openvino.h" #include "openvino/c/openvino.h"
#if WASM_ENABLE_WASI_EPHEMERAL_NN == 0
#error This backend doesn't support legacy "wasi_nn" abi. Please enable WASM_ENABLE_WASI_EPHEMERAL_NN.
#endif
/* /*
* refer to * refer to
* https://docs.openvino.ai/2024/openvino-workflow/running-inference/integrate-openvino-with-your-application.html * https://docs.openvino.ai/2024/openvino-workflow/running-inference/integrate-openvino-with-your-application.html

View File

@ -406,12 +406,11 @@ os_socket_addr_resolve(const char *host, const char *service,
res = result; res = result;
while (res) { while (res) {
if (addr_info_size > pos) {
if (!is_addrinfo_supported(res)) { if (!is_addrinfo_supported(res)) {
res = res->ai_next; res = res->ai_next;
continue; continue;
} }
if (addr_info_size > pos) {
ret = ret =
sockaddr_to_bh_sockaddr(res->ai_addr, &addr_info[pos].sockaddr); sockaddr_to_bh_sockaddr(res->ai_addr, &addr_info[pos].sockaddr);

View File

@ -3,7 +3,23 @@
# Refer to https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html # Refer to https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html
# for more information on how to set up the Zephyr development environment. # for more information on how to set up the Zephyr development environment.
FROM ubuntu:22.04
# https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-application
# zephyrproject/ --> CI ROOT
# ├─── .west/
# │ └─── config
# ├─── bootloader/
# ├─── zephyr/ --> Zephyr source code
# ├─── zephyr-sdk/
# ├─── modules/
# │ |─── wasm-micro-runtime --> WAMR source code
# ├─── tools/
# ├─── vendor/
# └─── application/ --> DUMMY. keep west_lite.yml here
# If you modify this file, you may need to sync the modifications to the
# .github/actions/setup-zephyr/action.yml
FROM ghcr.io/zephyrproject-rtos/ci-base:v0.26-branch
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asian/Shanghai ENV TZ=Asian/Shanghai
@ -11,44 +27,30 @@ ARG ZEPHYR_SDK_VERSION=0.16.9
# In west_lite.yml, the Zephyr version is set to v3.7.0 # In west_lite.yml, the Zephyr version is set to v3.7.0
#ARG ZEPHYR_VERSION=3.7.0 #ARG ZEPHYR_VERSION=3.7.0
# Install dependencies for Zephyr
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Install the Zephyr Software Development Kit (SDK) # Install the Zephyr Software Development Kit (SDK)
WORKDIR /opt WORKDIR /root/zephyrproject/zephyr-sdk
# hadolint ignore=DL4006 # hadolint ignore=DL4006
RUN wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz \ RUN wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz \
&& wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/sha256.sum | shasum --check --ignore-missing \ && wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/sha256.sum | shasum --check --ignore-missing \
&& tar xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz && tar --strip-components=1 -xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64.tar.xz
WORKDIR /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
# hadolint ignore=DL4006 # hadolint ignore=DL4006
# Install host tools and Register Zephyr SDK CMake package # Install host tools and Register Zephyr SDK CMake package
RUN ./setup.sh -h -c RUN ./setup.sh -h -c
# Get Zephyr # Install west
WORKDIR /root/zephyrproject/smoke-test # hadolint ignore=DL3013,DL3059
# hadolint ignore=DL3013
RUN pip3 install --no-cache-dir west RUN pip3 install --no-cache-dir west
COPY ./west_lite.yml ./west.yml
# Setup a T2(Star topology) workspace
WORKDIR /root/zephyrproject/application
COPY ./west_lite.yml ./west_lite.yml
# init the west workspace with a minimal manifest # init the west workspace with a minimal manifest
RUN west init -l RUN west init -l --mf west_lite.yml .
WORKDIR /root/zephyrproject WORKDIR /root/zephyrproject
RUN west update --stats RUN west update --stats
WORKDIR /root/zephyrproject/modules/zephyr
RUN west zephyr-export && pip install --no-cache-dir -r ./scripts/requirements.txt
ENV ZEPHYR_BASE="/root/zephyrproject/modules/zephyr"
# Git clone wamr # Git clone wamr
WORKDIR /root/zephyrproject/modules/ WORKDIR /root/zephyrproject/modules/
RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git wasm-micro-runtime RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime.git wasm-micro-runtime

View File

@ -8,8 +8,8 @@ manifest:
url: https://github.com/zephyrproject-rtos/zephyr url: https://github.com/zephyrproject-rtos/zephyr
revision: v3.7.0 revision: v3.7.0
clone-depth: 1 clone-depth: 1
path: modules/zephyr path: zephyr
west-commands: scripts/west-commands.yml west-commands: scripts/west-commands.yml
self: self:
path: smoke-test path: application

View File

@ -58,6 +58,7 @@ LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
option.enable_simd = true; option.enable_simd = true;
option.enable_ref_types = true; option.enable_ref_types = true;
option.enable_gc = true; option.enable_gc = true;
option.aux_stack_frame_type = AOT_STACK_FRAME_TYPE_STANDARD;
comp_data = comp_data =
aot_create_comp_data(module, option.target_arch, option.enable_gc); aot_create_comp_data(module, option.target_arch, option.enable_gc);