Uh oh!
There was an error while loading. Please reload this page.
rustc: Add _imp_ symbols later in compilation - #45348
Conversation
rust-highfive
commented
Oct 18, 2017
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Oct 18, 2017
michaelwoerister
left a comment
There was a problem hiding this comment.
Thanks, @alexcrichton!
r=me with the comment in the test case added.
There was a problem hiding this comment.
Could you add a comment what this is all about? Otherwise one might be a little lost when this test fails.
On MSVC targets rustc will add symbols prefixed with `_imp_` to LLVM modules to "emulate" dllexported statics as that workaround is still in place after rust-lang#27438 hasn't been solved otherwise. These statics, however, were getting gc'd by ThinLTO accidentally which later would cause linking failures. This commit updates the location we add such symbols to happen just before codegen to ensure that (a) they're not eliminated by the optimizer and (b) the optimizer doesn't even worry about them. Closesrust-lang#45347
a1fd369 to
3541ffbComparealexcrichton
commented
Oct 18, 2017
@bors: r=michaelwoerister |
bors
commented
Oct 18, 2017
📌 Commit 3541ffb has been approved by |
bors
commented
Oct 20, 2017
⌛ Testing commit 3541ffb with merge 0e612b6c44ca77fa77c60680ebf0f8a498902dee... |
bors
commented
Oct 20, 2017
💔 Test failed - status-appveyor |
kennytm
commented
Oct 20, 2017
The test against Details |
alexcrichton
commented
Oct 20, 2017
wut |
alexcrichton
commented
Oct 20, 2017
That test failure is a quickcheck-based test, and otherwise this PR should only affect linkage (not runtime), so I'm going to retry assuming it's spurious. If this lands I'll open an issue upstream. @bors: retry |
bors
commented
Oct 20, 2017
rustc: Add `_imp_` symbols later in compilation On MSVC targets rustc will add symbols prefixed with `_imp_` to LLVM modules to "emulate" dllexported statics as that workaround is still in place after #27438 hasn't been solved otherwise. These statics, however, were getting gc'd by ThinLTO accidentally which later would cause linking failures. This commit updates the location we add such symbols to happen just before codegen to ensure that (a) they're not eliminated by the optimizer and (b) the optimizer doesn't even worry about them. Closes#45347
bors
commented
Oct 21, 2017
☀️ Test successful - status-appveyor, status-travis |
This fixes a flaky test which caused spurious failures in rust-lang#45348 and rust-lang#45380
On MSVC targets rustc will add symbols prefixed with
_imp_to LLVM modules to"emulate" dllexported statics as that workaround is still in place after #27438
hasn't been solved otherwise. These statics, however, were getting gc'd by
ThinLTO accidentally which later would cause linking failures.
This commit updates the location we add such symbols to happen just before
codegen to ensure that (a) they're not eliminated by the optimizer and (b) the
optimizer doesn't even worry about them.
Closes#45347