Update wasm app build scripts for wasi-sdk-12 and refine interpreter (#481)
Update wasm app build scripts for wasi-sdk-12.0: add --export=__main_argc_argv, remove --no-threads Lookup function with name "__main_argc_argv" as main function besides "main" Change module_malloc to runtime_malloc in wasi native lib Refine classic interpreter op_block and op_br_table Refine faster interpreter op_br_table Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
@ -2039,12 +2039,9 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst,
|
||||
}
|
||||
#endif /* end of WASM_ENABLE_LIBC_WASI */
|
||||
|
||||
func = resolve_function(module_inst, "_main");
|
||||
if (!func) {
|
||||
func = resolve_function(module_inst, "main");
|
||||
}
|
||||
|
||||
if (!func) {
|
||||
if (!(func = resolve_function(module_inst, "main"))
|
||||
&& !(func = resolve_function(module_inst, "__main_argc_argv"))
|
||||
&& !(func = resolve_function(module_inst, "_main"))) {
|
||||
wasm_runtime_set_exception(module_inst,
|
||||
"lookup main function failed");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user