-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc: Always handle exported symbols on the wasm target #60526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Currently when linking an artifact rustc will only conditionally call the `Linker::export_symbols` function, but this causes issues on some targets, like WebAssembly, where it means that executable outputs will not have the same symbols exported that cdylib outputs have. This commit sinks the conditional call to `export_symbols` inside the various implementations of the function that still need it, and otherwise the wasm linker is configured to always pass through symbol visibility lists.
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
If the early return is forgotten for a linker, are the any adverse side effects? And if so, how hard is it to figure out from the side effects that the linker |
I haven't tested it out but I suspect that link errors would crop up here and there. In theory we should always be passing the symbol whitelist to the linker, but that's likely to be a breaking change (even though it's not supposed to be) for weird esoteric linker reasons. This doesn't really change that often though so I'm not too too worried about forgotten returns. |
@bors r+ Thanks! |
📌 Commit 884632c has been approved by |
rustc: Always handle exported symbols on the wasm target Currently when linking an artifact rustc will only conditionally call the `Linker::export_symbols` function, but this causes issues on some targets, like WebAssembly, where it means that executable outputs will not have the same symbols exported that cdylib outputs have. This commit sinks the conditional call to `export_symbols` inside the various implementations of the function that still need it, and otherwise the wasm linker is configured to always pass through symbol visibility lists.
☀️ Test successful - checks-travis, status-appveyor |
Tested on commit rust-lang/rust@f64ed09. Direct link to PR: <rust-lang/rust#60526> 🎉 rls on windows: test-fail → test-pass (cc @Xanewok, @rust-lang/infra).
Currently when linking an artifact rustc will only conditionally call
the
Linker::export_symbols
function, but this causes issues on sometargets, like WebAssembly, where it means that executable outputs will
not have the same symbols exported that cdylib outputs have. This commit
sinks the conditional call to
export_symbols
inside the variousimplementations of the function that still need it, and otherwise the
wasm linker is configured to always pass through symbol visibility
lists.