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.
This commit is contained in:
Wenyong Huang 2023-02-02 13:06:30 +08:00 committed by GitHub
parent 27e7e160af
commit edee2eb956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4151,10 +4151,8 @@ check_wasi_abi_compatibility(const WASMModule *module,
/* should have one at least */
if (module->import_wasi_api && !start && !initialize) {
set_error_buf(
error_buf, error_buf_size,
"a module with WASI apis must be either a command or a reactor");
return false;
LOG_WARNING("warning: a module with WASI apis should be either "
"a command or a reactor");
}
/*