mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 04:23:37 +00:00
bootstrap: Allow for build libstd to have its own codegen-unit setting.
This commit is contained in:
parent
82239b04dc
commit
b8f977a8a7
|
@ -277,6 +277,10 @@
|
|||
# compiler.
|
||||
#codegen-units = 1
|
||||
|
||||
# Sets the number of codegen units to build the standard library with,
|
||||
# regardless of what the codegen-unit setting for the rest of the compiler is.
|
||||
#codegen-units-std = 1
|
||||
|
||||
# Whether or not debug assertions are enabled for the compiler and standard
|
||||
# library. Also enables compilation of debug! and trace! logging macros.
|
||||
#debug-assertions = false
|
||||
|
|
|
@ -1119,10 +1119,15 @@ pub fn cargo(
|
|||
cargo.arg("-v");
|
||||
}
|
||||
|
||||
// This must be kept before the thinlto check, as we set codegen units
|
||||
// to 1 forcibly there.
|
||||
if let Some(n) = self.config.rust_codegen_units {
|
||||
cargo.env("RUSTC_CODEGEN_UNITS", n.to_string());
|
||||
match (mode, self.config.rust_codegen_units_std, self.config.rust_codegen_units) {
|
||||
(Mode::Std, Some(n), _) |
|
||||
(Mode::Test, Some(n), _) |
|
||||
(_, _, Some(n)) => {
|
||||
cargo.env("RUSTC_CODEGEN_UNITS", n.to_string());
|
||||
}
|
||||
_ => {
|
||||
// Don't set anything
|
||||
}
|
||||
}
|
||||
|
||||
if self.config.rust_optimize {
|
||||
|
|
|
@ -95,6 +95,7 @@ pub struct Config {
|
|||
// rust codegen options
|
||||
pub rust_optimize: bool,
|
||||
pub rust_codegen_units: Option<u32>,
|
||||
pub rust_codegen_units_std: Option<u32>,
|
||||
pub rust_debug_assertions: bool,
|
||||
pub rust_debuginfo: bool,
|
||||
pub rust_debuginfo_lines: bool,
|
||||
|
@ -294,6 +295,7 @@ fn default() -> StringOrBool {
|
|||
struct Rust {
|
||||
optimize: Option<bool>,
|
||||
codegen_units: Option<u32>,
|
||||
codegen_units_std: Option<u32>,
|
||||
debug_assertions: Option<bool>,
|
||||
debuginfo: Option<bool>,
|
||||
debuginfo_lines: Option<bool>,
|
||||
|
@ -580,6 +582,8 @@ pub fn parse(args: &[String]) -> Config {
|
|||
Some(n) => config.rust_codegen_units = Some(n),
|
||||
None => {}
|
||||
}
|
||||
|
||||
config.rust_codegen_units_std = rust.codegen_units_std;
|
||||
}
|
||||
|
||||
if let Some(ref t) = toml.target {
|
||||
|
|
Loading…
Reference in a new issue