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

Cross language LTO #191

Closed
NobodyXu opened this issue Jan 24, 2023 · 2 comments
Closed

Cross language LTO #191

NobodyXu opened this issue Jan 24, 2023 · 2 comments

Comments

@NobodyXu
Copy link
Contributor

IMO this feature could be benefit crates such as cargo-binstall, which wants to reduce size of the final binary and does not use feature like compression.

It would also improves performance by inlining small C functions across language boundaries.

To enable this feature, zstd-sys will first have to re-enable LTO.

With rust-lang/cc-rs#757 merged, I think now lto support detection should be more robust and could be re-enabled.

Or we could enable lto only if feature thin is enabled, minimize people affected by this while experimenting with lto.

@NobodyXu
Copy link
Contributor Author

#198 re-enabled LTO behind feature flags thin-lto and fat-lto.

@NobodyXu
Copy link
Contributor Author

cargo-bins/cargo-binstall#817 enabled cross-lang-fat-lto in cargo-binstall and is able to reduce >50% of the final binary size on linux.

We haven't figured out for MacOS and Windows yet.

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

1 participant