Lukas has marked this topic as resolved.
Hey @Lukas glad you were able to get this fixed! Would you mind expanding on your solution for people who might find this in the future?
Ah yes, of course, I planned on doing that. So I think one issue is that the wasi-sdk uses wasi version 0.2.0, downgrading all dependencies to use exactly 0.2.0 resolved the issue. (That's already probably a bug)
However, there were other link-time issues remaining, so the way to go for these was to use rust-lld again as linker, and not clang, but explicitly providing needed libraries with -Clink-arg=-L/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasip2.
The entire discussion can be found here
for the record, similar linker flags are also needed for wasip1 when compiling C++ libraries so that rust-lld can find libc++, I just never checked if that's documented anywhere since it seemed like the obvious thing to do with linker errors
Last updated: Dec 06 2025 at 06:05 UTC