Do you have a fork of the compiler online?
zig build-lib add.zig -O ReleaseSmall -target wasm32-freestanding -static
You can debug the linker invocation with `--verbose-link` on the end of that.The issue tracking the problem is: https://github.com/ziglang/zig/issues/7133