最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rust - How to use LTO via command line flags? - Stack Overflow

programmeradmin3浏览0评论

I have several crates in a workspace, and some badly need LTO (say foo), whereas others would suffer absurdly long compile times with it. But when I naively apply

[profile.release.package.foo]
lto = true

for the crates that need it, I get

error: failed to parse manifest at ...

Caused by:
  `lto` may not be specified in a `package` profile

I thought I could solve this by passing the flag at runtime, e.g. RUSTFLAGS="-C lto=true" cargo build --release -p foo. But when I do that, it requires me to also use the nightly compiler and set -C embed-bitcode=true -Zdylib-lto. Is this really the right way to configure LTO at the command line?

发布评论

评论列表(0)

  1. 暂无评论