diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2019-12-20 14:38:28 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2020-01-02 14:06:45 +0100 |
| commit | 1b7c404d4bf5b28f61da14f84fe73c62862f5963 (patch) | |
| tree | 83a58f987a751395227a34631bce45d50beb06d0 /src/bootstrap | |
| parent | 766fba3fdca8fe075c370a63d2f76f8407483af5 (diff) | |
| download | rust-1b7c404d4bf5b28f61da14f84fe73c62862f5963.tar.gz rust-1b7c404d4bf5b28f61da14f84fe73c62862f5963.zip | |
bootstrap: Allow for setting the ThinLTO import limit used for compiler the compiler.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 15 | ||||
| -rw-r--r-- | src/bootstrap/config.rs | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index a2dca66697d..f7d8daa75ec 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1183,6 +1183,21 @@ impl<'a> Builder<'a> { rustflags.arg("-Cprefer-dynamic"); } + // When building incrementally we default to a lower ThinLTO import limit + // (unless explicitly specified otherwise). This will produce a somewhat + // slower code but give way better compile times. + { + let limit = match self.config.rust_thin_lto_import_instr_limit { + Some(limit) => Some(limit), + None if self.config.incremental => Some(10), + _ => None, + }; + + if let Some(limit) = limit { + rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={}", limit)); + } + } + Cargo { command: cargo, rustflags } } diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 0970a50bee4..ed65a606ff5 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -108,6 +108,7 @@ pub struct Config { pub rust_dist_src: bool, pub rust_codegen_backends: Vec<Interned<String>>, pub rust_verify_llvm_ir: bool, + pub rust_thin_lto_import_instr_limit: Option<u32>, pub rust_remap_debuginfo: bool, pub build: Interned<String>, @@ -325,6 +326,7 @@ struct Rust { deny_warnings: Option<bool>, backtrace_on_ice: Option<bool>, verify_llvm_ir: Option<bool>, + thin_lto_import_instr_limit: Option<u32>, remap_debuginfo: Option<bool>, jemalloc: Option<bool>, test_compare_mode: Option<bool>, @@ -569,6 +571,7 @@ impl Config { set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings)); set(&mut config.backtrace_on_ice, rust.backtrace_on_ice); set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir); + config.rust_thin_lto_import_instr_limit = rust.thin_lto_import_instr_limit; set(&mut config.rust_remap_debuginfo, rust.remap_debuginfo); if let Some(ref backends) = rust.codegen_backends { |
