1- From 97aadf76b44629def8041f3006e8feab9785af91 Mon Sep 17 00:00:00 2001
1+ From 4cbfb48faf37bb52de76596c8a8007ca4c1f902e Mon Sep 17 00:00:00 2001
2233Date: Fri, 30 May 2025 12:33:02 +0200
44Subject: [PATCH 02/15] remove a bunch of unused junk
55
66---
77 .../rustc_target/src/spec/base/linux_musl.rs | 5 +-
8- compiler/rustc_target/src/spec/crt_objects.rs | 22 ----
8+ compiler/rustc_target/src/spec/crt_objects.rs | 27 + ----
99 src/bootstrap/configure.py | 100 ------------------
1010 src/bootstrap/src/core/build_steps/compile.rs | 58 +---------
1111 src/bootstrap/src/core/build_steps/llvm.rs | 5 +-
12- src/bootstrap/src/core/config/config.rs | 6 --
12+ src/bootstrap/src/core/config/config.rs | 8 --
1313 .../src/core/config/target_selection.rs | 4 -
1414 src/bootstrap/src/core/config/toml/rust.rs | 2 -
1515 src/bootstrap/src/core/config/toml/target.rs | 4 -
1616 src/bootstrap/src/core/sanity.rs | 18 +---
1717 src/bootstrap/src/lib.rs | 29 -----
1818 src/bootstrap/src/utils/cc_detect.rs | 24 -----
19- 12 files changed, 4 insertions(+), 273 deletions(-)
19+ 12 files changed, 8 insertions(+), 276 deletions(-)
2020
2121diff --git a/compiler/rustc_target/src/spec/base/linux_musl.rs b/compiler/rustc_target/src/spec/base/linux_musl.rs
2222index 1bef60240..7cd54b07a 100644
@@ -36,10 +36,22 @@ index 1bef60240..7cd54b07a 100644
3636 }
3737 }
3838diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
39- index e3b6430a4..13a96e2cb 100644
39+ index 2d84e78f2..607a777eb 100644
4040--- a/compiler/rustc_target/src/spec/crt_objects.rs
4141+++ b/compiler/rustc_target/src/spec/crt_objects.rs
42- @@ -62,28 +62,6 @@ pub(super) fn all(obj: &'static str) -> CrtObjects {
42+ @@ -48,7 +48,10 @@ use crate::spec::LinkOutputKind;
43+ pub type CrtObjects = BTreeMap<LinkOutputKind, Vec<Cow<'static, str>>>;
44+
45+ pub(super) fn new(obj_table: &[(LinkOutputKind, &[&'static str])]) -> CrtObjects {
46+ - obj_table.iter().map(|(z, k)| (*z, k.iter().map(|b| (*b).into()).collect())).collect()
47+ + obj_table
48+ + .iter()
49+ + .map(|(z, k)| (*z, k.iter().map(|b| (*b).into()).collect()))
50+ + .collect()
51+ }
52+
53+ pub(super) fn all(obj: &'static str) -> CrtObjects {
54+ @@ -62,28 +65,6 @@ pub(super) fn all(obj: &'static str) -> CrtObjects {
4355 ])
4456 }
4557
@@ -67,9 +79,9 @@ index e3b6430a4..13a96e2cb 100644
6779-
6880 pub(super) fn pre_mingw_self_contained() -> CrtObjects {
6981 new(&[
70- (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o" ]),
82+ (LinkOutputKind::DynamicNoPicExe, &["crt2.o"]),
7183diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
72- index b05a5cc8b..e75802e0a 100755
84+ index 1915986be..7f5721594 100755
7385--- a/src/bootstrap/configure.py
7486+++ b/src/bootstrap/configure.py
7587@@ -180,106 +180,6 @@ v("llvm-config", None, "set path to llvm-config")
@@ -180,10 +192,10 @@ index b05a5cc8b..e75802e0a 100755
180192 "qemu-armhf-rootfs",
181193 "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
182194diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
183- index 82fd1119c..267443b93 100644
195+ index 6857a40ad..809be74fd 100644
184196--- a/src/bootstrap/src/core/build_steps/compile.rs
185197+++ b/src/bootstrap/src/core/build_steps/compile.rs
186- @@ -375 ,54 +375 ,7 @@ fn copy_self_contained_objects(
198+ @@ -373 ,54 +373 ,7 @@ fn copy_self_contained_objects(
187199 t!(fs::create_dir_all(&libdir_self_contained));
188200 let mut target_deps = vec![];
189201
@@ -239,7 +251,7 @@ index 82fd1119c..267443b93 100644
239251 let srcdir = builder.wasi_libdir(target).unwrap_or_else(|| {
240252 panic!(
241253 "Target {:?} does not have a \"wasi-root\" key in bootstrap.toml \
242- @@ -630 ,15 +583 ,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, cargo: &mut Car
254+ @@ -654 ,15 +607 ,6 @@ pub fn std_cargo(
243255 .arg("--manifest-path")
244256 .arg(builder.src.join("library/sysroot/Cargo.toml"));
245257
@@ -256,7 +268,7 @@ index 82fd1119c..267443b93 100644
256268 && let Some(dir) = builder.wasi_libdir(target)
257269 {
258270diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
259- index 83ed7430c..167dcb188 100644
271+ index d43d261ad..2d7f8e26c 100644
260272--- a/src/bootstrap/src/core/build_steps/llvm.rs
261273+++ b/src/bootstrap/src/core/build_steps/llvm.rs
262274@@ -1317,10 +1317,7 @@ impl Step for CrtBeginEnd {
@@ -272,10 +284,10 @@ index 83ed7430c..167dcb188 100644
272284
273285 /// Build crtbegin.o/crtend.o for musl target.
274286diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
275- index 678a9b639..8bc28e300 100644
287+ index 4b7ae6df3..09ccda806 100644
276288--- a/src/bootstrap/src/core/config/config.rs
277289+++ b/src/bootstrap/src/core/config/config.rs
278- @@ -257 ,8 +257 ,6 @@ pub struct Config {
290+ @@ -260 ,8 +260 ,6 @@ pub struct Config {
279291 pub print_step_timings: bool,
280292 pub print_step_rusage: bool,
281293
@@ -284,24 +296,33 @@ index 678a9b639..8bc28e300 100644
284296 pub prefix: Option<PathBuf>,
285297 pub sysconfdir: Option<PathBuf>,
286298 pub datadir: Option<PathBuf>,
287- @@ -518 ,7 +516 ,6 @@ impl Config {
299+ @@ -535 ,7 +533 ,6 @@ impl Config {
288300 randomize_layout: rust_randomize_layout,
289301 default_linker: rust_default_linker,
290302 channel: rust_channel,
291303- musl_root: rust_musl_root,
292304 rpath: rust_rpath,
293305 verbose_tests: rust_verbose_tests,
294306 optimize_tests: rust_optimize_tests,
295- @@ -825,8 +822,6 @@ impl Config {
296- target.ranlib = cfg.ranlib.map(PathBuf::from);
297- target.linker = cfg.linker.map(PathBuf::from);
298- target.crt_static = cfg.crt_static;
299- - target.musl_root = cfg.musl_root.map(PathBuf::from);
300- - target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
301- target.wasi_root = cfg.wasi_root.map(PathBuf::from);
302- target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
303- target.runner = cfg.runner;
304- @@ -1252,7 +1247,6 @@ impl Config {
307+ @@ -855,8 +852,6 @@ impl Config {
308+ profiler: target_profiler,
309+ rpath: target_rpath,
310+ crt_static: target_crt_static,
311+ - musl_root: target_musl_root,
312+ - musl_libdir: target_musl_libdir,
313+ wasi_root: target_wasi_root,
314+ qemu_rootfs: target_qemu_rootfs,
315+ no_std: target_no_std,
316+ @@ -929,8 +924,6 @@ impl Config {
317+ target.crt_static = target_crt_static;
318+ target.default_linker = target_default_linker;
319+ target.default_linker_linux_override = default_linker_linux_override;
320+ - target.musl_root = target_musl_root.map(PathBuf::from);
321+ - target.musl_libdir = target_musl_libdir.map(PathBuf::from);
322+ target.wasi_root = target_wasi_root.map(PathBuf::from);
323+ target.qemu_rootfs = target_qemu_rootfs.map(PathBuf::from);
324+ target.runner = target_runner;
325+ @@ -1379,7 +1372,6 @@ impl Config {
305326 low_priority: build_low_priority.unwrap_or(false),
306327 mandir: install_mandir.map(PathBuf::from),
307328 miri_info,
@@ -325,7 +346,7 @@ index 40b63a7f9..7fbd8d9d8 100644
325346 pub fn filepath(&self) -> Option<&Path> {
326347 self.file.as_ref().map(Path::new)
327348diff --git a/src/bootstrap/src/core/config/toml/rust.rs b/src/bootstrap/src/core/config/toml/rust.rs
328- index 4832a1d37..3fdc679f6 100644
349+ index cb48c7d9a..fd6c9b2ee 100644
329350--- a/src/bootstrap/src/core/config/toml/rust.rs
330351+++ b/src/bootstrap/src/core/config/toml/rust.rs
331352@@ -31,7 +31,6 @@ define_config! {
@@ -336,7 +357,7 @@ index 4832a1d37..3fdc679f6 100644
336357 rpath: Option<bool> = "rpath",
337358 strip: Option<bool> = "strip",
338359 frame_pointers: Option<bool> = "frame-pointers",
339- @@ -332 ,7 +331 ,6 @@ pub fn check_incompatible_options_for_ci_rustc(
360+ @@ -344 ,7 +343 ,6 @@ pub fn check_incompatible_options_for_ci_rustc(
340361 debuginfo_level_tools: _,
341362 debuginfo_level_tests: _,
342363 backtrace: _,
@@ -345,10 +366,10 @@ index 4832a1d37..3fdc679f6 100644
345366 optimize_tests: _,
346367 codegen_tests: _,
347368diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
348- index 020602e6a..a437942c4 100644
369+ index 4c7afa50b..119f8d512 100644
349370--- a/src/bootstrap/src/core/config/toml/target.rs
350371+++ b/src/bootstrap/src/core/config/toml/target.rs
351- @@ -34 ,8 +34 ,6 @@ define_config! {
372+ @@ -38 ,8 +38 ,6 @@ define_config! {
352373 profiler: Option<StringOrBool> = "profiler",
353374 rpath: Option<bool> = "rpath",
354375 crt_static: Option<bool> = "crt-static",
@@ -357,7 +378,7 @@ index 020602e6a..a437942c4 100644
357378 wasi_root: Option<String> = "wasi-root",
358379 qemu_rootfs: Option<String> = "qemu-rootfs",
359380 no_std: Option<bool> = "no-std",
360- @@ -66 ,8 +64 ,6 @@ pub struct Target {
381+ @@ -71 ,8 +69 ,6 @@ pub struct Target {
361382 pub profiler: Option<StringOrBool>,
362383 pub rpath: Option<bool>,
363384 pub crt_static: Option<bool>,
@@ -367,7 +388,7 @@ index 020602e6a..a437942c4 100644
367388 pub qemu_rootfs: Option<PathBuf>,
368389 pub runner: Option<String>,
369390diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
370- index 04cf63f1c..a02519f18 100644
391+ index eaa9e3a6a..dac738730 100644
371392--- a/src/bootstrap/src/core/sanity.rs
372393+++ b/src/bootstrap/src/core/sanity.rs
373394@@ -11,7 +11,7 @@
@@ -379,7 +400,7 @@ index 04cf63f1c..a02519f18 100644
379400
380401 #[cfg(not(test))]
381402 use crate::builder::Builder;
382- @@ -358 ,22 +358 ,6 @@ than building it.
403+ @@ -359 ,22 +359 ,6 @@ than building it.
383404 continue;
384405 }
385406
@@ -403,10 +424,10 @@ index 04cf63f1c..a02519f18 100644
403424 // There are three builds of cmake on windows: MSVC, MinGW, and
404425 // Cygwin. The Cygwin build does not have generators for Visual
405426diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
406- index dc72725b6..f8afc1c68 100644
427+ index 1aec79630..3f609f3ce 100644
407428--- a/src/bootstrap/src/lib.rs
408429+++ b/src/bootstrap/src/lib.rs
409- @@ -1400 ,35 +1400 ,6 @@ impl Build {
430+ @@ -1388 ,35 +1388 ,6 @@ impl Build {
410431 }
411432 }
412433
@@ -443,7 +464,7 @@ index dc72725b6..f8afc1c68 100644
443464 /// configured.
444465 ///
445466diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
446- index d3926df96..7d03d8730 100644
467+ index 0662ae304..f6373f44e 100644
447468--- a/src/bootstrap/src/utils/cc_detect.rs
448469+++ b/src/bootstrap/src/utils/cc_detect.rs
449470@@ -195,30 +195,6 @@ fn default_compiler(
0 commit comments