Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upApply some fixes to cross-language LTO (especially when targeting MSVC) #53031
Conversation
rust-highfive
assigned
alexcrichton
Aug 3, 2018
rust-highfive
added
the
S-waiting-on-review
label
Aug 3, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Aug 3, 2018
alexcrichton
reviewed
Aug 3, 2018
| @@ -1626,8 +1626,12 @@ fn relevant_lib(sess: &Session, lib: &NativeLibrary) -> bool { | |||
| fn is_full_lto_enabled(sess: &Session) -> bool { | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
Aug 3, 2018
Member
With the comment below, perhaps this function could be renamed to something like are_upstream_rust_objects_already_included? (albeit a bit wordy)
This comment has been minimized.
This comment has been minimized.
| @@ -1331,6 +1335,11 @@ fn execute_work_item(cgcx: &CodegenContext, | |||
| let needs_lto = match cgcx.lto { | |||
| Lto::No => false, | |||
|
|
|||
| // If the linker does LTO, we don't have to do it. Note that we | |||
| // keep doing full LTO, if it is requested, as not to break the | |||
| // assumption that the output will be a single module. | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
Aug 3, 2018
Member
To confirm, this is a rustc bug, right? This is fixable on our end where fat LTO plus cross-lang-lto shouldn't actually run the LTO passes in rustc?
This comment has been minimized.
This comment has been minimized.
michaelwoerister
Aug 3, 2018
Contributor
Yes, it probably isn't too hard to do just the module merging but not the optimizations. Maybe in another PR, unless you think it's urgent.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Aug 3, 2018
Member
Oh nah definitely fine to happen later, just wanted to make sure I understood!
| sess.opts.cg.prefer_dynamic && | ||
| sess.target.target.options.is_like_msvc { | ||
| sess.err("Linker plugin based LTO is not supported together with \ | ||
| `-C prefer-dynamic` when targeting MSVC"); |
This comment has been minimized.
This comment has been minimized.
alexcrichton
Aug 3, 2018
Member
Could a comment be added above this with a brief explanation as to why the error is being emitted? AFAIK it's all b/c of DLL weirdness, right?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@rust-timer build 807bbd9 |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Aug 3, 2018
|
Success: Queued 807bbd9 with parent 88e0ff1, comparison URL. |
This comment has been minimized.
This comment has been minimized.
|
Perf is ready. Almost nothing is changed. |
This comment has been minimized.
This comment has been minimized.
|
Hm, there's still a bit of a regression. It might be coming from allocating the |
michaelwoerister
force-pushed the
michaelwoerister:cross-lto
branch
from
0b253da
to
603584d
Aug 6, 2018
added a commit
to michaelwoerister/rust
that referenced
this pull request
Aug 6, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors try ( |
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Aug 6, 2018
kennytm
added
the
S-waiting-on-perf
label
Aug 6, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-author
and removed
S-waiting-on-review
labels
Aug 6, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
michaelwoerister
force-pushed the
michaelwoerister:cross-lto
branch
from
603584d
to
551ef38
Aug 6, 2018
added a commit
to michaelwoerister/rust
that referenced
this pull request
Aug 6, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
michaelwoerister
force-pushed the
michaelwoerister:cross-lto
branch
from
551ef38
to
1ecb0a5
Aug 6, 2018
added a commit
to michaelwoerister/rust
that referenced
this pull request
Aug 6, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-review
and removed
S-waiting-on-bors
labels
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
Hm, everything passed except for |
This comment has been minimized.
This comment has been minimized.
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 49972e9
into
rust-lang:master
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister is there a guide somewhere explaining how to use Cross-Language LTO? I‘m Linking a vectorized version of libm in packed simd that gets compiled from C and would like it to be inlined into Rust. I’d also like to set this up for jemalloc. |
This comment has been minimized.
This comment has been minimized.
|
No guide yet. You basically:
Note that things are still experimental (although stable enough to build Firefox with it). |
michaelwoerister commentedAug 3, 2018
This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory.
r? @alexcrichton