-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
The motivating example here is when you want to have development and release profiles with lto = false, because LTO is so expensive. Why not put lto = true in your release profile? Because the release profile might not be used for releases, per se; it might be used for people doing local development, and they don't want to bear the burden of compiling with LTO all the time. They want to compile with optimization on so at least their performance measurements are not completely out of whack.
But you do want to compile with LTO at certain times: when you're doing a formal release of your software, for instance. It would be convenient to turn LTO on via -C lto in RUSTFLAGS...but -C lto isn't valid for all places where RUSTFLAGS would be passed.
Hence the request for a RUSTLINKFLAGS or similar that would specify flags to be used in the final link of a binary artifact.
This could be made somewhat superfluous by #2007, where we could specify another profile for "release releases", but it might still be handy to have for flags that can't be injected via Cargo.toml.