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

build-sys: Turn Rust LTO off by default, add --enable-lto flag #1664

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Member

For us, this is primarily right now a size issue. See:
https://internals.rust-lang.org/t/rust-staticlibs-and-optimizing-for-size/5746

For more information, there are these two issues:
rust-lang/cargo#4349
https://bugzilla.mozilla.org/show_bug.cgi?id=1386371

The basic issue here is that a build with LTO off (and a trivial
change to add a println! takes 14s here, and with it on takes 38s.
However, with LTO off the stripped size of librpmostree_rust.a is
6M, with LTO on it's 1.1M.

I named this --enable-lto as I'd like to investigate doing this
for the C code too.

For us, this is primarily right now a size issue.  See:
https://internals.rust-lang.org/t/rust-staticlibs-and-optimizing-for-size/5746

For more information, there are these two issues:
rust-lang/cargo#4349
https://bugzilla.mozilla.org/show_bug.cgi?id=1386371

The basic issue here is that a build with LTO off (and a trivial
change to add a `println!` takes 14s here, and with it on takes 38s.
However, with LTO off the stripped size of `librpmostree_rust.a` is
`6M`, with LTO on it's `1.1M`.

I named this `--enable-lto` as I'd like to investigate doing this
for the C code too.
@jlebon
Copy link
Member

jlebon commented Nov 5, 2018

@rh-atomic-bot r+ f76e961

@rh-atomic-bot
Copy link

⌛ Testing commit f76e961 with merge ef587b5...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing ef587b5 to master...

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

Successfully merging this pull request may close these issues.

3 participants