From 38f0c099b2e684ea689633eb424d8737a1063a5e Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Tue, 19 Nov 2024 18:48:02 +0800 Subject: [PATCH 1/3] Default-enable `llvm_tools_enabled` when no `config.toml` is present --- src/bootstrap/src/core/config/config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 95b1303fa71..e706aba977b 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1255,6 +1255,10 @@ impl Config { }, out: PathBuf::from("build"), + // This is needed by codegen_ssa on macOS to ship `llvm-objcopy` aliased to + // `rust-objcopy` to workaround bad `strip`s on macOS. + llvm_tools_enabled: true, + ..Default::default() } } From fcfb782a7582fc5f2264c2bcb67e6ffe6ea4a0e2 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Tue, 19 Nov 2024 19:04:45 +0800 Subject: [PATCH 2/3] Register change info --- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 1d05f94e3be..7f62ffb20db 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -300,4 +300,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "`download-rustc='if-unchanged'` is now a default option for library profile.", }, + ChangeInfo { + change_id: 133207, + severity: ChangeSeverity::Info, + summary: "`rust.llvm-tools` is now enabled by default when no `config.toml` is provided.", + }, ]; From 4b5c88301bcc20de9fa58b7390d78d596f7d7223 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Tue, 19 Nov 2024 20:00:58 +0800 Subject: [PATCH 3/3] Explicitly disable llvm tools for cranelift --- compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh b/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh index 2f13b0b9cb8..5b3f2a91207 100644 --- a/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh +++ b/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh @@ -38,6 +38,11 @@ local-rebuild = true codegen-backends = ["cranelift"] deny-warnings = false verbose-tests = false +# The cg_clif sysroot doesn't contain llvm tools and unless llvm_tools is +# disabled bootstrap will crash trying to copy llvm tools for the bootstrap +# compiler. +llvm_tools = false + EOF popd