From 5d1f19fc0994b6c50d9f578cf8cbbba4bb7be35c Mon Sep 17 00:00:00 2001 From: Benbuck Nason Date: Wed, 5 Jun 2024 18:53:22 -0700 Subject: [PATCH] Fix wasm_mini_loader.c build when jit or multi-module is enabled (#3502) This PR fixes compilation error when building with `-DWAMR_BUILD_MINI_LOADER=1 -DWAMR_BUILD_JIT=1` or `-DWAMR_BUILD_MINI_LOADER=1 -DWAMR_BUILD_MULTI_MODULE=1`, though normally we don't use wasm mini loader when JIT or multi-module is enabled. --- core/iwasm/interpreter/wasm_mini_loader.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/iwasm/interpreter/wasm_mini_loader.c b/core/iwasm/interpreter/wasm_mini_loader.c index 75ac876cf..41d137c25 100644 --- a/core/iwasm/interpreter/wasm_mini_loader.c +++ b/core/iwasm/interpreter/wasm_mini_loader.c @@ -2114,7 +2114,7 @@ static bool init_llvm_jit_functions_stage1(WASMModule *module, char *error_buf, uint32 error_buf_size) { - LLVMJITOptions llvm_jit_options = wasm_runtime_get_llvm_jit_options(); + LLVMJITOptions *llvm_jit_options = wasm_runtime_get_llvm_jit_options(); AOTCompOption option = { 0 }; char *aot_last_error; uint64 size; @@ -3235,8 +3235,11 @@ load(const uint8 *buf, uint32 size, WASMModule *module, } WASMModule * -wasm_loader_load(uint8 *buf, uint32 size, const LoadArgs *args, char *error_buf, - uint32 error_buf_size) +wasm_loader_load(uint8 *buf, uint32 size, +#if WASM_ENABLE_MULTI_MODULE != 0 + bool main_module, +#endif + const LoadArgs *args, char *error_buf, uint32 error_buf_size) { WASMModule *module = create_module(args->name, error_buf, error_buf_size); if (!module) { @@ -3254,6 +3257,10 @@ wasm_loader_load(uint8 *buf, uint32 size, const LoadArgs *args, char *error_buf, goto fail; } +#if WASM_ENABLE_MULTI_MODULE != 0 + (void)main_module; +#endif + LOG_VERBOSE("Load module success.\n"); return module;