Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Combination of lto=true and crate-type = ["cdylib", "rlib"] confusingly doesn't do lto #9672

Open
matklad opened this issue Jul 9, 2021 · 1 comment
Labels
A-lto Area: link-time optimization C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@matklad
Copy link
Member

matklad commented Jul 9, 2021

See https://github.com/matklad/repros/tree/6b5121590ed9a758b90bb269d2d3d860a381a21d/lto-vs-rlib for the full reproduction.

The TL;DR is that if I have lto=true in profile, and crate-type = ["cdylib", "rlib"], the lto silently isn't applied. This is confusing -- I would expect to see at least a warning.

Note that wasm+cdylib+rlib combination is advertised in https://rustwasm.github.io/wasm-pack/book/tutorials/npm-browser-packages/template-deep-dive/cargo-toml.html#1-crate-type, and you often do want lto for wasm.

Related issues:

@matklad matklad added the C-bug Category: bug label Jul 9, 2021
@ehuss ehuss added the A-lto Area: link-time optimization label Jul 9, 2021
@Rustin170506
Copy link
Member

@rustbot claim

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lto Area: link-time optimization C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants