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

bootstrap: support building rustc with monolithic lto #49175

Closed
matthiaskrgr opened this issue Mar 19, 2018 · 6 comments
Closed

bootstrap: support building rustc with monolithic lto #49175

matthiaskrgr opened this issue Mar 19, 2018 · 6 comments

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Mar 19, 2018

I would like to be able to locally build rustc with monolithic lto enabled (-C lto) however it seems that using lto=true in src/Carto.toml does not have any effect.

RUSTFLAGS="-C lto" ./x.py build fails as well

Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling std v0.0.0 (file:///home/matthias/RUST/rust_build/src/libstd)
error: cannot prefer dynamic linking when performing LTO
note: only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO
error: aborting due to previous error
error: Could not compile `std`.

Edit: related: #49180

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Mar 19, 2018

rustc is primarily composed of dylibs, which as the error message states are incompatible with LTO. So an LTO'd rustc is fundamentally impossible, at least until we get rid of the dylibs (they're currently required for compiler plugins and proc macros).

@matthiaskrgr
Copy link
Member Author

Hmm so forcing everything to be linked statically is not possible at the moment, right?
// cc #39998

@sanxiyn
Copy link
Member

sanxiyn commented Mar 19, 2018

No, it is not possible.

@Mark-Simulacrum
Copy link
Member

I'm going to close this as it's not feasible today and probably not something we'll want to do for quite some time if ever.

@matthiaskrgr
Copy link
Member Author

@Mark-Simulacrum uhm, #49180 says that it would desirable to bootstrap with monolithic lto

@Mark-Simulacrum
Copy link
Member

True, but I don't think a dedicated issue will help move this along at this point -- I don't particularly care either way though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants