rust/compiler/rustc_codegen_ssa
Guillaume Gomez dc176bd216
Rollup merge of #146795 - alexcrichton:wasm-limit-rdylib-exports, r=bjorn3
Enable `limit_rdylib_exports` on wasm targets

This commit updates the target specification of wasm targets to set the `limit_rdylib_exports` value to `true` like it is on other native platforms. This was originally not implemented long ago as `wasm-ld` didn't have options for symbol exports, but since then it's grown a `--export` flag and such to control this. A custom case is needed in the linker implementation to handle wasm targets as `wasm-ld` doesn't support linker scripts used on other targets, but other than that the implementation is straightforward.

The goal of this commit is enable building dynamic libraries on `wasm32-wasip2` which don't export every single symbol in the Rust standard library. Currently, without otherwise control over symbol visibility, all symbols end up being exported which generates excessively large binaries because `--gc-sections` ends up doing nothing as it's all exported anyway.
2025-09-22 17:17:42 +02:00
..
src Rollup merge of #146795 - alexcrichton:wasm-limit-rdylib-exports, r=bjorn3 2025-09-22 17:17:42 +02:00
Cargo.toml Auto merge of #146018 - lambdageek:add-winres-version, r=wesleywiser 2025-09-09 03:56:41 +00:00
messages.ftl Set lto="fat" automatically when compiling with RUSTFLAGS="-Zautodiff=Enable". 2025-09-18 15:26:14 +08:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.