Skip to content
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: Remove dylib crate type from most rustc crates #56987

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Dec 19, 2018

Now that procedural macros no longer link transitively to libsyntax,
this shouldn't be needed any more! This commit is an experiment in
removing all dynamic libraries from rustc except for librustc_driver
itself. Let's see how far we can get with that!

More details below about this change

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 19, 2018
@alexcrichton
Copy link
Member Author

@bors: try

r? @alexcrichton

@bors
Copy link
Contributor

bors commented Dec 19, 2018

⌛ Trying commit 6419362 with merge b7ced6c...

bors added a commit that referenced this pull request Dec 19, 2018
rustc: Remove `dylib` crate type from most rustc crates

Now that procedural macros no longer link transitively to libsyntax,
this shouldn't be needed any more! This commit is an experiment in
removing all dynamic libraries from rustc except for librustc_driver
itself. Let's see how far we can get with that!
@Mark-Simulacrum
Copy link
Member

I believe this won't work - clippy, codegen, perhaps miri aren't built in the same target directory as librustc_* so without dylib I think they won't be able to load those libraries from the prelude? Perhaps I'm forgetting what files we copy/need though and just the rlib is enough?

Though in that case it's not super clear to me why proc macros needed the dylibs either...

@bors
Copy link
Contributor

bors commented Dec 19, 2018

☀️ Test successful - status-travis
State: approved= try=True

@alexcrichton
Copy link
Member Author

@Mark-Simulacrum heh well I can empirically say that it does indeed work! All of those tools load the compiler primarily through the rustc_driver crate which will now statically include all the other compiler crates. The target directory already isn't shared with rustc, and they all load compiler crates through the sysroot anyway.

Any compiler crate can be loaded at any time through the sysroot, just because they aren't dylibs doesn't mean they can't be loaded (you can already today load the compiler's own crates.io dependencies). The sysroot still contains all the intermediate rlib files.

Locally I've run ./x.py test src/tools/{clippy,rls} as well as ./x.py build src/tools/miri (miri is currently test-fail on master). Getting everything working only required one expected diff against clippy:

diff --git a/src/lib.rs b/src/lib.rs
index 40694726..5cb1a737 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -17,6 +17,8 @@
 // (currently there is no way to opt into sysroot crates w/o `extern crate`)
 #[allow(unused_extern_crates)]
 extern crate rustc_plugin;
+#[allow(unused_extern_crates)]
+extern crate rustc_driver;
 use self::rustc_plugin::Registry;
 
 #[plugin_registrar]

@alexcrichton
Copy link
Member Author

@rust-timer build b7ced6c

@rust-timer
Copy link
Collaborator

Success: Queued b7ced6c with parent 6f839fb, comparison URL.

alexcrichton added a commit to alexcrichton/rust-clippy that referenced this pull request Dec 19, 2018
This is in anticipation for rust-lang/rust#56987 where the
`rustc_driver` crate being linked in will be required to link correctly
against the compiler. In the meantime it should be harmless otherwise!
@Mark-Simulacrum
Copy link
Member

Okay, yeah, that makes sense. I guess I just didn't quite connect the dots so to speak on rlib crates being loadable, but of course they have to be as otherwise the whole ecosystem wouldn't work.


However, one additional concern with doing this is that it bumps artifact sizes by ~1.6x (from 487 MB to 765 MB). With a rustup-toolchain-install-master on the master and try commits from the try build, I see the following "top 10" file sizes. I suspect that this fairly sizeable growth may be quite painful for downstream users; we already ship nearly ~1 GB of data across all of our tools -- this feels like it would increase that by 250 MB. That's quite a lot, in general, though we can probably afford it. I suspect that MIR-only rlibs would help here but we probably can't "just" do that at this point.

$ find master -type f | xargs du -ah | sort -rh | head
74M     master/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
68M     master/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-8svn.so
36M     master/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-emscripten.so
36M     master/bin/rustdoc
26M     master/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-8197a5f727130e18.so
26M     master/lib/librustc-8197a5f727130e18.so
25M     master/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f929d44e8ee822a6.rlib
11M     master/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_mir-9e333f7280aadc85.so
11M     master/lib/librustc_mir-9e333f7280aadc85.so
9.9M    master/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-317bdea014a4d323.rlib

$ find try -type f | xargs du -ah | sort -rh | head
116M    try/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
87M     try/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-749452a0b8d67c66.rlib
78M     try/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-emscripten.so
68M     try/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-8svn.so
57M     try/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_driver-7422448280a926b8.so
57M     try/lib/librustc_driver-7422448280a926b8.so
37M     try/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_mir-5bcf33ecc7db40f1.rlib
36M     try/bin/rustdoc
25M     try/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-8a01f40ec9cf63ef.rlib
23M     try/lib/rustlib/x86_64-unknown-linux-gnu/lib/libsyntax-c233c5cd5247336c.rlib

@alexcrichton
Copy link
Member Author

That's a good point! I hadn't written up a full summary for this yet because if it doesn't affect perf at all it's probably not worth it. That being said it's definitely expected that this will increase sizes. Rust dylibs are naturally much smaller than rlibs for two reasons:

  • First, metadata is compressed in a dylib
  • Second, the object code for all rust crates is now present twice in the sysroot, once in the librustc_driver.so dylib and once in the crate's own rlib (like librustc.rlib).

That's just to say there's no hacks here AFAIK, it's just fundamental that the rlib sizes will be much larger.

I don't think installation size is really all that important, though. So long as we're not an order of magnitude off at least! The more imporant metric (I think at least) is the download size. Downloading the rust-std+rustc components before this commit was 142MB, and this commit (from try) is 232 megabytes. Funnily enough that's also a 1.6x increase!

I sort of highly doubt that anyone will notice this in practice. We add dependencies to the compiler willy-nilly and have already increased our download size 20% over the last year with binaries alone (that's not even taking into account the 86% increase over the last year in rust-docs download size).

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit b7ced6c

@mati865
Copy link
Contributor

mati865 commented Dec 19, 2018

Impressive amount of green 🎉

alexcrichton added a commit to alexcrichton/rust-clippy that referenced this pull request Dec 19, 2018
This is in anticipation for rust-lang/rust#56987 where the
`rustc_driver` crate being linked in will be required to link correctly
against the compiler. In the meantime it should be harmless otherwise!
@alexcrichton
Copy link
Member Author

Ok, great! I think that's green enough that this is worth considering at least. To detail this a bit more, we've historically used the dylib crate type for all rustc crates. That means all rustc crates are shipped as dynamic libraries, dynamically linking to one another. As to why we've done this for so long, I don't really know why. My best guess would be that when the compiler was implemented only dynamic libraries were supported. By the time Cargo came along to build rustc (after 1.0 was released) and opened up easily producing rlibs, we I think just never really got around to changing how things were done.

Note that today tons of rlibs ship with the compiler. All of rustc's crates.io dependencies are compiled as rlibs and linked into one dylib or another. What this PR is doing is basically creating one dynamic library for the compiler, only librustc_driver.so. Everything else is now compiled to an rlib instead of a dylib, and then everything is linked statically into one large librustc_driver.so. This notably means that we're shipping rlibs of compiler dependencies instead of dylibs, so we can't stop shipping those.

Any tool which depends on the compiler (RLS, miri, clippy, rustdoc, etc) all use rustc through the rustc_driver crate pretty much already. You can still access any other crate, but linking works best if rustc_driver is linked as well (even if it's not used). This had to be added to clippy for example, but all other tools work as-is (the RLS even worked with the previous try build!).

There's a few major consequences as a result from this change:

  • First, we have way fewer dynamic libraires in rustc's execution. This in turn means there's way less work to be done in terms of dynamic relocations because so much of rustc's inter-library calls are now static. This is where all the perf improvements are coming from. Note, however, that I believe these perf improvements are Linux-specific (and may affect OSX?). I believe I've measured in the past and a change like this doesn't have much effect on Windows. Keep in mind that all the green from the perf run is mostly tens of milliseconds here and there. It's definitely less work for the dynamic loader to do, but no one's likely to really feel the impact of a change like this.

  • Next, we're shipping rlibs instead of dylibs. This means that we're not only shipping uncompressed metadata for all of these libraries but we're also shipping double the object code (once in the rlib and once as it's linked into librustc_driver.so). There's some discussion above about the various size changes happening here.

  • Finally we're able to remove the rustc_cratesio_shim crate from the compiler. That's just a "linking hack" needed and is now obviated because everything isn't linked until the very end with librustc_driver.so.

I'm curious what others think of this change! This ideally shouldn't affect how the compiler is really developed that much, but I think I'd like to land this for the dynamic loader improvements on Linux. The dynamic library surely still has an absolutely massive symbol table, but it'd be great if we could try to minimize it in the future via one way or another. My favorite part about this, however, is how it simplifies the distribution of the compiler as there's only one dynamic library instead of a large proliferating set!

Also note that the rustc binary still has a dependency on a few other dynamic libraries, notably libstd.so, libterm.so, and libtest.so (term comes from test). I'd like to remove these as well in the long run, only shipping one self-contained librustc_driver.so, but that's a change for another day! (and unlikely to bring about any wins).

Ok for a randomly selected compiler team member...

r? @eddyb

and also cc @rust-lang/compiler and @rust-lang/release, but feel free to unsubscribe yourself if you're not interested in this change

@rust-highfive rust-highfive assigned eddyb and unassigned alexcrichton Dec 19, 2018
@Zoxc
Copy link
Contributor

Zoxc commented Dec 19, 2018

I'm definitely in favor of this change. This should also speed up tests on Linux and enable us to throw ThinLTO on librustc_driver.so, which will effectively be the whole compiler.

bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 20, 2018
Link to `rustc_driver` crate in plugin

This is in anticipation for rust-lang/rust#56987 where the
`rustc_driver` crate being linked in will be required to link correctly
against the compiler. In the meantime it should be harmless otherwise!
@michaelwoerister
Copy link
Member

Cool! Thanks, Alex!

I'd also be interested whether we can do some kind of cross-crate LTO in the future.

@nagisa
Copy link
Member

nagisa commented Dec 20, 2018

Next, we're shipping rlibs instead of dylibs. This means that we're not only shipping uncompressed metadata for all of these libraries but we're also shipping double the object code (once in the rlib and once as it's linked into librustc_driver.so). There's some discussion above about the various size changes happening here.

Might be interesting to add -Zmetadata=compressed that would make the rlib metadata compressed regardless, but that should not affect the download size much as the tarball compresses the metadata one way or the other... but I’d much rather slightly slower compilation when linking in the compiler crates (rare) over keeping extra megabytes on my disk (adds up for all the toolchains I tend to keep around).

It hurts somewhat that we are increasing the download size by 1.6x here. Just 25% decrease was a major drive in adding xz tarballs in the first place... It makes me wonder whether it is really necessary to have all the compiler crates as rlibs at all. For example I cannot imagine anybody needing rustc_data_structures, rustc_arena or rustc_apfloat in the sysroot for any reason. It would make sense to me to just ship rustc_driver and re-export all that tools need from it, perhaps even whole crates (pub extern crate ... instead of extern crate ...).

@alexcrichton
Copy link
Member Author

@Zoxc @michaelwoerister ah yes good points! While we're not really ready to just flip a switch to do that, this would be a prerequisite for doing it.

@alexcrichton
Copy link
Member Author

@bors: r=michaelwoerister

@bors
Copy link
Contributor

bors commented Jan 9, 2019

📌 Commit 36a185e has been approved by michaelwoerister

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2019
@bors
Copy link
Contributor

bors commented Jan 9, 2019

⌛ Testing commit 36a185e with merge faebe862969eb67db28aece199d19cde4c021d66...

@bors
Copy link
Contributor

bors commented Jan 9, 2019

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 9, 2019
@mati865
Copy link
Contributor

mati865 commented Jan 9, 2019

Memory access violation:

Building stage1 std artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
error: failed to run `rustc` to learn about target-specific information
Caused by:
 process didn't exit successfully: `C:\projects\rust\build\bootstrap/debug/rustc - --crate-name ___ --print=file-names --target x86_64-pc-windows-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 3221225477)

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 12, 2019
@bors
Copy link
Contributor

bors commented Jan 16, 2019

☔ The latest upstream changes (presumably #57416) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton
Copy link
Member Author

The segfault is legitimate and I could reproduce locally, but I don't have the time to investigate this so I'm going to close it.

@alexcrichton alexcrichton deleted the less-dylibs branch January 22, 2019 17:01
@euclio
Copy link
Contributor

euclio commented Feb 16, 2019

I tried rebasing this change on the current master to build it locally on mingw but I run into a linker issue (Error: export ordinal too large: 153266) at the end of stage0, maybe it's related to the segfault?

$ ./x.py dist
Updating only changed submodules
Submodules updated in 0.16 seconds
    Finished dev [unoptimized] target(s) in 0.49s
Dist docs (x86_64-pc-windows-gnu)
Building stage0 std artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
    Finished release [optimized] target(s) in 0.80s
Copying stage0 std from stage0 (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu / x86_64-pc-windows-gnu)
Building stage0 test artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
    Finished release [optimized] target(s) in 0.66s
Copying stage0 test from stage0 (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu / x86_64-pc-windows-gnu)
Building stage0 compiler artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
   Compiling rustc_traits v0.0.0 (C:\Users\Andy\repos\rust\src\librustc_traits)
   Compiling rustc_driver v0.0.0 (C:\Users\Andy\repos\rust\src\librustc_driver)
error: linking with `gcc` failed: exit code: 1=> ] 129/131
  |
  = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\dllcrt2.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.0.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.1.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.10.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.11.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.12.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.13.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.14.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.15.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.2.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.3.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.4.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.5.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.6.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.7.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.8.rcgu.o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.rustc_driver.71307bl9-cgu.9.rcgu.o" "-o" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.dll" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc_driver-dd7a142f002ac358.1yfy875y9s27b2t2.rcgu.o" "-nodefaultlibs" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\release\\deps" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\miniz-sys-4d5cf6b43112915b\\out" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_traits-012e9e7715d7eab2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_save_analysis-3ef10cdb1e6c0721.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_codegen_utils-56e0118d6adceb2b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librls_data-b2e01fc4fac2bf07.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librls_span-ca0f1894c1f110e2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_serialize-1ea428f894265c63.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_resolve-62b90d93881b2653.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_incremental-9869d9f4d984ba67.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_privacy-874007240410c737.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_typeck-b2412931516f160a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_plugin-67b1dab883d0446e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_metadata-0c8c31e148685ac5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libmemmap-322ad466ced497bd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_lint-b863f5afbd7015c6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_passes-167a27dc94c05108.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libsyntax_ext-59347fa353a3c07f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libproc_macro-ec8499a93c5acfcd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_borrowck-48d508934e9778ff.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_mir-8b8a7414349c6cc1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\liblog_settings-0bd51b264dfbbcb2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_allocator-6186110bba04f9c4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc-fe7f910af6f6ad58.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libpolonius_engine-ebf211e9bbb1b5cb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libdatafrog-b47c0d2d1d052f60.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libchalk_engine-30cae197e64a4722.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libchalk_macros-988b92632241c8ec.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\liblazy_static-6550539c68ca9c58.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libfmt_macros-81d9386c166b446c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_fs_util-0ceab182d544ea3a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libjobserver-a54dcca4aee9242d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand-d58789d618ac6596.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_xorshift-22dedac293d61ed9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_pcg-bf848073c33ec88b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_hc-80143eb203c8f618.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_chacha-637c9c75046e2748.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_isaac-62a177c79e5fc75f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libbacktrace-9350e80d0321dcca.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_demangle-c5db3a58063c950b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_apfloat-0e5168fb39036327.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libparking_lot-8f200b8cd5f3f925.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libparking_lot_core-040d73901226b885.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand-7b4d3984ed1130cb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_core-68928b45258cac51.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand_core-6e5c7903f5d36d49.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\liblock_api-ff58ac0ed2161e7b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libowning_ref-a8f6145d2ebe2059.rlib" "-Wl,--no-whole-archive" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bdynamic" "-ltest-3f8c3f9208b0db63" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-lterm-7b830e0a209d883c" "-Wl,-Bstatic" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libflate2-a3219140a5c68fa4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libminiz_sys-2ac6def00aa8a747.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libcrc32fast-de0cec8909101c1e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libsyntax-d1c5f5172ecc5bca.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_target-c90d185dad1e0572.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_errors-4a8f70c598e73472.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libsyntax_pos-35be3fe81413db87.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libunicode_width-08754b9723652ef1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libscoped_tls-369f780843a440cc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libbitflags-60b02988a62732d7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_rayon-6798535ddd8235c5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libeither-68855a90bfe367ee.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_rayon_core-1cef81523eba94db.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librand-63e5216bb05f7aa5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libnum_cpus-9742061d6d12dde2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\liblibc-78c0ebdfd1a2a164.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libcrossbeam_deque-9493cd53b357eb46.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libcrossbeam_epoch-db53287958a97dce.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libscopeguard-f2be3acf850ae47b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libmemoffset-2fb27db18af6f5de.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\liblazy_static-77ca12506d15d9f0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libcrossbeam_utils-4ad9acde8deba690.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libarrayvec-deb622e5e4627194.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libnodrop-e4678474716f5aa3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libenv_logger-2d0f61339c527e58.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libatty-67dbdfe8836b8af3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libhumantime-e95eb9fa3e83cf9e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libquick_error-0a75a4cdaa9271b2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libtermcolor-236baabbaefd655c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libwincolor-6a0daf4180ccf296.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libwinapi_util-f5e79b94052b9134.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libwinapi-296c6ad875e39f58.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libarena-39daa5cc6d6b62bc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_data_structures-c9f7d7b3ec61a38b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libena-5604d2008c9bacb3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libstable_deref_trait-c0a8e77791f25634.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libgraphviz-d5f1f99d77146963.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\librustc_hash-f90e1b53f4d31547.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libbyteorder-45f4b612a03d90c5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libserialize-3b3beb3e02c15b72.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libsmallvec-f787d20ed7a4433e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libunreachable-d2e8916b8b941e25.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libvoid-6a5870b08800535f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\liblog-009304631a60d385.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libcfg_if-69a6bc5b5f375021.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-L" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bdynamic" "-lstd-1e51d81f72c7a7cd" "-Wl,--end-group" "-Wl,-Bstatic" "C:\\tools\\msys64\\tmp\\rustcHpXHY4\\libcompiler_builtins-56ea006521186435.rlib" "-Wl,-Bdynamic" "-lpsapi" "-lkernel32" "-ladvapi32" "-lcredui" "-ldbghelp" "-lgdi32" "-lkernel32" "-lmsimg32" "-lopengl32" "-lsecur32" "-lsetupapi" "-luser32" "-lwinspool" "-ladvapi32" "-lws2_32" "-luserenv" "-shared" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-lmsvcrt" "-luser32" "-lkernel32" "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 153266
          collect2.exe: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `rustc_driver`.

To learn more, run the command again with --verbose.
command did not execute successfully: "C:\\Users\\Andy\\repos\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-gnu" "-j" "4" "--release" "--features" "" "--manifest-path" "C:\\Users\\Andy\\repos\\rust\\src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
failed to run: C:/Users/Andy/repos/rust/build/bootstrap/debug/bootstrap dist
Build completed unsuccessfully in 0:01:43

@mati865
Copy link
Contributor

mati865 commented Feb 16, 2019

@euclio that's different error, unrelated to previous one.

@eddyb
Copy link
Member

eddyb commented Jun 5, 2019

@alexcrichton Has shipping .rmeta instead of .rlib been considered?
We would have to either include MIR for everything and codegen at the end (potentially subopyimal) or just throw away the .rlib and somehow require the final .so crate to be linked in order to use anything from the component crates.
For the latter, it could be as simple as a check like "at least one of the dependency crates must claim to contain each symbol referenced and be linkable".

@ghost ghost mentioned this pull request Jun 20, 2019
Centril added a commit to Centril/rust that referenced this pull request Jul 6, 2019
rustc: Remove `dylib` crate type from most rustc crates

Revival of rust-lang#56987

cc @alexcrichton
r? @michaelwoerister
bors added a commit that referenced this pull request Jul 7, 2019
rustc: Remove `dylib` crate type from most rustc crates

Revival of #56987

cc @alexcrichton
r? @michaelwoerister
spikespaz pushed a commit to spikespaz/dotwalk-rs that referenced this pull request Aug 29, 2024
rustc: Remove `dylib` crate type from most rustc crates

Revival of rust-lang/rust#56987

cc @alexcrichton
r? @michaelwoerister
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.