mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-08-02 17:58:26 +00:00
Compare commits
15 Commits
WAMR-2.4.1
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5d15f8fa2d | ||
![]() |
e40b05a5c6 | ||
![]() |
29d465b44e | ||
![]() |
272a41dc80 | ||
![]() |
378320b886 | ||
![]() |
33eff933c0 | ||
![]() |
aad1866260 | ||
![]() |
a0de8c7b7d | ||
![]() |
c6afa131a4 | ||
![]() |
6c6447fadb | ||
![]() |
2685f2cae0 | ||
![]() |
2fe36f4516 | ||
![]() |
b322e297c6 | ||
![]() |
f34d28cfbc | ||
![]() |
224b426d70 |
128
.github/workflows/build_iwasm_release.yml
vendored
128
.github/workflows/build_iwasm_release.yml
vendored
|
@ -34,58 +34,58 @@ on:
|
|||
env:
|
||||
DEFAULT_BUILD_OPTIONS:
|
||||
"-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
|
||||
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
|
||||
-DWAMR_BUILD_DEBUG_INTERP=0 \
|
||||
-DWAMR_BUILD_DEBUG_AOT=0 \
|
||||
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
|
||||
-DWAMR_BUILD_LIBC_UVWASI=0 \
|
||||
-DWAMR_BUILD_LIBC_EMCC=0 \
|
||||
-DWAMR_BUILD_LIB_RATS=0 \
|
||||
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
|
||||
-DWAMR_BUILD_MEMORY_PROFILING=0 \
|
||||
-DWAMR_BUILD_MINI_LOADER=0 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=0 \
|
||||
-DWAMR_BUILD_PERF_PROFILING=0 \
|
||||
-DWAMR_BUILD_SPEC_TEST=0 \
|
||||
-DWAMR_BUILD_BULK_MEMORY=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
|
||||
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
|
||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||
-DWAMR_BUILD_LIBC_WASI=1 \
|
||||
-DWAMR_BUILD_REF_TYPES=1 \
|
||||
-DWAMR_BUILD_SIMD=1 \
|
||||
-DWAMR_BUILD_SHARED_MEMORY=1 \
|
||||
-DWAMR_BUILD_TAIL_CALL=1 \
|
||||
-DWAMR_BUILD_THREAD_MGR=1"
|
||||
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
|
||||
-DWAMR_BUILD_DEBUG_INTERP=0 \
|
||||
-DWAMR_BUILD_DEBUG_AOT=0 \
|
||||
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
|
||||
-DWAMR_BUILD_LIBC_UVWASI=0 \
|
||||
-DWAMR_BUILD_LIBC_EMCC=0 \
|
||||
-DWAMR_BUILD_LIB_RATS=0 \
|
||||
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
|
||||
-DWAMR_BUILD_MEMORY_PROFILING=0 \
|
||||
-DWAMR_BUILD_MINI_LOADER=0 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=0 \
|
||||
-DWAMR_BUILD_PERF_PROFILING=0 \
|
||||
-DWAMR_BUILD_SPEC_TEST=0 \
|
||||
-DWAMR_BUILD_BULK_MEMORY=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
|
||||
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
|
||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||
-DWAMR_BUILD_LIBC_WASI=1 \
|
||||
-DWAMR_BUILD_REF_TYPES=1 \
|
||||
-DWAMR_BUILD_SIMD=1 \
|
||||
-DWAMR_BUILD_SHARED_MEMORY=1 \
|
||||
-DWAMR_BUILD_TAIL_CALL=1 \
|
||||
-DWAMR_BUILD_THREAD_MGR=1"
|
||||
GC_EH_BUILD_OPTIONS:
|
||||
"-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=0 \
|
||||
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
|
||||
-DWAMR_BUILD_DEBUG_INTERP=0 \
|
||||
-DWAMR_BUILD_DEBUG_AOT=0 \
|
||||
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
|
||||
-DWAMR_BUILD_LIBC_UVWASI=0 \
|
||||
-DWAMR_BUILD_LIBC_EMCC=0 \
|
||||
-DWAMR_BUILD_LIB_RATS=0 \
|
||||
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
|
||||
-DWAMR_BUILD_MEMORY_PROFILING=0 \
|
||||
-DWAMR_BUILD_MINI_LOADER=0 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=0 \
|
||||
-DWAMR_BUILD_PERF_PROFILING=0 \
|
||||
-DWAMR_BUILD_SPEC_TEST=0 \
|
||||
-DWAMR_BUILD_BULK_MEMORY=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
|
||||
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
|
||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||
-DWAMR_BUILD_LIBC_WASI=1 \
|
||||
-DWAMR_BUILD_REF_TYPES=1 \
|
||||
-DWAMR_BUILD_SIMD=1 \
|
||||
-DWAMR_BUILD_SHARED_MEMORY=1 \
|
||||
-DWAMR_BUILD_TAIL_CALL=1 \
|
||||
-DWAMR_BUILD_THREAD_MGR=1 \
|
||||
-DWAMR_BUILD_EXCE_HANDLING=1 \
|
||||
-DWAMR_BUILD_GC=1"
|
||||
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
|
||||
-DWAMR_BUILD_DEBUG_INTERP=0 \
|
||||
-DWAMR_BUILD_DEBUG_AOT=0 \
|
||||
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
|
||||
-DWAMR_BUILD_LIBC_UVWASI=0 \
|
||||
-DWAMR_BUILD_LIBC_EMCC=0 \
|
||||
-DWAMR_BUILD_LIB_RATS=0 \
|
||||
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
|
||||
-DWAMR_BUILD_MEMORY_PROFILING=0 \
|
||||
-DWAMR_BUILD_MINI_LOADER=0 \
|
||||
-DWAMR_BUILD_MULTI_MODULE=0 \
|
||||
-DWAMR_BUILD_PERF_PROFILING=0 \
|
||||
-DWAMR_BUILD_SPEC_TEST=0 \
|
||||
-DWAMR_BUILD_BULK_MEMORY=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD=1 \
|
||||
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
|
||||
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
|
||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||
-DWAMR_BUILD_LIBC_WASI=1 \
|
||||
-DWAMR_BUILD_REF_TYPES=1 \
|
||||
-DWAMR_BUILD_SIMD=1 \
|
||||
-DWAMR_BUILD_SHARED_MEMORY=1 \
|
||||
-DWAMR_BUILD_TAIL_CALL=1 \
|
||||
-DWAMR_BUILD_THREAD_MGR=1 \
|
||||
-DWAMR_BUILD_EXCE_HANDLING=1 \
|
||||
-DWAMR_BUILD_GC=1"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
@ -97,9 +97,9 @@ jobs:
|
|||
matrix:
|
||||
include:
|
||||
- build_options: $DEFAULT_BUILD_OPTIONS
|
||||
suffix: ''
|
||||
suffix: ""
|
||||
- build_options: $GC_EH_BUILD_OPTIONS
|
||||
suffix: '-gc-eh'
|
||||
suffix: "-gc-eh"
|
||||
permissions:
|
||||
contents: write # for uploading release artifacts
|
||||
|
||||
|
@ -126,6 +126,30 @@ jobs:
|
|||
cmake --build build --config Release --parallel 4
|
||||
working-directory: ${{ inputs.cwd }}
|
||||
|
||||
- name: smoke test on non-Windows
|
||||
if: ${{ !startsWith(inputs.runner, 'windows') }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ! -f build/iwasm ]]; then
|
||||
echo "iwasm binary is not found in the expected location."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build/iwasm --version
|
||||
working-directory: ${{ inputs.cwd }}
|
||||
|
||||
- name: smoke test on Windows
|
||||
if: ${{ startsWith(inputs.runner, 'windows') }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ! -f build/Release/iwasm ]]; then
|
||||
echo "iwasm binary is not found in the expected location."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build/Release/iwasm --version
|
||||
working-directory: ${{ inputs.cwd }}
|
||||
|
||||
- name: Compress the binary on Windows
|
||||
if: inputs.runner == 'windows-latest'
|
||||
run: |
|
||||
|
|
24
.github/workflows/build_wamrc.yml
vendored
24
.github/workflows/build_wamrc.yml
vendored
|
@ -62,6 +62,30 @@ jobs:
|
|||
cmake --build build --config Release --parallel 4
|
||||
working-directory: wamr-compiler
|
||||
|
||||
- name: smoke test on non-windows
|
||||
if: ${{ !startsWith(inputs.runner, 'windows') }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ! -f build/wamrc ]]; then
|
||||
echo "wamrc binary is not found in the expected location."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build/wamrc --version
|
||||
working-directory: wamr-compiler
|
||||
|
||||
- name: smoke test on Windows
|
||||
if: ${{ startsWith(inputs.runner, 'windows') }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ! -f build/Release/wamrc ]]; then
|
||||
echo "wamrc binary is not found in the expected location."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build/Release/wamrc --version
|
||||
working-directory: wamr-compiler
|
||||
|
||||
- name: Compress the binary on Windows
|
||||
if: inputs.runner == 'windows-latest' && inputs.release
|
||||
run: |
|
||||
|
|
6
.github/workflows/codeql.yml
vendored
6
.github/workflows/codeql.yml
vendored
|
@ -53,7 +53,7 @@ jobs:
|
|||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3.29.3
|
||||
uses: github/codeql-action/init@v3.29.4
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
|
@ -70,7 +70,7 @@ jobs:
|
|||
- run: |
|
||||
./.github/scripts/codeql_buildscript.sh
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3.29.3
|
||||
uses: github/codeql-action/analyze@v3.29.4
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
upload: false
|
||||
|
@ -99,7 +99,7 @@ jobs:
|
|||
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
|
||||
|
||||
- name: Upload CodeQL results to code scanning
|
||||
uses: github/codeql-action/upload-sarif@v3.29.3
|
||||
uses: github/codeql-action/upload-sarif@v3.29.4
|
||||
with:
|
||||
sarif_file: ${{ steps.step1.outputs.sarif-output }}
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
|
|
@ -371,6 +371,47 @@ jobs:
|
|||
ctest
|
||||
working-directory: tests/unit
|
||||
|
||||
build_regression_tests:
|
||||
needs:
|
||||
[build_llvm_libraries_on_ubuntu_2204]
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-22.04]
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get LLVM libraries
|
||||
id: retrieve_llvm_libs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
./core/deps/llvm/build/bin
|
||||
./core/deps/llvm/build/include
|
||||
./core/deps/llvm/build/lib
|
||||
./core/deps/llvm/build/libexec
|
||||
./core/deps/llvm/build/share
|
||||
key: ${{ matrix.llvm_cache_key }}
|
||||
|
||||
- name: Quit if cache miss
|
||||
if: (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
|
||||
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
|
||||
|
||||
- name: Build wamrc and iwasm
|
||||
run: |
|
||||
./build_wamr.sh
|
||||
working-directory: tests/regression/ba-issues
|
||||
|
||||
- name: Run regression tests
|
||||
run: |
|
||||
python run.py
|
||||
working-directory: tests/regression/ba-issues
|
||||
|
||||
build_samples_wasm_c_api:
|
||||
needs:
|
||||
[
|
||||
|
|
2
.github/workflows/supply_chain.yml
vendored
2
.github/workflows/supply_chain.yml
vendored
|
@ -60,6 +60,6 @@ jobs:
|
|||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@7710ed11e398ea99c7f7004c2b2e0f580458db42
|
||||
uses: github/codeql-action/upload-sarif@701df0e49d84a24bd8f0d01f80c0dbf69ab07674
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
|
|
@ -1786,7 +1786,8 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
|
|||
|
||||
read_uint32(buf, buf_end, j);
|
||||
#if WASM_ENABLE_AOT_VALIDATOR != 0
|
||||
if (j >= module->type_count) {
|
||||
/* an equivalence type should be before the type it refers to */
|
||||
if (j > i) {
|
||||
set_error_buf(error_buf, error_buf_size, "invalid type index");
|
||||
goto fail;
|
||||
}
|
||||
|
@ -1805,7 +1806,12 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
|
|||
read_uint32(buf, buf_end, parent_type_idx);
|
||||
read_uint16(buf, buf_end, rec_count);
|
||||
read_uint16(buf, buf_end, rec_idx);
|
||||
|
||||
#if WASM_ENABLE_AOT_VALIDATOR != 0
|
||||
if (rec_idx > i) {
|
||||
set_error_buf(error_buf, error_buf_size, "invalid rec_idx");
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
if (type_flag == WASM_TYPE_FUNC) {
|
||||
AOTFuncType *func_type;
|
||||
|
||||
|
|
3
core/iwasm/common/arch/fneh.txt
Normal file
3
core/iwasm/common/arch/fneh.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
|
@ -79,3 +79,6 @@ return:
|
|||
add sp, sp, #0x30 /* restore sp */
|
||||
ret
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -77,3 +77,6 @@ return:
|
|||
add sp, sp, #0x30 /* restore sp */
|
||||
ret
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -67,3 +67,6 @@ call_func:
|
|||
j_s [blink] /* ret */
|
||||
nop_s
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -73,3 +73,6 @@ return:
|
|||
add sp, sp, #4
|
||||
ldmfd sp!, {r4, r5, r6, r7, lr}
|
||||
bx lr
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -84,3 +84,6 @@ return:
|
|||
ldmfd sp!, {r4, r5, r6, r7, lr}
|
||||
bx lr
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -62,3 +62,6 @@ push_args_end:
|
|||
leave
|
||||
ret
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -62,3 +62,6 @@ push_args_end:
|
|||
leave
|
||||
ret
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -35,3 +35,6 @@ skip_push_args:
|
|||
leave
|
||||
ret
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -72,3 +72,6 @@ done:
|
|||
|
||||
j $31
|
||||
.end invokeNative
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -89,3 +89,6 @@ return:
|
|||
pop {r4, r5, r6, r7}
|
||||
mov lr, r3
|
||||
bx lr
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -98,3 +98,6 @@ return:
|
|||
mov lr, r3
|
||||
bx lr
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -72,3 +72,6 @@ call_func:
|
|||
|
||||
return:
|
||||
retw.n
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
|
|
@ -199,6 +199,8 @@ wasm_runtime_create_shared_heap(SharedHeapInitArgs *init_args)
|
|||
|
||||
heap->heap_handle = NULL;
|
||||
heap->base_addr = init_args->pre_allocated_addr;
|
||||
LOG_VERBOSE("Create preallocated shared heap %p with size %u",
|
||||
heap->base_addr, size);
|
||||
}
|
||||
else {
|
||||
if (!(heap->heap_handle =
|
||||
|
@ -225,6 +227,8 @@ wasm_runtime_create_shared_heap(SharedHeapInitArgs *init_args)
|
|||
LOG_WARNING("init share heap failed");
|
||||
goto fail4;
|
||||
}
|
||||
LOG_VERBOSE("Create pool shared heap %p with size %u", heap->base_addr,
|
||||
size);
|
||||
}
|
||||
|
||||
os_mutex_lock(&shared_heap_list_lock);
|
||||
|
@ -509,6 +513,8 @@ wasm_runtime_attach_shared_heap_internal(WASMModuleInstanceCommon *module_inst,
|
|||
os_mutex_lock(&shared_heap_list_lock);
|
||||
shared_heap->attached_count++;
|
||||
os_mutex_unlock(&shared_heap_list_lock);
|
||||
LOG_VERBOSE("Shared heap %p is attached to module instance %p", shared_heap,
|
||||
module_inst);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -570,6 +576,7 @@ wasm_runtime_detach_shared_heap_internal(WASMModuleInstanceCommon *module_inst)
|
|||
e->shared_heap_base_addr_adj = NULL;
|
||||
}
|
||||
#endif /* end of WASM_ENABLE_AOT != 0 */
|
||||
LOG_VERBOSE("Shared heap is detached from module instance %p", module_inst);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -400,8 +400,7 @@ check_array_type(const WASMModule *module, uint32 type_index, char *error_buf,
|
|||
error_buf_size)) {
|
||||
return false;
|
||||
}
|
||||
if (module->types[type_index] == NULL
|
||||
|| module->types[type_index]->type_flag != WASM_TYPE_ARRAY) {
|
||||
if (module->types[type_index]->type_flag != WASM_TYPE_ARRAY) {
|
||||
set_error_buf(error_buf, error_buf_size, "unknown array type");
|
||||
return false;
|
||||
}
|
||||
|
@ -424,8 +423,7 @@ check_function_type(const WASMModule *module, uint32 type_index,
|
|||
}
|
||||
|
||||
#if WASM_ENABLE_GC != 0
|
||||
if (module->types[type_index] == NULL
|
||||
|| module->types[type_index]->type_flag != WASM_TYPE_FUNC) {
|
||||
if (module->types[type_index]->type_flag != WASM_TYPE_FUNC) {
|
||||
set_error_buf(error_buf, error_buf_size, "unknown function type");
|
||||
return false;
|
||||
}
|
||||
|
@ -1257,9 +1255,8 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
|||
error_buf_size)) {
|
||||
goto fail;
|
||||
}
|
||||
if (module->types[type_idx] == NULL
|
||||
|| module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
if (module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unknown struct type");
|
||||
goto fail;
|
||||
|
@ -2499,6 +2496,13 @@ load_type_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
|
|||
#endif /* end of WASM_ENABLE_GC == 0 */
|
||||
}
|
||||
|
||||
for (i = 0; i < module->type_count; i++) {
|
||||
if (module->types[i] == NULL) {
|
||||
set_error_buf_v(error_buf, error_buf_size, "unknown type %d", i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (p != p_end) {
|
||||
set_error_buf(error_buf, error_buf_size, "section size mismatch");
|
||||
return false;
|
||||
|
@ -12685,9 +12689,7 @@ re_scan:
|
|||
error_buf, error_buf_size)) {
|
||||
goto fail;
|
||||
}
|
||||
if (module->types[type_idx1] == NULL
|
||||
|| module->types[type_idx1]->type_flag
|
||||
!= WASM_TYPE_FUNC) {
|
||||
if (module->types[type_idx1]->type_flag != WASM_TYPE_FUNC) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unknown function type");
|
||||
goto fail;
|
||||
|
@ -12704,9 +12706,7 @@ re_scan:
|
|||
error_buf, error_buf_size)) {
|
||||
goto fail;
|
||||
}
|
||||
if (module->types[type_idx] == NULL
|
||||
|| module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_FUNC) {
|
||||
if (module->types[type_idx]->type_flag != WASM_TYPE_FUNC) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unknown function type");
|
||||
goto fail;
|
||||
|
@ -14542,9 +14542,8 @@ re_scan:
|
|||
error_buf_size)) {
|
||||
goto fail;
|
||||
}
|
||||
if (module->types[type_idx] == NULL
|
||||
|| module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
if (module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unknown struct type");
|
||||
goto fail;
|
||||
|
@ -14630,9 +14629,8 @@ re_scan:
|
|||
error_buf_size)) {
|
||||
goto fail;
|
||||
}
|
||||
if (module->types[type_idx] == NULL
|
||||
|| module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
if (module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unknown struct type");
|
||||
goto fail;
|
||||
|
|
|
@ -219,6 +219,9 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
|
|||
|
||||
void
|
||||
freeaddrinfo(struct addrinfo *res);
|
||||
|
||||
const char *
|
||||
gai_strerror(int code);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -590,6 +590,28 @@ freeaddrinfo(struct addrinfo *res)
|
|||
free(res);
|
||||
}
|
||||
|
||||
const char *
|
||||
gai_strerror(int code)
|
||||
{
|
||||
switch (code) {
|
||||
#define ERR(a) \
|
||||
case a: \
|
||||
return #a
|
||||
ERR(EAI_AGAIN);
|
||||
ERR(EAI_BADFLAGS);
|
||||
ERR(EAI_FAIL);
|
||||
ERR(EAI_FAMILY);
|
||||
ERR(EAI_MEMORY);
|
||||
ERR(EAI_NONAME);
|
||||
ERR(EAI_OVERFLOW);
|
||||
ERR(EAI_SERVICE);
|
||||
ERR(EAI_SOCKTYPE);
|
||||
ERR(EAI_SYSTEM);
|
||||
#undef ERR
|
||||
}
|
||||
return "Unknown error";
|
||||
}
|
||||
|
||||
static struct timeval
|
||||
time_us_to_timeval(uint64_t time_us)
|
||||
{
|
||||
|
|
|
@ -507,10 +507,35 @@ fail:
|
|||
return res;
|
||||
}
|
||||
|
||||
static wasi_nn_error
|
||||
copyin_and_nul_terminate(wasm_module_inst_t inst, char *name, uint32_t name_len,
|
||||
char **resultp)
|
||||
{
|
||||
char *nul_terminated_name;
|
||||
if (!wasm_runtime_validate_native_addr(inst, name, name_len)) {
|
||||
return invalid_argument;
|
||||
}
|
||||
nul_terminated_name = wasm_runtime_malloc(name_len + 1);
|
||||
if (nul_terminated_name == NULL) {
|
||||
return runtime_error;
|
||||
}
|
||||
bh_memcpy_s(nul_terminated_name, name_len + 1, name, name_len);
|
||||
nul_terminated_name[name_len] = '\0'; /* ensure NUL termination */
|
||||
if (strlen(nul_terminated_name) != name_len) {
|
||||
/* reject names containing '\0' for now */
|
||||
wasm_runtime_free(nul_terminated_name);
|
||||
return invalid_argument;
|
||||
}
|
||||
*resultp = nul_terminated_name;
|
||||
return success;
|
||||
}
|
||||
|
||||
wasi_nn_error
|
||||
wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
|
||||
graph *g)
|
||||
{
|
||||
WASINNContext *wasi_nn_ctx = NULL;
|
||||
char *nul_terminated_name = NULL;
|
||||
wasi_nn_error res;
|
||||
|
||||
wasm_module_inst_t instance = wasm_runtime_get_module_inst(exec_env);
|
||||
|
@ -518,25 +543,21 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
|
|||
return runtime_error;
|
||||
}
|
||||
|
||||
if (!wasm_runtime_validate_native_addr(instance, name, name_len)) {
|
||||
NN_ERR_PRINTF("name is invalid");
|
||||
return invalid_argument;
|
||||
}
|
||||
|
||||
if (!wasm_runtime_validate_native_addr(instance, g,
|
||||
(uint64)sizeof(graph))) {
|
||||
NN_ERR_PRINTF("graph is invalid");
|
||||
return invalid_argument;
|
||||
}
|
||||
|
||||
if (name_len == 0 || name[name_len] != '\0') {
|
||||
NN_ERR_PRINTF("Invalid filename");
|
||||
return invalid_argument;
|
||||
res = copyin_and_nul_terminate(instance, name, name_len,
|
||||
&nul_terminated_name);
|
||||
if (res != success) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME %s...", name);
|
||||
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME %s...", nul_terminated_name);
|
||||
|
||||
WASINNContext *wasi_nn_ctx = lock_ctx(instance);
|
||||
wasi_nn_ctx = lock_ctx(instance);
|
||||
if (wasi_nn_ctx == NULL) {
|
||||
res = busy;
|
||||
goto fail;
|
||||
|
@ -547,14 +568,20 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
|
|||
goto fail;
|
||||
|
||||
call_wasi_nn_func(wasi_nn_ctx->backend, load_by_name, res,
|
||||
wasi_nn_ctx->backend_ctx, name, name_len, g);
|
||||
wasi_nn_ctx->backend_ctx, nul_terminated_name, name_len,
|
||||
g);
|
||||
if (res != success)
|
||||
goto fail;
|
||||
|
||||
wasi_nn_ctx->is_model_loaded = true;
|
||||
res = success;
|
||||
fail:
|
||||
unlock_ctx(wasi_nn_ctx);
|
||||
if (nul_terminated_name != NULL) {
|
||||
wasm_runtime_free(nul_terminated_name);
|
||||
}
|
||||
if (wasi_nn_ctx != NULL) {
|
||||
unlock_ctx(wasi_nn_ctx);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -563,6 +590,9 @@ wasi_nn_load_by_name_with_config(wasm_exec_env_t exec_env, char *name,
|
|||
int32_t name_len, char *config,
|
||||
int32_t config_len, graph *g)
|
||||
{
|
||||
WASINNContext *wasi_nn_ctx = NULL;
|
||||
char *nul_terminated_name = NULL;
|
||||
char *nul_terminated_config = NULL;
|
||||
wasi_nn_error res;
|
||||
|
||||
wasm_module_inst_t instance = wasm_runtime_get_module_inst(exec_env);
|
||||
|
@ -570,30 +600,27 @@ wasi_nn_load_by_name_with_config(wasm_exec_env_t exec_env, char *name,
|
|||
return runtime_error;
|
||||
}
|
||||
|
||||
if (!wasm_runtime_validate_native_addr(instance, name, name_len)) {
|
||||
NN_ERR_PRINTF("name is invalid");
|
||||
return invalid_argument;
|
||||
}
|
||||
|
||||
if (!wasm_runtime_validate_native_addr(instance, g,
|
||||
(uint64)sizeof(graph))) {
|
||||
NN_ERR_PRINTF("graph is invalid");
|
||||
return invalid_argument;
|
||||
}
|
||||
|
||||
if (name_len == 0 || name[name_len] != '\0') {
|
||||
NN_ERR_PRINTF("Invalid filename");
|
||||
return invalid_argument;
|
||||
res = copyin_and_nul_terminate(instance, name, name_len,
|
||||
&nul_terminated_name);
|
||||
if (res != success) {
|
||||
goto fail;
|
||||
}
|
||||
res = copyin_and_nul_terminate(instance, config, config_len,
|
||||
&nul_terminated_config);
|
||||
if (res != success) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!config || config_len == 0 || config[config_len] != '\0') {
|
||||
NN_ERR_PRINTF("Invalid config");
|
||||
return invalid_argument;
|
||||
}
|
||||
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME_WITH_CONFIG %s %s...",
|
||||
nul_terminated_name, nul_terminated_config);
|
||||
|
||||
NN_DBG_PRINTF("[WASI NN] LOAD_BY_NAME_WITH_CONFIG %s %s...", name, config);
|
||||
|
||||
WASINNContext *wasi_nn_ctx = lock_ctx(instance);
|
||||
wasi_nn_ctx = lock_ctx(instance);
|
||||
if (wasi_nn_ctx == NULL) {
|
||||
res = busy;
|
||||
goto fail;
|
||||
|
@ -605,15 +632,23 @@ wasi_nn_load_by_name_with_config(wasm_exec_env_t exec_env, char *name,
|
|||
;
|
||||
|
||||
call_wasi_nn_func(wasi_nn_ctx->backend, load_by_name_with_config, res,
|
||||
wasi_nn_ctx->backend_ctx, name, name_len, config,
|
||||
config_len, g);
|
||||
wasi_nn_ctx->backend_ctx, nul_terminated_name, name_len,
|
||||
nul_terminated_config, config_len, g);
|
||||
if (res != success)
|
||||
goto fail;
|
||||
|
||||
wasi_nn_ctx->is_model_loaded = true;
|
||||
res = success;
|
||||
fail:
|
||||
unlock_ctx(wasi_nn_ctx);
|
||||
if (nul_terminated_name != NULL) {
|
||||
wasm_runtime_free(nul_terminated_name);
|
||||
}
|
||||
if (nul_terminated_config != NULL) {
|
||||
wasm_runtime_free(nul_terminated_config);
|
||||
}
|
||||
if (wasi_nn_ctx != NULL) {
|
||||
unlock_ctx(wasi_nn_ctx);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "wasi_nn_backend.h"
|
||||
#include "wasm_export.h"
|
||||
|
||||
#include <tensorflow/lite/c/c_api.h>
|
||||
#include <tensorflow/lite/interpreter.h>
|
||||
#include <tensorflow/lite/kernels/register.h>
|
||||
#include <tensorflow/lite/model.h>
|
||||
|
@ -279,29 +280,53 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
tensor *input_tensor)
|
||||
{
|
||||
TFLiteContext *tfl_ctx = (TFLiteContext *)tflite_ctx;
|
||||
TfLiteType tfl_type;
|
||||
|
||||
if (input_tensor->type != fp32) {
|
||||
NN_ERR_PRINTF("unsupported input tensor type %u", input_tensor->type);
|
||||
return runtime_error;
|
||||
switch (input_tensor->type) {
|
||||
case fp32:
|
||||
tfl_type = TfLiteType::kTfLiteFloat32;
|
||||
break;
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
case u8:
|
||||
tfl_type = TfLiteType::kTfLiteUInt8;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
NN_ERR_PRINTF("unsupported input tensor type %u",
|
||||
input_tensor->type);
|
||||
return runtime_error;
|
||||
}
|
||||
|
||||
wasi_nn_error res;
|
||||
if (success != (res = is_valid_graph_execution_context(tfl_ctx, ctx)))
|
||||
return res;
|
||||
|
||||
uint32_t num_tensors =
|
||||
tfl_ctx->interpreters[ctx].interpreter->inputs().size();
|
||||
auto interpreter = tfl_ctx->interpreters[ctx].interpreter.get();
|
||||
|
||||
uint32_t num_tensors = interpreter->inputs().size();
|
||||
NN_DBG_PRINTF("Number of tensors (%d)", num_tensors);
|
||||
if (index + 1 > num_tensors) {
|
||||
return runtime_error;
|
||||
}
|
||||
|
||||
auto tensor = tfl_ctx->interpreters[ctx].interpreter->input_tensor(index);
|
||||
auto tensor = interpreter->input_tensor(index);
|
||||
if (tensor == NULL) {
|
||||
NN_ERR_PRINTF("Missing memory");
|
||||
return too_large;
|
||||
}
|
||||
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
if (TfLiteTensorType(tensor) != tfl_type) {
|
||||
NN_ERR_PRINTF("Type mismatch");
|
||||
return runtime_error;
|
||||
}
|
||||
|
||||
if (TfLiteTensorCopyFromBuffer(tensor, input_tensor->data.buf,
|
||||
input_tensor->data.size)
|
||||
!= kTfLiteOk) {
|
||||
return runtime_error;
|
||||
}
|
||||
#else
|
||||
uint32_t model_tensor_size = 1;
|
||||
for (int i = 0; i < tensor->dims->size; ++i)
|
||||
model_tensor_size *= (uint32_t)tensor->dims->data[i];
|
||||
|
@ -346,6 +371,7 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
it[i] = (uint8_t)(input_tensor_f[i] / scale + zero_point);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
|
@ -388,14 +414,19 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
return too_large;
|
||||
}
|
||||
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
size_t sz = TfLiteTensorByteSize(tensor);
|
||||
if (output_tensor->size < sz) {
|
||||
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
|
||||
return too_large;
|
||||
}
|
||||
if (TfLiteTensorCopyToBuffer(tensor, output_tensor->buf, sz) != kTfLiteOk) {
|
||||
return runtime_error;
|
||||
}
|
||||
*output_tensor_size = sz;
|
||||
#else
|
||||
if (tensor->quantization.type == kTfLiteNoQuantization) {
|
||||
NN_DBG_PRINTF("No quantization information");
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
if (output_tensor->size < tensor->bytes) {
|
||||
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
|
||||
return too_large;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* for now, maintain the bug-to-bug compatibility with the old abi,
|
||||
* where the size here is the number of fp32, not bytes.
|
||||
|
@ -404,18 +435,13 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
|
||||
return too_large;
|
||||
}
|
||||
#endif
|
||||
bh_memcpy_s(output_tensor->buf, output_tensor->size, tensor->data.data,
|
||||
tensor->bytes);
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
*output_tensor_size = tensor->bytes;
|
||||
#else
|
||||
/*
|
||||
* for now, maintain the bug-to-bug compatibility with the old abi,
|
||||
* where the size here is the number of fp32, not bytes.
|
||||
*/
|
||||
*output_tensor_size = tensor->bytes / sizeof(float);
|
||||
#endif
|
||||
}
|
||||
else { // TODO: Assuming uint8 quantized networks.
|
||||
TfLiteAffineQuantization *quant_info =
|
||||
|
@ -429,12 +455,6 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
for (int i = 0; i < (int)tensor->dims->size; ++i)
|
||||
model_tensor_size *= (uint32_t)tensor->dims->data[i];
|
||||
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
if (output_tensor->size / sizeof(float) < model_tensor_size) {
|
||||
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
|
||||
return too_large;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* for now, maintain the bug-to-bug compatibility with the old abi,
|
||||
* where the size here is the number of fp32, not bytes.
|
||||
|
@ -443,7 +463,6 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
NN_ERR_PRINTF("Insufficient memory to copy tensor %d", index);
|
||||
return too_large;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t *ot = tfl_ctx->interpreters[ctx]
|
||||
.interpreter->typed_output_tensor<uint8_t>(index);
|
||||
|
@ -458,16 +477,13 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
output_tensor_f[i] = (ot[i] - zero_point) * scale;
|
||||
}
|
||||
|
||||
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
|
||||
*output_tensor_size = model_tensor_size * sizeof(float);
|
||||
#else
|
||||
/*
|
||||
* for now, maintain the bug-to-bug compatibility with the old abi,
|
||||
* where the size here is the number of fp32, not bytes.
|
||||
*/
|
||||
*output_tensor_size = model_tensor_size;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -110,6 +110,13 @@ os_thread_create_with_prio(korp_tid *tid, thread_start_routine_t start,
|
|||
targ->start = start;
|
||||
targ->arg = arg;
|
||||
|
||||
#ifdef CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM
|
||||
esp_pthread_cfg_t default_config = esp_pthread_get_default_config();
|
||||
|
||||
default_config.stack_alloc_caps = MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM;
|
||||
ESP_ERROR_CHECK(esp_pthread_set_cfg(&default_config));
|
||||
#endif
|
||||
|
||||
if (pthread_create(tid, &tattr, os_thread_wrapper, targ) != 0) {
|
||||
pthread_attr_destroy(&tattr);
|
||||
os_free(targ);
|
||||
|
|
|
@ -382,9 +382,11 @@ a non-compatible`AOT_CURRENT_VERSION`.
|
|||
We try our best to maintain our runtime ABI for AoT-compiled modules
|
||||
compatible among WAMR versions with compatible `AOT_CURRENT_VERSION`
|
||||
so that combinations of older wamrc and newer runtime usually work.
|
||||
However, there might be minor incompatibilities time to time.
|
||||
For productions, we recommend to use compatible versions of
|
||||
wamrc and the runtime.
|
||||
|
||||
However, there might be minor incompatibilities from time to time. For
|
||||
example, we usually avoid bumping the version when making a change which
|
||||
affects only a small fraction of users. For productions, we recommend
|
||||
using exactly same versions of wamrc and the runtime.
|
||||
|
||||
| WAMR version | AOT_CURRENT_VERSION | Compatible AOT version | |
|
||||
| ------------ | ------------------- | ---------------------- | ---------------------- |
|
||||
|
|
|
@ -57,6 +57,10 @@ print_help(void)
|
|||
#else
|
||||
printf(" --heap-size=n Set maximum heap size in bytes, default is 16 KB when libc wasi is diabled\n");
|
||||
#endif
|
||||
#if WASM_ENABLE_SHARED_HEAP != 0
|
||||
printf(" --shared-heap-size=n Create shared heap of n bytes and attach to the wasm app.\n");
|
||||
printf(" The size n will be adjusted to a minumum number aligned to page size\n");
|
||||
#endif
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
printf(" --jit-codecache-size=n Set fast jit maximum code cache size in bytes,\n");
|
||||
printf(" default is %u KB\n", FAST_JIT_DEFAULT_CODE_CACHE_SIZE / 1024);
|
||||
|
@ -578,6 +582,11 @@ main(int argc, char *argv[])
|
|||
#else
|
||||
uint32 heap_size = 16 * 1024;
|
||||
#endif
|
||||
#if WASM_ENABLE_SHARED_HEAP != 0
|
||||
SharedHeapInitArgs heap_init_args;
|
||||
uint32 shared_heap_size = 0;
|
||||
void *shared_heap = NULL;
|
||||
#endif
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
uint32 jit_code_cache_size = FAST_JIT_DEFAULT_CODE_CACHE_SIZE;
|
||||
#endif
|
||||
|
@ -685,6 +694,13 @@ main(int argc, char *argv[])
|
|||
return print_help();
|
||||
heap_size = atoi(argv[0] + 12);
|
||||
}
|
||||
#if WASM_ENABLE_SHARED_HEAP != 0
|
||||
else if (!strncmp(argv[0], "--shared-heap-size=", 19)) {
|
||||
if (argv[0][19] == '\0')
|
||||
return print_help();
|
||||
shared_heap_size = atoi(argv[0] + 19);
|
||||
}
|
||||
#endif
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
else if (!strncmp(argv[0], "--jit-codecache-size=", 21)) {
|
||||
if (argv[0][21] == '\0')
|
||||
|
@ -1007,6 +1023,24 @@ main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_SHARED_HEAP != 0
|
||||
if (shared_heap_size > 0) {
|
||||
memset(&heap_init_args, 0, sizeof(heap_init_args));
|
||||
heap_init_args.size = shared_heap_size;
|
||||
shared_heap = wasm_runtime_create_shared_heap(&heap_init_args);
|
||||
if (!shared_heap) {
|
||||
printf("Create preallocated shared heap failed\n");
|
||||
goto fail6;
|
||||
}
|
||||
|
||||
/* attach module instance 2 to the shared heap */
|
||||
if (!wasm_runtime_attach_shared_heap(wasm_module_inst, shared_heap)) {
|
||||
printf("Attach shared heap failed.\n");
|
||||
goto fail6;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = 0;
|
||||
const char *exception = NULL;
|
||||
if (is_repl_mode) {
|
||||
|
@ -1050,6 +1084,9 @@ main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_SHARED_HEAP != 0
|
||||
fail6:
|
||||
#endif
|
||||
#if WASM_ENABLE_THREAD_MGR != 0
|
||||
fail5:
|
||||
#endif
|
||||
|
|
|
@ -27,15 +27,16 @@ ARG ZEPHYR_SDK_VERSION=0.16.9
|
|||
# In west_lite.yml, the Zephyr version is set to v3.7.0
|
||||
#ARG ZEPHYR_VERSION=3.7.0
|
||||
|
||||
# Install the Zephyr Software Development Kit (SDK)
|
||||
# Install the Zephyr Software Development Kit (SDK) minimal version
|
||||
WORKDIR /root/zephyrproject/zephyr-sdk
|
||||
# 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_minimal.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 \
|
||||
&& 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
|
||||
&& tar --strip-components=1 -xf zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz && rm zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-x86_64_minimal.tar.xz
|
||||
# hadolint ignore=DL4006
|
||||
# Install host tools and Register Zephyr SDK CMake package
|
||||
RUN ./setup.sh -h -c
|
||||
# Install arc tools, host tools and Register Zephyr SDK CMake package
|
||||
# If you want to use other toolchains, please change the -t option
|
||||
RUN ./setup.sh -t arc-zephyr-elf -h -c
|
||||
|
||||
# Install west
|
||||
# hadolint ignore=DL3013,DL3059
|
||||
|
|
|
@ -11,6 +11,7 @@ import subprocess
|
|||
import glob
|
||||
import re
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
from typing import Dict, Optional, List
|
||||
|
||||
|
@ -275,6 +276,11 @@ def process_and_run_test_cases(
|
|||
else:
|
||||
print(f" Issues not found in folder: {format_issue_ids_should_test}")
|
||||
|
||||
if failed > 0:
|
||||
# Exit with error code if there are failed test for CI
|
||||
print("Some tests failed, see log file for details.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Run BA issue tests.")
|
||||
|
|
|
@ -3,5 +3,17 @@
|
|||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
cleanup() {
|
||||
local exit_code=$?
|
||||
rm -rf "$TEMP_DIR"
|
||||
exit $exit_code
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
/usr/bin/env python3 -m venv --clear "$TEMP_DIR"
|
||||
source "$TEMP_DIR/bin/activate"
|
||||
/usr/bin/env python3 -m pip install -r ../build-scripts/requirements.txt
|
||||
/usr/bin/env python3 ../build-scripts/build_llvm.py "$@"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
|
||||
/usr/bin/env python3 ../build-scripts/build_llvm.py --platform arc "$@"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
$SCRIPT_DIR/build_llvm.sh --platform arc "$@"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
|
||||
/usr/bin/env python3 ../build-scripts/build_llvm.py --platform xtensa "$@"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
$SCRIPT_DIR/build_llvm.sh --platform xtensa "$@"
|
||||
|
|
Loading…
Reference in New Issue
Block a user