Skip to content

Commit edee2eb

Browse files
authored
Loosen the wasi abi compatibility check in loader (#1932)
Change an error to warning when checking wasi abi compatibility in loader, for rust case below: #[no_mangle] pub extern "C" fn main() { println!("foo"); } compile it with `cargo build --target wasm32-wasi`, a wasm file is generated with wasi apis imported and a "void main(void)" function exported. Other runtime e.g. wasmtime allows to load it and execute the main function with `--invoke` option.
1 parent 27e7e16 commit edee2eb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/iwasm/interpreter/wasm_loader.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4151,10 +4151,8 @@ check_wasi_abi_compatibility(const WASMModule *module,
41514151

41524152
/* should have one at least */
41534153
if (module->import_wasi_api && !start && !initialize) {
4154-
set_error_buf(
4155-
error_buf, error_buf_size,
4156-
"a module with WASI apis must be either a command or a reactor");
4157-
return false;
4154+
LOG_WARNING("warning: a module with WASI apis should be either "
4155+
"a command or a reactor");
41584156
}
41594157

41604158
/*

0 commit comments

Comments
 (0)