[lld] [lld][WebAssembly] Default to -Bdynamic in wasm-ld (PR #206185)
Alex Crichton via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 29 05:59:34 PDT 2026
alexcrichton wrote:
Thanks for the heads up on this! This'd definitely affect the wasi-sdk builds by default since it's just a "default clang" wrapper and additionally wasi-sdk ships both `libc.a` and `libc.so` next to each other. I have the same inclination as @dschuff that the expected default for now is probably still static linking because shipping/distributing `libc.so` isn't quite as ubiquitous as native platforms for example. Given that I'd like `wasi-sdk` to remain the same by default, but as-is this'd require `-Bstatic` to be specified by all users.
I agree though it's generally best if the toolchain matches system toolchains as that's been the same lesson learned often in the past. Given that I'm not quite sure how to square this insofar as where the configuration for today's "keep static linking by default" is specified. We could specify a build time option for wasi-sdk perhaps? That'd require some more build logic within `wasm-ld`, however, and that's also not great IMO as build-time options can lead to confusing different defaults on other platforms.
https://github.com/llvm/llvm-project/pull/206185
More information about the llvm-commits
mailing list