Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichton
Allow for opting out of ThinLTO and clean up LTO related cli flag handling. It turns out that there currently is no way to explicitly disable ThinLTO (except for the nightly-only `-Zthinlto` flag). This PR extends `-C lto` to take `yes` and `no` in addition to `thin` and `fat`. It should be backwards compatible. It also cleans up how LTO mode selection is handled. Note that merging the PR in the current state would make the new values for `-C lto` available on the stable channel. I think that would be fine but maybe some team should vote on it.
This commit is contained in:
commit
07dc4b3759
8 changed files with 97 additions and 32 deletions
|
|
@ -16,11 +16,11 @@ all:
|
|||
$(RUSTC) -C extra-filename=foo dummy.rs 2>&1
|
||||
#Option taking no argument
|
||||
$(RUSTC) -C lto= dummy.rs 2>&1 | \
|
||||
$(CGREP) 'codegen option `lto` - one of `thin`, `fat`, or'
|
||||
$(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
|
||||
$(RUSTC) -C lto=1 dummy.rs 2>&1 | \
|
||||
$(CGREP) 'codegen option `lto` - one of `thin`, `fat`, or'
|
||||
$(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
|
||||
$(RUSTC) -C lto=foo dummy.rs 2>&1 | \
|
||||
$(CGREP) 'codegen option `lto` - one of `thin`, `fat`, or'
|
||||
$(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
|
||||
$(RUSTC) -C lto dummy.rs
|
||||
|
||||
# Should not link dead code...
|
||||
|
|
|
|||
|
|
@ -1,6 +1,30 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
all: noparam bool_true bool_false thin fat
|
||||
|
||||
noparam:
|
||||
$(RUSTC) lib.rs
|
||||
$(RUSTC) main.rs -C lto
|
||||
$(call RUN,main)
|
||||
|
||||
bool_true:
|
||||
$(RUSTC) lib.rs
|
||||
$(RUSTC) main.rs -C lto=yes
|
||||
$(call RUN,main)
|
||||
|
||||
|
||||
bool_false:
|
||||
$(RUSTC) lib.rs
|
||||
$(RUSTC) main.rs -C lto=off
|
||||
$(call RUN,main)
|
||||
|
||||
thin:
|
||||
$(RUSTC) lib.rs
|
||||
$(RUSTC) main.rs -C lto=thin
|
||||
$(call RUN,main)
|
||||
|
||||
fat:
|
||||
$(RUSTC) lib.rs
|
||||
$(RUSTC) main.rs -C lto=fat
|
||||
$(call RUN,main)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue