Skip to content

Commit dd3bf40

Browse files
committed
fix several reviewing comments
1 parent 76499de commit dd3bf40

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

core/iwasm/common/wasm_native.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ static dtor_t g_context_dtors[WASM_MAX_INSTANCE_CONTEXTS];
347347

348348
static void
349349
dtor_noop(WASMModuleInstanceCommon *inst, void *ctx)
350-
{}
350+
{
351+
}
351352

352353
void *
353354
wasm_native_create_context_key(void (*dtor)(WASMModuleInstanceCommon *inst,
@@ -485,7 +486,8 @@ wasm_native_init()
485486
|| WASM_ENABLE_LIB_RATS != 0 || WASM_ENABLE_WASI_NN != 0 \
486487
|| WASM_ENABLE_APP_FRAMEWORK != 0 || WASM_ENABLE_LIBC_WASI != 0 \
487488
|| WASM_ENABLE_LIB_PTHREAD != 0 || WASM_ENABLE_LIB_WASI_THREADS != 0 \
488-
|| WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
489+
|| WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0 \
490+
|| WASM_ENABLE_SHARED_HEAP != 0
489491
NativeSymbol *native_symbols;
490492
uint32 n_native_symbols;
491493
#endif
@@ -602,7 +604,8 @@ wasm_native_init()
602604
|| WASM_ENABLE_LIB_RATS != 0 || WASM_ENABLE_WASI_NN != 0 \
603605
|| WASM_ENABLE_APP_FRAMEWORK != 0 || WASM_ENABLE_LIBC_WASI != 0 \
604606
|| WASM_ENABLE_LIB_PTHREAD != 0 || WASM_ENABLE_LIB_WASI_THREADS != 0 \
605-
|| WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
607+
|| WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0 \
608+
|| WASM_ENABLE_SHARED_HEAP != 0
606609
goto fail;
607610
#else
608611
return false;
@@ -616,7 +619,8 @@ wasm_native_init()
616619
|| WASM_ENABLE_LIB_RATS != 0 || WASM_ENABLE_WASI_NN != 0 \
617620
|| WASM_ENABLE_APP_FRAMEWORK != 0 || WASM_ENABLE_LIBC_WASI != 0 \
618621
|| WASM_ENABLE_LIB_PTHREAD != 0 || WASM_ENABLE_LIB_WASI_THREADS != 0 \
619-
|| WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
622+
|| WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0 \
623+
|| WASM_ENABLE_SHARED_HEAP != 0
620624
fail:
621625
wasm_native_destroy();
622626
return false;

tests/unit/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ add_subdirectory(libc-builtin)
6060
add_subdirectory(shared-utils)
6161
add_subdirectory(linear-memory-wasm)
6262
add_subdirectory(linear-memory-aot)
63-
add_subdirectory(aot-stack-frame)
6463
add_subdirectory(linux-perf)
6564
add_subdirectory(gc)
6665
add_subdirectory(tid-allocator)
6766

6867
if (NOT WAMR_BUILD_TARGET STREQUAL "X86_32")
68+
add_subdirectory(aot-stack-frame)
69+
6970
# should enable 32-bit llvm when X86_32
7071
add_subdirectory (aot)
7172
add_subdirectory (custom-section)
@@ -74,7 +75,7 @@ if (NOT WAMR_BUILD_TARGET STREQUAL "X86_32")
7475
# Fast-JIT or mem64 is not supported on X86_32
7576
add_subdirectory (running-modes)
7677
add_subdirectory (memory64)
77-
# add_subdirectory (shared-heap)
78+
add_subdirectory (shared-heap)
7879

7980
# HW_BOUND_CHECK is not supported on X86_32
8081
add_subdirectory (runtime-common)

tests/unit/aot/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ add_definitions (-DWASM_ENABLE_AOT_STACK_FRAME=1)
1616
set (WAMR_BUILD_AOT 1)
1717
set (WAMR_BUILD_FAST_INTERP 0)
1818
set (WAMR_BUILD_INTERP 0)
19-
# to involve LLVM
2019
set (WAMR_BUILD_JIT 1)
2120
set (WAMR_BUILD_LIBC_WASI 0)
22-
set (WAMR_BUILD_APP_FRAMEWORK 1)
21+
set (WAMR_BUILD_APP_FRAMEWORK 0)
2322

2423
include (../unit_common.cmake)
2524

tests/unit/linear-memory-aot/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ set (WAMR_BUILD_MEMORY_PROFILING 1)
1313
set (WAMR_BUILD_INTERP 0)
1414
set (WAMR_BUILD_AOT 1)
1515
set (WAMR_BUILD_FAST_INTERP 0)
16-
# to involve LLVM
17-
set (WAMR_BUILD_JIT 1)
1816

1917
include (../unit_common.cmake)
2018

@@ -33,7 +31,7 @@ set (unit_test_sources
3331

3432
# Test case: .aot file with hardware bound check.
3533
add_executable (linear_memory_test_aot ${unit_test_sources})
36-
target_link_libraries (linear_memory_test_aot ${LLVM_AVAILABLE_LIBS} gtest_main)
34+
target_link_libraries (linear_memory_test_aot gtest_main)
3735
gtest_discover_tests(linear_memory_test_aot)
3836
target_compile_definitions(linear_memory_test_aot PRIVATE WAMR_DISABLE_HW_BOUND_CHECK=0)
3937

@@ -65,6 +63,6 @@ add_custom_command(TARGET linear_memory_test_aot POST_BUILD
6563

6664
# Test case: .aot file with no hardware bound check.
6765
add_executable (linear_memory_test_aot_no_hw_bound ${unit_test_sources})
68-
target_link_libraries (linear_memory_test_aot_no_hw_bound ${LLVM_AVAILABLE_LIBS} gtest_main)
66+
target_link_libraries (linear_memory_test_aot_no_hw_bound gtest_main)
6967
gtest_discover_tests(linear_memory_test_aot_no_hw_bound)
7068
target_compile_definitions(linear_memory_test_aot_no_hw_bound PRIVATE WAMR_DISABLE_HW_BOUND_CHECK=1)

tests/unit/memory64/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ set(WAMR_BUILD_APP_FRAMEWORK 0)
1313
set(WAMR_BUILD_AOT 0)
1414
set(WAMR_BUILD_INTERP 1)
1515
set(WAMR_BUILD_FAST_INTERP 0)
16-
set(WAMR_BUILD_JIT 0)
16+
# to involve LLVM
17+
set(WAMR_BUILD_JIT 1)
1718
set(WAMR_BUILD_FAST_JIT 0)
1819
set(WAMR_BUILD_MEMORY64 1)
1920
set(WAMR_BUILD_SHARED_MEMORY 1)

tests/unit/running-modes/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ add_definitions(-DRUN_ON_LINUX)
2424

2525
set(WAMR_BUILD_LIBC_BUILTIN 1)
2626
set(WAMR_BUILD_MULTI_MODULE 0)
27-
set(WAMR_BUILD_LIBC_WASI 0)
27+
set(WAMR_BUILD_LIBC_WASI 1)
2828
set(WAMR_BUILD_APP_FRAMEWORK 0)
2929
set(WAMR_BUILD_JIT 1)
3030
set(WAMR_BUILD_FAST_JIT 1)

tests/unit/runtime-common/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ add_executable(runtime_common_test ${unit_test_sources})
3636
target_link_libraries(runtime_common_test ${LLVM_AVAILABLE_LIBS} gtest_main)
3737

3838
# Ensure that aot compiled is completed before linear_memory_test_aot is built
39-
set(dummy_output "${CMAKE_CURRENT_BINARY_DIR}/dummy_output")
40-
41-
add_custom_command(OUTPUT ${dummy_output}
39+
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/wasm-apps/main.aot
4240
COMMAND ./build_aot.sh
43-
COMMAND ${CMAKE_COMMAND} -E touch ${dummy_output}
4441
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
4542
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build_aot.sh
4643
COMMENT "Executing script to compile aot files"
@@ -49,15 +46,15 @@ add_custom_command(OUTPUT ${dummy_output}
4946

5047
add_custom_target(
5148
BuildAot ALL
52-
DEPENDS ${dummy_output}
49+
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/wasm-apps/main.aot
5350
)
5451

5552
add_dependencies(runtime_common_test BuildAot)
5653

5754
add_custom_command(TARGET runtime_common_test POST_BUILD
5855
COMMAND ${CMAKE_COMMAND} -E copy
59-
${CMAKE_CURRENT_LIST_DIR}/wasm-apps/main.wasm ${CMAKE_CURRENT_LIST_DIR}/wasm-apps/main.aot
60-
${CMAKE_CURRENT_BINARY_DIR}
56+
${CMAKE_CURRENT_LIST_DIR}/wasm-apps/main.wasm ${CMAKE_CURRENT_LIST_DIR}/wasm-apps/main.aot
57+
${CMAKE_CURRENT_BINARY_DIR}
6158
COMMENT "Copy main.wasm and main.aot to the directory: build/runtime-common."
6259
)
6360

tests/unit/shared-heap/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ set(WAMR_BUILD_APP_FRAMEWORK 0)
1111
set(WAMR_BUILD_AOT 1)
1212
set(WAMR_BUILD_INTERP 1)
1313
set(WAMR_BUILD_FAST_INTERP 1)
14-
# to involve LLVM
15-
set(WAMR_BUILD_JIT 1)
14+
set(WAMR_BUILD_JIT 0)
1615
if(WAMR_BUILD_TARGET STREQUAL "X86_32")
1716
set(WAMR_BUILD_MEMORY64 0)
1817
else()
@@ -47,6 +46,6 @@ set(unit_test_sources
4746
# Now simply link against gtest or gtest_main as needed. Eg
4847
add_executable(shared_heap_test ${unit_test_sources})
4948

50-
target_link_libraries(shared_heap_test ${LLVM_AVAILABLE_LIBS} gtest_main)
49+
target_link_libraries(shared_heap_test gtest_main)
5150

5251
gtest_discover_tests(shared_heap_test)

0 commit comments

Comments
 (0)