Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upmsvc: Get codegen-units working #26869
Conversation
rust-highfive
assigned
pcwalton
Jul 7, 2015
This comment has been minimized.
This comment has been minimized.
|
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
nrc
and unassigned
pcwalton
Jul 7, 2015
alexcrichton
force-pushed the
alexcrichton:fix-msvc-sepcomp
branch
2 times, most recently
from
d084b21
to
1bfd21f
Jul 7, 2015
This comment has been minimized.
This comment has been minimized.
|
Did you test this on all the platforms? There were a lot of subtle linking bugs the first time around, and testing on the bots does not currently test codegen-units. |
This comment has been minimized.
This comment has been minimized.
|
This passes the test suite on 64-bit linux, but it looks like we do have a bunch of codegen-units tests? The |
This comment has been minimized.
This comment has been minimized.
|
It would be good to know that we can bootstrap with codegen-units=4 on Linux and OSX, I think the full bootstrap exercises a bunch of code paths the tests miss |
alexcrichton
force-pushed the
alexcrichton:fix-msvc-sepcomp
branch
from
1bfd21f
to
6987d50
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Do you know how big an effect on compile times this will have? I'm wondering if it is worth keeping around both paths so we don't affect compile times where we don't need to. (I imagine it is not worth the extra complexity, but if the effect is enormous...) |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
If you create a "hello world" dylib this commit increases the time from 200ms to 290ms, the breakdown of the timings as:
I do think that creating dylibs isn't exactly common, but this is definitely unfortunate. I'm hoping that we can stop shelling out to So this'll definitely slow us down now, but hopefully we can make it up in the future! Also unfortunately I don't think there's a case where we can avoid these extra copies on a dylib b/c they're technically needed for correctness (to ensure that all code makes it into the dylib). Another possible route in the future for improvement is to separate the notion of an intermediate dylib and a final dylib (e.g. a dylib to be used again in Rust and a dylib to be used in C). If we're creating a dylib to be used in C we don't need to do any of these alterations because we want the linker to eliminate as much as possible. Unfortunately we don't know which case is which, so we have to assume they're all intermediate libs in which case everything is needed. |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added a commit
that referenced
this pull request
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:fix-msvc-sepcomp
branch
from
6987d50
to
9bc8e6d
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jul 8, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
merged commit 9bc8e6d
into
rust-lang:master
Jul 9, 2015
alexcrichton
deleted the
alexcrichton:fix-msvc-sepcomp
branch
Jul 10, 2015
alexcrichton
referenced this pull request
Jul 14, 2015
Merged
Upgrade to rustc 1.3.0-dev (fddfd089b 2015-07-10) #6591
This comment has been minimized.
This comment has been minimized.
|
NB: This was a breaking change for Servo. Please put this in a release note because we may not be the only ones to be broken because of it. |
alexcrichton commentedJul 7, 2015
This commit alters the implementation of multiple codegen units slightly to be
compatible with the MSVC linker. Currently the implementation will take the N
object files created by each codegen unit and will run
ld -rto create a newobject file which is then passed along. The MSVC linker, however, is not able to
do this operation.
The compiler will now no longer attempt to assemble object files together but
will instead just pass through all the object files as usual. This implies that
rlibs may not contain more than one object file (if the library is compiled with
more than one codegen unit) and the output of
-C save-tempswill have changedslightly as object files with the extension
0.owill not be renamed toounless requested otherwise.