-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc: Handle #[no_mangle]
anywhere in a crate
#45189
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Looks good to me. Some tests are failing though. |
1b8e3de
to
c7aa741
Compare
Ok I changed this to just handling @bors: r=michaelwoerister |
📌 Commit c7aa741 has been approved by |
…michaelwoerister rustc: Handle `#[no_mangle]` anywhere in a crate This commit updates the reachability pass of the compiler to seed the local worklist with `#[no_mangle]`-like items anywhere in a crate, not just those reachable from public items. Closes rust-lang#45165
@bors r- asm.js's The test involves
|
@alexcrichton So what exactly is going on here? I.e. what is the root cause of the problem this PR tries to fix? |
@michaelwoerister the problem is that ThinLTO is internalizing these symbols when they otherwise need to be exposed. That in turns happens because locally defined allocator symbols aren't in the list of "rust exported symbols" (the |
@alexcrichton But why is that a problem with ThinLTO but not the regular multi-CGU case? |
I think that happens is that in normal trans we will translate everything to LLVM and at that time we'll recognize Does that make sense? |
This commit updates the reachability pass of the compiler to seed the local worklist with `#[linkage]`-like items anywhere in a crate, not just those reachable from public items. Closes rust-lang#45165
c7aa741
to
6cae080
Compare
Also I'm removing that test once and for all, it has caused dozens and dozens of failures and has literally never caught a regression. @bors: r=michaelwoerister |
📌 Commit 6cae080 has been approved by |
|
Thanks for the clarification. |
…michaelwoerister rustc: Handle `#[no_mangle]` anywhere in a crate This commit updates the reachability pass of the compiler to seed the local worklist with `#[no_mangle]`-like items anywhere in a crate, not just those reachable from public items. Closes rust-lang#45165
This commit updates the reachability pass of the compiler to seed the local
worklist with
#[no_mangle]
-like items anywhere in a crate, not just thosereachable from public items.
Closes #45165