WebAssembly / WASI

WebAssembly System Interface
Other
4.81k stars 249 forks source link

wasi calls from wasm start function #616

Open yamt opened 1 month ago

yamt commented 1 month ago

is it allowed to call wasi functions from wasm start function?

i suppose the answer is no because, with some embedder apis, it's tricky or impossible to get a reference to the exported memory before the start function is called. anyway, is it specified anywhere in the spec?

sbc100 commented 1 month ago

Yes, this issue has been much discussed.

See https://github.com/WebAssembly/design/issues/1160 and https://github.com/WebAssembly/WASI/issues/487 https://github.com/WebAssembly/WASI/issues/19

I'm not sure if any of those discussions lets to documentation changes anywhere.

sbc100 commented 1 month ago

The status quo is that _start is reserved for use by the linker (at least with llvm/wasm-ld) and cannot run user code.

yamt commented 4 weeks ago

The status quo is that _start is reserved for use by the linker (at least with llvm/wasm-ld) and cannot run user code.

do you mean wasm start function?

sbc100 commented 4 weeks ago

Yes, sorry I meant the wasm start function.

sbc100 commented 4 weeks ago

As you can see the terminology is confusing here :)