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.
This commit is contained in:
Benbuck Nason 2024-06-05 18:53:22 -07:00 committed by GitHub
parent 421a6c4301
commit 5d1f19fc09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;