Skip to content

Commit e2cf59c

Browse files
authored
Fix an undefined reference problem (#4612)
The issue was previously covered by WAMR_BUILD_LIBC_BUILTIN and WAMR_BUILD_LIBC_WASI. Reproduced by ``` $ cmake -S . -B build -DWAMR_BUILD_SHARE_HEAP=1 -DWAMR_BUILD_LIBC_BUILTIN=0 -DWAMR_BUILD_LIBC_WASI=0 $ cmake --build build ```
1 parent 0264686 commit e2cf59c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
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;

0 commit comments

Comments
 (0)