about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2025-09-19 13:16:38 -0700
committerAlex Crichton <alex@alexcrichton.com>2025-09-19 13:16:38 -0700
commitf354d93abe1c404544c18585861518cf03188b0e (patch)
treee36b5838d7d0bd955d83c759b5f6ca6f39402f15 /compiler/rustc_codegen_llvm/src
parent59043567a5cf12800e1457c36ad6a6b0fa02c6b6 (diff)
downloadrust-f354d93abe1c404544c18585861518cf03188b0e.tar.gz
rust-f354d93abe1c404544c18585861518cf03188b0e.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions