WebAssembly / WebAssembly/wasi-sdk
Avoid stdlib printing to stdout/stderr?
Nobody has claimed this yet.
- Dominant language
- CMake
- Stars
- 1.6k
- Forks
- 237
- Avg merge
- 18h 26m
- Merged PRs (30d)
- 5
Description
A very minimal code sample like this:
#include <memory>
int main() {
auto a = std::shared_ptr<int>(new int(3));
return *a + 40;
}
compiled with WASI SDK like this:
clang++ --target=wasm32-wasi -O3 -flto -Wl,--lto-O3 -fno-exceptions --sysroot=/path/to/wasi-sysroot -o test.wasm ./test.cpp
results in a Wasm module that expects wasi_snapshot_preview1::{fd_close, fd_seek, fd_write} as imports, which feels unexpected to me. I am not sure why these imports are there, because I can’t find any embedded debugging strings, but I am assuming it’s because failed allocations etc will print to stderr? Is there any way to disable that and just fail with unreachable instead?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the minimal C++ example with the shown WASI SDK and inspect the resulting imports. Trace which standard-library or wasi-libc components introduce fd_close, fd_seek, and fd_write. Done means determining whether those imports can be removed or disabled, and documenting the supported configuration or limitation; no source file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- build-system, compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100