1

Allow use of `-Clto=thin` with `-Ccodegen-units=1` in general by wesleywiser · P...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/103610
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Member

@wesleywiser wesleywiser commented Oct 27, 2022

The current logic to ignore ThinLTO when -Ccodegen-units=1 makes sense for local ThinLTO but even in this scenario, a user may still want (non-local) ThinLTO for the purpose of optimizing dependencies into the final crate which is being compiled with 1 CGU.

The previous behavior was even more confusing because if you were generating a binary (--emit=link), then you would get ThinLTO but if you asked for LLVM IR or bytecode, then it would silently change to using regular LTO.

With this change, we only override the defaults for local ThinLTO if you ask for a single output such as LLVM IR or bytecode and in all other cases honor the requested LTO setting.

r? @michaelwoerister

All reactions

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK