Stream: wasmtime

Topic: WASI linkage (emscreepten)


view this post on Zulip Mikhail Natalenko (Mar 15 2023 at 13:30):

Hi! I have a problem. I built a c++ module with emscreepten. It uses ICU lib (ported to emcc). I have an error on instantiation of a WASI linker like :unknown import: `env::__syscall_stat64` has not been defined How to link these syscalls properly?

view this post on Zulip bjorn3 (Mar 15 2023 at 14:05):

You can't mix emscripten and wasi together. That is like trying to run a linux program on windows. You will either have to compile for wasi using wasi-sdk and run in a runtime supporting wasi like wasmtime, or you have to compile using emscripten and run it in the browser or any wasm runtime implementing the emscripten abi.

view this post on Zulip Mikhail Natalenko (Mar 29 2023 at 07:35):

are you sure you not missing something? I thought that WASI is something like a concept of importing system API. EMSCREEPTEN and WASI-SDK are just variants of this implementation

view this post on Zulip Mikhail Natalenko (Mar 29 2023 at 08:33):

I have researched a bit. Now i see. There is a WASI and emscreepten use it a little bit (it explaines why i can run minimal examples)

view this post on Zulip Mikhail Natalenko (Mar 29 2023 at 08:33):

Thank you for the help

view this post on Zulip bjorn3 (Mar 29 2023 at 16:04):

Emscripten does use some of the wasi interfaces internally, but it also uses a lot of emscripten specific interfaces and doesn't implement many wasi interfaces.

view this post on Zulip bjorn3 (Mar 29 2023 at 16:06):

One way to put it is that wasi and emscripten are kind of like linux and freebsd. There is overlap in terms of the api, but if you compile for one OS, it likely won't run correctly on another OS even if a small subset of the programs may actually happen to work correctly if both OSes are from the same OS family.


Last updated: Oct 23 2024 at 20:03 UTC