Open hungryzzz opened 1 year ago
I don't think WASI has a socket API yet, at least not in preview1, so I'm not sure how this could ever work in a standalone environment (at least not without some kind of custom imports).
Hi, I found that some socket APIs are already in WASI, sock_accept, sock_recv, sock_send and sock_shutdown, but indeed it's not enough to support the whole socket features.
Please include the following in your bug report:
Description Hi, I try to compile a simple server written by C(only contains
socket()
,recvfrom()
andsendto()
) to a standalone Wasm using Emscripten. However, I find in the compiled Wasm file, the import functions related to socket API are not from the WASI interface but from customenv
, thus it cannot be executed in a standalone Wasm runtime. Should I add some options of Emscripten when I compile it? Thank you!Version of emscripten/emsdk: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.24 (68a9f990429e0bcfb63b1cde68bad792554350a5) clang version 16.0.0 (https://github.com/llvm/llvm-project 277c382760bf9575cfa2eac73d5ad1db91466d3f) Target: wasm32-unknown-emscripten Thread model: posix
Failing command line in full: Both command lines failed to generate WASI socket API.