Fix EII function aliases eliminated by LTO#153648
Fix EII function aliases eliminated by LTO#153648AsakuraMizu wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
d721f86 to
1aef424
Compare
|
r? jdonszelmann |
|
I'm not sure if this is the right fix. They might need to be added to |
|
hm, I wonder what the difference is between aliases and these shims. These shims pretty much act like aliases, and their symbol is the same as the EII declatation's. We already handle those symbols specially in a few places (look for the aliases field on CodegenAttrs). In fact, I personally thought we already kept them alive enough. I guess functions are optimized differently which makes some sense. In any case, I expect the problem to fundamentally also affect aliases of statics, something we don't test much at the moment, so the solution should apply to all aliases, not just these shims. |
1aef424 to
a80c922
Compare
| ExportedSymbol::NonGeneric(foreign_item), | ||
| SymbolExportInfo { | ||
| level: info.level, | ||
| kind: SymbolExportKind::Text, |
There was a problem hiding this comment.
This needs to be SymbolExportKind::Data if the alias points to a data object.
a80c922 to
d81cc68
Compare
Thank you for your comment. My previous attempt was more of a hack than a fix. So I redesigned a better solution based on your suggestion. This should fix both my issue and #151271 now.
The new attempt will apply to any |
Add EII function aliases to
llvm.compiler.usedso that LLVM's LTO passes do not eliminate them.Fixes #153645
Tracking issue: #125418