From 8bde2acfc7876148ebfe192780434dbb969eded3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 16 Jan 2018 15:02:31 -0800 Subject: rustc: Add `-C lto=val` option This commit primarily adds the ability to control what kind of LTO happens when rustc performs LTO, namely allowing values to be specified to the `-C lto` option, such as `-C lto=thin` and `-C lto=fat`. (where "fat" is the previous kind of LTO, throw everything in one giant module) Along the way this also refactors a number of fields which store information about whether LTO/ThinLTO are enabled to unify them all into one field through which everything is dispatched, hopefully removing a number of special cases throughout. This is intended to help mitigate #47409 but will require a backport as well, and this would unfortunately need to be an otherwise insta-stable option. --- src/test/run-make/codegen-options-parsing/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/run-make') diff --git a/src/test/run-make/codegen-options-parsing/Makefile b/src/test/run-make/codegen-options-parsing/Makefile index 81e06043c87..fda96a8b1fb 100644 --- a/src/test/run-make/codegen-options-parsing/Makefile +++ b/src/test/run-make/codegen-options-parsing/Makefile @@ -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` takes no value' + $(CGREP) 'codegen option `lto` - one of `thin`, `fat`, or' $(RUSTC) -C lto=1 dummy.rs 2>&1 | \ - $(CGREP) 'codegen option `lto` takes no value' + $(CGREP) 'codegen option `lto` - one of `thin`, `fat`, or' $(RUSTC) -C lto=foo dummy.rs 2>&1 | \ - $(CGREP) 'codegen option `lto` takes no value' + $(CGREP) 'codegen option `lto` - one of `thin`, `fat`, or' $(RUSTC) -C lto dummy.rs # Should not link dead code... -- cgit 1.4.1-3-g733a5