mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Fix several issues found (#1996)
- CMakeLists.txt: add lib_export.h to install list - Fast JIT: enlarge spill cache size to enable several standalone cases when hw bound check is disabled - Thread manager: wasm_cluster_exit_thread may destroy an invalid exec_env->module_inst when exec_env was destroyed before - samples/socket-api: fix failure to run timeout_client.wasm - enhance CI build wasi-libc and sample/wasm-c-api-imports CMakeLlist.txt
This commit is contained in:
parent
9f0c4b63ac
commit
1be202fad8
|
@ -367,7 +367,7 @@ jobs:
|
||||||
git fetch https://github.com/WebAssembly/wasi-libc \
|
git fetch https://github.com/WebAssembly/wasi-libc \
|
||||||
8f5275796a82f8ecfd0833a4f3f444fa37ed4546
|
8f5275796a82f8ecfd0833a4f3f444fa37ed4546
|
||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
make \
|
make -j \
|
||||||
AR=/opt/wasi-sdk/bin/llvm-ar \
|
AR=/opt/wasi-sdk/bin/llvm-ar \
|
||||||
NM=/opt/wasi-sdk/bin/llvm-nm \
|
NM=/opt/wasi-sdk/bin/llvm-nm \
|
||||||
CC=/opt/wasi-sdk/bin/clang \
|
CC=/opt/wasi-sdk/bin/clang \
|
||||||
|
|
|
@ -160,4 +160,5 @@ install (TARGETS iwasm_shared LIBRARY DESTINATION lib)
|
||||||
install (FILES
|
install (FILES
|
||||||
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h
|
${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/wasm_export.h
|
||||||
|
${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h
|
||||||
DESTINATION include)
|
DESTINATION include)
|
||||||
|
|
|
@ -841,7 +841,7 @@ init_func_translation(JitCompContext *cc)
|
||||||
cc->spill_cache_offset = wasm_interp_interp_frame_size(total_cell_num);
|
cc->spill_cache_offset = wasm_interp_interp_frame_size(total_cell_num);
|
||||||
/* Set spill cache size according to max local cell num, max stack cell
|
/* Set spill cache size according to max local cell num, max stack cell
|
||||||
num and virtual fixed register num */
|
num and virtual fixed register num */
|
||||||
cc->spill_cache_size = (max_locals + max_stacks) * 4 + sizeof(void *) * 5;
|
cc->spill_cache_size = (max_locals + max_stacks) * 4 + sizeof(void *) * 16;
|
||||||
cc->total_frame_size = cc->spill_cache_offset + cc->spill_cache_size;
|
cc->total_frame_size = cc->spill_cache_offset + cc->spill_cache_size;
|
||||||
cc->jitted_return_address_offset =
|
cc->jitted_return_address_offset =
|
||||||
offsetof(WASMInterpFrame, jitted_return_addr);
|
offsetof(WASMInterpFrame, jitted_return_addr);
|
||||||
|
|
|
@ -896,6 +896,7 @@ void
|
||||||
wasm_cluster_exit_thread(WASMExecEnv *exec_env, void *retval)
|
wasm_cluster_exit_thread(WASMExecEnv *exec_env, void *retval)
|
||||||
{
|
{
|
||||||
WASMCluster *cluster;
|
WASMCluster *cluster;
|
||||||
|
WASMModuleInstanceCommon *module_inst;
|
||||||
|
|
||||||
#ifdef OS_ENABLE_HW_BOUND_CHECK
|
#ifdef OS_ENABLE_HW_BOUND_CHECK
|
||||||
if (exec_env->jmpbuf_stack_top) {
|
if (exec_env->jmpbuf_stack_top) {
|
||||||
|
@ -926,6 +927,8 @@ wasm_cluster_exit_thread(WASMExecEnv *exec_env, void *retval)
|
||||||
|
|
||||||
os_mutex_lock(&cluster->lock);
|
os_mutex_lock(&cluster->lock);
|
||||||
|
|
||||||
|
module_inst = exec_env->module_inst;
|
||||||
|
|
||||||
/* Free aux stack space */
|
/* Free aux stack space */
|
||||||
free_aux_stack(exec_env, exec_env->aux_stack_bottom.bottom);
|
free_aux_stack(exec_env, exec_env->aux_stack_bottom.bottom);
|
||||||
/* Remove exec_env */
|
/* Remove exec_env */
|
||||||
|
@ -933,7 +936,7 @@ wasm_cluster_exit_thread(WASMExecEnv *exec_env, void *retval)
|
||||||
/* Destroy exec_env */
|
/* Destroy exec_env */
|
||||||
wasm_exec_env_destroy_internal(exec_env);
|
wasm_exec_env_destroy_internal(exec_env);
|
||||||
/* Routine exit, destroy instance */
|
/* Routine exit, destroy instance */
|
||||||
wasm_runtime_deinstantiate_internal(exec_env->module_inst, true);
|
wasm_runtime_deinstantiate_internal(module_inst, true);
|
||||||
|
|
||||||
os_mutex_unlock(&cluster->lock);
|
os_mutex_unlock(&cluster->lock);
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ Shuting down
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./iwasm --addr-pool=127.0.0.1/15 --heap-size=10000000 timeout_client.wasm
|
$ ./iwasm --addr-pool=127.0.0.1/15 timeout_client.wasm
|
||||||
```
|
```
|
||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
|
@ -54,7 +54,9 @@ function(COMPILE_WITH_CLANG SOURCE_FILE)
|
||||||
target_link_options(${MAIN_TARGET_NAME} PRIVATE
|
target_link_options(${MAIN_TARGET_NAME} PRIVATE
|
||||||
LINKER:--export=__heap_base
|
LINKER:--export=__heap_base
|
||||||
LINKER:--export=__data_end
|
LINKER:--export=__data_end
|
||||||
LINKER:--shared-memory,--max-memory=196608
|
LINKER:--export=malloc
|
||||||
|
LINKER:--export=free
|
||||||
|
LINKER:--shared-memory,--max-memory=10485760
|
||||||
LINKER:--no-check-features
|
LINKER:--no-check-features
|
||||||
LINKER:--allow-undefined
|
LINKER:--allow-undefined
|
||||||
)
|
)
|
||||||
|
|
|
@ -56,10 +56,15 @@ if (NOT CMAKE_BUILD_TYPE)
|
||||||
set (CMAKE_BUILD_TYPE Release)
|
set (CMAKE_BUILD_TYPE Release)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (NOT DEFINED WAMR_BUILD_AOT)
|
||||||
|
# Enable AOT by default.
|
||||||
set (WAMR_BUILD_AOT 1)
|
set (WAMR_BUILD_AOT 1)
|
||||||
|
endif ()
|
||||||
|
if (NOT DEFINED WAMR_BUILD_INTERP)
|
||||||
|
# Disable Interpreter by default
|
||||||
set (WAMR_BUILD_INTERP 0)
|
set (WAMR_BUILD_INTERP 0)
|
||||||
|
endif ()
|
||||||
set(WAMR_BUILD_JIT 0)
|
set(WAMR_BUILD_JIT 0)
|
||||||
|
|
||||||
set(WAMR_BUILD_FAST_INTERP 1)
|
set(WAMR_BUILD_FAST_INTERP 1)
|
||||||
set(WAMR_BUILD_LIB_PTHREAD 1)
|
set(WAMR_BUILD_LIB_PTHREAD 1)
|
||||||
set(WAMR_BUILD_LIBC_BUILTIN 1)
|
set(WAMR_BUILD_LIBC_BUILTIN 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user