diff options
| author | bors <bors@rust-lang.org> | 2022-12-23 02:44:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-23 02:44:32 +0000 |
| commit | 5e656baf8bc832d3b77a1e49373352b3b2685fc0 (patch) | |
| tree | 41c3fe35f7c61e7ad001a48f67d3b57df7d7d9d5 /src/bootstrap | |
| parent | daccb3d974ca20d78e02c9691fb3bddc90194935 (diff) | |
| parent | fa1e34fbaf5a21d6ddc677c280ff8510b471bb96 (diff) | |
| download | rust-5e656baf8bc832d3b77a1e49373352b3b2685fc0.tar.gz rust-5e656baf8bc832d3b77a1e49373352b3b2685fc0.zip | |
Auto merge of #106070 - matthiaskrgr:rollup-jv9ctkl, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #105978 (Mark `proc_macro_decls_static` as always used) - #106051 (Allow building std with cranelift) - #106056 (Make `sess.bug` much less noisy) - #106057 (Give a more helpful error for "trimmed_def_paths constructed") - #106058 (Fix the issue number in comment for as_local_call_operand) - #106059 (Avoid running the `Profile` step twice on `x setup`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 5 | ||||
| -rw-r--r-- | src/bootstrap/compile.rs | 13 | ||||
| -rw-r--r-- | src/bootstrap/config.rs | 4 | ||||
| -rw-r--r-- | src/bootstrap/lib.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/setup.rs | 4 |
5 files changed, 23 insertions, 5 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index eb03a45583e..72d6a48b37a 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1864,7 +1864,10 @@ impl<'a> Builder<'a> { }; if let Some(limit) = limit { - rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={}", limit)); + if stage == 0 || self.config.default_codegen_backend().unwrap_or_default() == "llvm" + { + rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={}", limit)); + } } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index b62e0bfe4e0..0e3bbad9909 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -321,8 +321,15 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car "" }; + let mut features = String::new(); + + // Cranelift doesn't support `asm`. + if stage != 0 && builder.config.default_codegen_backend().unwrap_or_default() == "cranelift" { + features += " compiler-builtins-no-asm"; + } + if builder.no_std(target) == Some(true) { - let mut features = "compiler-builtins-mem".to_string(); + features += " compiler-builtins-mem"; if !target.starts_with("bpf") { features.push_str(compiler_builtins_c_feature); } @@ -335,7 +342,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car .arg("--features") .arg(features); } else { - let mut features = builder.std_features(target); + features += &builder.std_features(target); features.push_str(compiler_builtins_c_feature); cargo @@ -754,7 +761,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS .env("CFG_RELEASE_CHANNEL", &builder.config.channel) .env("CFG_VERSION", builder.rust_version()); - if let Some(backend) = builder.config.rust_codegen_backends.get(0) { + if let Some(backend) = builder.config.default_codegen_backend() { cargo.env("CFG_DEFAULT_CODEGEN_BACKEND", backend); } diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 2906616ffad..84278583846 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1611,6 +1611,10 @@ impl Config { self.submodules.unwrap_or(rust_info.is_managed_git_subrepository()) } + pub fn default_codegen_backend(&self) -> Option<Interned<String>> { + self.rust_codegen_backends.get(0).cloned() + } + /// Returns the commit to download, or `None` if we shouldn't download CI artifacts. fn download_ci_rustc_commit(&self, download_rustc: Option<StringOrBool>) -> Option<String> { // If `download-rustc` is not set, default to rebuilding. diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 35a58e11df9..f84fcd21cfc 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -796,7 +796,7 @@ impl Build { /// Gets the space-separated set of activated features for the standard /// library. fn std_features(&self, target: TargetSelection) -> String { - let mut features = "panic-unwind".to_string(); + let mut features = " panic-unwind".to_string(); match self.config.llvm_libunwind(target) { LlvmLibunwind::InTree => features.push_str(" llvm-libunwind"), diff --git a/src/bootstrap/setup.rs b/src/bootstrap/setup.rs index 57426ce3d51..cd360cbef96 100644 --- a/src/bootstrap/setup.rs +++ b/src/bootstrap/setup.rs @@ -96,6 +96,10 @@ impl Step for Profile { } fn make_run(run: RunConfig<'_>) { + if run.builder.config.dry_run() { + return; + } + // for Profile, `run.paths` will have 1 and only 1 element // this is because we only accept at most 1 path from user input. // If user calls `x.py setup` without arguments, the interactive TUI |
