From a057e85147979d256af6598ac764deaa851bfced Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 7 Dec 2023 09:56:29 -0800 Subject: [PATCH 01/86] Update to 1.74.1. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 63526cf..10f6c12 100644 --- a/.gitignore +++ b/.gitignore @@ -428,3 +428,4 @@ /wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz /rustc-1.73.0-src.tar.xz /rustc-1.74.0-src.tar.xz +/rustc-1.74.1-src.tar.xz diff --git a/rust.spec b/rust.spec index 6b51a37..200e668 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.74.0 +Version: 1.74.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -1027,6 +1027,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* Thu Dec 07 2023 Josh Stone - 1.74.1-1 +- Update to 1.74.1. + * Thu Nov 16 2023 Josh Stone - 1.74.0-1 - Update to 1.74.0. diff --git a/sources b/sources index 032c72b..e71ba42 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.74.0-src.tar.xz) = d949987fab5b7fa4d92910cd4384debd11e598fd2b31d003439dd479977f3389e399d9fd9b43b9a856c54e8777fd10339e169dbb9e87b1a8b07a7ff2ff280c34 +SHA512 (rustc-1.74.1-src.tar.xz) = 14c7e7ed2f38ab60299d8c7d41d78f042b6b57ef822d577b5138e60bdde31cf141eccd4332a25bc5da3d58eb5313d63c1448b5dfe9e11b8055bb8ea133a9038d SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066 From 162f7919e2ee4f206a607549c6f279d787ff5702 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sun, 31 Dec 2023 11:00:36 -0800 Subject: [PATCH 02/86] Update to 1.75.0. --- .gitignore | 1 + ...variables-override-some-default-CPUs.patch | 38 ++++++------- 0001-Use-lld-provided-by-system.patch | 36 ++++++------ ...llow-disabling-target-self-contained.patch | 56 +++++++++---------- ...-only-show-PGO-warnings-when-verbose.patch | 33 +++++++++++ ...xternal-library-path-for-wasm32-wasi.patch | 28 +++++----- rust.spec | 27 ++++++--- ...atch => rustc-1.75.0-disable-libssh2.patch | 20 +++---- sources | 2 +- 9 files changed, 142 insertions(+), 99 deletions(-) create mode 100644 0001-bootstrap-only-show-PGO-warnings-when-verbose.patch rename rustc-1.74.0-disable-libssh2.patch => rustc-1.75.0-disable-libssh2.patch (57%) diff --git a/.gitignore b/.gitignore index 10f6c12..8b53132 100644 --- a/.gitignore +++ b/.gitignore @@ -429,3 +429,4 @@ /rustc-1.73.0-src.tar.xz /rustc-1.74.0-src.tar.xz /rustc-1.74.1-src.tar.xz +/rustc-1.75.0-src.tar.xz diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch index 04a0c9c..dc8be55 100644 --- a/0001-Let-environment-variables-override-some-default-CPUs.patch +++ b/0001-Let-environment-variables-override-some-default-CPUs.patch @@ -1,33 +1,33 @@ -From 87caaab3681b95fa633aac48b9794364e18c467d Mon Sep 17 00:00:00 2001 +From 184d61d2c12aa2db01de9a14ccb2be0cfae5039b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 9 Jun 2023 15:23:08 -0700 Subject: [PATCH] Let environment variables override some default CPUs --- - compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs | 2 +- - compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs | 2 +- - compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs | 2 +- + .../src/spec/targets/powerpc64le_unknown_linux_gnu.rs | 2 +- + .../rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs | 2 +- + .../rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs -index fd896e086b54..08d0c43d20b4 100644 ---- a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs -+++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs +diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs +index 194c3170e683..9806ca78297c 100644 +--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs @@ -2,7 +2,7 @@ pub fn target() -> Target { - let mut base = super::linux_gnu_base::opts(); + let mut base = base::linux_gnu::opts(); - base.cpu = "ppc64le".into(); + base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into(); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); base.max_atomic_width = Some(64); base.stack_probes = StackProbeType::Inline; -diff --git a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs -index f2c722b9a89d..17a14d10b27e 100644 ---- a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs -+++ b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs +diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs +index 6fc410eb2235..c8f84edb9715 100644 +--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs @@ -5,7 +5,7 @@ pub fn target() -> Target { - let mut base = super::linux_gnu_base::opts(); + let mut base = base::linux_gnu::opts(); base.endian = Endian::Big; // z10 is the oldest CPU supported by LLVM - base.cpu = "z10".into(); @@ -35,14 +35,14 @@ index f2c722b9a89d..17a14d10b27e 100644 // FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector // ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we // also strip v128 from the data_layout below to match the older LLVM's expectation. -diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs -index 2f970f87cc64..7ee62cd62a5c 100644 ---- a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs -+++ b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs +diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs +index 80e267c163fa..8436a00e66d5 100644 +--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs @@ -2,7 +2,7 @@ pub fn target() -> Target { - let mut base = super::linux_gnu_base::opts(); + let mut base = base::linux_gnu::opts(); - base.cpu = "x86-64".into(); + base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into(); base.plt_by_default = false; diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index dc1f1ba..bee8e16 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -1,19 +1,19 @@ -From b6ca6a363a7c91136c723a21fda4816d3009e479 Mon Sep 17 00:00:00 2001 +From 61b5cc96337da2121221dd1bcdb63fd36551d065 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 1 Nov 2023 15:21:15 -0700 Subject: [PATCH] Use lld provided by system --- - compiler/rustc_target/src/spec/wasm_base.rs | 3 +-- - compiler/rustc_target/src/spec/x86_64_unknown_none.rs | 2 +- - compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs | 1 + + compiler/rustc_target/src/spec/base/wasm.rs | 3 +-- + compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +- + compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index 341763aadbaf..ee6358e72955 100644 ---- a/compiler/rustc_target/src/spec/wasm_base.rs -+++ b/compiler/rustc_target/src/spec/wasm_base.rs -@@ -89,8 +89,7 @@ macro_rules! args { +diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs +index 87ade9e58cf4..2ddff95febab 100644 +--- a/compiler/rustc_target/src/spec/base/wasm.rs ++++ b/compiler/rustc_target/src/spec/base/wasm.rs +@@ -91,8 +91,7 @@ macro_rules! args { // arguments just yet limit_rdylib_exports: false, @@ -23,10 +23,10 @@ index 341763aadbaf..ee6358e72955 100644 linker_flavor: LinkerFlavor::WasmLld(Cc::No), pre_link_args, -diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/x86_64_unknown_none.rs -index fe3b24f2d4af..1f1731d202ca 100644 ---- a/compiler/rustc_target/src/spec/x86_64_unknown_none.rs -+++ b/compiler/rustc_target/src/spec/x86_64_unknown_none.rs +diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs +index 9aa95a35f8e5..a9172f9441b7 100644 +--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs ++++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs @@ -17,7 +17,7 @@ pub fn target() -> Target { static_position_independent_executables: true, relro_level: RelroLevel::Full, @@ -36,11 +36,11 @@ index fe3b24f2d4af..1f1731d202ca 100644 features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float" .into(), -diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs -index 41ba768068a3..2eea4c76f1ca 100644 ---- a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs -+++ b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs -@@ -13,6 +13,7 @@ pub fn target() -> Target { +diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs +index 5abfb8162f70..13cb43bda1a4 100644 +--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs ++++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs +@@ -16,6 +16,7 @@ pub fn target() -> Target { base.plt_by_default = false; base.max_atomic_width = Some(64); base.entry_abi = Conv::X86_64Win64; diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index a2cb874..2a3cbd7 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,20 +1,20 @@ -From 4acc7d53182cf83f2c776c4005fc12756ecdfe8f Mon Sep 17 00:00:00 2001 +From df0d6f1d8b46db82d7599ca8eff6e8f844cf52f2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:14:28 -0700 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained --- - config.example.toml | 5 +++++ - src/bootstrap/compile.rs | 4 ++++ - src/bootstrap/config.rs | 8 ++++++++ - src/bootstrap/lib.rs | 5 +++++ + config.example.toml | 5 +++++ + src/bootstrap/src/core/build_steps/compile.rs | 4 ++++ + src/bootstrap/src/core/config/config.rs | 8 ++++++++ + src/bootstrap/src/lib.rs | 5 +++++ 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index f3c2366d674e..c6c5e24fb592 100644 +index e5df28a49af6..2fcd8b8cb057 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -798,6 +798,11 @@ changelog-seen = 2 +@@ -807,6 +807,11 @@ change-id = 116881 # target triples containing `-none`, `nvptx`, `switch`, or `-uefi`. #no-std = (bool) @@ -26,11 +26,11 @@ index f3c2366d674e..c6c5e24fb592 100644 # ============================================================================= # Distribution options # -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 292ccc5780fa..d4d79ce982af 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -251,6 +251,10 @@ fn copy_self_contained_objects( +diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs +index 7021a9543582..11555c65ca87 100644 +--- a/src/bootstrap/src/core/build_steps/compile.rs ++++ b/src/bootstrap/src/core/build_steps/compile.rs +@@ -302,6 +302,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -41,11 +41,11 @@ index 292ccc5780fa..d4d79ce982af 100644 let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained"); t!(fs::create_dir_all(&libdir_self_contained)); let mut target_deps = vec![]; -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index 836328f94ef8..4ae3d853ed88 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -527,6 +527,7 @@ pub struct Target { +diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs +index 0a9175aa3ea5..a2e028b25036 100644 +--- a/src/bootstrap/src/core/config/config.rs ++++ b/src/bootstrap/src/core/config/config.rs +@@ -533,6 +533,7 @@ pub struct Target { pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, @@ -53,7 +53,7 @@ index 836328f94ef8..4ae3d853ed88 100644 } impl Target { -@@ -535,6 +536,9 @@ pub fn from_triple(triple: &str) -> Self { +@@ -541,6 +542,9 @@ pub fn from_triple(triple: &str) -> Self { if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") { target.no_std = true; } @@ -63,7 +63,7 @@ index 836328f94ef8..4ae3d853ed88 100644 target } } -@@ -1033,6 +1037,7 @@ struct TomlTarget { +@@ -1051,6 +1055,7 @@ struct TomlTarget { wasi_root: Option = "wasi-root", qemu_rootfs: Option = "qemu-rootfs", no_std: Option = "no-std", @@ -71,21 +71,21 @@ index 836328f94ef8..4ae3d853ed88 100644 } } -@@ -1587,6 +1592,9 @@ fn get_table(option: &str) -> Result { +@@ -1600,6 +1605,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } + if let Some(s) = cfg.self_contained { + target.self_contained = s; + } - target.cc = cfg.cc.map(PathBuf::from).or_else(|| { - target.ndk.as_ref().map(|ndk| ndk_compiler(Language::C, &triple, ndk)) - }); -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 8b8d4b237953..c3e7a1ccc00f 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -1320,6 +1320,11 @@ fn no_std(&self, target: TargetSelection) -> Option { + target.cc = cfg.cc.map(PathBuf::from); + target.cxx = cfg.cxx.map(PathBuf::from); + target.ar = cfg.ar.map(PathBuf::from); +diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs +index 33b8f1a7ce72..f36e53187576 100644 +--- a/src/bootstrap/src/lib.rs ++++ b/src/bootstrap/src/lib.rs +@@ -1335,6 +1335,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } diff --git a/0001-bootstrap-only-show-PGO-warnings-when-verbose.patch b/0001-bootstrap-only-show-PGO-warnings-when-verbose.patch new file mode 100644 index 0000000..ca36844 --- /dev/null +++ b/0001-bootstrap-only-show-PGO-warnings-when-verbose.patch @@ -0,0 +1,33 @@ +From 776146e9ebb6bbe17a37bfad955f3dac95317275 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 16 Nov 2023 10:42:23 -0800 +Subject: [PATCH] bootstrap: only show PGO warnings when verbose + +Building rustc with `--rust-profile-use` is currently dumping a lot of +warnings of "no profile data available for function" from `rustc_smir` +and `stable_mir`. These simply aren't exercised by the current profile- +gathering steps, but that's to be expected for new or experimental +functionality. I think for most people, these warnings will be just +noise, so it makes sense to only have them in verbose builds. +--- + src/bootstrap/src/core/build_steps/compile.rs | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs +index af69860df1c5..51e4195827fc 100644 +--- a/src/bootstrap/src/core/build_steps/compile.rs ++++ b/src/bootstrap/src/core/build_steps/compile.rs +@@ -887,7 +887,9 @@ fn run(self, builder: &Builder<'_>) { + } else if let Some(path) = &builder.config.rust_profile_use { + if compiler.stage == 1 { + cargo.rustflag(&format!("-Cprofile-use={path}")); +- cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function"); ++ if builder.is_verbose() { ++ cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function"); ++ } + true + } else { + false +-- +2.43.0 + diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index 951e360..e2da2fe 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,19 +1,19 @@ -From 461f64c60ec897d8e9caa85190ac27fe81871ebf Mon Sep 17 00:00:00 2001 +From 79bb610c8fc5d9df7dd4720ae847b8f17e7b1ad4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:18:16 -0700 Subject: [PATCH 2/2] set an external library path for wasm32-wasi --- - compiler/rustc_codegen_ssa/src/back/link.rs | 9 +++++++++ - compiler/rustc_target/src/spec/mod.rs | 2 ++ - compiler/rustc_target/src/spec/wasm32_wasi.rs | 6 +++++- + compiler/rustc_codegen_ssa/src/back/link.rs | 9 +++++++++ + compiler/rustc_target/src/spec/mod.rs | 2 ++ + compiler/rustc_target/src/spec/targets/wasm32_wasi.rs | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index c4a0f6291e7f..9421f2fda303 100644 +index dd9d277fb775..3d0f0502f255 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1490,6 +1490,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1496,6 +1496,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -37,10 +37,10 @@ index c4a0f6291e7f..9421f2fda303 100644 /// Add options making relocation sections in the produced ELF files read-only diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 1bcb1f353159..33d9c54922cb 100644 +index f04799482c83..25410b37ba24 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -1701,6 +1701,7 @@ pub struct TargetOptions { +@@ -1874,6 +1874,7 @@ pub struct TargetOptions { /// Objects to link before and after all other object code. pub pre_link_objects: CrtObjects, pub post_link_objects: CrtObjects, @@ -48,7 +48,7 @@ index 1bcb1f353159..33d9c54922cb 100644 /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. pub pre_link_objects_self_contained: CrtObjects, pub post_link_objects_self_contained: CrtObjects, -@@ -2175,6 +2176,7 @@ fn default() -> TargetOptions { +@@ -2352,6 +2353,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), @@ -56,11 +56,11 @@ index 1bcb1f353159..33d9c54922cb 100644 pre_link_objects_self_contained: Default::default(), post_link_objects_self_contained: Default::default(), link_self_contained: LinkSelfContainedDefault::False, -diff --git a/compiler/rustc_target/src/spec/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs -index a0476d542e64..ad7160bf5fcd 100644 ---- a/compiler/rustc_target/src/spec/wasm32_wasi.rs -+++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs -@@ -85,7 +85,11 @@ pub fn target() -> Target { +diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs +index 6dbcb01ea436..2151f86d0648 100644 +--- a/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs ++++ b/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs +@@ -86,7 +86,11 @@ pub fn target() -> Target { options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained(); // FIXME: Figure out cases in which WASM needs to link with a native toolchain. diff --git a/rust.spec b/rust.spec index 200e668..8852909 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.74.1 +Version: 1.75.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.73.0 -%global bootstrap_channel 1.73.0 -%global bootstrap_date 2023-10-05 +%global bootstrap_version 1.74.0 +%global bootstrap_channel 1.74.0 +%global bootstrap_date 2023-11-16 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -63,7 +63,7 @@ ExclusiveArch: %{rust_arches} # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 15.0+. %global min_llvm_version 15.0.0 -%global bundled_llvm_version 17.0.4 +%global bundled_llvm_version 17.0.5 %bcond_with bundled_llvm # Requires stable libgit2 1.7, and not the next minor soname change. @@ -118,13 +118,16 @@ Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch +# https://github.com/rust-lang/rust/pull/117982 +Patch6: 0001-bootstrap-only-show-PGO-warnings-when-verbose.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.74.0-disable-libssh2.patch +Patch100: rustc-1.75.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -558,6 +561,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %if %without bundled_wasi_libc %patch -P5 -p1 %endif +%patch -P6 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -596,7 +600,7 @@ rm -rf vendor/libssh2-sys*/ %endif # This only affects the transient rust-installer, but let it use our dynamic xz-libs -sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs +sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/src/core/build_steps/tool.rs %if %{without bundled_llvm} && %{with llvm_static} # Static linking to distro LLVM needs to add -lffi @@ -854,11 +858,12 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %{export_rust_env} # Sanity-check the installed binaries, debuginfo-stripped and all. -%{buildroot}%{_bindir}/cargo new build/hello-world +TMP_HELLO=$(mktemp -d) ( - cd build/hello-world + cd "$TMP_HELLO" export RUSTC=%{buildroot}%{_bindir}/rustc \ LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" + %{buildroot}%{_bindir}/cargo init --name hello-world %{buildroot}%{_bindir}/cargo run --verbose # Sanity-check that code-coverage builds and runs @@ -870,6 +875,7 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %{buildroot}%{_bindir}/cargo build --verbose --target=$triple done ) +rm -rf "$TMP_HELLO" # The results are not stable on koji, so mask errors and just log it. # Some of the larger test artifacts are manually cleaned to save space. @@ -1027,6 +1033,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* Sun Dec 31 2023 Josh Stone - 1.75.0-1 +- Update to 1.75.0. + * Thu Dec 07 2023 Josh Stone - 1.74.1-1 - Update to 1.74.1. diff --git a/rustc-1.74.0-disable-libssh2.patch b/rustc-1.75.0-disable-libssh2.patch similarity index 57% rename from rustc-1.74.0-disable-libssh2.patch rename to rustc-1.75.0-disable-libssh2.patch index 81c30b4..2b06046 100644 --- a/rustc-1.74.0-disable-libssh2.patch +++ b/rustc-1.75.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-10-20 22:31:52.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-11-01 15:33:13.224745542 -0700 -@@ -2009,7 +2009,6 @@ +--- ./rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-11-12 12:24:35.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-11-14 17:01:32.010125953 -0800 +@@ -2027,7 +2027,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2042,20 +2041,6 @@ +@@ -2060,20 +2059,6 @@ ] [[package]] @@ -29,14 +29,14 @@ name = "libz-sys" version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-11-01 15:33:13.225745528 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-11-01 15:34:51.883397544 -0700 +--- ./rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-11-14 17:01:32.010125953 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-11-14 17:02:44.645097701 -0800 @@ -40,7 +40,7 @@ curl-sys = "0.4.68" filetime = "0.2.22" - flate2 = { version = "1.0.27", default-features = false, features = ["zlib"] } --git2 = "0.18.0" -+git2 = { version = "0.18.0", default-features = false, features = ["https"] } + flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] } +-git2 = "0.18.1" ++git2 = { version = "0.18.1", default-features = false, features = ["https"] } git2-curl = "0.19.0" - gix = { version = "0.54.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] } + gix = { version = "0.55.2", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] } gix-features-for-configuration-only = { version = "0.35.0", package = "gix-features", features = [ "parallel" ] } diff --git a/sources b/sources index e71ba42..c4c9dac 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.74.1-src.tar.xz) = 14c7e7ed2f38ab60299d8c7d41d78f042b6b57ef822d577b5138e60bdde31cf141eccd4332a25bc5da3d58eb5313d63c1448b5dfe9e11b8055bb8ea133a9038d +SHA512 (rustc-1.75.0-src.tar.xz) = 7b0f25d91b1b5c317980fc88e059200bd43b56a70b445fbc72fb9b96e09775bfd3a98e9bd9d662af80f0ce3aef527c777ee82777e96ca876f47a972d63da8606 SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066 From 6f2eb1990e11ab9e0d2026f5e06a866362a40184 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 3 Jan 2024 16:22:01 -0800 Subject: [PATCH 03/86] Rename x/xk macros for older rpm compat --- rust.spec | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/rust.spec b/rust.spec index 8852909..c800c50 100644 --- a/rust.spec +++ b/rust.spec @@ -735,32 +735,32 @@ test -r "%{profiler}" --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" -%global x %{__python3} ./x.py -%global xk %{x} --keep-stage=0 --keep-stage=1 +%global __x %{__python3} ./x.py +%global __xk %{__x} --keep-stage=0 --keep-stage=1 %if %with rustc_pgo # Build the compiler with profile instrumentation PROFRAW="$PWD/build/profiles" PROFDATA="$PWD/build/rustc.profdata" mkdir -p "$PROFRAW" -%{x} build -j "$ncpus" sysroot --rust-profile-generate="$PROFRAW" +%{__x} build -j "$ncpus" sysroot --rust-profile-generate="$PROFRAW" # Build cargo as a workload to generate compiler profiles -env LLVM_PROFILE_FILE="$PROFRAW/default_%%m_%%p.profraw" %{xk} build cargo +env LLVM_PROFILE_FILE="$PROFRAW/default_%%m_%%p.profraw" %{__xk} build cargo llvm-profdata merge -o "$PROFDATA" "$PROFRAW" rm -r "$PROFRAW" build/%{rust_triple}/stage2*/ # Rebuild the compiler using the profile data -%{x} build -j "$ncpus" sysroot --rust-profile-use="$PROFDATA" +%{__x} build -j "$ncpus" sysroot --rust-profile-use="$PROFDATA" %else # Build the compiler without PGO -%{x} build -j "$ncpus" sysroot +%{__x} build -j "$ncpus" sysroot %endif # Build everything else normally -%{xk} build -%{xk} doc +%{__xk} build +%{__xk} doc for triple in %{?all_targets} ; do - %{xk} build --target=$triple std + %{__xk} build --target=$triple std done %install @@ -769,10 +769,10 @@ done %endif %{export_rust_env} -DESTDIR=%{buildroot} %{xk} install +DESTDIR=%{buildroot} %{__xk} install for triple in %{?all_targets} ; do - DESTDIR=%{buildroot} %{xk} install --target=$triple std + DESTDIR=%{buildroot} %{__xk} install --target=$triple std done # The rls stub doesn't have an install target, but we can just copy it. @@ -882,17 +882,17 @@ rm -rf "$TMP_HELLO" # Bootstrap is excluded because it's not something we ship, and a lot of its # tests are geared toward the upstream CI environment. -%{xk} test --no-fail-fast --skip src/bootstrap || : +%{__xk} test --no-fail-fast --skip src/bootstrap || : rm -rf "./build/%{rust_triple}/test/" -%{xk} test --no-fail-fast cargo || : +%{__xk} test --no-fail-fast cargo || : rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" -%{xk} test --no-fail-fast clippy || : +%{__xk} test --no-fail-fast clippy || : -%{xk} test --no-fail-fast rust-analyzer || : +%{__xk} test --no-fail-fast rust-analyzer || : -%{xk} test --no-fail-fast rustfmt || : +%{__xk} test --no-fail-fast rustfmt || : %ldconfig_scriptlets From 6c6aaa4382fe329978bc1af590a095b103e2b62e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jan 2024 17:48:12 +0000 Subject: [PATCH 04/86] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index c800c50..831bedc 100644 --- a/rust.spec +++ b/rust.spec @@ -1,6 +1,6 @@ Name: rust Version: 1.75.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) # ^ written as: (rust itself) and (bundled libraries) @@ -1033,6 +1033,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* Fri Jan 26 2024 Fedora Release Engineering - 1.75.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Dec 31 2023 Josh Stone - 1.75.0-1 - Update to 1.75.0. From 8c1ae0e7626bb52b063cee210f3ad31f0fef4930 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 3 Jan 2024 15:33:47 -0500 Subject: [PATCH 05/86] Provide rust-srpm-macros in RHEL rust-srpm-macros is a dependency of redhat-rpm-config so that Rust-based SRPMs can rely on these particular macros. In RHEL 9 and earlier, rust-srpm-macros was a separate source package which was included in RHEL. Since then, it became a subpackage of rust-packaging in Fedora. In order to not pull in any part of rust-packaging into RHEL 10, thereby allowing it to be maintained separately in EPEL, those macros are provided here instead. --- macros.rust-srpm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ rust.spec | 13 ++++++++++ 2 files changed, 75 insertions(+) create mode 100644 macros.rust-srpm diff --git a/macros.rust-srpm b/macros.rust-srpm new file mode 100644 index 0000000..45287a8 --- /dev/null +++ b/macros.rust-srpm @@ -0,0 +1,62 @@ +# rust_arches: list of architectures where building Rust is supported +# +# Since RPM itself now depends on Rust code (via its GPG backend, rpm-sequoia), +# this list will probably always be a superset of all architectures that are +# supported by Fedora, which is why it is no longer required to set +# "ExclusiveArch: rust_arches" for Rust packages in Fedora. +%rust_arches x86_64 %{ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x + +# version_no_tilde: lua macro for reconstructing the original crate version +# from the RPM version (i.e. replace any "~" characters with "-") +%version_no_tilde() %{lua: + local sep = rpm.expand('%1') + local ver = rpm.expand('%2') +\ + if sep == '%1' then + sep = '-' + end +\ + if ver == '%2' then + ver = rpm.expand('%version') + end + ver = ver:gsub('~', sep) +\ + print(ver) +} + +# __crates_url: default API endpoint for downloading .crate files from crates.io +%__crates_url https://crates.io/api/v1/crates/ + +# crates_source: lua macro for constructing the Source URL for a crate +%crates_source() %{lua: + local crate = rpm.expand('%1') + local version = rpm.expand('%2') + local url = rpm.expand('%__crates_url') +\ + -- first argument missing: fall back to %crate + if crate == '%1' then + crate = rpm.expand('%crate') + end + -- %crate macro not defined: fall back to %name + if crate == '%crate' then + crate = rpm.expand('%name') + end +\ + -- second argument missing: fall back to %crate_version + if version == '%2' then + version = rpm.expand('%crate_version') + end + -- %crate_version macro not defined: fall back to %version + if version == '%crate_version' then + version = rpm.expand('%version') + end + -- replace '~' with '-' for backwards compatibility + -- can be removed in the future + version = version:gsub('~', '-') +\ + print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate') +} + +# __cargo_skip_build: unused macro, set to 0 for backwards compatibility +%__cargo_skip_build 0 + diff --git a/rust.spec b/rust.spec index 831bedc..377e94d 100644 --- a/rust.spec +++ b/rust.spec @@ -125,6 +125,7 @@ Patch6: 0001-bootstrap-only-show-PGO-warnings-when-verbose.patch # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) Source100: macros.rust-toolset +Source101: macros.rust-srpm # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) Patch100: rustc-1.75.0-disable-libssh2.patch @@ -520,6 +521,14 @@ useful as a reference for code completion tools in various editors. %if 0%{?rhel} +%package srpm-macros +Summary: RPM macros for building Rust source packages +BuildArch: noarch + +%description srpm-macros +RPM macros for building source packages for Rust projects. + + %package toolset Summary: Rust Toolset BuildArch: noarch @@ -848,6 +857,7 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %if 0%{?rhel} # This allows users to build packages using Rust Toolset. %{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset +%{__install} -D -m 644 %{S:101} %{buildroot}%{rpmmacrodir}/macros.rust-srpm %endif @@ -1027,6 +1037,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %if 0%{?rhel} +%files srpm-macros +%{rpmmacrodir}/macros.rust-srpm + %files toolset %{rpmmacrodir}/macros.rust-toolset %endif From 6501920abb56dc85a7bebb08a5c047137662f46f Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 16 Nov 2023 22:08:03 -0500 Subject: [PATCH 06/86] Sync rust-toolset macros to rust-packaging v25.2 This bring RHEL rust-toolset in sync with the latest Fedora rust-packaging, most importantly: * Fedora's new style (-v vendor) vendoring is implemented. The old RHEL style (-V #) vendoring is still supported, at least until we can convert everything in ELN. * Automatic generation of bundled provides using %cargo_vendor_manifest. However, instead of depending on cargo2rpm, a very stripped-down version of just its parse-vendor-manifest command is provided as a private script, along with a fileattr to call it. Other changes incorporated in this commit: * -Cstrip=none added to %build_rustflags. * --profile rpm is used instead of --release. * Errors in spawned commands are now caught. * Comments and whitespace are synced for easier comparison with Fedora. * --target all is dropped from license and vendor macros, to avoid false alarms from windows crates. --- cargo_vendor.attr | 2 + cargo_vendor.prov | 127 ++++++++++++++++++++++++++++++++ macros.rust-toolset | 176 ++++++++++++++++++++++++++++++-------------- rust.spec | 6 ++ 4 files changed, 255 insertions(+), 56 deletions(-) create mode 100644 cargo_vendor.attr create mode 100755 cargo_vendor.prov diff --git a/cargo_vendor.attr b/cargo_vendor.attr new file mode 100644 index 0000000..be2d48f --- /dev/null +++ b/cargo_vendor.attr @@ -0,0 +1,2 @@ +%__cargo_vendor_path ^%{_defaultlicensedir}(/[^/]+)+/cargo-vendor.txt$ +%__cargo_vendor_provides %{_rpmconfigdir}/cargo_vendor.prov diff --git a/cargo_vendor.prov b/cargo_vendor.prov new file mode 100755 index 0000000..6efca18 --- /dev/null +++ b/cargo_vendor.prov @@ -0,0 +1,127 @@ +#! /usr/bin/python3 -s +# Stripped down replacement for cargo2rpm parse-vendor-manifest + +import re +import subprocess +import sys +from typing import Optional + + +VERSION_REGEX = re.compile( + r""" + ^ + (?P0|[1-9]\d*) + \.(?P0|[1-9]\d*) + \.(?P0|[1-9]\d*) + (?:-(?P
(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?
+    (?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
+    """,
+    re.VERBOSE,
+)
+
+
+class Version:
+    """
+    Version that adheres to the "semantic versioning" format.
+    """
+
+    def __init__(self, major: int, minor: int, patch: int, pre: Optional[str] = None, build: Optional[str] = None):
+        self.major: int = major
+        self.minor: int = minor
+        self.patch: int = patch
+        self.pre: Optional[str] = pre
+        self.build: Optional[str] = build
+
+    @staticmethod
+    def parse(version: str) -> "Version":
+        """
+        Parses a version string and return a `Version` object.
+        Raises a `ValueError` if the string does not match the expected format.
+        """
+
+        match = VERSION_REGEX.match(version)
+        if not match:
+            raise ValueError(f"Invalid version: {version!r}")
+
+        matches = match.groupdict()
+
+        major_str = matches["major"]
+        minor_str = matches["minor"]
+        patch_str = matches["patch"]
+        pre = matches["pre"]
+        build = matches["build"]
+
+        major = int(major_str)
+        minor = int(minor_str)
+        patch = int(patch_str)
+
+        return Version(major, minor, patch, pre, build)
+
+    def to_rpm(self) -> str:
+        """
+        Formats the `Version` object as an equivalent RPM version string.
+        Characters that are invalid in RPM versions are replaced ("-" -> "_")
+
+        Build metadata (the optional `Version.build` attribute) is dropped, so
+        the conversion is not lossless for versions where this attribute is not
+        `None`. However, build metadata is not intended to be part of the
+        version (and is not even considered when doing version comparison), so
+        dropping it when converting to the RPM version format is correct.
+        """
+
+        s = f"{self.major}.{self.minor}.{self.patch}"
+        if self.pre:
+            s += f"~{self.pre.replace('-', '_')}"
+        return s
+
+
+def break_the_build(error: str):
+    """
+    This function writes a string that is an invalid RPM dependency specifier,
+    which causes dependency generators to fail and break the build. The
+    additional error message is printed to stderr.
+    """
+
+    print("*** FATAL ERROR ***")
+    print(error, file=sys.stderr)
+
+ 
+def get_cargo_vendor_txt_paths_from_stdin() -> set[str]:  # pragma nocover
+    """
+    Read lines from standard input and filter out lines that look like paths
+    to `cargo-vendor.txt` files. This is how RPM generators pass lists of files.
+    """
+
+    lines = {line.rstrip("\n") for line in sys.stdin.readlines()}
+    return {line for line in lines if line.endswith("/cargo-vendor.txt")}
+
+
+def action_parse_vendor_manifest():
+    paths = get_cargo_vendor_txt_paths_from_stdin()
+
+    for path in paths:
+        with open(path) as file:
+            manifest = file.read()
+
+        for line in manifest.strip().splitlines():
+            crate, version = line.split(" v")
+            print(f"bundled(crate({crate})) = {Version.parse(version).to_rpm()}")
+
+
+def main():
+    try:
+        action_parse_vendor_manifest()
+        exit(0)
+
+    # print an error message that is not a valid RPM dependency
+    # to cause the generator to break the build
+    except (IOError, ValueError) as exc:
+        break_the_build(str(exc))
+        exit(1)
+
+    break_the_build("Uncaught exception: This should not happen, please report a bug.")
+    exit(1)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/macros.rust-toolset b/macros.rust-toolset
index 250e934..396f6c3 100644
--- a/macros.rust-toolset
+++ b/macros.rust-toolset
@@ -1,12 +1,7 @@
-# Explicitly use bindir tools, in case others are in the PATH,
-# like the rustup shims in a user's ~/.cargo/bin/.
-#
-# Since cargo 1.31, install only uses $CARGO_HOME/config, ignoring $PWD.
-#   https://github.com/rust-lang/cargo/issues/6397
-# But we can set CARGO_HOME locally, which is a good idea anyway to make sure
-# it never writes to ~/.cargo during rpmbuild.
-%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
+# __rustc: path to the default rustc executable
 %__rustc /usr/bin/rustc
+
+# __rustdoc: path to the default rustdoc executable
 %__rustdoc /usr/bin/rustdoc
 
 # rustflags_opt_level: default optimization level
@@ -46,22 +41,56 @@
   -Copt-level=%rustflags_opt_level
   -Cdebuginfo=%rustflags_debuginfo
   -Ccodegen-units=%rustflags_codegen_units
+  -Cstrip=none
   %{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""}
   %[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""]
 }
 
+# __cargo: cargo command with environment variables
+#
+# CARGO_HOME: This ensures cargo reads configuration file from .cargo/config,
+#       and prevents writing any files to $HOME during RPM builds.
+%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
+
 # __cargo_common_opts: common command line flags for cargo
 #
 # _smp_mflags: run builds and tests in parallel
 %__cargo_common_opts %{?_smp_mflags}
 
-%cargo_prep(V:) (\
-%{__mkdir} -p .cargo \
-cat > .cargo/config << EOF \
+# cargo_prep: macro to set up build environment for cargo projects
+#
+# This involves four steps:
+# - create the ".cargo" directory if it doesn't exist yet
+# - dump custom cargo configuration into ".cargo/config"
+# - remove "Cargo.lock" if it exists (it breaks builds with custom cargo config)
+# - remove "Cargo.toml.orig" if it exists (it breaks running "cargo package")
+#
+# Options:
+#   -V     - unpack and use vendored sources from Source tarball
+#                    (deprecated; use -v instead)
+#   -v  - use vendored sources from 
+#   -N             - Don't set up any registry. Only set up the build configuration.
+%cargo_prep(V:v:N)\
+%{-v:%{-V:%{error:-v and -V are mutually exclusive!}}}\
+%{-v:%{-N:%{error:-v and -N are mutually exclusive!}}}\
+(\
+set -euo pipefail\
+%{__mkdir} -p target/rpm\
+/usr/bin/ln -s rpm target/release\
+%{__rm} -rf .cargo/\
+%{__mkdir} -p .cargo\
+cat > .cargo/config << EOF\
 [build]\
 rustc = "%{__rustc}"\
 rustdoc = "%{__rustdoc}"\
 \
+[profile.rpm]\
+inherits = "release"\
+opt-level = %{rustflags_opt_level}\
+codegen-units = %{rustflags_codegen_units}\
+debug = %{rustflags_debuginfo}\
+strip = "none"\
+\
 [env]\
 CFLAGS = "%{build_cflags}"\
 CXXFLAGS = "%{build_cxxflags}"\
@@ -73,37 +102,38 @@ root = "%{buildroot}%{_prefix}"\
 [term]\
 verbose = true\
 EOF\
-%if 0%{-V:1}\
-%{__tar} -xoaf %{S:%{-V*}}\
-cat >> .cargo/config << EOF \
+%{-V:%{__tar} -xoaf %{S:%{-V*}}}\
+%{!?-N:\
+cat >> .cargo/config << EOF\
+[source.vendored-sources]\
+directory = "%{-v*}%{-V:./vendor}"\
 \
 [source.crates-io]\
+registry = "https://crates.io"\
 replace-with = "vendored-sources"\
-\
-[source.vendored-sources]\
-directory = "./vendor"\
-EOF\
-%endif\
+EOF}\
+%{__rm} -f Cargo.toml.orig\
 )
 
 # __cargo_parse_opts: function-like macro which parses common flags into the
 #       equivalent command-line flags for cargo
 %__cargo_parse_opts(naf:) %{shrink:\
-%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
-  %{-n:--no-default-features}                             \
-  %{-a:--all-features}                                    \
-  %{-f:--features %{-f*}}                                 \
-  %{nil}
+    %{-n:%{-a:%{error:Can't specify both -n and -a}}}           \
+    %{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}}   \
+    %{-n:--no-default-features}                                 \
+    %{-a:--all-features}                                        \
+    %{-f:--features %{-f*}}                                     \
+    %{nil}                                                      \
 }
 
 # cargo_build: builds the crate with cargo with the specified feature flags
-%cargo_build(naf:) \
-%{shrink:\
-  %{__cargo} build                                   \
-    %{__cargo_common_opts}                           \
-    --release                                        \
-    %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
-    %*                                               \
+%cargo_build(naf:)\
+%{shrink:                                               \
+    %{__cargo} build                                    \
+    %{__cargo_common_opts}                              \
+    --profile rpm                                       \
+    %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}    \
+    %*                                                  \
 }
 
 # cargo_test: runs the test suite with cargo with the specified feature flags
@@ -113,14 +143,14 @@ EOF\
 # macro argument parsing and "cargo test" argument parsing need to be bypassed,
 # i.e. "%%cargo_test -- -- --skip foo" for skipping all tests with names that
 # match "foo".
-%cargo_test(naf:) \
-%{shrink:\
-  %{__cargo} test                                    \
-    %{__cargo_common_opts}                           \
-    --release                                        \
-    --no-fail-fast                                   \
-    %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
-    %*                                               \
+%cargo_test(naf:)\
+%{shrink:                                               \
+    %{__cargo} test                                     \
+    %{__cargo_common_opts}                              \
+    --profile rpm                                       \
+    --no-fail-fast                                      \
+    %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}    \
+    %*                                                  \
 }
 
 # cargo_install: install files into the buildroot
@@ -130,16 +160,18 @@ EOF\
 # "$CARGO_HOME/.crates.toml" file, which is used to keep track of which version
 # of a specific binary has been installed, but which conflicts between builds
 # of different Rust applications and is not needed when building RPM packages.
-%cargo_install(t:naf:) (                                          \
-set -eu                                                           \
-%{shrink:                                                         \
-  %{__cargo} install                                              \
-    %{__cargo_common_opts}                                        \
-    --no-track                                                    \
-    --path .                                                      \
-    %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}              \
-    %*                                                            \
-}                                                                 \
+%cargo_install(t:naf:)\
+(\
+set -euo pipefail                                                   \
+  %{shrink:                                                         \
+    %{__cargo} install                                              \
+      %{__cargo_common_opts}                                        \
+      --profile rpm                                                 \
+      --no-track                                                    \
+      --path .                                                      \
+      %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}              \
+      %*                                                            \
+  }                                                                 \
 )
 
 # cargo_license: print license information for all crate dependencies
@@ -156,19 +188,21 @@ set -eu                                                           \
 # The "cargo tree" command called by this macro will fail if there are missing
 # (optional) dependencies.
 %cargo_license(naf:)\
-%{shrink:\
+(\
+set -euo pipefail\
+%{shrink:                                                           \
     %{__cargo} tree                                                 \
     --workspace                                                     \
     --offline                                                       \
     --edges no-build,no-dev,no-proc-macro                           \
     --no-dedupe                                                     \
-    --target all                                                    \
     %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}                \
     --prefix none                                                   \
     --format "{l}: {p}"                                             \
     | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "s:/: OR :g"   \
-    | sort -u
-}
+    | sort -u                                                       \
+}\
+)
 
 # cargo_license_summary: print license summary for all crate dependencies
 #
@@ -177,16 +211,46 @@ set -eu                                                           \
 # in the dependency tree. This is useful for determining the correct License
 # tag for packages that contain compiled Rust binaries.
 %cargo_license_summary(naf:)\
-%{shrink:\
+(\
+set -euo pipefail\
+%{shrink:                                                           \
     %{__cargo} tree                                                 \
     --workspace                                                     \
     --offline                                                       \
     --edges no-build,no-dev,no-proc-macro                           \
     --no-dedupe                                                     \
-    --target all                                                    \
     %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}                \
     --prefix none                                                   \
     --format "# {l}"                                                \
     | sed -e "s: / :/:g" -e "s:/: OR :g"                            \
     | sort -u                                                       \
-}
+}\
+)
+
+# cargo_vendor_manifest: write list of vendored crates and their versions
+#
+# The arguments for the internal "cargo tree" call emulate the logic
+# that determines which crates are included when running "cargo vendor".
+# The results are written to "cargo-vendor.txt".
+#
+# TODO: --all-features may be overly broad; this should be modified to
+# use %%__cargo_parse_opts to handle feature flags.
+%cargo_vendor_manifest()\
+(\
+set -euo pipefail\
+%{shrink:                                                           \
+    %{__cargo} tree                                                 \
+    --workspace                                                     \
+    --offline                                                       \
+    --edges normal,build                                            \
+    --no-dedupe                                                     \
+    --all-features                                                  \
+    --prefix none                                                   \
+    --format "{p}"                                                  \
+    | grep -v "$(pwd)"                                              \
+    | sed -e "s: (proc-macro)::"                                    \
+    | sort -u                                                       \
+    > cargo-vendor.txt                                              \
+}\
+)
+
diff --git a/rust.spec b/rust.spec
index 377e94d..d5ddc9b 100644
--- a/rust.spec
+++ b/rust.spec
@@ -126,6 +126,8 @@ Patch6:         0001-bootstrap-only-show-PGO-warnings-when-verbose.patch
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
 Source100:      macros.rust-toolset
 Source101:      macros.rust-srpm
+Source102:      cargo_vendor.attr
+Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
 Patch100:       rustc-1.75.0-disable-libssh2.patch
@@ -858,6 +860,8 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll*
 # This allows users to build packages using Rust Toolset.
 %{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset
 %{__install} -D -m 644 %{S:101} %{buildroot}%{rpmmacrodir}/macros.rust-srpm
+%{__install} -D -m 644 %{S:102} %{buildroot}%{_fileattrsdir}/cargo_vendor.attr
+%{__install} -D -m 755 %{S:103} %{buildroot}%{_rpmconfigdir}/cargo_vendor.prov
 %endif
 
 
@@ -1042,6 +1046,8 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 %files toolset
 %{rpmmacrodir}/macros.rust-toolset
+%{_fileattrsdir}/cargo_vendor.attr
+%{_rpmconfigdir}/cargo_vendor.prov
 %endif
 
 

From d7cd45b9e460241158a16dc308c5026b649cbb5d Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 9 Jan 2024 13:46:24 -0800
Subject: [PATCH 07/86] Consolidate 32-bit build compromises.

---
 rust.spec | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/rust.spec b/rust.spec
index d5ddc9b..6c02679 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,6 +1,6 @@
 Name:           rust
 Version:        1.75.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
 # ^ written as: (rust itself) and (bundled libraries)
@@ -85,9 +85,15 @@ ExclusiveArch:  %{rust_arches}
 %endif
 
 %if 0%{?__isa_bits} == 32
-# Disable PGO on 32-bit to reduce build memory
+# Reduce rustc's own debuginfo and optimizations to conserve 32-bit memory.
+# e.g. https://github.com/rust-lang/rust/issues/45854
+%global enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
+%global enable_rust_opts --set rust.codegen-units-std=1
 %bcond_with rustc_pgo
 %else
+# Build rustc with full debuginfo, CGU=1, ThinLTO, and PGO.
+%global enable_debuginfo --debuginfo-level=2
+%global enable_rust_opts --set rust.codegen-units=1 --set rust.lto=thin
 %bcond_without rustc_pgo
 %endif
 
@@ -660,14 +666,6 @@ end}
 %build
 %{export_rust_env}
 
-%ifarch %{arm} %{ix86}
-# full debuginfo is exhausting memory; just do libstd for now
-# https://github.com/rust-lang/rust/issues/45854
-%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
-%else
-%define enable_debuginfo --debuginfo-level=2
-%endif
-
 # Some builders have relatively little memory for their CPU count.
 # At least 2GB per CPU is a good rule of thumb for building rustc.
 ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN)
@@ -732,8 +730,7 @@ test -r "%{profiler}"
   --disable-llvm-static-stdcpp \
   --disable-rpath \
   %{enable_debuginfo} \
-  --set rust.codegen-units=1 \
-  --set rust.lto=thin \
+  %{enable_rust_opts} \
   --set build.build-stage=2 \
   --set build.doc-stage=2 \
   --set build.install-stage=2 \
@@ -1052,6 +1049,10 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %changelog
+* Tue Jan 30 2024 Josh Stone  - 1.75.0-3
+- Consolidate 32-bit build compromises.
+- Update rust-toolset and add rust-srpm-macros for ELN.
+
 * Fri Jan 26 2024 Fedora Release Engineering  - 1.75.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
 

From 89eacb88ce5a3dab18801af3055b466a310469e4 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 8 Feb 2024 09:36:10 -0800
Subject: [PATCH 08/86] Update to 1.76.0.

---
 .gitignore                                    |  2 +
 ...-only-show-PGO-warnings-when-verbose.patch | 33 --------------
 rust.spec                                     | 44 +++++++++++--------
 ...atch => rustc-1.76.0-disable-libssh2.patch | 28 ++++++------
 rustc-1.76.0-unbundle-sqlite.patch            | 21 +++++++++
 sources                                       |  4 +-
 6 files changed, 64 insertions(+), 68 deletions(-)
 delete mode 100644 0001-bootstrap-only-show-PGO-warnings-when-verbose.patch
 rename rustc-1.75.0-disable-libssh2.patch => rustc-1.76.0-disable-libssh2.patch (60%)
 create mode 100644 rustc-1.76.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index 8b53132..85da98e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -430,3 +430,5 @@
 /rustc-1.74.0-src.tar.xz
 /rustc-1.74.1-src.tar.xz
 /rustc-1.75.0-src.tar.xz
+/rustc-1.76.0-src.tar.xz
+/wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
diff --git a/0001-bootstrap-only-show-PGO-warnings-when-verbose.patch b/0001-bootstrap-only-show-PGO-warnings-when-verbose.patch
deleted file mode 100644
index ca36844..0000000
--- a/0001-bootstrap-only-show-PGO-warnings-when-verbose.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 776146e9ebb6bbe17a37bfad955f3dac95317275 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 16 Nov 2023 10:42:23 -0800
-Subject: [PATCH] bootstrap: only show PGO warnings when verbose
-
-Building rustc with `--rust-profile-use` is currently dumping a lot of
-warnings of "no profile data available for function" from `rustc_smir`
-and `stable_mir`. These simply aren't exercised by the current profile-
-gathering steps, but that's to be expected for new or experimental
-functionality. I think for most people, these warnings will be just
-noise, so it makes sense to only have them in verbose builds.
----
- src/bootstrap/src/core/build_steps/compile.rs | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index af69860df1c5..51e4195827fc 100644
---- a/src/bootstrap/src/core/build_steps/compile.rs
-+++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -887,7 +887,9 @@ fn run(self, builder: &Builder<'_>) {
-         } else if let Some(path) = &builder.config.rust_profile_use {
-             if compiler.stage == 1 {
-                 cargo.rustflag(&format!("-Cprofile-use={path}"));
--                cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
-+                if builder.is_verbose() {
-+                    cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
-+                }
-                 true
-             } else {
-                 false
--- 
-2.43.0
-
diff --git a/rust.spec b/rust.spec
index 6c02679..4c4600c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,6 +1,6 @@
 Name:           rust
-Version:        1.75.0
-Release:        3%{?dist}
+Version:        1.76.0
+Release:        1%{?dist}
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
 # ^ written as: (rust itself) and (bundled libraries)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.74.0
-%global bootstrap_channel 1.74.0
-%global bootstrap_date 2023-11-16
+%global bootstrap_version 1.75.0
+%global bootstrap_channel 1.75.0
+%global bootstrap_date 2023-12-28
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -44,10 +44,9 @@ ExclusiveArch:  %{rust_arches}
 
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
-# (updated per https://github.com/rust-lang/rust/pull/96907)
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-#global wasi_libc_ref wasi-sdk-20
-%global wasi_libc_ref bd950eb128bff337153de217b11270f948d04bb4
+#global wasi_libc_ref wasi-sdk-21
+%global wasi_libc_ref 03b228e46bb02fcc5927253e1b8ad715072b1ae4
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@@ -63,7 +62,7 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient.  Rust currently requires LLVM 15.0+.
 %global min_llvm_version 15.0.0
-%global bundled_llvm_version 17.0.5
+%global bundled_llvm_version 17.0.6
 %bcond_with bundled_llvm
 
 # Requires stable libgit2 1.7, and not the next minor soname change.
@@ -124,8 +123,8 @@ Patch3:         0001-Let-environment-variables-override-some-default-CPUs.patch
 Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
-# https://github.com/rust-lang/rust/pull/117982
-Patch6:         0001-bootstrap-only-show-PGO-warnings-when-verbose.patch
+# We don't want to use the bundled library in libsqlite3-sys
+Patch6:         rustc-1.76.0-unbundle-sqlite.patch
 
 ### RHEL-specific patches below ###
 
@@ -136,7 +135,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.75.0-disable-libssh2.patch
+Patch100:       rustc-1.76.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -206,6 +205,7 @@ BuildRequires:  curl-devel
 BuildRequires:  pkgconfig(libcurl)
 BuildRequires:  pkgconfig(liblzma)
 BuildRequires:  pkgconfig(openssl)
+BuildRequires:  pkgconfig(sqlite3)
 BuildRequires:  pkgconfig(zlib)
 
 %if %{without bundled_libgit2}
@@ -603,6 +603,7 @@ mkdir -p src/llvm-project/libunwind/
 %clear_dir vendor/*jemalloc-sys*/jemalloc/
 %clear_dir vendor/libffi-sys*/libffi/
 %clear_dir vendor/libmimalloc-sys*/c_src/mimalloc/
+%clear_dir vendor/libsqlite3-sys*/{sqlite3,sqlcipher}/
 %clear_dir vendor/libssh2-sys*/libssh2/
 %clear_dir vendor/libz-sys*/src/zlib{,-ng}/
 %clear_dir vendor/lzma-sys*/xz-*/
@@ -655,13 +656,15 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
   print(env)
 end}
 
-# Set up shared environment variables for build/install/check
-%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{rustc_target_cpus}
-%if %without disabled_libssh2
-# convince libssh2-sys to use the distro libssh2
-%global rust_env %{?rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1
-%endif
-%global export_rust_env %{?rust_env:export %{rust_env}}
+# Set up shared environment variables for build/install/check.
+# *_USE_PKG_CONFIG=1 convinces *-sys crates to use the system library.
+%global rust_env %{shrink:
+  %{?rustflags:RUSTFLAGS="%{rustflags}"}
+  %{rustc_target_cpus}
+  LIBSQLITE3_SYS_USE_PKG_CONFIG=1
+  %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1}
+}
+%global export_rust_env export %{rust_env}
 
 %build
 %{export_rust_env}
@@ -1049,6 +1052,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %changelog
+* Thu Feb 08 2024 Josh Stone  - 1.76.0-1
+- Update to 1.76.0.
+
 * Tue Jan 30 2024 Josh Stone  - 1.75.0-3
 - Consolidate 32-bit build compromises.
 - Update rust-toolset and add rust-srpm-macros for ELN.
diff --git a/rustc-1.75.0-disable-libssh2.patch b/rustc-1.76.0-disable-libssh2.patch
similarity index 60%
rename from rustc-1.75.0-disable-libssh2.patch
rename to rustc-1.76.0-disable-libssh2.patch
index 2b06046..2c6fba2 100644
--- a/rustc-1.75.0-disable-libssh2.patch
+++ b/rustc-1.76.0-disable-libssh2.patch
@@ -1,6 +1,6 @@
---- ./rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2023-11-12 12:24:35.000000000 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2023-11-14 17:01:32.010125953 -0800
-@@ -2027,7 +2027,6 @@
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-01-07 18:12:08.000000000 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-01-09 15:25:51.519781381 -0800
+@@ -2071,7 +2071,6 @@
  dependencies = [
   "cc",
   "libc",
@@ -8,10 +8,12 @@
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2060,20 +2059,6 @@
+@@ -2113,20 +2112,6 @@
+  "pkg-config",
+  "vcpkg",
  ]
- 
- [[package]]
+-
+-[[package]]
 -name = "libssh2-sys"
 -version = "0.3.0"
 -source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -24,19 +26,17 @@
 - "pkg-config",
 - "vcpkg",
 -]
--
--[[package]]
+ 
+ [[package]]
  name = "libz-sys"
- version = "1.1.9"
- source = "registry+https://github.com/rust-lang/crates.io-index"
---- ./rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2023-11-14 17:01:32.010125953 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2023-11-14 17:02:44.645097701 -0800
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-01-09 15:23:02.369032291 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-01-09 15:24:44.015679666 -0800
 @@ -40,7 +40,7 @@
- curl-sys = "0.4.68"
+ curl-sys = "0.4.70"
  filetime = "0.2.22"
  flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
 -git2 = "0.18.1"
 +git2 = { version = "0.18.1", default-features = false, features = ["https"] }
  git2-curl = "0.19.0"
- gix = { version = "0.55.2", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
+ gix = { version = "0.56.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
  gix-features-for-configuration-only = { version = "0.35.0", package = "gix-features", features = [ "parallel" ] }
diff --git a/rustc-1.76.0-unbundle-sqlite.patch b/rustc-1.76.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..6c1c667
--- /dev/null
+++ b/rustc-1.76.0-unbundle-sqlite.patch
@@ -0,0 +1,21 @@
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-01-07 18:12:08.000000000 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-01-09 15:36:23.808367445 -0800
+@@ -2109,7 +2109,6 @@
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-01-07 18:12:08.000000000 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-01-09 15:36:18.534437627 -0800
+@@ -73,7 +73,7 @@
+ pulldown-cmark = { version = "0.9.3", default-features = false }
+ rand = "0.8.5"
+ regex = "1.10.2"
+-rusqlite = { version = "0.30.0", features = ["bundled"] }
++rusqlite = { version = "0.30.0", features = [] }
+ rustfix = { version = "0.7.0", path = "crates/rustfix" }
+ same-file = "1.0.6"
+ security-framework = "2.9.2"
diff --git a/sources b/sources
index c4c9dac..e29d03b 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.75.0-src.tar.xz) = 7b0f25d91b1b5c317980fc88e059200bd43b56a70b445fbc72fb9b96e09775bfd3a98e9bd9d662af80f0ce3aef527c777ee82777e96ca876f47a972d63da8606
-SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066
+SHA512 (rustc-1.76.0-src.tar.xz) = 92e16cfdeb91bde341fe6c2774d92868275b07aa1d46d870ddc9291eadfe4ea9af93e06586fa7d6b8d60534903945cbbe706d354c90272712989c58d2bf174bf
+SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045

From 6b5e21282d88f288cd271233332b37cb2affabd0 Mon Sep 17 00:00:00 2001
From: David Abdurachmanov 
Date: Wed, 8 Nov 2023 14:19:52 +0200
Subject: [PATCH 09/86] Lower memory usage for riscv64

Signed-off-by: David Abdurachmanov 
Signed-off-by: Richard W.M. Jones 
---
 rust.spec | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/rust.spec b/rust.spec
index 4c4600c..bb3b19c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -83,9 +83,20 @@ ExclusiveArch:  %{rust_arches}
 %bcond_with disabled_libssh2
 %endif
 
-%if 0%{?__isa_bits} == 32
 # Reduce rustc's own debuginfo and optimizations to conserve 32-bit memory.
 # e.g. https://github.com/rust-lang/rust/issues/45854
+%global reduced_debuginfo 0
+%if 0%{?__isa_bits} == 32
+%global reduced_debuginfo 1
+%endif
+# Also on current riscv64 hardware, although future hardware will be
+# able to handle it.
+# e.g. http://fedora.riscv.rocks/koji/buildinfo?buildID=249870
+%ifarch riscv64
+%global reduced_debuginfo 1
+%endif
+
+%if 0%{?reduced_debuginfo}
 %global enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
 %global enable_rust_opts --set rust.codegen-units-std=1
 %bcond_with rustc_pgo

From 504e9e1d44f44932a24e3047652e054845ec8d18 Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Wed, 14 Feb 2024 12:31:06 +0100
Subject: [PATCH 10/86] Update to 1.77.0

---
 .gitignore                         |  1 +
 rust.spec                          | 20 ++++++++------
 rustc-1.76.0-disable-libssh2.patch | 42 ----------------------------
 rustc-1.76.0-unbundle-sqlite.patch | 21 --------------
 rustc-1.77.0-disable-libssh2.patch | 44 ++++++++++++++++++++++++++++++
 rustc-1.77.0-unbundle-sqlite.patch | 23 ++++++++++++++++
 sources                            |  2 +-
 7 files changed, 81 insertions(+), 72 deletions(-)
 delete mode 100644 rustc-1.76.0-disable-libssh2.patch
 delete mode 100644 rustc-1.76.0-unbundle-sqlite.patch
 create mode 100644 rustc-1.77.0-disable-libssh2.patch
 create mode 100644 rustc-1.77.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index 85da98e..8c04a16 100644
--- a/.gitignore
+++ b/.gitignore
@@ -432,3 +432,4 @@
 /rustc-1.75.0-src.tar.xz
 /rustc-1.76.0-src.tar.xz
 /wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
+/rustc-1.77.0-src.tar.xz
diff --git a/rust.spec b/rust.spec
index bb3b19c..3cddd3a 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.76.0
+Version:        1.77.0
 Release:        1%{?dist}
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.75.0
-%global bootstrap_channel 1.75.0
-%global bootstrap_date 2023-12-28
+%global bootstrap_version 1.76.0
+%global bootstrap_channel 1.76.0
+%global bootstrap_date 2024-02-08
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -67,9 +67,9 @@ ExclusiveArch:  %{rust_arches}
 
 # Requires stable libgit2 1.7, and not the next minor soname change.
 # This needs to be consistent with the bindings in vendor/libgit2-sys.
-%global min_libgit2_version 1.7.1
+%global min_libgit2_version 1.7.2
 %global next_libgit2_version 1.8.0~
-%global bundled_libgit2_version 1.7.1
+%global bundled_libgit2_version 1.7.2
 %if 0%{?fedora} >= 39
 %bcond_with bundled_libgit2
 %else
@@ -135,7 +135,7 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.76.0-unbundle-sqlite.patch
+Patch6:         rustc-1.77.0-unbundle-sqlite.patch
 
 ### RHEL-specific patches below ###
 
@@ -146,7 +146,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.76.0-disable-libssh2.patch
+Patch100:       rustc-1.77.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -749,6 +749,7 @@ test -r "%{profiler}"
   --set build.doc-stage=2 \
   --set build.install-stage=2 \
   --set build.test-stage=2 \
+  --set build.optimized-compiler-builtins=false \
   --enable-extended \
   --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \
   --enable-vendor \
@@ -1063,6 +1064,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %changelog
+* Thu Mar 21 2024 Nikita Popov  - 1.77.0-1
+- Update to 1.77.0
+
 * Thu Feb 08 2024 Josh Stone  - 1.76.0-1
 - Update to 1.76.0.
 
diff --git a/rustc-1.76.0-disable-libssh2.patch b/rustc-1.76.0-disable-libssh2.patch
deleted file mode 100644
index 2c6fba2..0000000
--- a/rustc-1.76.0-disable-libssh2.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-01-07 18:12:08.000000000 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-01-09 15:25:51.519781381 -0800
-@@ -2071,7 +2071,6 @@
- dependencies = [
-  "cc",
-  "libc",
-- "libssh2-sys",
-  "libz-sys",
-  "openssl-sys",
-  "pkg-config",
-@@ -2113,20 +2112,6 @@
-  "pkg-config",
-  "vcpkg",
- ]
--
--[[package]]
--name = "libssh2-sys"
--version = "0.3.0"
--source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
--dependencies = [
-- "cc",
-- "libc",
-- "libz-sys",
-- "openssl-sys",
-- "pkg-config",
-- "vcpkg",
--]
- 
- [[package]]
- name = "libz-sys"
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-01-09 15:23:02.369032291 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-01-09 15:24:44.015679666 -0800
-@@ -40,7 +40,7 @@
- curl-sys = "0.4.70"
- filetime = "0.2.22"
- flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
--git2 = "0.18.1"
-+git2 = { version = "0.18.1", default-features = false, features = ["https"] }
- git2-curl = "0.19.0"
- gix = { version = "0.56.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
- gix-features-for-configuration-only = { version = "0.35.0", package = "gix-features", features = [ "parallel" ] }
diff --git a/rustc-1.76.0-unbundle-sqlite.patch b/rustc-1.76.0-unbundle-sqlite.patch
deleted file mode 100644
index 6c1c667..0000000
--- a/rustc-1.76.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-01-07 18:12:08.000000000 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-01-09 15:36:23.808367445 -0800
-@@ -2109,7 +2109,6 @@
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-01-07 18:12:08.000000000 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-01-09 15:36:18.534437627 -0800
-@@ -73,7 +73,7 @@
- pulldown-cmark = { version = "0.9.3", default-features = false }
- rand = "0.8.5"
- regex = "1.10.2"
--rusqlite = { version = "0.30.0", features = ["bundled"] }
-+rusqlite = { version = "0.30.0", features = [] }
- rustfix = { version = "0.7.0", path = "crates/rustfix" }
- same-file = "1.0.6"
- security-framework = "2.9.2"
diff --git a/rustc-1.77.0-disable-libssh2.patch b/rustc-1.77.0-disable-libssh2.patch
new file mode 100644
index 0000000..859fecb
--- /dev/null
+++ b/rustc-1.77.0-disable-libssh2.patch
@@ -0,0 +1,44 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-02-14 14:06:05.881165093 +0100
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-02-14 14:06:27.169456166 +0100
+@@ -2072,7 +2072,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
+ dependencies = [
+  "cc",
+  "libc",
+- "libssh2-sys",
+  "libz-sys",
+  "openssl-sys",
+  "pkg-config",
+@@ -2113,20 +2112,6 @@ dependencies = [
+  "pkg-config",
+  "vcpkg",
+ ]
+-
+-[[package]]
+-name = "libssh2-sys"
+-version = "0.3.0"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
+-dependencies = [
+- "cc",
+- "libc",
+- "libz-sys",
+- "openssl-sys",
+- "pkg-config",
+- "vcpkg",
+-]
+ 
+ [[package]]
+ name = "libz-sys"
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-02-14 14:06:10.400226884 +0100
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-02-14 14:06:51.225785086 +0100
+@@ -44,7 +44,7 @@ curl = "0.4.44"
+ curl-sys = "0.4.70"
+ filetime = "0.2.23"
+ flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
+-git2 = "0.18.2"
++git2 = { version = "0.18.2", default-features = false, features = ["https"] }
+ git2-curl = "0.19.0"
+ gix = { version = "0.57.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
+ gix-features-for-configuration-only = { version = "0.37.1", package = "gix-features", features = [ "parallel" ] }
diff --git a/rustc-1.77.0-unbundle-sqlite.patch b/rustc-1.77.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..50aa4a8
--- /dev/null
+++ b/rustc-1.77.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-02-14 13:00:20.318976752 +0100
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-02-14 13:00:28.447051475 +0100
+@@ -2110,7 +2110,6 @@ version = "0.27.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-02-14 13:00:14.942927327 +0100
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-02-14 13:00:40.688164017 +0100
+@@ -77,7 +77,7 @@ proptest = "1.4.0"
+ pulldown-cmark = { version = "0.9.3", default-features = false }
+ rand = "0.8.5"
+ regex = "1.10.2"
+-rusqlite = { version = "0.30.0", features = ["bundled"] }
++rusqlite = { version = "0.30.0", features = [] }
+ rustfix = { version = "0.8.0", path = "crates/rustfix" }
+ same-file = "1.0.6"
+ security-framework = "2.9.2"
diff --git a/sources b/sources
index e29d03b..e9e2382 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.76.0-src.tar.xz) = 92e16cfdeb91bde341fe6c2774d92868275b07aa1d46d870ddc9291eadfe4ea9af93e06586fa7d6b8d60534903945cbbe706d354c90272712989c58d2bf174bf
+SHA512 (rustc-1.77.0-src.tar.xz) = 59f19d9def93b613ac72925625e6662622f445506489b8f1cd405d037c28becd53ae1446b46edfd63734f6f236af2dc326a57a184f01bc10d497c96227f09034
 SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045

From 15b7bb28e4ba39b27852fa053dd3a3f90003e9a4 Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Wed, 6 Mar 2024 17:56:41 +0100
Subject: [PATCH 11/86] Add LLVM 18 compat patches

---
 120529.patch | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 121088.patch | 55 ++++++++++++++++++++++++++++++++++++++++++++++
 rust.spec    |  7 ++++++
 3 files changed, 124 insertions(+)
 create mode 100644 120529.patch
 create mode 100644 121088.patch

diff --git a/120529.patch b/120529.patch
new file mode 100644
index 0000000..9e53295
--- /dev/null
+++ b/120529.patch
@@ -0,0 +1,62 @@
+From 8eb48b4f4c6e3d48f2600159a75184ec4d74b249 Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Wed, 31 Jan 2024 15:08:08 +0100
+Subject: [PATCH] Update data layouts in custom target tests for LLVM 18
+
+Fixes https://github.com/rust-lang/rust/issues/120492.
+---
+ tests/run-make/rust-lld-custom-target/custom-target.json        | 2 +-
+ tests/run-make/rustdoc-target-spec-json-path/target.json        | 2 +-
+ tests/run-make/target-specs/my-awesome-platform.json            | 2 +-
+ .../target-specs/my-x86_64-unknown-linux-gnu-platform.json      | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tests/run-make/rust-lld-custom-target/custom-target.json b/tests/run-make/rust-lld-custom-target/custom-target.json
+index 7828a99f235c1..e2c64cbdb43c2 100644
+--- a/tests/run-make/rust-lld-custom-target/custom-target.json
++++ b/tests/run-make/rust-lld-custom-target/custom-target.json
+@@ -2,7 +2,7 @@
+   "arch": "x86_64",
+   "cpu": "x86-64",
+   "crt-static-respected": true,
+-  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
++  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
+   "dynamic-linking": true,
+   "env": "gnu",
+   "has-rpath": true,
+diff --git a/tests/run-make/rustdoc-target-spec-json-path/target.json b/tests/run-make/rustdoc-target-spec-json-path/target.json
+index 34357182c205e..c478f1196fae0 100644
+--- a/tests/run-make/rustdoc-target-spec-json-path/target.json
++++ b/tests/run-make/rustdoc-target-spec-json-path/target.json
+@@ -2,7 +2,7 @@
+   "arch": "x86_64",
+   "cpu": "x86-64",
+   "crt-static-respected": true,
+-  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
++  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
+   "dynamic-linking": true,
+   "env": "gnu",
+   "executables": true,
+diff --git a/tests/run-make/target-specs/my-awesome-platform.json b/tests/run-make/target-specs/my-awesome-platform.json
+index 00de3de05f07a..1673ef7bd54d1 100644
+--- a/tests/run-make/target-specs/my-awesome-platform.json
++++ b/tests/run-make/target-specs/my-awesome-platform.json
+@@ -1,5 +1,5 @@
+ {
+-    "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128",
++    "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
+     "linker-flavor": "gcc",
+     "llvm-target": "i686-unknown-linux-gnu",
+     "target-endian": "little",
+diff --git a/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
+index 6d5e964ed4fee..0cafce15a9fef 100644
+--- a/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
++++ b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
+@@ -1,6 +1,6 @@
+ {
+     "pre-link-args": {"gcc": ["-m64"]},
+-    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
++    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
+     "linker-flavor": "gcc",
+     "llvm-target": "x86_64-unknown-linux-gnu",
+     "target-endian": "little",
diff --git a/121088.patch b/121088.patch
new file mode 100644
index 0000000..b70b52a
--- /dev/null
+++ b/121088.patch
@@ -0,0 +1,55 @@
+From 369fff6c0640fe89be9b915adaa83e66a022e00d Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Wed, 14 Feb 2024 16:26:20 +0100
+Subject: [PATCH] Implicitly enable evex512 if avx512 is enabled
+
+LLVM 18 requires the evex512 feature to allow use of zmm registers.
+LLVM automatically sets it when using a generic CPU, but not when
+`-C target-cpu` is specified. This will result either in backend
+legalization crashes, or code unexpectedly using ymm instead of
+zmm registers.
+
+For now, make sure that `avx512*` features imply `evex512`. Long
+term we'll probably have to deal with the AVX10 mess somehow.
+---
+ compiler/rustc_codegen_llvm/src/llvm_util.rs    |  4 ++++
+ tests/ui/asm/x86_64/evex512-implicit-feature.rs | 15 +++++++++++++++
+ 2 files changed, 19 insertions(+)
+ create mode 100644 tests/ui/asm/x86_64/evex512-implicit-feature.rs
+
+diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
+index e48479c8da279..54e8ed85e3250 100644
+--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
++++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
+@@ -266,6 +266,10 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> LLVMFeature<'a> {
+         ("riscv32" | "riscv64", "fast-unaligned-access") if get_version().0 <= 17 => {
+             LLVMFeature::new("unaligned-scalar-mem")
+         }
++        // For LLVM 18, enable the evex512 target feature if a avx512 target feature is enabled.
++        ("x86", s) if get_version().0 >= 18 && s.starts_with("avx512") => {
++            LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512"))
++        }
+         (_, s) => LLVMFeature::new(s),
+     }
+ }
+diff --git a/tests/ui/asm/x86_64/evex512-implicit-feature.rs b/tests/ui/asm/x86_64/evex512-implicit-feature.rs
+new file mode 100644
+index 0000000000000..a15060857eccb
+--- /dev/null
++++ b/tests/ui/asm/x86_64/evex512-implicit-feature.rs
+@@ -0,0 +1,15 @@
++// build-pass
++// only-x86_64
++// compile-flags: --crate-type=lib -C target-cpu=skylake
++
++#![feature(avx512_target_feature)]
++#![feature(stdarch_x86_avx512)]
++
++use std::arch::x86_64::*;
++
++#[target_feature(enable = "avx512f")]
++#[no_mangle]
++pub unsafe fn test(res: *mut f64, p: *const f64) {
++    let arg = _mm512_load_pd(p);
++    _mm512_store_pd(res, _mm512_fmaddsub_pd(arg, arg, arg));
++}
diff --git a/rust.spec b/rust.spec
index 3cddd3a..776d5ef 100644
--- a/rust.spec
+++ b/rust.spec
@@ -137,6 +137,10 @@ Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 # We don't want to use the bundled library in libsqlite3-sys
 Patch6:         rustc-1.77.0-unbundle-sqlite.patch
 
+# Backports of fixes for LLVM 18 compatibility
+Patch7:         120529.patch
+Patch8:         121088.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -591,6 +595,9 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %endif
 %patch -P6 -p1
 
+%patch -P7 -p1
+%patch -P8 -p1
+
 %if %with disabled_libssh2
 %patch -P100 -p1
 %endif

From e0c61d226212fc0fd43ae6b50489a953df8cd4c8 Mon Sep 17 00:00:00 2001
From: Davide Cavalca 
Date: Mon, 11 Dec 2023 20:22:45 -0800
Subject: [PATCH 12/86] Add build target for aarch64-unknown-none-softfloat

---
 0001-Use-lld-provided-by-system.patch | 12 ++++++++++++
 rust.spec                             | 18 +++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch
index bee8e16..8fcf4dc 100644
--- a/0001-Use-lld-provided-by-system.patch
+++ b/0001-Use-lld-provided-by-system.patch
@@ -48,6 +48,18 @@ index 5abfb8162f70..13cb43bda1a4 100644
  
      // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
      // enable these CPU features explicitly before their first use, otherwise their instructions
+diff -Naur a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
+--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs	2024-03-17 12:03:00.000000000 -0700
++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs	2024-03-22 10:02:17.742806274 -0700
+@@ -14,7 +14,7 @@
+     let opts = TargetOptions {
+         abi: "softfloat".into(),
+         linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
+-        linker: Some("rust-lld".into()),
++        linker: Some("lld".into()),
+         features: "+v8a,+strict-align,-neon,-fp-armv8".into(),
+         relocation_model: RelocModel::Static,
+         disable_redzone: true,
 -- 
 2.41.0
 
diff --git a/rust.spec b/rust.spec
index 776d5ef..f192c67 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,6 +1,6 @@
 Name:           rust
 Version:        1.77.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
 # ^ written as: (rust itself) and (bundled libraries)
@@ -37,6 +37,9 @@ ExclusiveArch:  %{rust_arches}
 %global extra_targets x86_64-unknown-none x86_64-unknown-uefi
 %endif
 %endif
+%ifarch aarch64
+%global extra_targets aarch64-unknown-none-softfloat
+%endif
 %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
 %define target_enabled() %{lua:
   print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0)
@@ -415,6 +418,12 @@ Requires:       lld
 %target_description x86_64-unknown-uefi embedded
 %endif
 
+%if %target_enabled aarch64-unknown-none-softfloat
+%target_package aarch64-unknown-none-softfloat
+Requires:       lld
+%target_description aarch64-unknown-none-softfloat embedded
+%endif
+
 
 %package debugger-common
 Summary:        Common debugger pretty printers for Rust
@@ -994,6 +1003,10 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %target_files x86_64-unknown-uefi
 %endif
 
+%if %target_enabled aarch64-unknown-none-softfloat
+%target_files aarch64-unknown-none-softfloat
+%endif
+
 
 %files debugger-common
 %dir %{rustlibdir}
@@ -1071,6 +1084,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %changelog
+* Thu Mar 21 2024 Davide Cavalca  - 1.77.0-2
+- Add build target for aarch64-unknown-none-softfloat
+
 * Thu Mar 21 2024 Nikita Popov  - 1.77.0-1
 - Update to 1.77.0
 

From 46e73524453eb6d11a741e92185274c6080a2fb1 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Fri, 5 Apr 2024 17:11:37 -0700
Subject: [PATCH 13/86] Ensure more consistency in PGO flags -- fixes Cargo
 tests

---
 ...-all-of-rustc-s-flags-to-rustc_cargo.patch | 200 ++++++++++++++++++
 rust.spec                                     |  57 ++---
 2 files changed, 232 insertions(+), 25 deletions(-)
 create mode 100644 0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch

diff --git a/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch b/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
new file mode 100644
index 0000000..baceb2f
--- /dev/null
+++ b/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
@@ -0,0 +1,200 @@
+From 56942ed6d13d330facddbd71470a3c115a3fe0d1 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Fri, 5 Apr 2024 15:07:58 -0700
+Subject: [PATCH] bootstrap: move all of rustc's flags to `rustc_cargo`
+
+This ensures that `RUSTFLAGS` will be consistent between all modes of
+building the compiler, so they won't trigger a rebuild by cargo. This
+kind of fix was started in #119414 just for LTO flags, but it's
+applicable to all kinds of flags that might be configured.
+
+(cherry picked from commit e8fb8c36ca0de817b3d30f603d6d6b3c56e8b0be)
+---
+ src/bootstrap/src/core/build_steps/check.rs   |   2 +-
+ src/bootstrap/src/core/build_steps/compile.rs | 107 +++++++++---------
+ src/bootstrap/src/core/build_steps/doc.rs     |   2 +-
+ src/bootstrap/src/core/build_steps/test.rs    |   2 +-
+ 4 files changed, 59 insertions(+), 54 deletions(-)
+
+diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
+index 5f0afdb1b36c..dd866c2eb0f3 100644
+--- a/src/bootstrap/src/core/build_steps/check.rs
++++ b/src/bootstrap/src/core/build_steps/check.rs
+@@ -263,7 +263,7 @@ fn run(self, builder: &Builder<'_>) {
+             target,
+             cargo_subcommand(builder.kind),
+         );
+-        rustc_cargo(builder, &mut cargo, target, compiler.stage);
++        rustc_cargo(builder, &mut cargo, target, &compiler);
+ 
+         // For ./x.py clippy, don't run with --all-targets because
+         // linting tests and benchmarks can produce very noisy results
+diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
+index ddbe18ab8388..607a658617b5 100644
+--- a/src/bootstrap/src/core/build_steps/compile.rs
++++ b/src/bootstrap/src/core/build_steps/compile.rs
+@@ -898,55 +898,10 @@ fn run(self, builder: &Builder<'_>) -> u32 {
+         ));
+ 
+         let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "build");
+-        rustc_cargo(builder, &mut cargo, target, compiler.stage);
++        rustc_cargo(builder, &mut cargo, target, &compiler);
+ 
+-        if builder.config.rust_profile_use.is_some()
+-            && builder.config.rust_profile_generate.is_some()
+-        {
+-            panic!("Cannot use and generate PGO profiles at the same time");
+-        }
+-
+-        // With LLD, we can use ICF (identical code folding) to reduce the executable size
+-        // of librustc_driver/rustc and to improve i-cache utilization.
+-        //
+-        // -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
+-        // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
+-        // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
+-        // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
+-        if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
+-            cargo.rustflag("-Clink-args=-Wl,--icf=all");
+-        }
+-
+-        let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
+-            if compiler.stage == 1 {
+-                cargo.rustflag(&format!("-Cprofile-generate={path}"));
+-                // Apparently necessary to avoid overflowing the counters during
+-                // a Cargo build profile
+-                cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
+-                true
+-            } else {
+-                false
+-            }
+-        } else if let Some(path) = &builder.config.rust_profile_use {
+-            if compiler.stage == 1 {
+-                cargo.rustflag(&format!("-Cprofile-use={path}"));
+-                if builder.is_verbose() {
+-                    cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
+-                }
+-                true
+-            } else {
+-                false
+-            }
+-        } else {
+-            false
+-        };
+-        if is_collecting {
+-            // Ensure paths to Rust sources are relative, not absolute.
+-            cargo.rustflag(&format!(
+-                "-Cllvm-args=-static-func-strip-dirname-prefix={}",
+-                builder.config.src.components().count()
+-            ));
+-        }
++        // NB: all RUSTFLAGS should be added to `rustc_cargo()` so they will be
++        // consistently applied by check/doc/test modes too.
+ 
+         for krate in &*self.crates {
+             cargo.arg("-p").arg(krate);
+@@ -997,7 +952,12 @@ fn run(self, builder: &Builder<'_>) -> u32 {
+     }
+ }
+ 
+-pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelection, stage: u32) {
++pub fn rustc_cargo(
++    builder: &Builder<'_>,
++    cargo: &mut Cargo,
++    target: TargetSelection,
++    compiler: &Compiler,
++) {
+     cargo
+         .arg("--features")
+         .arg(builder.rustc_features(builder.kind))
+@@ -1008,7 +968,7 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
+ 
+     // We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
+     // and may just be a time sink.
+-    if stage != 0 {
++    if compiler.stage != 0 {
+         match builder.config.rust_lto {
+             RustcLto::Thin | RustcLto::Fat => {
+                 // Since using LTO for optimizing dylibs is currently experimental,
+@@ -1034,7 +994,52 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
+         cargo.rustflag("-Clto=off");
+     }
+ 
+-    rustc_cargo_env(builder, cargo, target, stage);
++    // With LLD, we can use ICF (identical code folding) to reduce the executable size
++    // of librustc_driver/rustc and to improve i-cache utilization.
++    //
++    // -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
++    // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
++    // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
++    // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
++    if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
++        cargo.rustflag("-Clink-args=-Wl,--icf=all");
++    }
++
++    if builder.config.rust_profile_use.is_some() && builder.config.rust_profile_generate.is_some() {
++        panic!("Cannot use and generate PGO profiles at the same time");
++    }
++    let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
++        if compiler.stage == 1 {
++            cargo.rustflag(&format!("-Cprofile-generate={path}"));
++            // Apparently necessary to avoid overflowing the counters during
++            // a Cargo build profile
++            cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
++            true
++        } else {
++            false
++        }
++    } else if let Some(path) = &builder.config.rust_profile_use {
++        if compiler.stage == 1 {
++            cargo.rustflag(&format!("-Cprofile-use={path}"));
++            if builder.is_verbose() {
++                cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
++            }
++            true
++        } else {
++            false
++        }
++    } else {
++        false
++    };
++    if is_collecting {
++        // Ensure paths to Rust sources are relative, not absolute.
++        cargo.rustflag(&format!(
++            "-Cllvm-args=-static-func-strip-dirname-prefix={}",
++            builder.config.src.components().count()
++        ));
++    }
++
++    rustc_cargo_env(builder, cargo, target, compiler.stage);
+ }
+ 
+ pub fn rustc_cargo_env(
+diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
+index 57e63927c95e..e10035f07c05 100644
+--- a/src/bootstrap/src/core/build_steps/doc.rs
++++ b/src/bootstrap/src/core/build_steps/doc.rs
+@@ -794,7 +794,7 @@ fn run(self, builder: &Builder<'_>) {
+         cargo.rustdocflag("-Znormalize-docs");
+         cargo.rustdocflag("--show-type-layout");
+         cargo.rustdocflag("--generate-link-to-definition");
+-        compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
++        compile::rustc_cargo(builder, &mut cargo, target, &compiler);
+         cargo.arg("-Zunstable-options");
+         cargo.arg("-Zskip-rustdoc-fingerprint");
+ 
+diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
+index 04728e2e00dc..c4fdda0a2606 100644
+--- a/src/bootstrap/src/core/build_steps/test.rs
++++ b/src/bootstrap/src/core/build_steps/test.rs
+@@ -2558,7 +2558,7 @@ fn run(self, builder: &Builder<'_>) {
+                 }
+             }
+             Mode::Rustc => {
+-                compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
++                compile::rustc_cargo(builder, &mut cargo, target, &compiler);
+             }
+             _ => panic!("can only test libraries"),
+         };
+-- 
+2.44.0
+
diff --git a/rust.spec b/rust.spec
index f192c67..1e34d04 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,6 +1,6 @@
 Name:           rust
 Version:        1.77.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
 # ^ written as: (rust itself) and (bundled libraries)
@@ -144,6 +144,9 @@ Patch6:         rustc-1.77.0-unbundle-sqlite.patch
 Patch7:         120529.patch
 Patch8:         121088.patch
 
+# https://github.com/rust-lang/rust/pull/123520
+Patch9:         0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -603,9 +606,9 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P5 -p1
 %endif
 %patch -P6 -p1
-
 %patch -P7 -p1
 %patch -P8 -p1
+%patch -P9 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -775,31 +778,32 @@ test -r "%{profiler}"
   --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}"
 
 %global __x %{__python3} ./x.py
-%global __xk %{__x} --keep-stage=0 --keep-stage=1
 
 %if %with rustc_pgo
 # Build the compiler with profile instrumentation
-PROFRAW="$PWD/build/profiles"
-PROFDATA="$PWD/build/rustc.profdata"
-mkdir -p "$PROFRAW"
-%{__x} build -j "$ncpus" sysroot --rust-profile-generate="$PROFRAW"
+%define profraw $PWD/build/profiles
+%define profdata $PWD/build/rustc.profdata
+mkdir -p "%{profraw}"
+%{__x} build -j "$ncpus" sysroot --rust-profile-generate="%{profraw}"
 # Build cargo as a workload to generate compiler profiles
-env LLVM_PROFILE_FILE="$PROFRAW/default_%%m_%%p.profraw" %{__xk} build cargo
-llvm-profdata merge -o "$PROFDATA" "$PROFRAW"
-rm -r "$PROFRAW" build/%{rust_triple}/stage2*/
-# Rebuild the compiler using the profile data
-%{__x} build -j "$ncpus" sysroot --rust-profile-use="$PROFDATA"
-%else
-# Build the compiler without PGO
-%{__x} build -j "$ncpus" sysroot
+env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \
+  %{__x} --keep-stage=0 --keep-stage=1 build cargo
+# Finalize the profile data and clean up the raw files
+llvm-profdata merge -o "%{profdata}" "%{profraw}"
+rm -r "%{profraw}" build/%{rust_triple}/stage2*/
+# Redefine the macro to use that profile data from now on
+%global __x %{__x} --rust-profile-use="%{profdata}"
 %endif
 
+# Build the compiler normally (with or without PGO)
+%{__x} build -j "$ncpus" sysroot
+
 # Build everything else normally
-%{__xk} build
-%{__xk} doc
+%{__x} build
+%{__x} doc
 
 for triple in %{?all_targets} ; do
-  %{__xk} build --target=$triple std
+  %{__x} build --target=$triple std
 done
 
 %install
@@ -808,10 +812,10 @@ done
 %endif
 %{export_rust_env}
 
-DESTDIR=%{buildroot} %{__xk} install
+DESTDIR=%{buildroot} %{__x} install
 
 for triple in %{?all_targets} ; do
-  DESTDIR=%{buildroot} %{__xk} install --target=$triple std
+  DESTDIR=%{buildroot} %{__x} install --target=$triple std
 done
 
 # The rls stub doesn't have an install target, but we can just copy it.
@@ -924,17 +928,17 @@ rm -rf "$TMP_HELLO"
 
 # Bootstrap is excluded because it's not something we ship, and a lot of its
 # tests are geared toward the upstream CI environment.
-%{__xk} test --no-fail-fast --skip src/bootstrap || :
+%{__x} test --no-fail-fast --skip src/bootstrap || :
 rm -rf "./build/%{rust_triple}/test/"
 
-%{__xk} test --no-fail-fast cargo || :
+%{__x} test --no-fail-fast cargo || :
 rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
-%{__xk} test --no-fail-fast clippy || :
+%{__x} test --no-fail-fast clippy || :
 
-%{__xk} test --no-fail-fast rust-analyzer || :
+%{__x} test --no-fail-fast rust-analyzer || :
 
-%{__xk} test --no-fail-fast rustfmt || :
+%{__x} test --no-fail-fast rustfmt || :
 
 
 %ldconfig_scriptlets
@@ -1084,6 +1088,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %changelog
+* Fri Apr 05 2024 Josh Stone  - 1.77.0-3
+- Ensure more consistency in PGO flags -- fixes Cargo tests
+
 * Thu Mar 21 2024 Davide Cavalca  - 1.77.0-2
 - Add build target for aarch64-unknown-none-softfloat
 

From f6ac4da7c5e7d695986040a85dbc2e3b6faf65a5 Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Wed, 6 Mar 2024 17:39:20 +0100
Subject: [PATCH 14/86] Fix building against compat library

We also need to use the corresponding compiler-rt version and
use the llvm-profdata from the correct path.

The compat build is now enabled by defining llvm_compat_version.
---
 rust.spec | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/rust.spec b/rust.spec
index 1e34d04..5181ec1 100644
--- a/rust.spec
+++ b/rust.spec
@@ -66,6 +66,8 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient.  Rust currently requires LLVM 15.0+.
 %global min_llvm_version 15.0.0
 %global bundled_llvm_version 17.0.6
+#global llvm_compat_version 17
+%global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
 
 # Requires stable libgit2 1.7, and not the next minor soname change.
@@ -250,10 +252,9 @@ BuildRequires:  ninja-build
 Provides:       bundled(llvm) = %{bundled_llvm_version}
 %else
 BuildRequires:  cmake >= 3.5.1
-%if %defined llvm
+%if %defined llvm_compat_version
 %global llvm_root %{_libdir}/%{llvm}
 %else
-%global llvm llvm
 %global llvm_root %{_prefix}
 %endif
 BuildRequires:  %{llvm}-devel >= %{min_llvm_version}
@@ -335,7 +336,7 @@ find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)'
 %endif
 
 # For profiler_builtins
-BuildRequires:  compiler-rt
+BuildRequires:  compiler-rt%{?llvm_compat_version}
 
 # This component was removed as of Rust 1.69.0.
 # https://github.com/rust-lang/rust/pull/101841
@@ -735,12 +736,17 @@ fi
 %endif
 
 # Find the compiler-rt library for the Rust profiler_builtins crate.
+%if %defined llvm_compat_version
+# clang_resource_dir is not defined for compat builds.
+%define profiler /usr/lib/clang/%{llvm_compat_version}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
+%else
 %if 0%{?clang_major_version} >= 17
 %define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
 %else
 # The exact profiler path is version dependent..
 %define profiler %(echo %{_libdir}/clang/??/lib/libclang_rt.profile-*.a)
 %endif
+%endif
 test -r "%{profiler}"
 
 %configure --disable-option-checking \
@@ -789,7 +795,7 @@ mkdir -p "%{profraw}"
 env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \
   %{__x} --keep-stage=0 --keep-stage=1 build cargo
 # Finalize the profile data and clean up the raw files
-llvm-profdata merge -o "%{profdata}" "%{profraw}"
+%{llvm_root}/bin/llvm-profdata merge -o "%{profdata}" "%{profraw}"
 rm -r "%{profraw}" build/%{rust_triple}/stage2*/
 # Redefine the macro to use that profile data from now on
 %global __x %{__x} --rust-profile-use="%{profdata}"

From 4db2e772690849b82d92c9a4feace6f5a245727a Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 9 Apr 2024 10:10:47 -0700
Subject: [PATCH 15/86] Convert to %autorelease and %autochangelog

[skip changelog]
---
 changelog | 607 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 rust.spec | 610 +-----------------------------------------------------
 2 files changed, 609 insertions(+), 608 deletions(-)
 create mode 100644 changelog

diff --git a/changelog b/changelog
new file mode 100644
index 0000000..9048885
--- /dev/null
+++ b/changelog
@@ -0,0 +1,607 @@
+* Fri Apr 05 2024 Josh Stone  - 1.77.0-3
+- Ensure more consistency in PGO flags -- fixes Cargo tests
+
+* Thu Mar 21 2024 Davide Cavalca  - 1.77.0-2
+- Add build target for aarch64-unknown-none-softfloat
+
+* Thu Mar 21 2024 Nikita Popov  - 1.77.0-1
+- Update to 1.77.0
+
+* Thu Feb 08 2024 Josh Stone  - 1.76.0-1
+- Update to 1.76.0.
+
+* Tue Jan 30 2024 Josh Stone  - 1.75.0-3
+- Consolidate 32-bit build compromises.
+- Update rust-toolset and add rust-srpm-macros for ELN.
+
+* Fri Jan 26 2024 Fedora Release Engineering  - 1.75.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Sun Dec 31 2023 Josh Stone  - 1.75.0-1
+- Update to 1.75.0.
+
+* Thu Dec 07 2023 Josh Stone  - 1.74.1-1
+- Update to 1.74.1.
+
+* Thu Nov 16 2023 Josh Stone  - 1.74.0-1
+- Update to 1.74.0.
+
+* Thu Oct 26 2023 Josh Stone  - 1.73.0-2
+- Use thin-LTO and PGO for rustc itself.
+
+* Thu Oct 05 2023 Josh Stone  - 1.73.0-1
+- Update to 1.73.0.
+- Drop el7 conditionals from the spec.
+
+* Fri Sep 29 2023 Josh Stone  - 1.72.1-3
+- Fix the profiler runtime with compiler-rt-17
+- Switch to unbundled wasi-libc on Fedora
+- Use emmalloc instead of CC0 dlmalloc when bundling wasi-libc
+
+* Mon Sep 25 2023 Josh Stone  - 1.72.1-2
+- Fix LLVM dependency for ELN
+- Add build target for x86_64-unknown-none
+- Add build target for x86_64-unknown-uefi
+
+* Tue Sep 19 2023 Josh Stone  - 1.72.1-1
+- Update to 1.72.1.
+- Migrated to SPDX license
+
+* Thu Aug 24 2023 Josh Stone  - 1.72.0-1
+- Update to 1.72.0.
+
+* Mon Aug 07 2023 Josh Stone  - 1.71.1-1
+- Update to 1.71.1.
+- Security fix for CVE-2023-38497
+
+* Tue Jul 25 2023 Josh Stone  - 1.71.0-3
+- Relax the suspicious_double_ref_op lint
+- Enable the profiler runtime for native hosts
+
+* Fri Jul 21 2023 Fedora Release Engineering  - 1.71.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
+
+* Mon Jul 17 2023 Josh Stone  - 1.71.0-1
+- Update to 1.71.0.
+
+* Fri Jun 23 2023 Josh Stone  - 1.70.0-2
+- Override default target CPUs to match distro settings
+
+* Thu Jun 01 2023 Josh Stone  - 1.70.0-1
+- Update to 1.70.0.
+
+* Fri May 05 2023 Josh Stone  - 1.69.0-3
+- Fix debuginfo with LLVM 16
+
+* Mon May 01 2023 Josh Stone  - 1.69.0-2
+- Build with LLVM 15 on Fedora 38+
+
+* Thu Apr 20 2023 Josh Stone  - 1.69.0-1
+- Update to 1.69.0.
+- Obsolete rust-analysis.
+
+* Tue Mar 28 2023 Josh Stone  - 1.68.2-1
+- Update to 1.68.2.
+
+* Thu Mar 23 2023 Josh Stone  - 1.68.1-1
+- Update to 1.68.1.
+
+* Thu Mar 09 2023 Josh Stone  - 1.68.0-1
+- Update to 1.68.0.
+
+* Tue Mar 07 2023 David Michael  - 1.67.1-3
+- Add a virtual Provides to rust-std-static containing the target triple.
+
+* Mon Feb 20 2023 Orion Poplawski  - 1.67.1-2
+- Ship rust-toolset for EPEL7
+
+* Thu Feb 09 2023 Josh Stone  - 1.67.1-1
+- Update to 1.67.1.
+
+* Fri Feb 03 2023 Josh Stone  - 1.67.0-3
+- Unbundle libgit2 on Fedora 38.
+
+* Fri Jan 27 2023 Adam Williamson  - 1.67.0-2
+- Backport PR #107360 to fix build of mesa
+- Backport 675fa0b3 to fix bootstrapping failure
+
+* Thu Jan 26 2023 Josh Stone  - 1.67.0-1
+- Update to 1.67.0.
+
+* Fri Jan 20 2023 Fedora Release Engineering  - 1.66.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
+
+* Tue Jan 10 2023 Josh Stone  - 1.66.1-1
+- Update to 1.66.1.
+- Security fix for CVE-2022-46176
+
+* Thu Dec 15 2022 Josh Stone  - 1.66.0-1
+- Update to 1.66.0.
+
+* Thu Nov 03 2022 Josh Stone  - 1.65.0-1
+- Update to 1.65.0.
+- rust-analyzer now obsoletes rls.
+
+* Thu Sep 22 2022 Josh Stone  - 1.64.0-1
+- Update to 1.64.0.
+- Add rust-analyzer.
+
+* Thu Aug 11 2022 Josh Stone  - 1.63.0-1
+- Update to 1.63.0.
+
+* Sat Jul 23 2022 Fedora Release Engineering  - 1.62.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
+
+* Tue Jul 19 2022 Josh Stone  - 1.62.1-1
+- Update to 1.62.1.
+
+* Wed Jul 13 2022 Josh Stone  - 1.62.0-2
+- Prevent unsound coercions from functions with opaque return types.
+
+* Thu Jun 30 2022 Josh Stone  - 1.62.0-1
+- Update to 1.62.0.
+
+* Mon May 23 2022 Josh Stone  - 1.61.0-2
+- Add missing target_feature to the list of well known cfg names
+
+* Thu May 19 2022 Josh Stone  - 1.61.0-1
+- Update to 1.61.0.
+- Add rust-toolset for ELN.
+
+* Thu Apr 07 2022 Josh Stone  - 1.60.0-1
+- Update to 1.60.0.
+
+* Fri Mar 25 2022 Josh Stone  - 1.59.0-4
+- Fix the archive index for wasm32-wasi's libc.a
+
+* Fri Mar 04 2022 Stephen Gallagher  - 1.59.0-3
+- Rebuild against the bootstrapped build
+
+* Fri Mar 04 2022 Stephen Gallagher  - 1.59.0-2.1
+- Bootstrapping for Fedora ELN
+
+* Tue Mar 01 2022 Josh Stone  - 1.59.0-2
+- Fix s390x hangs, rhbz#2058803
+
+* Thu Feb 24 2022 Josh Stone  - 1.59.0-1
+- Update to 1.59.0.
+- Revert to libgit2 1.3.x
+
+* Sun Feb 20 2022 Igor Raits  - 1.58.1-2
+- Rebuild for libgit2 1.4.x
+
+* Thu Jan 20 2022 Josh Stone  - 1.58.1-1
+- Update to 1.58.1.
+
+* Thu Jan 13 2022 Josh Stone  - 1.58.0-1
+- Update to 1.58.0.
+
+* Wed Jan 05 2022 Josh Stone  - 1.57.0-2
+- Add rust-std-static-i686-pc-windows-gnu
+- Add rust-std-static-x86_64-pc-windows-gnu
+
+* Thu Dec 02 2021 Josh Stone  - 1.57.0-1
+- Update to 1.57.0, fixes rhbz#2028675.
+- Backport rust#91070, fixes rhbz#1990657
+- Add rust-std-static-wasm32-wasi
+
+* Sun Nov 28 2021 Igor Raits  - 1.56.1-3
+- De-bootstrap (libgit2)
+
+* Sun Nov 28 2021 Igor Raits  - 1.56.1-2
+- Rebuild for libgit2 1.3.x
+
+* Mon Nov 01 2021 Josh Stone  - 1.56.1-1
+- Update to 1.56.1.
+
+* Thu Oct 21 2021 Josh Stone  - 1.56.0-1
+- Update to 1.56.0.
+
+* Tue Sep 14 2021 Sahana Prasad  - 1.55.0-2
+- Rebuilt with OpenSSL 3.0.0
+
+* Thu Sep 09 2021 Josh Stone  - 1.55.0-1
+- Update to 1.55.0.
+- Use llvm-ranlib for wasm rlibs; Fixes rhbz#2002612
+
+* Tue Aug 24 2021 Josh Stone  - 1.54.0-2
+- Build with LLVM 12 on Fedora 35+
+
+* Thu Jul 29 2021 Josh Stone  - 1.54.0-1
+- Update to 1.54.0.
+
+* Fri Jul 23 2021 Fedora Release Engineering  - 1.53.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
+
+* Thu Jul 08 2021 Josh Stone  - 1.53.0-2
+- Exclude wasm on s390x for lack of lld
+
+* Thu Jun 17 2021 Josh Stone  - 1.53.0-1
+- Update to 1.53.0.
+
+* Wed Jun 02 2021 Josh Stone  - 1.52.1-2
+- Set rust.codegen-units-std=1 for all targets again.
+- Add rust-std-static-wasm32-unknown-unknown.
+- Rebuild f34 with LLVM 12.
+
+* Mon May 10 2021 Josh Stone  - 1.52.1-1
+- Update to 1.52.1.
+
+* Thu May 06 2021 Josh Stone  - 1.52.0-1
+- Update to 1.52.0.
+
+* Fri Apr 16 2021 Josh Stone  - 1.51.0-3
+- Security fixes for CVE-2020-36323, CVE-2021-31162
+
+* Wed Apr 14 2021 Josh Stone  - 1.51.0-2
+- Security fixes for CVE-2021-28876, CVE-2021-28878, CVE-2021-28879
+- Fix bootstrap for stage0 rust 1.51
+
+* Thu Mar 25 2021 Josh Stone  - 1.51.0-1
+- Update to 1.51.0.
+
+* Thu Feb 11 2021 Josh Stone  - 1.50.0-1
+- Update to 1.50.0.
+
+* Wed Jan 27 2021 Fedora Release Engineering  - 1.49.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
+
+* Tue Jan 05 2021 Josh Stone  - 1.49.0-1
+- Update to 1.49.0.
+
+* Tue Dec 29 2020 Igor Raits  - 1.48.0-3
+- De-bootstrap
+
+* Mon Dec 28 2020 Igor Raits  - 1.48.0-2
+- Rebuild for libgit2 1.1.x
+
+* Thu Nov 19 2020 Josh Stone  - 1.48.0-1
+- Update to 1.48.0.
+
+* Sat Oct 10 2020 Jeff Law  - 1.47.0-2
+- Re-enable LTO
+
+* Thu Oct 08 2020 Josh Stone  - 1.47.0-1
+- Update to 1.47.0.
+
+* Fri Aug 28 2020 Fabio Valentini  - 1.46.0-2
+- Fix LTO with doctests (backported cargo PR#8657).
+
+* Thu Aug 27 2020 Josh Stone  - 1.46.0-1
+- Update to 1.46.0.
+
+* Mon Aug 03 2020 Josh Stone  - 1.45.2-1
+- Update to 1.45.2.
+
+* Thu Jul 30 2020 Josh Stone  - 1.45.1-1
+- Update to 1.45.1.
+
+* Wed Jul 29 2020 Fedora Release Engineering  - 1.45.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
+
+* Thu Jul 16 2020 Josh Stone  - 1.45.0-1
+- Update to 1.45.0.
+
+* Wed Jul 01 2020 Jeff Law  - 1.44.1-2
+- Disable LTO
+
+* Thu Jun 18 2020 Josh Stone  - 1.44.1-1
+- Update to 1.44.1.
+
+* Thu Jun 04 2020 Josh Stone  - 1.44.0-1
+- Update to 1.44.0.
+
+* Thu May 07 2020 Josh Stone  - 1.43.1-1
+- Update to 1.43.1.
+
+* Thu Apr 23 2020 Josh Stone  - 1.43.0-1
+- Update to 1.43.0.
+
+* Thu Mar 12 2020 Josh Stone  - 1.42.0-1
+- Update to 1.42.0.
+
+* Thu Feb 27 2020 Josh Stone  - 1.41.1-1
+- Update to 1.41.1.
+
+* Thu Feb 20 2020 Josh Stone  - 1.41.0-2
+- Rebuild with llvm9.0
+
+* Thu Jan 30 2020 Josh Stone  - 1.41.0-1
+- Update to 1.41.0.
+
+* Thu Jan 16 2020 Josh Stone  - 1.40.0-3
+- Build compiletest with in-tree libtest
+
+* Tue Jan 07 2020 Josh Stone  - 1.40.0-2
+- Fix compiletest with newer (local-rebuild) libtest
+- Fix ARM EHABI unwinding
+
+* Thu Dec 19 2019 Josh Stone  - 1.40.0-1
+- Update to 1.40.0.
+
+* Tue Nov 12 2019 Josh Stone  - 1.39.0-2
+- Fix a couple build and test issues with rustdoc.
+
+* Thu Nov 07 2019 Josh Stone  - 1.39.0-1
+- Update to 1.39.0.
+
+* Fri Sep 27 2019 Josh Stone  - 1.38.0-2
+- Filter the libraries included in rust-std (rhbz1756487)
+
+* Thu Sep 26 2019 Josh Stone  - 1.38.0-1
+- Update to 1.38.0.
+
+* Thu Aug 15 2019 Josh Stone  - 1.37.0-1
+- Update to 1.37.0.
+
+* Fri Jul 26 2019 Fedora Release Engineering  - 1.36.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
+* Thu Jul 04 2019 Josh Stone  - 1.36.0-1
+- Update to 1.36.0.
+
+* Wed May 29 2019 Josh Stone  - 1.35.0-2
+- Fix compiletest for rebuild testing.
+
+* Thu May 23 2019 Josh Stone  - 1.35.0-1
+- Update to 1.35.0.
+
+* Tue May 14 2019 Josh Stone  - 1.34.2-1
+- Update to 1.34.2 -- fixes CVE-2019-12083.
+
+* Tue Apr 30 2019 Josh Stone  - 1.34.1-3
+- Set rust.codegen-units-std=1
+
+* Fri Apr 26 2019 Josh Stone  - 1.34.1-2
+- Remove the ThinLTO workaround.
+
+* Thu Apr 25 2019 Josh Stone  - 1.34.1-1
+- Update to 1.34.1.
+- Add a ThinLTO fix for rhbz1701339.
+
+* Thu Apr 11 2019 Josh Stone  - 1.34.0-1
+- Update to 1.34.0.
+
+* Fri Mar 01 2019 Josh Stone  - 1.33.0-2
+- Fix deprecations for self-rebuild
+
+* Thu Feb 28 2019 Josh Stone  - 1.33.0-1
+- Update to 1.33.0.
+
+* Sat Feb 02 2019 Fedora Release Engineering  - 1.32.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
+* Thu Jan 17 2019 Josh Stone  - 1.32.0-1
+- Update to 1.32.0.
+
+* Mon Jan 07 2019 Josh Stone  - 1.31.1-9
+- Update to 1.31.1 for RLS fixes.
+
+* Thu Dec 06 2018 Josh Stone  - 1.31.0-8
+- Update to 1.31.0 -- Rust 2018!
+- clippy/rls/rustfmt are no longer -preview
+
+* Thu Nov 08 2018 Josh Stone  - 1.30.1-7
+- Update to 1.30.1.
+
+* Thu Oct 25 2018 Josh Stone  - 1.30.0-6
+- Update to 1.30.0.
+
+* Mon Oct 22 2018 Josh Stone  - 1.29.2-5
+- Rebuild without bootstrap binaries.
+
+* Sat Oct 20 2018 Josh Stone  - 1.29.2-4
+- Re-bootstrap armv7hl due to rhbz#1639485
+
+* Fri Oct 12 2018 Josh Stone  - 1.29.2-3
+- Update to 1.29.2.
+
+* Tue Sep 25 2018 Josh Stone  - 1.29.1-2
+- Update to 1.29.1.
+- Security fix for str::repeat (pending CVE).
+
+* Thu Sep 13 2018 Josh Stone  - 1.29.0-1
+- Update to 1.29.0.
+- Add a clippy-preview subpackage
+
+* Mon Aug 13 2018 Josh Stone  - 1.28.0-3
+- Use llvm6.0 instead of llvm-7 for now
+
+* Tue Aug 07 2018 Josh Stone  - 1.28.0-2
+- Rebuild for LLVM ppc64/s390x fixes
+
+* Thu Aug 02 2018 Josh Stone  - 1.28.0-1
+- Update to 1.28.0.
+
+* Tue Jul 24 2018 Josh Stone  - 1.27.2-4
+- Update to 1.27.2.
+
+* Sat Jul 14 2018 Fedora Release Engineering  - 1.27.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Tue Jul 10 2018 Josh Stone  - 1.27.1-2
+- Update to 1.27.1.
+- Security fix for CVE-2018-1000622
+
+* Thu Jun 21 2018 Josh Stone  - 1.27.0-1
+- Update to 1.27.0.
+
+* Tue Jun 05 2018 Josh Stone  - 1.26.2-4
+- Rebuild without bootstrap binaries.
+
+* Tue Jun 05 2018 Josh Stone  - 1.26.2-3
+- Update to 1.26.2.
+- Re-bootstrap to deal with LLVM symbol changes.
+
+* Tue May 29 2018 Josh Stone  - 1.26.1-2
+- Update to 1.26.1.
+
+* Thu May 10 2018 Josh Stone  - 1.26.0-1
+- Update to 1.26.0.
+
+* Mon Apr 16 2018 Dan Callaghan  - 1.25.0-3
+- Add cargo, rls, and analysis
+
+* Tue Apr 10 2018 Josh Stone  - 1.25.0-2
+- Filter codegen-backends from Provides too.
+
+* Thu Mar 29 2018 Josh Stone  - 1.25.0-1
+- Update to 1.25.0.
+
+* Thu Mar 01 2018 Josh Stone  - 1.24.1-1
+- Update to 1.24.1.
+
+* Wed Feb 21 2018 Josh Stone  - 1.24.0-3
+- Backport a rebuild fix for rust#48308.
+
+* Mon Feb 19 2018 Josh Stone  - 1.24.0-2
+- rhbz1546541: drop full-bootstrap; cmp libs before symlinking.
+- Backport pr46592 to fix local_rebuild bootstrapping.
+- Backport pr48362 to fix relative/absolute libdir.
+
+* Thu Feb 15 2018 Josh Stone  - 1.24.0-1
+- Update to 1.24.0.
+
+* Mon Feb 12 2018 Iryna Shcherbina  - 1.23.0-4
+- Update Python 2 dependency declarations to new packaging standards
+  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
+
+* Tue Feb 06 2018 Josh Stone  - 1.23.0-3
+- Use full-bootstrap to work around a rebuild issue.
+- Patch binaryen for GCC 8
+
+* Thu Feb 01 2018 Igor Gnatenko  - 1.23.0-2
+- Switch to %%ldconfig_scriptlets
+
+* Mon Jan 08 2018 Josh Stone  - 1.23.0-1
+- Update to 1.23.0.
+
+* Thu Nov 23 2017 Josh Stone  - 1.22.1-1
+- Update to 1.22.1.
+
+* Thu Oct 12 2017 Josh Stone  - 1.21.0-1
+- Update to 1.21.0.
+
+* Mon Sep 11 2017 Josh Stone  - 1.20.0-2
+- ABI fixes for ppc64 and s390x.
+
+* Thu Aug 31 2017 Josh Stone  - 1.20.0-1
+- Update to 1.20.0.
+- Add a rust-src subpackage.
+
+* Thu Aug 03 2017 Fedora Release Engineering  - 1.19.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
+* Thu Jul 27 2017 Fedora Release Engineering  - 1.19.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Mon Jul 24 2017 Josh Stone  - 1.19.0-2
+- Use find-debuginfo.sh --keep-section .rustc
+
+* Thu Jul 20 2017 Josh Stone  - 1.19.0-1
+- Update to 1.19.0.
+
+* Thu Jun 08 2017 Josh Stone  - 1.18.0-1
+- Update to 1.18.0.
+
+* Mon May 08 2017 Josh Stone  - 1.17.0-2
+- Move shared libraries back to libdir and symlink in rustlib
+
+* Thu Apr 27 2017 Josh Stone  - 1.17.0-1
+- Update to 1.17.0.
+
+* Mon Mar 20 2017 Josh Stone  - 1.16.0-3
+- Make rust-lldb arch-specific to deal with lldb deps
+
+* Fri Mar 17 2017 Josh Stone  - 1.16.0-2
+- Limit rust-lldb arches
+
+* Thu Mar 16 2017 Josh Stone  - 1.16.0-1
+- Update to 1.16.0.
+- Use rustbuild instead of the old makefiles.
+- Update bootstrapping to include rust-std and cargo.
+- Add a rust-lldb subpackage.
+
+* Thu Feb 09 2017 Josh Stone  - 1.15.1-1
+- Update to 1.15.1.
+- Require rust-rpm-macros for new crate packaging.
+- Keep shared libraries under rustlib/, only debug-stripped.
+- Merge and clean up conditionals for epel7.
+
+* Fri Dec 23 2016 Josh Stone  - 1.14.0-2
+- Rebuild without bootstrap binaries.
+
+* Thu Dec 22 2016 Josh Stone  - 1.14.0-1
+- Update to 1.14.0.
+- Rewrite bootstrap logic to target specific arches.
+- Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!)
+
+* Thu Nov 10 2016 Josh Stone  - 1.13.0-1
+- Update to 1.13.0.
+- Use hardening flags for linking.
+- Split the standard library into its own package
+- Centralize rustlib/ under /usr/lib/ for multilib integration.
+
+* Thu Oct 20 2016 Josh Stone  - 1.12.1-1
+- Update to 1.12.1.
+
+* Fri Oct 14 2016 Josh Stone  - 1.12.0-7
+- Rebuild with LLVM 3.9.
+- Add ncurses-devel for llvm-config's -ltinfo.
+
+* Thu Oct 13 2016 Josh Stone  - 1.12.0-6
+- Rebuild with llvm-static, preparing for 3.9
+
+* Fri Oct 07 2016 Josh Stone  - 1.12.0-5
+- Rebuild with fixed eu-strip (rhbz1380961)
+
+* Fri Oct 07 2016 Josh Stone  - 1.12.0-4
+- Rebuild without bootstrap binaries.
+
+* Thu Oct 06 2016 Josh Stone  - 1.12.0-3
+- Bootstrap aarch64.
+- Use jemalloc's MALLOC_CONF to work around #36944.
+- Apply pr36933 to really disable armv7hl NEON.
+
+* Sat Oct 01 2016 Josh Stone  - 1.12.0-2
+- Protect .rustc from rpm stripping.
+
+* Fri Sep 30 2016 Josh Stone  - 1.12.0-1
+- Update to 1.12.0.
+- Always use --local-rust-root, even for bootstrap binaries.
+- Remove the rebuild conditional - the build system now figures it out.
+- Let minidebuginfo do its thing, since metadata is no longer a note.
+- Let rust build its own compiler-rt builtins again.
+
+* Sat Sep 03 2016 Josh Stone  - 1.11.0-3
+- Rebuild without bootstrap binaries.
+
+* Fri Sep 02 2016 Josh Stone  - 1.11.0-2
+- Bootstrap armv7hl, with backported no-neon patch.
+
+* Wed Aug 24 2016 Josh Stone  - 1.11.0-1
+- Update to 1.11.0.
+- Drop the backported patches.
+- Patch get-stage0.py to trust existing bootstrap binaries.
+- Use libclang_rt.builtins from compiler-rt, dodging llvm-static issues.
+- Use --local-rust-root to make sure the right bootstrap is used.
+
+* Sat Aug 13 2016 Josh Stone  1.10.0-4
+- Rebuild without bootstrap binaries.
+
+* Fri Aug 12 2016 Josh Stone  - 1.10.0-3
+- Initial import into Fedora (#1356907), bootstrapped
+- Format license text as suggested in review.
+- Note how the tests already run in parallel.
+- Undefine _include_minidebuginfo, because it duplicates ".note.rustc".
+- Don't let checks fail the whole build.
+- Note that -doc can't be noarch, as rpmdiff doesn't allow variations.
+
+* Tue Jul 26 2016 Josh Stone  - 1.10.0-2
+- Update -doc directory ownership, and mark its licenses.
+- Package and declare licenses for libbacktrace and hoedown.
+- Set bootstrap_base as a global.
+- Explicitly require python2.
+
+* Thu Jul 14 2016 Josh Stone  - 1.10.0-1
+- Initial package, bootstrapped
diff --git a/rust.spec b/rust.spec
index 5181ec1..d407705 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,6 +1,6 @@
 Name:           rust
 Version:        1.77.0
-Release:        3%{?dist}
+Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
 # ^ written as: (rust itself) and (bundled libraries)
@@ -1094,610 +1094,4 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %changelog
-* Fri Apr 05 2024 Josh Stone  - 1.77.0-3
-- Ensure more consistency in PGO flags -- fixes Cargo tests
-
-* Thu Mar 21 2024 Davide Cavalca  - 1.77.0-2
-- Add build target for aarch64-unknown-none-softfloat
-
-* Thu Mar 21 2024 Nikita Popov  - 1.77.0-1
-- Update to 1.77.0
-
-* Thu Feb 08 2024 Josh Stone  - 1.76.0-1
-- Update to 1.76.0.
-
-* Tue Jan 30 2024 Josh Stone  - 1.75.0-3
-- Consolidate 32-bit build compromises.
-- Update rust-toolset and add rust-srpm-macros for ELN.
-
-* Fri Jan 26 2024 Fedora Release Engineering  - 1.75.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
-
-* Sun Dec 31 2023 Josh Stone  - 1.75.0-1
-- Update to 1.75.0.
-
-* Thu Dec 07 2023 Josh Stone  - 1.74.1-1
-- Update to 1.74.1.
-
-* Thu Nov 16 2023 Josh Stone  - 1.74.0-1
-- Update to 1.74.0.
-
-* Thu Oct 26 2023 Josh Stone  - 1.73.0-2
-- Use thin-LTO and PGO for rustc itself.
-
-* Thu Oct 05 2023 Josh Stone  - 1.73.0-1
-- Update to 1.73.0.
-- Drop el7 conditionals from the spec.
-
-* Fri Sep 29 2023 Josh Stone  - 1.72.1-3
-- Fix the profiler runtime with compiler-rt-17
-- Switch to unbundled wasi-libc on Fedora
-- Use emmalloc instead of CC0 dlmalloc when bundling wasi-libc
-
-* Mon Sep 25 2023 Josh Stone  - 1.72.1-2
-- Fix LLVM dependency for ELN
-- Add build target for x86_64-unknown-none
-- Add build target for x86_64-unknown-uefi
-
-* Tue Sep 19 2023 Josh Stone  - 1.72.1-1
-- Update to 1.72.1.
-- Migrated to SPDX license
-
-* Thu Aug 24 2023 Josh Stone  - 1.72.0-1
-- Update to 1.72.0.
-
-* Mon Aug 07 2023 Josh Stone  - 1.71.1-1
-- Update to 1.71.1.
-- Security fix for CVE-2023-38497
-
-* Tue Jul 25 2023 Josh Stone  - 1.71.0-3
-- Relax the suspicious_double_ref_op lint
-- Enable the profiler runtime for native hosts
-
-* Fri Jul 21 2023 Fedora Release Engineering  - 1.71.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
-
-* Mon Jul 17 2023 Josh Stone  - 1.71.0-1
-- Update to 1.71.0.
-
-* Fri Jun 23 2023 Josh Stone  - 1.70.0-2
-- Override default target CPUs to match distro settings
-
-* Thu Jun 01 2023 Josh Stone  - 1.70.0-1
-- Update to 1.70.0.
-
-* Fri May 05 2023 Josh Stone  - 1.69.0-3
-- Fix debuginfo with LLVM 16
-
-* Mon May 01 2023 Josh Stone  - 1.69.0-2
-- Build with LLVM 15 on Fedora 38+
-
-* Thu Apr 20 2023 Josh Stone  - 1.69.0-1
-- Update to 1.69.0.
-- Obsolete rust-analysis.
-
-* Tue Mar 28 2023 Josh Stone  - 1.68.2-1
-- Update to 1.68.2.
-
-* Thu Mar 23 2023 Josh Stone  - 1.68.1-1
-- Update to 1.68.1.
-
-* Thu Mar 09 2023 Josh Stone  - 1.68.0-1
-- Update to 1.68.0.
-
-* Tue Mar 07 2023 David Michael  - 1.67.1-3
-- Add a virtual Provides to rust-std-static containing the target triple.
-
-* Mon Feb 20 2023 Orion Poplawski  - 1.67.1-2
-- Ship rust-toolset for EPEL7
-
-* Thu Feb 09 2023 Josh Stone  - 1.67.1-1
-- Update to 1.67.1.
-
-* Fri Feb 03 2023 Josh Stone  - 1.67.0-3
-- Unbundle libgit2 on Fedora 38.
-
-* Fri Jan 27 2023 Adam Williamson  - 1.67.0-2
-- Backport PR #107360 to fix build of mesa
-- Backport 675fa0b3 to fix bootstrapping failure
-
-* Thu Jan 26 2023 Josh Stone  - 1.67.0-1
-- Update to 1.67.0.
-
-* Fri Jan 20 2023 Fedora Release Engineering  - 1.66.1-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
-
-* Tue Jan 10 2023 Josh Stone  - 1.66.1-1
-- Update to 1.66.1.
-- Security fix for CVE-2022-46176
-
-* Thu Dec 15 2022 Josh Stone  - 1.66.0-1
-- Update to 1.66.0.
-
-* Thu Nov 03 2022 Josh Stone  - 1.65.0-1
-- Update to 1.65.0.
-- rust-analyzer now obsoletes rls.
-
-* Thu Sep 22 2022 Josh Stone  - 1.64.0-1
-- Update to 1.64.0.
-- Add rust-analyzer.
-
-* Thu Aug 11 2022 Josh Stone  - 1.63.0-1
-- Update to 1.63.0.
-
-* Sat Jul 23 2022 Fedora Release Engineering  - 1.62.1-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
-
-* Tue Jul 19 2022 Josh Stone  - 1.62.1-1
-- Update to 1.62.1.
-
-* Wed Jul 13 2022 Josh Stone  - 1.62.0-2
-- Prevent unsound coercions from functions with opaque return types.
-
-* Thu Jun 30 2022 Josh Stone  - 1.62.0-1
-- Update to 1.62.0.
-
-* Mon May 23 2022 Josh Stone  - 1.61.0-2
-- Add missing target_feature to the list of well known cfg names
-
-* Thu May 19 2022 Josh Stone  - 1.61.0-1
-- Update to 1.61.0.
-- Add rust-toolset for ELN.
-
-* Thu Apr 07 2022 Josh Stone  - 1.60.0-1
-- Update to 1.60.0.
-
-* Fri Mar 25 2022 Josh Stone  - 1.59.0-4
-- Fix the archive index for wasm32-wasi's libc.a
-
-* Fri Mar 04 2022 Stephen Gallagher  - 1.59.0-3
-- Rebuild against the bootstrapped build
-
-* Fri Mar 04 2022 Stephen Gallagher  - 1.59.0-2.1
-- Bootstrapping for Fedora ELN
-
-* Tue Mar 01 2022 Josh Stone  - 1.59.0-2
-- Fix s390x hangs, rhbz#2058803
-
-* Thu Feb 24 2022 Josh Stone  - 1.59.0-1
-- Update to 1.59.0.
-- Revert to libgit2 1.3.x
-
-* Sun Feb 20 2022 Igor Raits  - 1.58.1-2
-- Rebuild for libgit2 1.4.x
-
-* Thu Jan 20 2022 Josh Stone  - 1.58.1-1
-- Update to 1.58.1.
-
-* Thu Jan 13 2022 Josh Stone  - 1.58.0-1
-- Update to 1.58.0.
-
-* Wed Jan 05 2022 Josh Stone  - 1.57.0-2
-- Add rust-std-static-i686-pc-windows-gnu
-- Add rust-std-static-x86_64-pc-windows-gnu
-
-* Thu Dec 02 2021 Josh Stone  - 1.57.0-1
-- Update to 1.57.0, fixes rhbz#2028675.
-- Backport rust#91070, fixes rhbz#1990657
-- Add rust-std-static-wasm32-wasi
-
-* Sun Nov 28 2021 Igor Raits  - 1.56.1-3
-- De-bootstrap (libgit2)
-
-* Sun Nov 28 2021 Igor Raits  - 1.56.1-2
-- Rebuild for libgit2 1.3.x
-
-* Mon Nov 01 2021 Josh Stone  - 1.56.1-1
-- Update to 1.56.1.
-
-* Thu Oct 21 2021 Josh Stone  - 1.56.0-1
-- Update to 1.56.0.
-
-* Tue Sep 14 2021 Sahana Prasad  - 1.55.0-2
-- Rebuilt with OpenSSL 3.0.0
-
-* Thu Sep 09 2021 Josh Stone  - 1.55.0-1
-- Update to 1.55.0.
-- Use llvm-ranlib for wasm rlibs; Fixes rhbz#2002612
-
-* Tue Aug 24 2021 Josh Stone  - 1.54.0-2
-- Build with LLVM 12 on Fedora 35+
-
-* Thu Jul 29 2021 Josh Stone  - 1.54.0-1
-- Update to 1.54.0.
-
-* Fri Jul 23 2021 Fedora Release Engineering  - 1.53.0-3
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
-
-* Thu Jul 08 2021 Josh Stone  - 1.53.0-2
-- Exclude wasm on s390x for lack of lld
-
-* Thu Jun 17 2021 Josh Stone  - 1.53.0-1
-- Update to 1.53.0.
-
-* Wed Jun 02 2021 Josh Stone  - 1.52.1-2
-- Set rust.codegen-units-std=1 for all targets again.
-- Add rust-std-static-wasm32-unknown-unknown.
-- Rebuild f34 with LLVM 12.
-
-* Mon May 10 2021 Josh Stone  - 1.52.1-1
-- Update to 1.52.1.
-
-* Thu May 06 2021 Josh Stone  - 1.52.0-1
-- Update to 1.52.0.
-
-* Fri Apr 16 2021 Josh Stone  - 1.51.0-3
-- Security fixes for CVE-2020-36323, CVE-2021-31162
-
-* Wed Apr 14 2021 Josh Stone  - 1.51.0-2
-- Security fixes for CVE-2021-28876, CVE-2021-28878, CVE-2021-28879
-- Fix bootstrap for stage0 rust 1.51
-
-* Thu Mar 25 2021 Josh Stone  - 1.51.0-1
-- Update to 1.51.0.
-
-* Thu Feb 11 2021 Josh Stone  - 1.50.0-1
-- Update to 1.50.0.
-
-* Wed Jan 27 2021 Fedora Release Engineering  - 1.49.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
-
-* Tue Jan 05 2021 Josh Stone  - 1.49.0-1
-- Update to 1.49.0.
-
-* Tue Dec 29 2020 Igor Raits  - 1.48.0-3
-- De-bootstrap
-
-* Mon Dec 28 2020 Igor Raits  - 1.48.0-2
-- Rebuild for libgit2 1.1.x
-
-* Thu Nov 19 2020 Josh Stone  - 1.48.0-1
-- Update to 1.48.0.
-
-* Sat Oct 10 2020 Jeff Law  - 1.47.0-2
-- Re-enable LTO
-
-* Thu Oct 08 2020 Josh Stone  - 1.47.0-1
-- Update to 1.47.0.
-
-* Fri Aug 28 2020 Fabio Valentini  - 1.46.0-2
-- Fix LTO with doctests (backported cargo PR#8657).
-
-* Thu Aug 27 2020 Josh Stone  - 1.46.0-1
-- Update to 1.46.0.
-
-* Mon Aug 03 2020 Josh Stone  - 1.45.2-1
-- Update to 1.45.2.
-
-* Thu Jul 30 2020 Josh Stone  - 1.45.1-1
-- Update to 1.45.1.
-
-* Wed Jul 29 2020 Fedora Release Engineering  - 1.45.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
-
-* Thu Jul 16 2020 Josh Stone  - 1.45.0-1
-- Update to 1.45.0.
-
-* Wed Jul 01 2020 Jeff Law  - 1.44.1-2
-- Disable LTO
-
-* Thu Jun 18 2020 Josh Stone  - 1.44.1-1
-- Update to 1.44.1.
-
-* Thu Jun 04 2020 Josh Stone  - 1.44.0-1
-- Update to 1.44.0.
-
-* Thu May 07 2020 Josh Stone  - 1.43.1-1
-- Update to 1.43.1.
-
-* Thu Apr 23 2020 Josh Stone  - 1.43.0-1
-- Update to 1.43.0.
-
-* Thu Mar 12 2020 Josh Stone  - 1.42.0-1
-- Update to 1.42.0.
-
-* Thu Feb 27 2020 Josh Stone  - 1.41.1-1
-- Update to 1.41.1.
-
-* Thu Feb 20 2020 Josh Stone  - 1.41.0-2
-- Rebuild with llvm9.0
-
-* Thu Jan 30 2020 Josh Stone  - 1.41.0-1
-- Update to 1.41.0.
-
-* Thu Jan 16 2020 Josh Stone  - 1.40.0-3
-- Build compiletest with in-tree libtest
-
-* Tue Jan 07 2020 Josh Stone  - 1.40.0-2
-- Fix compiletest with newer (local-rebuild) libtest
-- Fix ARM EHABI unwinding
-
-* Thu Dec 19 2019 Josh Stone  - 1.40.0-1
-- Update to 1.40.0.
-
-* Tue Nov 12 2019 Josh Stone  - 1.39.0-2
-- Fix a couple build and test issues with rustdoc.
-
-* Thu Nov 07 2019 Josh Stone  - 1.39.0-1
-- Update to 1.39.0.
-
-* Fri Sep 27 2019 Josh Stone  - 1.38.0-2
-- Filter the libraries included in rust-std (rhbz1756487)
-
-* Thu Sep 26 2019 Josh Stone  - 1.38.0-1
-- Update to 1.38.0.
-
-* Thu Aug 15 2019 Josh Stone  - 1.37.0-1
-- Update to 1.37.0.
-
-* Fri Jul 26 2019 Fedora Release Engineering  - 1.36.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
-
-* Thu Jul 04 2019 Josh Stone  - 1.36.0-1
-- Update to 1.36.0.
-
-* Wed May 29 2019 Josh Stone  - 1.35.0-2
-- Fix compiletest for rebuild testing.
-
-* Thu May 23 2019 Josh Stone  - 1.35.0-1
-- Update to 1.35.0.
-
-* Tue May 14 2019 Josh Stone  - 1.34.2-1
-- Update to 1.34.2 -- fixes CVE-2019-12083.
-
-* Tue Apr 30 2019 Josh Stone  - 1.34.1-3
-- Set rust.codegen-units-std=1
-
-* Fri Apr 26 2019 Josh Stone  - 1.34.1-2
-- Remove the ThinLTO workaround.
-
-* Thu Apr 25 2019 Josh Stone  - 1.34.1-1
-- Update to 1.34.1.
-- Add a ThinLTO fix for rhbz1701339.
-
-* Thu Apr 11 2019 Josh Stone  - 1.34.0-1
-- Update to 1.34.0.
-
-* Fri Mar 01 2019 Josh Stone  - 1.33.0-2
-- Fix deprecations for self-rebuild
-
-* Thu Feb 28 2019 Josh Stone  - 1.33.0-1
-- Update to 1.33.0.
-
-* Sat Feb 02 2019 Fedora Release Engineering  - 1.32.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
-
-* Thu Jan 17 2019 Josh Stone  - 1.32.0-1
-- Update to 1.32.0.
-
-* Mon Jan 07 2019 Josh Stone  - 1.31.1-9
-- Update to 1.31.1 for RLS fixes.
-
-* Thu Dec 06 2018 Josh Stone  - 1.31.0-8
-- Update to 1.31.0 -- Rust 2018!
-- clippy/rls/rustfmt are no longer -preview
-
-* Thu Nov 08 2018 Josh Stone  - 1.30.1-7
-- Update to 1.30.1.
-
-* Thu Oct 25 2018 Josh Stone  - 1.30.0-6
-- Update to 1.30.0.
-
-* Mon Oct 22 2018 Josh Stone  - 1.29.2-5
-- Rebuild without bootstrap binaries.
-
-* Sat Oct 20 2018 Josh Stone  - 1.29.2-4
-- Re-bootstrap armv7hl due to rhbz#1639485
-
-* Fri Oct 12 2018 Josh Stone  - 1.29.2-3
-- Update to 1.29.2.
-
-* Tue Sep 25 2018 Josh Stone  - 1.29.1-2
-- Update to 1.29.1.
-- Security fix for str::repeat (pending CVE).
-
-* Thu Sep 13 2018 Josh Stone  - 1.29.0-1
-- Update to 1.29.0.
-- Add a clippy-preview subpackage
-
-* Mon Aug 13 2018 Josh Stone  - 1.28.0-3
-- Use llvm6.0 instead of llvm-7 for now
-
-* Tue Aug 07 2018 Josh Stone  - 1.28.0-2
-- Rebuild for LLVM ppc64/s390x fixes
-
-* Thu Aug 02 2018 Josh Stone  - 1.28.0-1
-- Update to 1.28.0.
-
-* Tue Jul 24 2018 Josh Stone  - 1.27.2-4
-- Update to 1.27.2.
-
-* Sat Jul 14 2018 Fedora Release Engineering  - 1.27.1-3
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
-
-* Tue Jul 10 2018 Josh Stone  - 1.27.1-2
-- Update to 1.27.1.
-- Security fix for CVE-2018-1000622
-
-* Thu Jun 21 2018 Josh Stone  - 1.27.0-1
-- Update to 1.27.0.
-
-* Tue Jun 05 2018 Josh Stone  - 1.26.2-4
-- Rebuild without bootstrap binaries.
-
-* Tue Jun 05 2018 Josh Stone  - 1.26.2-3
-- Update to 1.26.2.
-- Re-bootstrap to deal with LLVM symbol changes.
-
-* Tue May 29 2018 Josh Stone  - 1.26.1-2
-- Update to 1.26.1.
-
-* Thu May 10 2018 Josh Stone  - 1.26.0-1
-- Update to 1.26.0.
-
-* Mon Apr 16 2018 Dan Callaghan  - 1.25.0-3
-- Add cargo, rls, and analysis
-
-* Tue Apr 10 2018 Josh Stone  - 1.25.0-2
-- Filter codegen-backends from Provides too.
-
-* Thu Mar 29 2018 Josh Stone  - 1.25.0-1
-- Update to 1.25.0.
-
-* Thu Mar 01 2018 Josh Stone  - 1.24.1-1
-- Update to 1.24.1.
-
-* Wed Feb 21 2018 Josh Stone  - 1.24.0-3
-- Backport a rebuild fix for rust#48308.
-
-* Mon Feb 19 2018 Josh Stone  - 1.24.0-2
-- rhbz1546541: drop full-bootstrap; cmp libs before symlinking.
-- Backport pr46592 to fix local_rebuild bootstrapping.
-- Backport pr48362 to fix relative/absolute libdir.
-
-* Thu Feb 15 2018 Josh Stone  - 1.24.0-1
-- Update to 1.24.0.
-
-* Mon Feb 12 2018 Iryna Shcherbina  - 1.23.0-4
-- Update Python 2 dependency declarations to new packaging standards
-  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
-
-* Tue Feb 06 2018 Josh Stone  - 1.23.0-3
-- Use full-bootstrap to work around a rebuild issue.
-- Patch binaryen for GCC 8
-
-* Thu Feb 01 2018 Igor Gnatenko  - 1.23.0-2
-- Switch to %%ldconfig_scriptlets
-
-* Mon Jan 08 2018 Josh Stone  - 1.23.0-1
-- Update to 1.23.0.
-
-* Thu Nov 23 2017 Josh Stone  - 1.22.1-1
-- Update to 1.22.1.
-
-* Thu Oct 12 2017 Josh Stone  - 1.21.0-1
-- Update to 1.21.0.
-
-* Mon Sep 11 2017 Josh Stone  - 1.20.0-2
-- ABI fixes for ppc64 and s390x.
-
-* Thu Aug 31 2017 Josh Stone  - 1.20.0-1
-- Update to 1.20.0.
-- Add a rust-src subpackage.
-
-* Thu Aug 03 2017 Fedora Release Engineering  - 1.19.0-4
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
-
-* Thu Jul 27 2017 Fedora Release Engineering  - 1.19.0-3
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
-
-* Mon Jul 24 2017 Josh Stone  - 1.19.0-2
-- Use find-debuginfo.sh --keep-section .rustc
-
-* Thu Jul 20 2017 Josh Stone  - 1.19.0-1
-- Update to 1.19.0.
-
-* Thu Jun 08 2017 Josh Stone  - 1.18.0-1
-- Update to 1.18.0.
-
-* Mon May 08 2017 Josh Stone  - 1.17.0-2
-- Move shared libraries back to libdir and symlink in rustlib
-
-* Thu Apr 27 2017 Josh Stone  - 1.17.0-1
-- Update to 1.17.0.
-
-* Mon Mar 20 2017 Josh Stone  - 1.16.0-3
-- Make rust-lldb arch-specific to deal with lldb deps
-
-* Fri Mar 17 2017 Josh Stone  - 1.16.0-2
-- Limit rust-lldb arches
-
-* Thu Mar 16 2017 Josh Stone  - 1.16.0-1
-- Update to 1.16.0.
-- Use rustbuild instead of the old makefiles.
-- Update bootstrapping to include rust-std and cargo.
-- Add a rust-lldb subpackage.
-
-* Thu Feb 09 2017 Josh Stone  - 1.15.1-1
-- Update to 1.15.1.
-- Require rust-rpm-macros for new crate packaging.
-- Keep shared libraries under rustlib/, only debug-stripped.
-- Merge and clean up conditionals for epel7.
-
-* Fri Dec 23 2016 Josh Stone  - 1.14.0-2
-- Rebuild without bootstrap binaries.
-
-* Thu Dec 22 2016 Josh Stone  - 1.14.0-1
-- Update to 1.14.0.
-- Rewrite bootstrap logic to target specific arches.
-- Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!)
-
-* Thu Nov 10 2016 Josh Stone  - 1.13.0-1
-- Update to 1.13.0.
-- Use hardening flags for linking.
-- Split the standard library into its own package
-- Centralize rustlib/ under /usr/lib/ for multilib integration.
-
-* Thu Oct 20 2016 Josh Stone  - 1.12.1-1
-- Update to 1.12.1.
-
-* Fri Oct 14 2016 Josh Stone  - 1.12.0-7
-- Rebuild with LLVM 3.9.
-- Add ncurses-devel for llvm-config's -ltinfo.
-
-* Thu Oct 13 2016 Josh Stone  - 1.12.0-6
-- Rebuild with llvm-static, preparing for 3.9
-
-* Fri Oct 07 2016 Josh Stone  - 1.12.0-5
-- Rebuild with fixed eu-strip (rhbz1380961)
-
-* Fri Oct 07 2016 Josh Stone  - 1.12.0-4
-- Rebuild without bootstrap binaries.
-
-* Thu Oct 06 2016 Josh Stone  - 1.12.0-3
-- Bootstrap aarch64.
-- Use jemalloc's MALLOC_CONF to work around #36944.
-- Apply pr36933 to really disable armv7hl NEON.
-
-* Sat Oct 01 2016 Josh Stone  - 1.12.0-2
-- Protect .rustc from rpm stripping.
-
-* Fri Sep 30 2016 Josh Stone  - 1.12.0-1
-- Update to 1.12.0.
-- Always use --local-rust-root, even for bootstrap binaries.
-- Remove the rebuild conditional - the build system now figures it out.
-- Let minidebuginfo do its thing, since metadata is no longer a note.
-- Let rust build its own compiler-rt builtins again.
-
-* Sat Sep 03 2016 Josh Stone  - 1.11.0-3
-- Rebuild without bootstrap binaries.
-
-* Fri Sep 02 2016 Josh Stone  - 1.11.0-2
-- Bootstrap armv7hl, with backported no-neon patch.
-
-* Wed Aug 24 2016 Josh Stone  - 1.11.0-1
-- Update to 1.11.0.
-- Drop the backported patches.
-- Patch get-stage0.py to trust existing bootstrap binaries.
-- Use libclang_rt.builtins from compiler-rt, dodging llvm-static issues.
-- Use --local-rust-root to make sure the right bootstrap is used.
-
-* Sat Aug 13 2016 Josh Stone  1.10.0-4
-- Rebuild without bootstrap binaries.
-
-* Fri Aug 12 2016 Josh Stone  - 1.10.0-3
-- Initial import into Fedora (#1356907), bootstrapped
-- Format license text as suggested in review.
-- Note how the tests already run in parallel.
-- Undefine _include_minidebuginfo, because it duplicates ".note.rustc".
-- Don't let checks fail the whole build.
-- Note that -doc can't be noarch, as rpmdiff doesn't allow variations.
-
-* Tue Jul 26 2016 Josh Stone  - 1.10.0-2
-- Update -doc directory ownership, and mark its licenses.
-- Package and declare licenses for libbacktrace and hoedown.
-- Set bootstrap_base as a global.
-- Explicitly require python2.
-
-* Thu Jul 14 2016 Josh Stone  - 1.10.0-1
-- Initial package, bootstrapped
+%autochangelog

From d04d391a8298c788ce4beb246d87c68bdb292f3a Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 9 Apr 2024 14:56:51 -0700
Subject: [PATCH 16/86] Update to 1.77.2; Fixes RHBZ#2274248 CVE-2024-24576

---
 .gitignore | 1 +
 rust.spec  | 2 +-
 sources    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8c04a16..4c26a4a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -433,3 +433,4 @@
 /rustc-1.76.0-src.tar.xz
 /wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
 /rustc-1.77.0-src.tar.xz
+/rustc-1.77.2-src.tar.xz
diff --git a/rust.spec b/rust.spec
index d407705..5960f56 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.77.0
+Version:        1.77.2
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
diff --git a/sources b/sources
index e9e2382..aa7b40c 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.77.0-src.tar.xz) = 59f19d9def93b613ac72925625e6662622f445506489b8f1cd405d037c28becd53ae1446b46edfd63734f6f236af2dc326a57a184f01bc10d497c96227f09034
+SHA512 (rustc-1.77.2-src.tar.xz) = ab099a5e545892f145af9f4c21f41693463248697accf1c92d9afbe6c711639c3859e89c1bb99b84854c462784cc5970fb84dd7c89260ff92174e3684f76920c
 SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045

From 230ae0c65c9c719221d668037e4400bdeac9ee40 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 16 Apr 2024 10:54:39 -0700
Subject: [PATCH 17/86] [rhel] Rename rust-srpm-macros to
 rust-toolset-srpm-macros

The upgrade path was broken because the Rust version compares less than
the rust2rpm-based package version that was in RHEL 8 and 9. With a new
name and appropriate Obsoletes and Provides, it should upgrade cleanly.

Ref: https://issues.redhat.com/browse/RHEL-30636
---
 rust.spec | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/rust.spec b/rust.spec
index 5960f56..e6c5a3a 100644
--- a/rust.spec
+++ b/rust.spec
@@ -557,11 +557,15 @@ useful as a reference for code completion tools in various editors.
 
 %if 0%{?rhel}
 
-%package srpm-macros
+%package toolset-srpm-macros
 Summary:        RPM macros for building Rust source packages
 BuildArch:      noarch
 
-%description srpm-macros
+# This used to be from its own source package, versioned like rust2rpm.
+Obsoletes:      rust-srpm-macros < 18~
+Provides:       rust-srpm-macros = 25.2
+
+%description toolset-srpm-macros
 RPM macros for building source packages for Rust projects.
 
 
@@ -1083,7 +1087,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %if 0%{?rhel}
-%files srpm-macros
+%files toolset-srpm-macros
 %{rpmmacrodir}/macros.rust-srpm
 
 %files toolset

From 8e7d2666e4b3d2d54f5265270b5819773027f54d Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 16 Apr 2024 17:15:17 -0700
Subject: [PATCH 18/86] Add fixes for several test cases

---
 ...ests-with-dist-vendored-dependencies.patch |  51 ++++
 ..._unsafe_ops_per_block-test-needs-asm.patch | 233 ++++++++++++++++++
 ...-stderr-per-bitwidth-from-some-tests.patch |  82 ++++++
 ...-don-t-compress-test-registry-crates.patch | 185 ++++++++++++++
 121088.patch                                  |   2 +-
 rust.spec                                     |  16 ++
 6 files changed, 568 insertions(+), 1 deletion(-)
 create mode 100644 0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
 create mode 100644 0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
 create mode 100644 0001-remove-stderr-per-bitwidth-from-some-tests.patch
 create mode 100644 0001-test-don-t-compress-test-registry-crates.patch

diff --git a/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch b/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
new file mode 100644
index 0000000..2d18d30
--- /dev/null
+++ b/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
@@ -0,0 +1,51 @@
+From fb4d9ee194e4e6488dcbf9a7e4e16bb1e65ce5f2 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Mon, 8 Apr 2024 15:04:44 -0700
+Subject: [PATCH] Fix UI tests with dist-vendored dependencies
+
+There is already a workaround in `compiletest` to deal with custom
+`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`.
+A similar need exists when dependencies come from the local `vendor`
+directory, which distro builds often use, so now we ignore that too.
+
+Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
+expecting a version suffix, but the vendored path doesn't include the
+version. Now that matches `[\\/]hashbrown` instead.
+
+(cherry picked from commit f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63)
+---
+ src/tools/compiletest/src/runtest.rs | 5 +++++
+ tests/ui/issues/issue-21763.rs       | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
+index 8be4def15ded..644775c0385c 100644
+--- a/src/tools/compiletest/src/runtest.rs
++++ b/src/tools/compiletest/src/runtest.rs
+@@ -2362,6 +2362,11 @@ fn make_compile_args(
+             "ignore-directory-in-diagnostics-source-blocks={}",
+             home::cargo_home().expect("failed to find cargo home").to_str().unwrap()
+         ));
++        // Similarly, vendored sources shouldn't be shown when running from a dist tarball.
++        rustc.arg("-Z").arg(format!(
++            "ignore-directory-in-diagnostics-source-blocks={}",
++            self.config.find_rust_src_root().unwrap().join("vendor").display(),
++        ));
+ 
+         // Optionally prevent default --sysroot if specified in test compile-flags.
+         if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
+diff --git a/tests/ui/issues/issue-21763.rs b/tests/ui/issues/issue-21763.rs
+index 38103ff4f9c8..cc1a00687b30 100644
+--- a/tests/ui/issues/issue-21763.rs
++++ b/tests/ui/issues/issue-21763.rs
+@@ -1,6 +1,6 @@
+ // Regression test for HashMap only impl'ing Send/Sync if its contents do
+ 
+-// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"
++// normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"
+ 
+ use std::collections::HashMap;
+ use std::rc::Rc;
+-- 
+2.44.0
+
diff --git a/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch b/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
new file mode 100644
index 0000000..71e6770
--- /dev/null
+++ b/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
@@ -0,0 +1,233 @@
+From 29ed7749a3a0e4399b91b3d4198891a4d861f105 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Tue, 16 Apr 2024 16:45:59 -0700
+Subject: [PATCH] The `multiple_unsafe_ops_per_block` test needs `asm!`
+
+(cherry picked from commit 245fbeef49c2395471498d20e67f4edf4222c865)
+---
+ tests/ui/multiple_unsafe_ops_per_block.rs     |  1 +
+ tests/ui/multiple_unsafe_ops_per_block.stderr | 58 +++++++++----------
+ 2 files changed, 30 insertions(+), 29 deletions(-)
+
+diff --git a/tests/ui/multiple_unsafe_ops_per_block.rs b/tests/ui/multiple_unsafe_ops_per_block.rs
+index 8afb4df20af4..6b8a103d4a94 100644
+--- a/tests/ui/multiple_unsafe_ops_per_block.rs
++++ b/tests/ui/multiple_unsafe_ops_per_block.rs
+@@ -1,3 +1,4 @@
++//@needs-asm-support
+ //@aux-build:proc_macros.rs
+ #![allow(unused)]
+ #![allow(deref_nullptr)]
+diff --git a/tests/ui/multiple_unsafe_ops_per_block.stderr b/tests/ui/multiple_unsafe_ops_per_block.stderr
+index 4803a5089ab2..f9b22c68ddb1 100644
+--- a/tests/ui/multiple_unsafe_ops_per_block.stderr
++++ b/tests/ui/multiple_unsafe_ops_per_block.stderr
+@@ -1,5 +1,5 @@
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:36:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:37:5
+    |
+ LL | /     unsafe {
+ LL | |         STATIC += 1;
+@@ -8,12 +8,12 @@ LL | |     }
+    | |_____^
+    |
+ note: modification of a mutable static occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:37:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:38:9
+    |
+ LL |         STATIC += 1;
+    |         ^^^^^^^^^^^
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:38:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:39:9
+    |
+ LL |         not_very_safe();
+    |         ^^^^^^^^^^^^^^^
+@@ -21,7 +21,7 @@ LL |         not_very_safe();
+    = help: to override `-D warnings` add `#[allow(clippy::multiple_unsafe_ops_per_block)]`
+ 
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:45:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:46:5
+    |
+ LL | /     unsafe {
+ LL | |         drop(u.u);
+@@ -30,18 +30,18 @@ LL | |     }
+    | |_____^
+    |
+ note: union field access occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:46:14
++  --> $DIR/multiple_unsafe_ops_per_block.rs:47:14
+    |
+ LL |         drop(u.u);
+    |              ^^^
+ note: raw pointer dereference occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:47:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:48:9
+    |
+ LL |         *raw_ptr();
+    |         ^^^^^^^^^^
+ 
+ error: this `unsafe` block contains 3 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:52:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:53:5
+    |
+ LL | /     unsafe {
+ LL | |         asm!("nop");
+@@ -51,23 +51,23 @@ LL | |     }
+    | |_____^
+    |
+ note: inline assembly used here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:53:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:54:9
+    |
+ LL |         asm!("nop");
+    |         ^^^^^^^^^^^
+ note: unsafe method call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:54:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:55:9
+    |
+ LL |         sample.not_very_safe();
+    |         ^^^^^^^^^^^^^^^^^^^^^^
+ note: modification of a mutable static occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:55:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:56:9
+    |
+ LL |         STATIC = 0;
+    |         ^^^^^^^^^^
+ 
+ error: this `unsafe` block contains 6 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:61:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:62:5
+    |
+ LL | /     unsafe {
+ LL | |         drop(u.u);
+@@ -79,55 +79,55 @@ LL | |     }
+    | |_____^
+    |
+ note: union field access occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:62:14
++  --> $DIR/multiple_unsafe_ops_per_block.rs:63:14
+    |
+ LL |         drop(u.u);
+    |              ^^^
+ note: access of a mutable static occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:63:14
++  --> $DIR/multiple_unsafe_ops_per_block.rs:64:14
+    |
+ LL |         drop(STATIC);
+    |              ^^^^^^
+ note: unsafe method call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:64:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:65:9
+    |
+ LL |         sample.not_very_safe();
+    |         ^^^^^^^^^^^^^^^^^^^^^^
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:65:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:66:9
+    |
+ LL |         not_very_safe();
+    |         ^^^^^^^^^^^^^^^
+ note: raw pointer dereference occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:66:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:67:9
+    |
+ LL |         *raw_ptr();
+    |         ^^^^^^^^^^
+ note: inline assembly used here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:67:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:68:9
+    |
+ LL |         asm!("nop");
+    |         ^^^^^^^^^^^
+ 
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:105:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:106:5
+    |
+ LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:105:14
++  --> $DIR/multiple_unsafe_ops_per_block.rs:106:14
+    |
+ LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
+    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ note: raw pointer dereference occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:105:39
++  --> $DIR/multiple_unsafe_ops_per_block.rs:106:39
+    |
+ LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
+    |                                       ^^^^^^^^^^^^^^^^^^
+ 
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:123:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:124:5
+    |
+ LL | /     unsafe {
+ LL | |         x();
+@@ -136,18 +136,18 @@ LL | |     }
+    | |_____^
+    |
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:124:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:125:9
+    |
+ LL |         x();
+    |         ^^^
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:125:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:126:9
+    |
+ LL |         x();
+    |         ^^^
+ 
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:134:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:135:9
+    |
+ LL | /         unsafe {
+ LL | |             T::X();
+@@ -156,18 +156,18 @@ LL | |         }
+    | |_________^
+    |
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:135:13
++  --> $DIR/multiple_unsafe_ops_per_block.rs:136:13
+    |
+ LL |             T::X();
+    |             ^^^^^^
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:136:13
++  --> $DIR/multiple_unsafe_ops_per_block.rs:137:13
+    |
+ LL |             T::X();
+    |             ^^^^^^
+ 
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:144:5
++  --> $DIR/multiple_unsafe_ops_per_block.rs:145:5
+    |
+ LL | /     unsafe {
+ LL | |         x.0();
+@@ -176,12 +176,12 @@ LL | |     }
+    | |_____^
+    |
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:145:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:146:9
+    |
+ LL |         x.0();
+    |         ^^^^^
+ note: unsafe function call occurs here
+-  --> $DIR/multiple_unsafe_ops_per_block.rs:146:9
++  --> $DIR/multiple_unsafe_ops_per_block.rs:147:9
+    |
+ LL |         x.0();
+    |         ^^^^^
+-- 
+2.44.0
+
diff --git a/0001-remove-stderr-per-bitwidth-from-some-tests.patch b/0001-remove-stderr-per-bitwidth-from-some-tests.patch
new file mode 100644
index 0000000..57a0c1f
--- /dev/null
+++ b/0001-remove-stderr-per-bitwidth-from-some-tests.patch
@@ -0,0 +1,82 @@
+From 96e7b2767b30c215361d26626ef235f5ec0e8cd5 Mon Sep 17 00:00:00 2001
+From: Ralf Jung 
+Date: Fri, 16 Feb 2024 10:01:43 +0100
+Subject: [PATCH] remove stderr-per-bitwidth from some tests
+
+(cherry picked from commit f68e79dcac3acb635c58ff2fa4178b9a0b040fe4)
+---
+ ...ut_ref_in_final_dynamic_check.64bit.stderr | 20 -------------------
+ .../mut_ref_in_final_dynamic_check.rs         |  3 ++-
+ ... => mut_ref_in_final_dynamic_check.stderr} |  8 ++++----
+ 3 files changed, 6 insertions(+), 25 deletions(-)
+ delete mode 100644 tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr
+ rename tests/ui/consts/const-mut-refs/{mut_ref_in_final_dynamic_check.32bit.stderr => mut_ref_in_final_dynamic_check.stderr} (75%)
+
+diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr
+deleted file mode 100644
+index fc68207512c0..000000000000
+--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr
++++ /dev/null
+@@ -1,20 +0,0 @@
+-error[E0080]: it is undefined behavior to use this value
+-  --> $DIR/mut_ref_in_final_dynamic_check.rs:15:1
+-   |
+-LL | const A: Option<&mut i32> = helper();
+-   | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered mutable reference in a `const` or `static`
+-   |
+-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+-   = note: the raw bytes of the constant (size: 8, align: 8) {
+-               2a 00 00 00 00 00 00 00                         │ *.......
+-           }
+-
+-error: encountered dangling pointer in final value of constant
+-  --> $DIR/mut_ref_in_final_dynamic_check.rs:22:1
+-   |
+-LL | const B: Option<&mut i32> = helper2();
+-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+-
+-error: aborting due to 2 previous errors
+-
+-For more information about this error, try `rustc --explain E0080`.
+diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
+index 455b557b97c4..b98f4d920694 100644
+--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
++++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
+@@ -1,4 +1,5 @@
+-// stderr-per-bitwidth
++// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
++// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?()?─*╼ )+ *│.*" -> "HEX_DUMP"
+ #![feature(const_mut_refs)]
+ #![feature(raw_ref_op)]
+ 
+diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
+similarity index 75%
+rename from tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr
+rename to tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
+index 87420a037514..bb3c5518680b 100644
+--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr
++++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
+@@ -1,16 +1,16 @@
+ error[E0080]: it is undefined behavior to use this value
+-  --> $DIR/mut_ref_in_final_dynamic_check.rs:15:1
++  --> $DIR/mut_ref_in_final_dynamic_check.rs:16:1
+    |
+ LL | const A: Option<&mut i32> = helper();
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered mutable reference in a `const` or `static`
+    |
+    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+-   = note: the raw bytes of the constant (size: 4, align: 4) {
+-               2a 00 00 00                                     │ *...
++   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
++               HEX_DUMP
+            }
+ 
+ error: encountered dangling pointer in final value of constant
+-  --> $DIR/mut_ref_in_final_dynamic_check.rs:22:1
++  --> $DIR/mut_ref_in_final_dynamic_check.rs:23:1
+    |
+ LL | const B: Option<&mut i32> = helper2();
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^
+-- 
+2.44.0
+
diff --git a/0001-test-don-t-compress-test-registry-crates.patch b/0001-test-don-t-compress-test-registry-crates.patch
new file mode 100644
index 0000000..60f2f27
--- /dev/null
+++ b/0001-test-don-t-compress-test-registry-crates.patch
@@ -0,0 +1,185 @@
+From ed8e223cc58103cae0586351fd9113a727523cab Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Thu, 11 Apr 2024 14:58:42 -0700
+Subject: [PATCH] test: don't compress test registry crates
+
+They are still nominally gzipped, but using `Compression::none()` makes
+them consistent even across zlib and zlib-ng, and this fixes checksum
+differences in the testsuite. There is a one-time update of all those
+checksums to catch up with this change though.
+
+(cherry picked from commit a70f23c50b61c1a3335f2943375a04ae7abf2fa4)
+---
+ crates/cargo-test-support/src/registry.rs        |  2 +-
+ tests/testsuite/alt_registry.rs                  |  2 +-
+ .../cargo_add/locked_unchanged/in/Cargo.lock     |  2 +-
+ .../cargo_add/lockfile_updated/in/Cargo.lock     |  2 +-
+ .../cargo_add/lockfile_updated/out/Cargo.lock    |  4 ++--
+ .../cargo_remove/update_lock_file/in/Cargo.lock  | 16 ++++++++--------
+ .../cargo_remove/update_lock_file/out/Cargo.lock | 12 ++++++------
+ 7 files changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs
+index cc51707dbbf9..e27d1e354d7b 100644
+--- a/crates/cargo-test-support/src/registry.rs
++++ b/crates/cargo-test-support/src/registry.rs
+@@ -1469,7 +1469,7 @@ impl Package {
+         let dst = self.archive_dst();
+         t!(fs::create_dir_all(dst.parent().unwrap()));
+         let f = t!(File::create(&dst));
+-        let mut a = Builder::new(GzEncoder::new(f, Compression::default()));
++        let mut a = Builder::new(GzEncoder::new(f, Compression::none()));
+ 
+         if !self
+             .files
+diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
+index f286dc018122..42b818493244 100644
+--- a/tests/testsuite/alt_registry.rs
++++ b/tests/testsuite/alt_registry.rs
+@@ -1466,7 +1466,7 @@ dependencies = [
+ name = "foo"
+ version = "0.1.0"
+ source = "sparse+http://[..]/"
+-checksum = "f6a200a9339fef960979d94d5c99cbbfd899b6f5a396a55d9775089119050203""#,
++checksum = "458c1addb23fde7dfbca0410afdbcc0086f96197281ec304d9e0e10def3cb899""#,
+     );
+ }
+ 
+diff --git a/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock b/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
+index 011b335926ee..b88709a9e9be 100644
+--- a/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
++++ b/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
+@@ -13,4 +13,4 @@ dependencies = [
+ name = "my-package"
+ version = "99999.0.0+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915"
++checksum = "73cfa03cf28feb001362b377a837910c5a6ec1cc5cceaa562b97fc14d15edec8"
+diff --git a/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock b/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
+index d9bcc988d3f2..d8fa962f3069 100644
+--- a/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
++++ b/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
+@@ -14,4 +14,4 @@ dependencies = [
+ name = "unrelateed-crate"
+ version = "0.2.0+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f"
++checksum = "b16af1a8ba7e4331ca62d945483a3028c2afbbe06a7f2ffaa0a3538ef0a7d63e"
+diff --git a/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock b/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
+index 4b5fb465f104..e423b3d1f8b7 100644
+--- a/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
++++ b/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
+@@ -14,10 +14,10 @@ dependencies = [
+ name = "my-package"
+ version = "99999.0.0+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915"
++checksum = "73cfa03cf28feb001362b377a837910c5a6ec1cc5cceaa562b97fc14d15edec8"
+ 
+ [[package]]
+ name = "unrelateed-crate"
+ version = "0.2.0+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f"
++checksum = "b16af1a8ba7e4331ca62d945483a3028c2afbbe06a7f2ffaa0a3538ef0a7d63e"
+diff --git a/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock b/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
+index 2302220f2fb7..a4018e70eb47 100644
+--- a/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
++++ b/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
+@@ -19,40 +19,40 @@ dependencies = [
+ name = "clippy"
+ version = "0.4.1+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "47ced0eda54e9ddc6063f0e1d0164493cd16c84c6b6a0329a536967c44e205f7"
++checksum = "e95568c5ce98de9c470c1d9b387466f4d5efa9687d3af7998e7c9c1da5e399fb"
+ 
+ [[package]]
+ name = "docopt"
+ version = "0.6.2+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b600540c4fafb27bf6e6961f0f1e6f547c9d6126ce581ab3a92f878c8e2c9a2c"
++checksum = "d4414d2705e6b42fe10772b4ab4e3260f362669e45606eb562dc4c0023e911f6"
+ 
+ [[package]]
+ name = "regex"
+ version = "0.1.1+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "84949cb53285a6c481d0133065a7b669871acfd9e20f273f4ce1283c309775d5"
++checksum = "bc4552a1d503f3a436bb18d1efff62eb95bd97f724d06466c55ef151ea2de9e0"
+ 
+ [[package]]
+ name = "rustc-serialize"
+-version = "0.4.1+my-package"
++version = "0.4.0+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "31162e7d23a085553c42dee375787b451a481275473f7779c4a63bcc267a24fd"
++checksum = "48c3645ec42f69a343fbe9734a477ae59448192e779206dbcb1a9c3397563fd8"
+ 
+ [[package]]
+ name = "semver"
+ version = "0.1.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "106bee742e3199d9e59f4269e458dfc825c1b4648c483b1c2b7a45cd2610a308"
++checksum = "20070289360e74dcdc28f437b08dda0c0c861c2328d749bb0d6e1a428013af83"
+ 
+ [[package]]
+ name = "serde"
+ version = "1.0.90"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "be7d269f612a60e3c2c4a4a120e2d878a3f3298a5285eda6e95453905a107d9a"
++checksum = "ba76b226746eabf28375d5ad184926bbb9cd727425c8d027ea10f6c508895c6c"
+ 
+ [[package]]
+ name = "toml"
+ version = "0.1.1+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a0f6c7804525ce0a968ef270e55a516cf4bdcf1fea0b09d130e0aa34a66745b3"
++checksum = "a9ea5fa6eaed7d7e6d9fb4571bb9d915b577e19bf2a95321ebb70fd3d894ce49"
+diff --git a/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock b/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
+index 0946cee47717..af60414ddad2 100644
+--- a/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
++++ b/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
+@@ -18,34 +18,34 @@ dependencies = [
+ name = "clippy"
+ version = "0.4.1+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "47ced0eda54e9ddc6063f0e1d0164493cd16c84c6b6a0329a536967c44e205f7"
++checksum = "e95568c5ce98de9c470c1d9b387466f4d5efa9687d3af7998e7c9c1da5e399fb"
+ 
+ [[package]]
+ name = "docopt"
+ version = "0.6.2+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "b600540c4fafb27bf6e6961f0f1e6f547c9d6126ce581ab3a92f878c8e2c9a2c"
++checksum = "d4414d2705e6b42fe10772b4ab4e3260f362669e45606eb562dc4c0023e911f6"
+ 
+ [[package]]
+ name = "regex"
+ version = "0.1.1+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "84949cb53285a6c481d0133065a7b669871acfd9e20f273f4ce1283c309775d5"
++checksum = "bc4552a1d503f3a436bb18d1efff62eb95bd97f724d06466c55ef151ea2de9e0"
+ 
+ [[package]]
+ name = "semver"
+ version = "0.1.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "106bee742e3199d9e59f4269e458dfc825c1b4648c483b1c2b7a45cd2610a308"
++checksum = "20070289360e74dcdc28f437b08dda0c0c861c2328d749bb0d6e1a428013af83"
+ 
+ [[package]]
+ name = "serde"
+ version = "1.0.90"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "be7d269f612a60e3c2c4a4a120e2d878a3f3298a5285eda6e95453905a107d9a"
++checksum = "ba76b226746eabf28375d5ad184926bbb9cd727425c8d027ea10f6c508895c6c"
+ 
+ [[package]]
+ name = "toml"
+ version = "0.1.1+my-package"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a0f6c7804525ce0a968ef270e55a516cf4bdcf1fea0b09d130e0aa34a66745b3"
++checksum = "a9ea5fa6eaed7d7e6d9fb4571bb9d915b577e19bf2a95321ebb70fd3d894ce49"
+-- 
+2.44.0
+
diff --git a/121088.patch b/121088.patch
index b70b52a..af436d2 100644
--- a/121088.patch
+++ b/121088.patch
@@ -43,7 +43,7 @@ index 0000000000000..a15060857eccb
 +// compile-flags: --crate-type=lib -C target-cpu=skylake
 +
 +#![feature(avx512_target_feature)]
-+#![feature(stdarch_x86_avx512)]
++#![feature(stdsimd)]
 +
 +use std::arch::x86_64::*;
 +
diff --git a/rust.spec b/rust.spec
index e6c5a3a..885a409 100644
--- a/rust.spec
+++ b/rust.spec
@@ -149,6 +149,18 @@ Patch8:         121088.patch
 # https://github.com/rust-lang/rust/pull/123520
 Patch9:         0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
 
+# https://github.com/rust-lang/rust/pull/123652
+Patch10:        0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
+
+# https://github.com/rust-lang/rust/pull/121179 (partial)
+Patch11:        0001-remove-stderr-per-bitwidth-from-some-tests.patch
+
+# https://github.com/rust-lang/cargo/pull/13744
+Patch12:        0001-test-don-t-compress-test-registry-crates.patch
+
+# https://github.com/rust-lang/rust-clippy/pull/12682
+Patch13:        0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -614,6 +626,10 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P7 -p1
 %patch -P8 -p1
 %patch -P9 -p1
+%patch -P10 -p1
+%patch -P11 -p1
+%patch -P12 -p1 -d src/tools/cargo
+%patch -P13 -p1 -d src/tools/clippy
 
 %if %with disabled_libssh2
 %patch -P100 -p1

From 8fff280b59ffadaed09fe8442aef401d0af74f8b Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Wed, 24 Apr 2024 16:36:01 -0700
Subject: [PATCH 19/86] Disable brp-strip-static-archive

We do want debuginfo for the standard library when built into other
programs, and this also avoids problems with strip on wasm and uefi.
---
 rust.spec | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/rust.spec b/rust.spec
index 885a409..079da25 100644
--- a/rust.spec
+++ b/rust.spec
@@ -311,6 +311,13 @@ Requires:       /usr/bin/cc
 # support custom-derive plugins like #[proc_macro_derive(Foo)].
 %global _find_debuginfo_opts --keep-section .rustc
 
+# The standard library rlibs are essentially static archives, but we don't want
+# to strip them because that impairs the debuginfo of all Rust programs.
+# It also had a tendency to break the cross-compiled libraries:
+# - wasm targets lost the archive index, which we were repairing with llvm-ranlib
+# - uefi targets couldn't link builtins like memcpy, possibly due to lost COMDAT flags
+%global __brp_strip_static_archive %{nil}
+
 %if %{without bundled_llvm}
 %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1}
 %global llvm_has_filecheck 1
@@ -340,11 +347,6 @@ BuildRequires:  clang
 BuildRequires:  wasi-libc-static
 %endif
 BuildRequires:  lld
-# brp-strip-static-archive breaks the archive index for wasm
-%global __os_install_post \
-%__os_install_post \
-find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' -print -exec '%{llvm_root}/bin/llvm-ranlib' '{}' ';' \
-%{nil}
 %endif
 
 # For profiler_builtins
@@ -887,9 +889,6 @@ find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
 # We don't actually need to ship any of those python scripts in rust-src anyway.
 find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
 
-# FIXME: __os_install_post will strip the rlibs
-# -- should we find a way to preserve debuginfo?
-
 # Remove unwanted documentation files (we already package them)
 rm -f %{buildroot}%{_docdir}/%{name}/README.md
 rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT

From 51570d63ec6384c53a1cd7036a8eabc36873f801 Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Mon, 22 Apr 2024 09:37:57 +0200
Subject: [PATCH 20/86] tests: Add rpmbuild tests

Created a virtual testcase for building any rpm with rust.
Added two specific cases: rpm-sequoia and ripgrep
---
 tests/Sanity/rpm-rebuild/main.fmf        | 13 ++++++
 tests/Sanity/rpm-rebuild/ripgrep.fmf     | 11 +++++
 tests/Sanity/rpm-rebuild/rpm-sequoia.fmf | 11 +++++
 tests/Sanity/rpm-rebuild/runtest.sh      | 55 ++++++++++++++++++++++++
 4 files changed, 90 insertions(+)
 create mode 100644 tests/Sanity/rpm-rebuild/main.fmf
 create mode 100644 tests/Sanity/rpm-rebuild/ripgrep.fmf
 create mode 100644 tests/Sanity/rpm-rebuild/rpm-sequoia.fmf
 create mode 100755 tests/Sanity/rpm-rebuild/runtest.sh

diff --git a/tests/Sanity/rpm-rebuild/main.fmf b/tests/Sanity/rpm-rebuild/main.fmf
new file mode 100644
index 0000000..72fce8a
--- /dev/null
+++ b/tests/Sanity/rpm-rebuild/main.fmf
@@ -0,0 +1,13 @@
+summary: rpmbuild package with rust
+description: 'Ensure that rust does not break rpmbuild'
+contact:
+  - Jesus Checa Hidalgo 
+component:
+  - rust
+test: ./runtest.sh
+framework: beakerlib
+require+:
+  - rust
+  - rpm-build
+  - yum-utils
+duration: 1h
diff --git a/tests/Sanity/rpm-rebuild/ripgrep.fmf b/tests/Sanity/rpm-rebuild/ripgrep.fmf
new file mode 100644
index 0000000..9cb533c
--- /dev/null
+++ b/tests/Sanity/rpm-rebuild/ripgrep.fmf
@@ -0,0 +1,11 @@
+summary+: ": ripgrep"
+require+:
+  - ripgrep
+environment+:
+  PKG_TO_BUILD: "ripgrep"
+duration: 15m
+
+adjust+:
+  # ripgrep is not part of RHEL
+  - when: distro != fedora
+    enabled: false
diff --git a/tests/Sanity/rpm-rebuild/rpm-sequoia.fmf b/tests/Sanity/rpm-rebuild/rpm-sequoia.fmf
new file mode 100644
index 0000000..d215dfb
--- /dev/null
+++ b/tests/Sanity/rpm-rebuild/rpm-sequoia.fmf
@@ -0,0 +1,11 @@
+summary+: ": rpm-sequoia"
+require+:
+  - rpm-sequoia
+environment+:
+  PKG_TO_BUILD: "rpm-sequoia"
+duration: 20m
+
+adjust+:
+  - when: distro < rhel-10, centos-stream-10
+    enabled: false
+    because: "rpm-sequoia is available only in RHEL >= 10"
diff --git a/tests/Sanity/rpm-rebuild/runtest.sh b/tests/Sanity/rpm-rebuild/runtest.sh
new file mode 100755
index 0000000..475d2f9
--- /dev/null
+++ b/tests/Sanity/rpm-rebuild/runtest.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+PACKAGE="$(rpm -qf $(which rustc))"
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlAssertRpm $PACKAGE || rlDie "rustc not found. Aborting testcase..."
+        rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
+        rlRun "pushd $TmpDir"
+
+        if [[ "x" == "x${PKG_TO_BUILD}" ]]; then
+            rlLogError "No package was configured to build."
+            rlDie "The package must be passed over PKG_TO_BUILD environment variable."
+        fi
+
+    rlPhaseEnd
+
+    rlPhaseStart FAIL ${PKG_TO_BUILD}FetchSrcAndInstallBuildDeps
+        if ! rlCheckRpm $PKG_TO_BUILD; then
+            rlRun "yum install -y $PKG_TO_BUILD ${YUM_SWITCHES}"
+            rlAssertRpm $PKG_TO_BUILD
+        fi
+        rlFetchSrcForInstalled $PKG_TO_BUILD
+        rlRun SRPM=$(ls -1 *.src.rpm)
+        rlRun "rpm -ivh $SRPM"
+        rlRun SPECDIR="$(rpm -E '%{_specdir}')"
+        # Note about the spec file name: When packaging rust crates, the package
+        # is named rust-, as well as the spec file, but the rpm package
+        # (the one we use in dnf to install and query) is named as the crate,
+        # (without the "rust-" prefix). We have to take that into account to
+        # find the spec:
+        # https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_naming
+        rlRun "SPECNAME=$(rpm -ql $SRPM | grep .spec)"
+
+        # Packages built with rust usually contains dynamic dependencies.
+        # builddep needs to be run from the srpm, not the spec file, to be able
+        # to generate them:
+        # https://fedoraproject.org/wiki/Changes/DynamicBuildRequires#rpmbuild
+        rlRun "yum-builddep -y ${SRPM} ${YUM_SWITCHES}"
+    rlPhaseEnd
+
+    rlPhaseStartTest
+        set -o pipefail
+        rlRun "rpmbuild -bb ${SPECDIR}/${SPECNAME} |& tee ${SRPM}_rpmbuild.log"
+        rlFileSubmit "${SRPM}_rpmbuild.log"
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "popd"
+        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
+    rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd

From b12fe9f482af032a2acf1aaf39c6b14f4b4fdbb2 Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Tue, 23 Apr 2024 08:06:58 +0200
Subject: [PATCH 21/86] test: Move librsvg2 and stratisd rebuild tests into
 rpm-rebuild test

---
 tests/Sanity/build-stratisd/Makefile      | 63 ---------------------
 tests/Sanity/build-stratisd/PURPOSE       |  3 -
 tests/Sanity/build-stratisd/main.fmf      | 17 ------
 tests/Sanity/build-stratisd/runtest.sh    | 65 ----------------------
 tests/Sanity/rpm-rebuild/librsvg2.fmf     | 11 ++++
 tests/Sanity/rpm-rebuild/stratisd.fmf     |  6 ++
 tests/Sanity/rpmbuild-librsvg2/Makefile   | 65 ----------------------
 tests/Sanity/rpmbuild-librsvg2/PURPOSE    |  3 -
 tests/Sanity/rpmbuild-librsvg2/main.fmf   | 18 ------
 tests/Sanity/rpmbuild-librsvg2/runtest.sh | 68 -----------------------
 10 files changed, 17 insertions(+), 302 deletions(-)
 delete mode 100644 tests/Sanity/build-stratisd/Makefile
 delete mode 100644 tests/Sanity/build-stratisd/PURPOSE
 delete mode 100644 tests/Sanity/build-stratisd/main.fmf
 delete mode 100755 tests/Sanity/build-stratisd/runtest.sh
 create mode 100644 tests/Sanity/rpm-rebuild/librsvg2.fmf
 create mode 100644 tests/Sanity/rpm-rebuild/stratisd.fmf
 delete mode 100644 tests/Sanity/rpmbuild-librsvg2/Makefile
 delete mode 100644 tests/Sanity/rpmbuild-librsvg2/PURPOSE
 delete mode 100644 tests/Sanity/rpmbuild-librsvg2/main.fmf
 delete mode 100755 tests/Sanity/rpmbuild-librsvg2/runtest.sh

diff --git a/tests/Sanity/build-stratisd/Makefile b/tests/Sanity/build-stratisd/Makefile
deleted file mode 100644
index a085527..0000000
--- a/tests/Sanity/build-stratisd/Makefile
+++ /dev/null
@@ -1,63 +0,0 @@
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Makefile of /tools/rust/Sanity/build-stratisd
-#   Description: rpmbuild stratisd
-#   Author: Edjunior Machado 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2018 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-export TEST=/tools/rust/Sanity/build-stratisd
-export TESTVERSION=1.0
-
-BUILT_FILES=
-
-FILES=$(METADATA) runtest.sh Makefile PURPOSE
-
-.PHONY: all install download clean
-
-run: $(FILES) build
-	./runtest.sh
-
-build: $(BUILT_FILES)
-	test -x runtest.sh || chmod a+x runtest.sh
-
-clean:
-	rm -f *~ $(BUILT_FILES)
-
-
-include /usr/share/rhts/lib/rhts-make.include
-
-$(METADATA): Makefile
-	@echo "Owner:           Edjunior Machado " > $(METADATA)
-	@echo "Name:            $(TEST)" >> $(METADATA)
-	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
-	@echo "Path:            $(TEST_DIR)" >> $(METADATA)
-	@echo "Description:     rpmbuild stratisd" >> $(METADATA)
-	@echo "Type:            Sanity" >> $(METADATA)
-	@echo "TestTime:        1h" >> $(METADATA)
-	@echo "RunFor:          rust" >> $(METADATA)
-	@echo "Requires:        rust rpm-build yum-utils stratisd" >> $(METADATA)
-	@echo "Priority:        Normal" >> $(METADATA)
-	@echo "License:         GPLv2+" >> $(METADATA)
-	@echo "Confidential:    no" >> $(METADATA)
-	@echo "Destructive:     no" >> $(METADATA)
-	@echo "Releases:        RHEL8 RHEL9" >> $(METADATA)
-
-	rhts-lint $(METADATA)
diff --git a/tests/Sanity/build-stratisd/PURPOSE b/tests/Sanity/build-stratisd/PURPOSE
deleted file mode 100644
index c790991..0000000
--- a/tests/Sanity/build-stratisd/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of /tools/rust/Sanity/build-stratisd
-Description: rpmbuild stratisd
-Author: Edjunior Machado 
diff --git a/tests/Sanity/build-stratisd/main.fmf b/tests/Sanity/build-stratisd/main.fmf
deleted file mode 100644
index 0617757..0000000
--- a/tests/Sanity/build-stratisd/main.fmf
+++ /dev/null
@@ -1,17 +0,0 @@
-summary: rpmbuild stratisd
-description:
-  - 'Ensure that rust does not break stratisd rpmbuild'
-contact:
-  - Jesus Checa Hidalgo 
-component:
-  - rust
-test: ./runtest.sh
-framework: beakerlib
-recommend:
-  - rust
-  - rpm-build
-  - yum-utils
-  - stratisd
-duration: 1h
-extra-summary: /tools/rust/Sanity/build-stratisd
-extra-task: /tools/rust/Sanity/build-stratisd
diff --git a/tests/Sanity/build-stratisd/runtest.sh b/tests/Sanity/build-stratisd/runtest.sh
deleted file mode 100755
index 693a72f..0000000
--- a/tests/Sanity/build-stratisd/runtest.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   runtest.sh of /tools/rust/Sanity/build-stratisd
-#   Description: rpmbuild stratisd
-#   Author: Edjunior Machado 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2018 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# Include Beaker environment
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGE="$(rpm -qf $(which rustc))"
-
-rlJournalStart
-    rlPhaseStartSetup
-        rlAssertRpm $PACKAGE || rlDie "rustc not found. Aborting testcase..."
-        rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
-        rlRun "pushd $TmpDir"
-    rlPhaseEnd
-
-    PKG_TO_BUILD=stratisd
-    rlPhaseStart FAIL ${PKG_TO_BUILD}FetchSrcAndInstallBuildDeps
-        if ! rlCheckRpm $PKG_TO_BUILD; then
-            rlRun "yum install -y $PKG_TO_BUILD"
-            rlAssertRpm $PKG_TO_BUILD
-        fi
-        rlFetchSrcForInstalled $PKG_TO_BUILD
-        rlRun SRPM=$(ls -1 ${PKG_TO_BUILD}*src.rpm)
-        rlRun "rpm -ivh $SRPM"
-        rlRun SPECDIR="$(rpm -E '%{_specdir}')"
-
-        rlRun "yum-builddep -y ${SRPM}"
-    rlPhaseEnd
-
-    rlPhaseStartTest
-        set -o pipefail
-        rlRun "rpmbuild -bb ${SPECDIR}/${PKG_TO_BUILD}.spec |& tee ${SRPM}_rpmbuild.log"
-        rlFileSubmit "${SRPM}_rpmbuild.log"
-    rlPhaseEnd
-
-    rlPhaseStartCleanup
-        rlRun "popd"
-        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
-    rlPhaseEnd
-rlJournalPrintText
-rlJournalEnd
diff --git a/tests/Sanity/rpm-rebuild/librsvg2.fmf b/tests/Sanity/rpm-rebuild/librsvg2.fmf
new file mode 100644
index 0000000..23e2f33
--- /dev/null
+++ b/tests/Sanity/rpm-rebuild/librsvg2.fmf
@@ -0,0 +1,11 @@
+summary+: ": librsvg2"
+require+:
+  - librsvg2
+environment+:
+  PKG_TO_BUILD: "librsvg2"
+duration: 20m
+
+adjust+:
+  # building librsvg2 in Fedora is very flaky. Do not run it there
+  - when: distro == fedora
+    enabled: false
\ No newline at end of file
diff --git a/tests/Sanity/rpm-rebuild/stratisd.fmf b/tests/Sanity/rpm-rebuild/stratisd.fmf
new file mode 100644
index 0000000..64cce60
--- /dev/null
+++ b/tests/Sanity/rpm-rebuild/stratisd.fmf
@@ -0,0 +1,6 @@
+summary+: ": stratisd"
+require+:
+  - stratisd
+environment+:
+  PKG_TO_BUILD: "stratisd"
+duration: 1h
diff --git a/tests/Sanity/rpmbuild-librsvg2/Makefile b/tests/Sanity/rpmbuild-librsvg2/Makefile
deleted file mode 100644
index bd22601..0000000
--- a/tests/Sanity/rpmbuild-librsvg2/Makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Makefile of /tools/rust/Sanity/rpmbuild-librsvg2
-#   Description: rpmbuild librsvg2
-#   Author: Edjunior Machado 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2018 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-export TEST=/tools/rust/Sanity/rpmbuild-librsvg2
-export TESTVERSION=1.0
-
-BUILT_FILES=
-
-FILES=$(METADATA) runtest.sh Makefile PURPOSE
-
-.PHONY: all install download clean
-
-run: $(FILES) build
-	./runtest.sh
-
-build: $(BUILT_FILES)
-	test -x runtest.sh || chmod a+x runtest.sh
-
-clean:
-	rm -f *~ $(BUILT_FILES)
-
-
-include /usr/share/rhts/lib/rhts-make.include
-
-$(METADATA): Makefile
-	@echo "Owner:           Edjunior Machado " > $(METADATA)
-	@echo "Name:            $(TEST)" >> $(METADATA)
-	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
-	@echo "Path:            $(TEST_DIR)" >> $(METADATA)
-	@echo "Description:     rpmbuild librsvg2" >> $(METADATA)
-	@echo "Type:            Sanity" >> $(METADATA)
-	@echo "TestTime:        1h" >> $(METADATA)
-	@echo "RunFor:          rust" >> $(METADATA)
-	# Due to bz1980717 librsvg2 requires git to build the srpm, but it's missing
-	# from the BuildRequires
-	@echo "Requires:        rust rpm-build yum-utils librsvg2 git" >> $(METADATA)
-	@echo "Priority:        Normal" >> $(METADATA)
-	@echo "License:         GPLv2+" >> $(METADATA)
-	@echo "Confidential:    no" >> $(METADATA)
-	@echo "Destructive:     no" >> $(METADATA)
-	@echo "Releases:        RHEL8 RHEL9" >> $(METADATA)
-
-	rhts-lint $(METADATA)
diff --git a/tests/Sanity/rpmbuild-librsvg2/PURPOSE b/tests/Sanity/rpmbuild-librsvg2/PURPOSE
deleted file mode 100644
index d3a05af..0000000
--- a/tests/Sanity/rpmbuild-librsvg2/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of /tools/rust/Sanity/rpmbuild-librsvg2
-Description: rpmbuild librsvg2
-Author: Edjunior Machado 
diff --git a/tests/Sanity/rpmbuild-librsvg2/main.fmf b/tests/Sanity/rpmbuild-librsvg2/main.fmf
deleted file mode 100644
index decb64d..0000000
--- a/tests/Sanity/rpmbuild-librsvg2/main.fmf
+++ /dev/null
@@ -1,18 +0,0 @@
-summary: rpmbuild librsvg2
-description:
-  - 'Ensure that rust does not break librsvg2 rpmbuild'
-contact:
-  - Jesus Checa Hidalgo 
-component:
-  - rust
-test: ./runtest.sh
-framework: beakerlib
-recommend:
-  - rust
-  - rpm-build
-  - yum-utils
-  - librsvg2
-  - git
-duration: 1h
-extra-summary: /tools/rust/Sanity/rpmbuild-librsvg2
-extra-task: /tools/rust/Sanity/rpmbuild-librsvg2
diff --git a/tests/Sanity/rpmbuild-librsvg2/runtest.sh b/tests/Sanity/rpmbuild-librsvg2/runtest.sh
deleted file mode 100755
index 470ecb5..0000000
--- a/tests/Sanity/rpmbuild-librsvg2/runtest.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   runtest.sh of /tools/rust/Sanity/rpmbuild-librsvg2
-#   Description: rpmbuild librsvg2
-#   Author: Edjunior Machado 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2018 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# Include Beaker environment
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGE="$(rpm -qf $(which rustc))"
-
-rlJournalStart
-    rlPhaseStartSetup
-        rlAssertRpm $PACKAGE || rlDie "rustc not found. Aborting testcase..."
-        rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
-        rlRun "pushd $TmpDir"
-    rlPhaseEnd
-
-    PKG_TO_BUILD=librsvg2
-    rlPhaseStart FAIL ${PKG_TO_BUILD}FetchSrcAndInstallBuildDeps
-        if ! rlCheckRpm $PKG_TO_BUILD; then
-            rlRun "yum install -y $PKG_TO_BUILD ${YUM_SWITCHES}"
-            rlAssertRpm $PKG_TO_BUILD
-        fi
-        rlFetchSrcForInstalled $PKG_TO_BUILD
-        rlRun SRPM=$(ls -1 ${PKG_TO_BUILD}*src.rpm)
-        rlRun "rpm -ivh $SRPM"
-        rlRun SPECDIR="$(rpm -E '%{_specdir}')"
-
-        # librsvg2 contains dynamic dependencies. builddep needs to be run
-        # from the srpm (not the spec file) to be able to generate them:
-        # https://fedoraproject.org/wiki/Changes/DynamicBuildRequires#rpmbuild
-        rlRun "yum-builddep -y ${SRPM} ${YUM_SWITCHES}"
-    rlPhaseEnd
-
-    rlPhaseStartTest
-        set -o pipefail
-        rlRun "rpmbuild -bb ${SPECDIR}/${PKG_TO_BUILD}.spec |& tee ${SRPM}_rpmbuild.log"
-        rlFileSubmit "${SRPM}_rpmbuild.log"
-    rlPhaseEnd
-
-    rlPhaseStartCleanup
-        rlRun "popd"
-        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
-    rlPhaseEnd
-rlJournalPrintText
-rlJournalEnd

From 3334ed315dd394914201b3c97a307a60164062b0 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 30 Apr 2024 13:22:43 -0700
Subject: [PATCH 22/86] Use bundled sqlite3 when the system version is too old.

---
 rust.spec | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/rust.spec b/rust.spec
index 079da25..d608a8a 100644
--- a/rust.spec
+++ b/rust.spec
@@ -81,6 +81,15 @@ ExclusiveArch:  %{rust_arches}
 %bcond_without bundled_libgit2
 %endif
 
+# Cargo uses UPSERTs with omitted conflict targets
+%global min_sqlite3_version 3.35
+%global bundled_sqlite3_version 3.44.0
+%if 0%{?rhel} && 0%{?rhel} < 10
+%bcond_without bundled_sqlite3
+%else
+%bcond_with bundled_sqlite3
+%endif
+
 %if 0%{?rhel}
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
 %bcond_without disabled_libssh2
@@ -240,13 +249,16 @@ BuildRequires:  curl-devel
 BuildRequires:  pkgconfig(libcurl)
 BuildRequires:  pkgconfig(liblzma)
 BuildRequires:  pkgconfig(openssl)
-BuildRequires:  pkgconfig(sqlite3)
 BuildRequires:  pkgconfig(zlib)
 
 %if %{without bundled_libgit2}
 BuildRequires:  (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(libgit2) < %{next_libgit2_version})
 %endif
 
+%if %{without bundled_sqlite3}
+BuildRequires:  pkgconfig(sqlite3) >= %{min_sqlite3_version}
+%endif
+
 %if %{without disabled_libssh2}
 BuildRequires:  pkgconfig(libssh2)
 %endif
@@ -497,6 +509,9 @@ Summary:        Rust's package manager and build tool
 %if %with bundled_libgit2
 Provides:       bundled(libgit2) = %{bundled_libgit2_version}
 %endif
+%if %with bundled_sqlite3
+Provides:       bundled(sqlite) = %{bundled_sqlite3_version}
+%endif
 # For tests:
 BuildRequires:  git-core
 # Cargo is not much use without Rust
@@ -624,7 +639,9 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %if %without bundled_wasi_libc
 %patch -P5 -p1
 %endif
+%if %without bundled_sqlite3
 %patch -P6 -p1
+%endif
 %patch -P7 -p1
 %patch -P8 -p1
 %patch -P9 -p1
@@ -656,7 +673,7 @@ mkdir -p src/llvm-project/libunwind/
 %clear_dir vendor/*jemalloc-sys*/jemalloc/
 %clear_dir vendor/libffi-sys*/libffi/
 %clear_dir vendor/libmimalloc-sys*/c_src/mimalloc/
-%clear_dir vendor/libsqlite3-sys*/{sqlite3,sqlcipher}/
+%clear_dir vendor/libsqlite3-sys*/sqlcipher/
 %clear_dir vendor/libssh2-sys*/libssh2/
 %clear_dir vendor/libz-sys*/src/zlib{,-ng}/
 %clear_dir vendor/lzma-sys*/xz-*/
@@ -666,6 +683,10 @@ mkdir -p src/llvm-project/libunwind/
 %clear_dir vendor/libgit2-sys*/libgit2/
 %endif
 
+%if %without bundled_sqlite3
+%clear_dir vendor/libsqlite3-sys*/sqlite3/
+%endif
+
 %if %with disabled_libssh2
 rm -rf vendor/libssh2-sys*/
 %endif
@@ -714,7 +735,7 @@ end}
 %global rust_env %{shrink:
   %{?rustflags:RUSTFLAGS="%{rustflags}"}
   %{rustc_target_cpus}
-  LIBSQLITE3_SYS_USE_PKG_CONFIG=1
+  %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1}
   %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1}
 }
 %global export_rust_env export %{rust_env}

From 110b2ab26eb726b13724000ab2dd1c99cce93b67 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 2 May 2024 10:01:52 -0700
Subject: [PATCH 23/86] Update to 1.78.0

---
 .gitignore                                    |   1 +
 0001-Fix-2-tests-for-offline-execution.patch  |  59 ++++
 ...ests-with-dist-vendored-dependencies.patch |  14 +-
 ...the-host-library-path-in-run-make-v2.patch |  79 ++++++
 ..._unsafe_ops_per_block-test-needs-asm.patch | 121 ++++----
 ...x86-64-cpu-in-tests-that-are-sensiti.patch | 264 ++++++++++++++++++
 ...llow-disabling-target-self-contained.patch |  38 +--
 ...-all-of-rustc-s-flags-to-rustc_cargo.patch |  40 ++-
 ...command-lines-failure-caused-by-rust.patch |  27 ++
 ...-stderr-per-bitwidth-from-some-tests.patch |  82 ------
 ...-don-t-compress-test-registry-crates.patch |  10 +-
 ...nv-split_paths-join_paths-in-runtest.patch |  63 +++++
 ...xternal-library-path-for-wasm32-wasi.patch |  61 ++--
 120529.patch                                  |  62 ----
 121088.patch                                  |  55 ----
 rust.spec                                     | 118 +++++---
 rustc-1.77.0-unbundle-sqlite.patch            |  23 --
 ...atch => rustc-1.78.0-disable-libssh2.patch |  20 +-
 rustc-1.78.0-unbundle-sqlite.patch            |  23 ++
 sources                                       |   2 +-
 20 files changed, 755 insertions(+), 407 deletions(-)
 create mode 100644 0001-Fix-2-tests-for-offline-execution.patch
 create mode 100644 0001-Set-the-host-library-path-in-run-make-v2.patch
 create mode 100644 0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
 create mode 100644 0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
 delete mode 100644 0001-remove-stderr-per-bitwidth-from-some-tests.patch
 create mode 100644 0002-Use-env-split_paths-join_paths-in-runtest.patch
 delete mode 100644 120529.patch
 delete mode 100644 121088.patch
 delete mode 100644 rustc-1.77.0-unbundle-sqlite.patch
 rename rustc-1.77.0-disable-libssh2.patch => rustc-1.78.0-disable-libssh2.patch (61%)
 create mode 100644 rustc-1.78.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index 4c26a4a..7632c62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -434,3 +434,4 @@
 /wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
 /rustc-1.77.0-src.tar.xz
 /rustc-1.77.2-src.tar.xz
+/rustc-1.78.0-src.tar.xz
diff --git a/0001-Fix-2-tests-for-offline-execution.patch b/0001-Fix-2-tests-for-offline-execution.patch
new file mode 100644
index 0000000..49688cf
--- /dev/null
+++ b/0001-Fix-2-tests-for-offline-execution.patch
@@ -0,0 +1,59 @@
+From 6dda4e006b0d6d7519ac4a9f540566c81e406a8b Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Mon, 22 Apr 2024 16:19:17 -0700
+Subject: [PATCH] Fix 2 tests for offline execution
+
+In `alt_registry::warn_for_unused_fields`, the second part of the test
+runs on `--registry crates-io`, so it needs a local replacement url.
+
+In `install::install_global_cargo_config`, it was adding to the "config"
+file, but the `pkg` before it configured the dummy registry replacement
+in "config.toml". So that replacement wasn't actually used, and if you
+ran tests online it was trying to install `bar v0.1.1` from the real
+registry! The filename is now fixed, and the test double-checks that
+we're only trying to install the local `bar v0.0.1`.
+---
+ tests/testsuite/alt_registry.rs | 4 ++++
+ tests/testsuite/install.rs      | 3 ++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
+index e95f2cbaabbd..1fef04e3ae42 100644
+--- a/tests/testsuite/alt_registry.rs
++++ b/tests/testsuite/alt_registry.rs
+@@ -1572,7 +1572,11 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN",
+         )
+         .run();
+ 
++    let crates_io = registry::RegistryBuilder::new()
++        .no_configure_token()
++        .build();
+     p.cargo("publish --registry crates-io")
++        .replace_crates_io(crates_io.index_url())
+         .with_status(101)
+         .with_stderr(
+             "\
+diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs
+index 89d40ada9543..ef3f4f3ae604 100644
+--- a/tests/testsuite/install.rs
++++ b/tests/testsuite/install.rs
+@@ -1981,7 +1981,7 @@ fn install_ignores_unstable_table_in_local_cargo_config() {
+ fn install_global_cargo_config() {
+     pkg("bar", "0.0.1");
+ 
+-    let config = cargo_home().join("config");
++    let config = cargo_home().join("config.toml");
+     let mut toml = fs::read_to_string(&config).unwrap_or_default();
+ 
+     toml.push_str(
+@@ -1994,6 +1994,7 @@ fn install_global_cargo_config() {
+ 
+     cargo_process("install bar")
+         .with_status(101)
++        .with_stderr_contains("[INSTALLING] bar v0.0.1")
+         .with_stderr_contains("[..]--target nonexistent[..]")
+         .run();
+ }
+-- 
+2.44.0
+
diff --git a/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch b/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
index 2d18d30..82c6c35 100644
--- a/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
+++ b/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
@@ -1,4 +1,4 @@
-From fb4d9ee194e4e6488dcbf9a7e4e16bb1e65ce5f2 Mon Sep 17 00:00:00 2001
+From f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Mon, 8 Apr 2024 15:04:44 -0700
 Subject: [PATCH] Fix UI tests with dist-vendored dependencies
@@ -11,18 +11,16 @@ directory, which distro builds often use, so now we ignore that too.
 Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
 expecting a version suffix, but the vendored path doesn't include the
 version. Now that matches `[\\/]hashbrown` instead.
-
-(cherry picked from commit f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63)
 ---
  src/tools/compiletest/src/runtest.rs | 5 +++++
  tests/ui/issues/issue-21763.rs       | 2 +-
  2 files changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
-index 8be4def15ded..644775c0385c 100644
+index bb8509fe4137..770496289e2e 100644
 --- a/src/tools/compiletest/src/runtest.rs
 +++ b/src/tools/compiletest/src/runtest.rs
-@@ -2362,6 +2362,11 @@ fn make_compile_args(
+@@ -2354,6 +2354,11 @@ fn make_compile_args(
              "ignore-directory-in-diagnostics-source-blocks={}",
              home::cargo_home().expect("failed to find cargo home").to_str().unwrap()
          ));
@@ -35,14 +33,14 @@ index 8be4def15ded..644775c0385c 100644
          // Optionally prevent default --sysroot if specified in test compile-flags.
          if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
 diff --git a/tests/ui/issues/issue-21763.rs b/tests/ui/issues/issue-21763.rs
-index 38103ff4f9c8..cc1a00687b30 100644
+index a349253063c0..1d0a0705cbbd 100644
 --- a/tests/ui/issues/issue-21763.rs
 +++ b/tests/ui/issues/issue-21763.rs
 @@ -1,6 +1,6 @@
  // Regression test for HashMap only impl'ing Send/Sync if its contents do
  
--// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"
-+// normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"
+-//@ normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"
++//@ normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"
  
  use std::collections::HashMap;
  use std::rc::Rc;
diff --git a/0001-Set-the-host-library-path-in-run-make-v2.patch b/0001-Set-the-host-library-path-in-run-make-v2.patch
new file mode 100644
index 0000000..b1ed9e1
--- /dev/null
+++ b/0001-Set-the-host-library-path-in-run-make-v2.patch
@@ -0,0 +1,79 @@
+From 27593a7ad3796cf3afaf4145275ff20d5aff333f Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Wed, 10 Apr 2024 17:25:10 -0700
+Subject: [PATCH 1/2] Set the host library path in run-make v2
+
+When the build is configured with `[rust] rpath = false`, we need to set
+`LD_LIBRARY_PATH` (or equivalent) to what would have been the `RPATH`,
+so the compiler can find its own libraries. The old `tools.mk` code has
+this environment prefixed in the `$(BARE_RUSTC)` variable, so we just
+need to wire up something similar for run-make v2.
+
+This is now set while building each `rmake.rs` itself, as well as in the
+`rust-make-support` helpers for `rustc` and `rustdoc` commands. This is
+also available in a `set_host_rpath` function for manual commands, like
+in the `compiler-builtins` test.
+
+(cherry picked from commit 8a5409bbdbadb522f25e7e5e3d54b967cb5eee56)
+---
+ src/tools/compiletest/src/runtest.rs  |  6 ++++++
+ src/tools/run-make-support/src/lib.rs | 15 +++++++++++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
+index 7be0571b1111..3c775ea0651c 100644
+--- a/src/tools/compiletest/src/runtest.rs
++++ b/src/tools/compiletest/src/runtest.rs
+@@ -3767,6 +3767,11 @@ fn run_rmake_v2_test(&self) {
+         debug!(?support_lib_deps);
+         debug!(?support_lib_deps_deps);
+ 
++        let mut host_dylib_env_paths = String::new();
++        host_dylib_env_paths.push_str(&cwd.join(&self.config.compile_lib_path).to_string_lossy());
++        host_dylib_env_paths.push(':');
++        host_dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
++
+         let res = self.cmd2procres(
+             Command::new(&self.config.rustc_path)
+                 .arg("-o")
+@@ -3787,6 +3792,7 @@ fn run_rmake_v2_test(&self) {
+                 .env("RUSTC", cwd.join(&self.config.rustc_path))
+                 .env("TMPDIR", &tmpdir)
+                 .env("LD_LIB_PATH_ENVVAR", dylib_env_var())
++                .env(dylib_env_var(), &host_dylib_env_paths)
+                 .env("HOST_RPATH_DIR", cwd.join(&self.config.compile_lib_path))
+                 .env("TARGET_RPATH_DIR", cwd.join(&self.config.run_lib_path))
+                 .env("LLVM_COMPONENTS", &self.config.llvm_components)
+diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
+index 674860f8413b..da3efd292b3f 100644
+--- a/src/tools/run-make-support/src/lib.rs
++++ b/src/tools/run-make-support/src/lib.rs
+@@ -11,6 +11,7 @@ pub fn out_dir() -> PathBuf {
+ fn setup_common_build_cmd() -> Command {
+     let rustc = env::var("RUSTC").unwrap();
+     let mut cmd = Command::new(rustc);
++    set_host_rpath(&mut cmd);
+     cmd.arg("--out-dir").arg(out_dir()).arg("-L").arg(out_dir());
+     cmd
+ }
+@@ -157,3 +158,17 @@ pub fn run_fail(bin_name: &str) -> Output {
+     }
+     output
+ }
++
++/// Set the runtime library path as needed for running the host rustc/rustdoc/etc.
++pub fn set_host_rpath(cmd: &mut Command) {
++    let ld_lib_path_envvar = env::var("LD_LIB_PATH_ENVVAR").unwrap();
++    cmd.env(&ld_lib_path_envvar, {
++        let mut paths = vec![];
++        paths.push(PathBuf::from(env::var("TMPDIR").unwrap()));
++        paths.push(PathBuf::from(env::var("HOST_RPATH_DIR").unwrap()));
++        for p in env::split_paths(&env::var(&ld_lib_path_envvar).unwrap()) {
++            paths.push(p.to_path_buf());
++        }
++        env::join_paths(paths.iter()).unwrap()
++    });
++}
+-- 
+2.44.0
+
diff --git a/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch b/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
index 71e6770..ca9178c 100644
--- a/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
+++ b/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
@@ -1,9 +1,8 @@
-From 29ed7749a3a0e4399b91b3d4198891a4d861f105 Mon Sep 17 00:00:00 2001
+From 245fbeef49c2395471498d20e67f4edf4222c865 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Tue, 16 Apr 2024 16:45:59 -0700
 Subject: [PATCH] The `multiple_unsafe_ops_per_block` test needs `asm!`
 
-(cherry picked from commit 245fbeef49c2395471498d20e67f4edf4222c865)
 ---
  tests/ui/multiple_unsafe_ops_per_block.rs     |  1 +
  tests/ui/multiple_unsafe_ops_per_block.stderr | 58 +++++++++----------
@@ -19,13 +18,13 @@ index 8afb4df20af4..6b8a103d4a94 100644
  #![allow(unused)]
  #![allow(deref_nullptr)]
 diff --git a/tests/ui/multiple_unsafe_ops_per_block.stderr b/tests/ui/multiple_unsafe_ops_per_block.stderr
-index 4803a5089ab2..f9b22c68ddb1 100644
+index cff85ae115e0..e732bde0707e 100644
 --- a/tests/ui/multiple_unsafe_ops_per_block.stderr
 +++ b/tests/ui/multiple_unsafe_ops_per_block.stderr
 @@ -1,5 +1,5 @@
  error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:36:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:37:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:36:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:37:5
     |
  LL | /     unsafe {
  LL | |         STATIC += 1;
@@ -33,14 +32,14 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_____^
     |
  note: modification of a mutable static occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:37:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:38:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:37:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:38:9
     |
  LL |         STATIC += 1;
     |         ^^^^^^^^^^^
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:38:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:39:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:38:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:39:9
     |
  LL |         not_very_safe();
     |         ^^^^^^^^^^^^^^^
@@ -48,8 +47,8 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     = help: to override `-D warnings` add `#[allow(clippy::multiple_unsafe_ops_per_block)]`
  
  error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:45:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:46:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:45:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:46:5
     |
  LL | /     unsafe {
  LL | |         drop(u.u);
@@ -57,21 +56,21 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_____^
     |
  note: union field access occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:46:14
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:47:14
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:46:14
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:47:14
     |
  LL |         drop(u.u);
     |              ^^^
  note: raw pointer dereference occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:47:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:48:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:47:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:48:9
     |
  LL |         *raw_ptr();
     |         ^^^^^^^^^^
  
  error: this `unsafe` block contains 3 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:52:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:53:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:52:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:53:5
     |
  LL | /     unsafe {
  LL | |         asm!("nop");
@@ -79,27 +78,27 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_____^
     |
  note: inline assembly used here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:53:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:54:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:53:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:54:9
     |
  LL |         asm!("nop");
     |         ^^^^^^^^^^^
  note: unsafe method call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:54:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:55:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:54:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:55:9
     |
  LL |         sample.not_very_safe();
     |         ^^^^^^^^^^^^^^^^^^^^^^
  note: modification of a mutable static occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:55:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:56:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:55:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:56:9
     |
  LL |         STATIC = 0;
     |         ^^^^^^^^^^
  
  error: this `unsafe` block contains 6 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:61:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:62:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:61:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:62:5
     |
  LL | /     unsafe {
  LL | |         drop(u.u);
@@ -107,65 +106,65 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_____^
     |
  note: union field access occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:62:14
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:63:14
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:62:14
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:63:14
     |
  LL |         drop(u.u);
     |              ^^^
  note: access of a mutable static occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:63:14
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:64:14
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:63:14
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:64:14
     |
  LL |         drop(STATIC);
     |              ^^^^^^
  note: unsafe method call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:64:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:65:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:64:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:65:9
     |
  LL |         sample.not_very_safe();
     |         ^^^^^^^^^^^^^^^^^^^^^^
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:65:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:66:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:65:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:66:9
     |
  LL |         not_very_safe();
     |         ^^^^^^^^^^^^^^^
  note: raw pointer dereference occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:66:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:67:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:66:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:67:9
     |
  LL |         *raw_ptr();
     |         ^^^^^^^^^^
  note: inline assembly used here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:67:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:68:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:67:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:68:9
     |
  LL |         asm!("nop");
     |         ^^^^^^^^^^^
  
  error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:105:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:106:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:105:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:106:5
     |
  LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:105:14
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:106:14
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:105:14
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:106:14
     |
  LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  note: raw pointer dereference occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:105:39
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:106:39
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:105:39
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:106:39
     |
  LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
     |                                       ^^^^^^^^^^^^^^^^^^
  
  error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:123:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:124:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:123:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:124:5
     |
  LL | /     unsafe {
  LL | |         x();
@@ -173,21 +172,21 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_____^
     |
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:124:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:125:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:124:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:125:9
     |
  LL |         x();
     |         ^^^
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:125:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:126:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:125:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:126:9
     |
  LL |         x();
     |         ^^^
  
  error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:134:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:135:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:134:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:135:9
     |
  LL | /         unsafe {
  LL | |             T::X();
@@ -195,21 +194,21 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_________^
     |
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:135:13
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:136:13
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:135:13
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:136:13
     |
  LL |             T::X();
     |             ^^^^^^
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:136:13
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:137:13
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:136:13
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:137:13
     |
  LL |             T::X();
     |             ^^^^^^
  
  error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> $DIR/multiple_unsafe_ops_per_block.rs:144:5
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:145:5
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:144:5
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:145:5
     |
  LL | /     unsafe {
  LL | |         x.0();
@@ -217,14 +216,14 @@ index 4803a5089ab2..f9b22c68ddb1 100644
     | |_____^
     |
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:145:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:146:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:145:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:146:9
     |
  LL |         x.0();
     |         ^^^^^
  note: unsafe function call occurs here
--  --> $DIR/multiple_unsafe_ops_per_block.rs:146:9
-+  --> $DIR/multiple_unsafe_ops_per_block.rs:147:9
+-  --> tests/ui/multiple_unsafe_ops_per_block.rs:146:9
++  --> tests/ui/multiple_unsafe_ops_per_block.rs:147:9
     |
  LL |         x.0();
     |         ^^^^^
diff --git a/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch b/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
new file mode 100644
index 0000000..c427d51
--- /dev/null
+++ b/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
@@ -0,0 +1,264 @@
+From 706f06c39a9e08a4708a53722429d13ae4069c2f Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Wed, 1 May 2024 15:25:26 -0700
+Subject: [PATCH] Use an explicit x86-64 cpu in tests that are sensitive to it
+
+There are a few tests that depend on some target features **not** being
+enabled by default, and usually they are correct with the default x86-64
+target CPU. However, in downstream builds we have modified the default
+to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10
+-- and the latter especially trips tests that expect not to have AVX.
+
+These cases are few enough that we can just set them back explicitly.
+---
+ tests/assembly/simd-intrinsic-mask-reduce.rs  |  1 +
+ tests/assembly/x86_64-floating-point-clamp.rs |  2 +-
+ .../codegen/target-feature-inline-closure.rs  |  2 +-
+ tests/ui/asm/x86_64/target-feature-attr.rs    |  1 +
+ .../ui/asm/x86_64/target-feature-attr.stderr  |  8 +++---
+ .../const-eval/const_fn_target_feature.rs     |  2 +-
+ .../rfc-2396-target_feature-11/safe-calls.rs  |  1 +
+ .../safe-calls.stderr                         | 28 +++++++++----------
+ tests/ui/sse2.rs                              |  4 +--
+ 9 files changed, 26 insertions(+), 23 deletions(-)
+
+diff --git a/tests/assembly/simd-intrinsic-mask-reduce.rs b/tests/assembly/simd-intrinsic-mask-reduce.rs
+index 763401755fad..0d77fc410511 100644
+--- a/tests/assembly/simd-intrinsic-mask-reduce.rs
++++ b/tests/assembly/simd-intrinsic-mask-reduce.rs
+@@ -1,6 +1,7 @@
+ // verify that simd mask reductions do not introduce additional bit shift operations
+ //@ revisions: x86 aarch64
+ //@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
++//@ [x86] compile-flags: -C target-cpu=x86-64
+ //@ [x86] needs-llvm-components: x86
+ //@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
+ //@ [aarch64] needs-llvm-components: aarch64
+diff --git a/tests/assembly/x86_64-floating-point-clamp.rs b/tests/assembly/x86_64-floating-point-clamp.rs
+index 4a72a7f44fa0..b963aee35590 100644
+--- a/tests/assembly/x86_64-floating-point-clamp.rs
++++ b/tests/assembly/x86_64-floating-point-clamp.rs
+@@ -2,7 +2,7 @@
+ // so check to make sure that's what it's actually emitting.
+ 
+ //@ assembly-output: emit-asm
+-//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
++//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -C target-cpu=x86-64
+ //@ only-x86_64
+ //@ ignore-sgx
+ 
+diff --git a/tests/codegen/target-feature-inline-closure.rs b/tests/codegen/target-feature-inline-closure.rs
+index 88bd413a8707..20bb4e66ff21 100644
+--- a/tests/codegen/target-feature-inline-closure.rs
++++ b/tests/codegen/target-feature-inline-closure.rs
+@@ -1,5 +1,5 @@
+ //@ only-x86_64
+-//@ compile-flags: -Copt-level=3
++//@ compile-flags: -Copt-level=3 -Ctarget-cpu=x86-64
+ 
+ #![crate_type = "lib"]
+ #![feature(target_feature_11)]
+diff --git a/tests/ui/asm/x86_64/target-feature-attr.rs b/tests/ui/asm/x86_64/target-feature-attr.rs
+index 820be132ef79..51829be15065 100644
+--- a/tests/ui/asm/x86_64/target-feature-attr.rs
++++ b/tests/ui/asm/x86_64/target-feature-attr.rs
+@@ -1,4 +1,5 @@
+ //@ only-x86_64
++//@ compile-flags: -C target-cpu=x86-64
+ 
+ #![feature(avx512_target_feature)]
+ 
+diff --git a/tests/ui/asm/x86_64/target-feature-attr.stderr b/tests/ui/asm/x86_64/target-feature-attr.stderr
+index c852726ee7ff..1a9962732cfb 100644
+--- a/tests/ui/asm/x86_64/target-feature-attr.stderr
++++ b/tests/ui/asm/x86_64/target-feature-attr.stderr
+@@ -1,23 +1,23 @@
+ error: register class `ymm_reg` requires the `avx` target feature
+-  --> $DIR/target-feature-attr.rs:18:40
++  --> $DIR/target-feature-attr.rs:19:40
+    |
+ LL |     asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
+    |                                        ^^^^^^^^^^^^^
+ 
+ error: register class `ymm_reg` requires the `avx` target feature
+-  --> $DIR/target-feature-attr.rs:18:55
++  --> $DIR/target-feature-attr.rs:19:55
+    |
+ LL |     asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
+    |                                                       ^^^^^^^^^^^^^
+ 
+ error: register class `ymm_reg` requires the `avx` target feature
+-  --> $DIR/target-feature-attr.rs:18:70
++  --> $DIR/target-feature-attr.rs:19:70
+    |
+ LL |     asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
+    |                                                                      ^^^^^^^^^^^^^^^^^^
+ 
+ error: register class `kreg` requires at least one of the following target features: avx512bw, avx512f
+-  --> $DIR/target-feature-attr.rs:33:23
++  --> $DIR/target-feature-attr.rs:34:23
+    |
+ LL |     asm!("/* {0} */", in(kreg) x);
+    |                       ^^^^^^^^^^
+diff --git a/tests/ui/consts/const-eval/const_fn_target_feature.rs b/tests/ui/consts/const-eval/const_fn_target_feature.rs
+index b56b68a57958..d0de9d8d7a34 100644
+--- a/tests/ui/consts/const-eval/const_fn_target_feature.rs
++++ b/tests/ui/consts/const-eval/const_fn_target_feature.rs
+@@ -1,5 +1,5 @@
+ //@ only-x86_64
+-//@ compile-flags:-C target-feature=+ssse3
++//@ compile-flags: -C target-cpu=x86-64 -C target-feature=+ssse3
+ 
+ #![crate_type = "lib"]
+ 
+diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
+index c73b8d7e4d29..6fb0688008e6 100644
+--- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
++++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
+@@ -1,4 +1,5 @@
+ //@ only-x86_64
++//@ compile-flags: -C target-cpu=x86-64
+ 
+ #![feature(target_feature_11)]
+ 
+diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
+index d9d7e297f8e9..fed3da6594cb 100644
+--- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
++++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
+@@ -1,5 +1,5 @@
+ error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:25:5
++  --> $DIR/safe-calls.rs:26:5
+    |
+ LL |     sse2();
+    |     ^^^^^^ call to function with `#[target_feature]`
+@@ -8,7 +8,7 @@ LL |     sse2();
+    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
+ 
+ error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:27:5
++  --> $DIR/safe-calls.rs:28:5
+    |
+ LL |     avx_bmi2();
+    |     ^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -16,7 +16,7 @@ LL |     avx_bmi2();
+    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
+ 
+ error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:29:5
++  --> $DIR/safe-calls.rs:30:5
+    |
+ LL |     Quux.avx_bmi2();
+    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -24,7 +24,7 @@ LL |     Quux.avx_bmi2();
+    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
+ 
+ error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:35:5
++  --> $DIR/safe-calls.rs:36:5
+    |
+ LL |     avx_bmi2();
+    |     ^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -32,7 +32,7 @@ LL |     avx_bmi2();
+    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
+ 
+ error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:37:5
++  --> $DIR/safe-calls.rs:38:5
+    |
+ LL |     Quux.avx_bmi2();
+    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -40,7 +40,7 @@ LL |     Quux.avx_bmi2();
+    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
+ 
+ error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:43:5
++  --> $DIR/safe-calls.rs:44:5
+    |
+ LL |     sse2();
+    |     ^^^^^^ call to function with `#[target_feature]`
+@@ -49,7 +49,7 @@ LL |     sse2();
+    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
+ 
+ error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:45:5
++  --> $DIR/safe-calls.rs:46:5
+    |
+ LL |     avx_bmi2();
+    |     ^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -57,7 +57,7 @@ LL |     avx_bmi2();
+    = help: in order for the call to be safe, the context requires the following additional target feature: bmi2
+ 
+ error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:47:5
++  --> $DIR/safe-calls.rs:48:5
+    |
+ LL |     Quux.avx_bmi2();
+    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -65,7 +65,7 @@ LL |     Quux.avx_bmi2();
+    = help: in order for the call to be safe, the context requires the following additional target feature: bmi2
+ 
+ error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:54:5
++  --> $DIR/safe-calls.rs:55:5
+    |
+ LL |     sse2();
+    |     ^^^^^^ call to function with `#[target_feature]`
+@@ -74,7 +74,7 @@ LL |     sse2();
+    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
+ 
+ error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:58:15
++  --> $DIR/safe-calls.rs:59:15
+    |
+ LL | const _: () = sse2();
+    |               ^^^^^^ call to function with `#[target_feature]`
+@@ -83,7 +83,7 @@ LL | const _: () = sse2();
+    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
+ 
+ error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block
+-  --> $DIR/safe-calls.rs:61:15
++  --> $DIR/safe-calls.rs:62:15
+    |
+ LL | const _: () = sse2_and_fxsr();
+    |               ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+@@ -92,7 +92,7 @@ LL | const _: () = sse2_and_fxsr();
+    = note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]`
+ 
+ error: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block (error E0133)
+-  --> $DIR/safe-calls.rs:68:5
++  --> $DIR/safe-calls.rs:69:5
+    |
+ LL |     sse2();
+    |     ^^^^^^ call to function with `#[target_feature]`
+@@ -101,12 +101,12 @@ LL |     sse2();
+    = help: in order for the call to be safe, the context requires the following additional target feature: sse2
+    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
+ note: an unsafe function restricts its caller, but its body is safe by default
+-  --> $DIR/safe-calls.rs:67:1
++  --> $DIR/safe-calls.rs:68:1
+    |
+ LL | unsafe fn needs_unsafe_block() {
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ note: the lint level is defined here
+-  --> $DIR/safe-calls.rs:64:8
++  --> $DIR/safe-calls.rs:65:8
+    |
+ LL | #[deny(unsafe_op_in_unsafe_fn)]
+    |        ^^^^^^^^^^^^^^^^^^^^^^
+diff --git a/tests/ui/sse2.rs b/tests/ui/sse2.rs
+index fa6d79713b4b..c203ca2716ff 100644
+--- a/tests/ui/sse2.rs
++++ b/tests/ui/sse2.rs
+@@ -20,6 +20,6 @@ fn main() {
+                 "SSE2 was not detected as available on an x86 platform");
+     }
+     // check a negative case too -- allowed on x86, but not enabled by default
+-    assert!(cfg!(not(target_feature = "avx2")),
+-            "AVX2 shouldn't be detected as available by default on any platform");
++    assert!(cfg!(not(target_feature = "avx512f")),
++            "AVX512 shouldn't be detected as available by default on any platform");
+ }
+-- 
+2.44.0
+
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 2a3cbd7..a168218 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From df0d6f1d8b46db82d7599ca8eff6e8f844cf52f2 Mon Sep 17 00:00:00 2001
+From 2b99134e2884fa56bcab6d360885ec5421048e66 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:14:28 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -11,12 +11,12 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/config.example.toml b/config.example.toml
-index e5df28a49af6..2fcd8b8cb057 100644
+index f94553dd63f7..5ec969c80a37 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -807,6 +807,11 @@ change-id = 116881
- # target triples containing `-none`, `nvptx`, `switch`, or `-uefi`.
- #no-std =  (bool)
+@@ -869,6 +869,11 @@
+ # argument as the test binary.
+ #runner =  (string)
  
 +# Copy libc and CRT objects into the target lib/self-contained/ directory.
 +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
@@ -27,10 +27,10 @@ index e5df28a49af6..2fcd8b8cb057 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 7021a9543582..11555c65ca87 100644
+index e927b491c71e..69a80d01d6b9 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -302,6 +302,10 @@ fn copy_self_contained_objects(
+@@ -356,6 +356,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,18 +42,18 @@ index 7021a9543582..11555c65ca87 100644
      t!(fs::create_dir_all(&libdir_self_contained));
      let mut target_deps = vec![];
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index 0a9175aa3ea5..a2e028b25036 100644
+index 3e1bc9a9acdd..5e24a9cc4f60 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -533,6 +533,7 @@ pub struct Target {
-     pub wasi_root: Option,
-     pub qemu_rootfs: Option,
+@@ -586,6 +586,7 @@ pub struct Target {
+     pub runner: Option,
      pub no_std: bool,
+     pub codegen_backends: Option>,
 +    pub self_contained: bool,
  }
  
  impl Target {
-@@ -541,6 +542,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -594,6 +595,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
              target.no_std = true;
          }
@@ -63,15 +63,15 @@ index 0a9175aa3ea5..a2e028b25036 100644
          target
      }
  }
-@@ -1051,6 +1055,7 @@ struct TomlTarget {
-         wasi_root: Option = "wasi-root",
-         qemu_rootfs: Option = "qemu-rootfs",
+@@ -1150,6 +1154,7 @@ struct TomlTarget {
          no_std: Option = "no-std",
+         codegen_backends: Option> = "codegen-backends",
+         runner: Option = "runner",
 +        self_contained: Option = "self-contained",
      }
  }
  
-@@ -1600,6 +1605,9 @@ fn get_table(option: &str) -> Result {
+@@ -1870,6 +1875,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index 0a9175aa3ea5..a2e028b25036 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index 33b8f1a7ce72..f36e53187576 100644
+index 5ed6b357e20a..c23b21d65713 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1335,6 +1335,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1348,6 +1348,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -98,5 +98,5 @@ index 33b8f1a7ce72..f36e53187576 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.41.0
+2.44.0
 
diff --git a/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch b/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
index baceb2f..5275aba 100644
--- a/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
+++ b/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
@@ -1,4 +1,4 @@
-From 56942ed6d13d330facddbd71470a3c115a3fe0d1 Mon Sep 17 00:00:00 2001
+From e8fb8c36ca0de817b3d30f603d6d6b3c56e8b0be Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 5 Apr 2024 15:07:58 -0700
 Subject: [PATCH] bootstrap: move all of rustc's flags to `rustc_cargo`
@@ -7,8 +7,6 @@ This ensures that `RUSTFLAGS` will be consistent between all modes of
 building the compiler, so they won't trigger a rebuild by cargo. This
 kind of fix was started in #119414 just for LTO flags, but it's
 applicable to all kinds of flags that might be configured.
-
-(cherry picked from commit e8fb8c36ca0de817b3d30f603d6d6b3c56e8b0be)
 ---
  src/bootstrap/src/core/build_steps/check.rs   |   2 +-
  src/bootstrap/src/core/build_steps/compile.rs | 107 +++++++++---------
@@ -17,26 +15,26 @@ applicable to all kinds of flags that might be configured.
  4 files changed, 59 insertions(+), 54 deletions(-)
 
 diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
-index 5f0afdb1b36c..dd866c2eb0f3 100644
+index 55180a82885b..37d91b14ca1b 100644
 --- a/src/bootstrap/src/core/build_steps/check.rs
 +++ b/src/bootstrap/src/core/build_steps/check.rs
-@@ -263,7 +263,7 @@ fn run(self, builder: &Builder<'_>) {
-             target,
+@@ -296,7 +296,7 @@ fn run(self, builder: &Builder<'_>) {
              cargo_subcommand(builder.kind),
          );
+ 
 -        rustc_cargo(builder, &mut cargo, target, compiler.stage);
 +        rustc_cargo(builder, &mut cargo, target, &compiler);
  
          // For ./x.py clippy, don't run with --all-targets because
          // linting tests and benchmarks can produce very noisy results
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index ddbe18ab8388..607a658617b5 100644
+index e03997181ee5..9420e40d6c2b 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -898,55 +898,10 @@ fn run(self, builder: &Builder<'_>) -> u32 {
-         ));
+@@ -945,55 +945,10 @@ fn run(self, builder: &Builder<'_>) -> u32 {
+             "build",
+         );
  
-         let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "build");
 -        rustc_cargo(builder, &mut cargo, target, compiler.stage);
 +        rustc_cargo(builder, &mut cargo, target, &compiler);
  
@@ -92,7 +90,7 @@ index ddbe18ab8388..607a658617b5 100644
  
          for krate in &*self.crates {
              cargo.arg("-p").arg(krate);
-@@ -997,7 +952,12 @@ fn run(self, builder: &Builder<'_>) -> u32 {
+@@ -1044,7 +999,12 @@ fn run(self, builder: &Builder<'_>) -> u32 {
      }
  }
  
@@ -105,8 +103,8 @@ index ddbe18ab8388..607a658617b5 100644
 +) {
      cargo
          .arg("--features")
-         .arg(builder.rustc_features(builder.kind))
-@@ -1008,7 +968,7 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
+         .arg(builder.rustc_features(builder.kind, target))
+@@ -1055,7 +1015,7 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
  
      // We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
      // and may just be a time sink.
@@ -115,7 +113,7 @@ index ddbe18ab8388..607a658617b5 100644
          match builder.config.rust_lto {
              RustcLto::Thin | RustcLto::Fat => {
                  // Since using LTO for optimizing dylibs is currently experimental,
-@@ -1034,7 +994,52 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
+@@ -1081,7 +1041,52 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
          cargo.rustflag("-Clto=off");
      }
  
@@ -170,23 +168,23 @@ index ddbe18ab8388..607a658617b5 100644
  
  pub fn rustc_cargo_env(
 diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
-index 57e63927c95e..e10035f07c05 100644
+index 51b5cdc05657..a22cbeacf016 100644
 --- a/src/bootstrap/src/core/build_steps/doc.rs
 +++ b/src/bootstrap/src/core/build_steps/doc.rs
-@@ -794,7 +794,7 @@ fn run(self, builder: &Builder<'_>) {
-         cargo.rustdocflag("-Znormalize-docs");
-         cargo.rustdocflag("--show-type-layout");
-         cargo.rustdocflag("--generate-link-to-definition");
+@@ -804,7 +804,7 @@ fn run(self, builder: &Builder<'_>) {
+         // see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
+         // cargo.rustdocflag("--generate-link-to-definition");
+ 
 -        compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
 +        compile::rustc_cargo(builder, &mut cargo, target, &compiler);
          cargo.arg("-Zunstable-options");
          cargo.arg("-Zskip-rustdoc-fingerprint");
  
 diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
-index 04728e2e00dc..c4fdda0a2606 100644
+index bacf5f0d33ce..5277c38a4ad0 100644
 --- a/src/bootstrap/src/core/build_steps/test.rs
 +++ b/src/bootstrap/src/core/build_steps/test.rs
-@@ -2558,7 +2558,7 @@ fn run(self, builder: &Builder<'_>) {
+@@ -2671,7 +2671,7 @@ fn run(self, builder: &Builder<'_>) {
                  }
              }
              Mode::Rustc => {
diff --git a/0001-fix-long-linker-command-lines-failure-caused-by-rust.patch b/0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
new file mode 100644
index 0000000..e2a2a28
--- /dev/null
+++ b/0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
@@ -0,0 +1,27 @@
+From f25809d2d33e1141d73487e55fe155f41762aef3 Mon Sep 17 00:00:00 2001
+From: onur-ozkan 
+Date: Sun, 10 Mar 2024 09:16:24 +0300
+Subject: [PATCH] fix `long-linker-command-lines` failure caused by
+ `rust.rpath=false`
+
+Signed-off-by: onur-ozkan 
+---
+ tests/run-make/long-linker-command-lines/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/run-make/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile
+index f864ea74f4a9..b573038e344a 100644
+--- a/tests/run-make/long-linker-command-lines/Makefile
++++ b/tests/run-make/long-linker-command-lines/Makefile
+@@ -1,6 +1,8 @@
+ # ignore-cross-compile
+ include ../tools.mk
+ 
++export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
++
+ all:
+ 	$(RUSTC) foo.rs -g -O
+ 	RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo)
+-- 
+2.44.0
+
diff --git a/0001-remove-stderr-per-bitwidth-from-some-tests.patch b/0001-remove-stderr-per-bitwidth-from-some-tests.patch
deleted file mode 100644
index 57a0c1f..0000000
--- a/0001-remove-stderr-per-bitwidth-from-some-tests.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 96e7b2767b30c215361d26626ef235f5ec0e8cd5 Mon Sep 17 00:00:00 2001
-From: Ralf Jung 
-Date: Fri, 16 Feb 2024 10:01:43 +0100
-Subject: [PATCH] remove stderr-per-bitwidth from some tests
-
-(cherry picked from commit f68e79dcac3acb635c58ff2fa4178b9a0b040fe4)
----
- ...ut_ref_in_final_dynamic_check.64bit.stderr | 20 -------------------
- .../mut_ref_in_final_dynamic_check.rs         |  3 ++-
- ... => mut_ref_in_final_dynamic_check.stderr} |  8 ++++----
- 3 files changed, 6 insertions(+), 25 deletions(-)
- delete mode 100644 tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr
- rename tests/ui/consts/const-mut-refs/{mut_ref_in_final_dynamic_check.32bit.stderr => mut_ref_in_final_dynamic_check.stderr} (75%)
-
-diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr
-deleted file mode 100644
-index fc68207512c0..000000000000
---- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr
-+++ /dev/null
-@@ -1,20 +0,0 @@
--error[E0080]: it is undefined behavior to use this value
--  --> $DIR/mut_ref_in_final_dynamic_check.rs:15:1
--   |
--LL | const A: Option<&mut i32> = helper();
--   | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered mutable reference in a `const` or `static`
--   |
--   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
--   = note: the raw bytes of the constant (size: 8, align: 8) {
--               2a 00 00 00 00 00 00 00                         │ *.......
--           }
--
--error: encountered dangling pointer in final value of constant
--  --> $DIR/mut_ref_in_final_dynamic_check.rs:22:1
--   |
--LL | const B: Option<&mut i32> = helper2();
--   | ^^^^^^^^^^^^^^^^^^^^^^^^^
--
--error: aborting due to 2 previous errors
--
--For more information about this error, try `rustc --explain E0080`.
-diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
-index 455b557b97c4..b98f4d920694 100644
---- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
-+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
-@@ -1,4 +1,5 @@
--// stderr-per-bitwidth
-+// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
-+// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?()?─*╼ )+ *│.*" -> "HEX_DUMP"
- #![feature(const_mut_refs)]
- #![feature(raw_ref_op)]
- 
-diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
-similarity index 75%
-rename from tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr
-rename to tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
-index 87420a037514..bb3c5518680b 100644
---- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr
-+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
-@@ -1,16 +1,16 @@
- error[E0080]: it is undefined behavior to use this value
--  --> $DIR/mut_ref_in_final_dynamic_check.rs:15:1
-+  --> $DIR/mut_ref_in_final_dynamic_check.rs:16:1
-    |
- LL | const A: Option<&mut i32> = helper();
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered mutable reference in a `const` or `static`
-    |
-    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
--   = note: the raw bytes of the constant (size: 4, align: 4) {
--               2a 00 00 00                                     │ *...
-+   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
-+               HEX_DUMP
-            }
- 
- error: encountered dangling pointer in final value of constant
--  --> $DIR/mut_ref_in_final_dynamic_check.rs:22:1
-+  --> $DIR/mut_ref_in_final_dynamic_check.rs:23:1
-    |
- LL | const B: Option<&mut i32> = helper2();
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^
--- 
-2.44.0
-
diff --git a/0001-test-don-t-compress-test-registry-crates.patch b/0001-test-don-t-compress-test-registry-crates.patch
index 60f2f27..a8bdd0c 100644
--- a/0001-test-don-t-compress-test-registry-crates.patch
+++ b/0001-test-don-t-compress-test-registry-crates.patch
@@ -1,4 +1,4 @@
-From ed8e223cc58103cae0586351fd9113a727523cab Mon Sep 17 00:00:00 2001
+From a70f23c50b61c1a3335f2943375a04ae7abf2fa4 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 11 Apr 2024 14:58:42 -0700
 Subject: [PATCH] test: don't compress test registry crates
@@ -7,8 +7,6 @@ They are still nominally gzipped, but using `Compression::none()` makes
 them consistent even across zlib and zlib-ng, and this fixes checksum
 differences in the testsuite. There is a one-time update of all those
 checksums to catch up with this change though.
-
-(cherry picked from commit a70f23c50b61c1a3335f2943375a04ae7abf2fa4)
 ---
  crates/cargo-test-support/src/registry.rs        |  2 +-
  tests/testsuite/alt_registry.rs                  |  2 +-
@@ -20,7 +18,7 @@ checksums to catch up with this change though.
  7 files changed, 20 insertions(+), 20 deletions(-)
 
 diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs
-index cc51707dbbf9..e27d1e354d7b 100644
+index e65baeab17d7..f8b4b1447822 100644
 --- a/crates/cargo-test-support/src/registry.rs
 +++ b/crates/cargo-test-support/src/registry.rs
 @@ -1469,7 +1469,7 @@ impl Package {
@@ -33,10 +31,10 @@ index cc51707dbbf9..e27d1e354d7b 100644
          if !self
              .files
 diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
-index f286dc018122..42b818493244 100644
+index e122199baa41..fb88105374a2 100644
 --- a/tests/testsuite/alt_registry.rs
 +++ b/tests/testsuite/alt_registry.rs
-@@ -1466,7 +1466,7 @@ dependencies = [
+@@ -1493,7 +1493,7 @@ dependencies = [
  name = "foo"
  version = "0.1.0"
  source = "sparse+http://[..]/"
diff --git a/0002-Use-env-split_paths-join_paths-in-runtest.patch b/0002-Use-env-split_paths-join_paths-in-runtest.patch
new file mode 100644
index 0000000..b1f9311
--- /dev/null
+++ b/0002-Use-env-split_paths-join_paths-in-runtest.patch
@@ -0,0 +1,63 @@
+From 642e12326055268c7605b31e7f91edf8f58e54d4 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Thu, 11 Apr 2024 15:33:44 -0700
+Subject: [PATCH 2/2] Use `env::split_paths`/`join_paths` in runtest
+
+(cherry picked from commit 7e171c72cbddb0636fa8ce71a0e862486ae72625)
+---
+ src/tools/compiletest/src/runtest.rs | 31 ++++++++++++++--------------
+ 1 file changed, 15 insertions(+), 16 deletions(-)
+
+diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
+index 3c775ea0651c..852ffa0a62a8 100644
+--- a/src/tools/compiletest/src/runtest.rs
++++ b/src/tools/compiletest/src/runtest.rs
+@@ -3767,10 +3767,13 @@ fn run_rmake_v2_test(&self) {
+         debug!(?support_lib_deps);
+         debug!(?support_lib_deps_deps);
+ 
+-        let mut host_dylib_env_paths = String::new();
+-        host_dylib_env_paths.push_str(&cwd.join(&self.config.compile_lib_path).to_string_lossy());
+-        host_dylib_env_paths.push(':');
+-        host_dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
++        let orig_dylib_env_paths =
++            Vec::from_iter(env::split_paths(&env::var(dylib_env_var()).unwrap()));
++
++        let mut host_dylib_env_paths = Vec::new();
++        host_dylib_env_paths.push(cwd.join(&self.config.compile_lib_path));
++        host_dylib_env_paths.extend(orig_dylib_env_paths.iter().cloned());
++        let host_dylib_env_paths = env::join_paths(host_dylib_env_paths).unwrap();
+ 
+         let res = self.cmd2procres(
+             Command::new(&self.config.rustc_path)
+@@ -3810,19 +3813,15 @@ fn run_rmake_v2_test(&self) {
+         // Finally, we need to run the recipe binary to build and run the actual tests.
+         debug!(?recipe_bin);
+ 
+-        let mut dylib_env_paths = String::new();
+-        dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
+-        dylib_env_paths.push(':');
+-        dylib_env_paths.push_str(&support_lib_path.parent().unwrap().to_string_lossy());
+-        dylib_env_paths.push(':');
+-        dylib_env_paths.push_str(
+-            &stage_std_path.join("rustlib").join(&self.config.host).join("lib").to_string_lossy(),
+-        );
++        let mut dylib_env_paths = orig_dylib_env_paths.clone();
++        dylib_env_paths.push(support_lib_path.parent().unwrap().to_path_buf());
++        dylib_env_paths.push(stage_std_path.join("rustlib").join(&self.config.host).join("lib"));
++        let dylib_env_paths = env::join_paths(dylib_env_paths).unwrap();
+ 
+-        let mut target_rpath_env_path = String::new();
+-        target_rpath_env_path.push_str(&tmpdir.to_string_lossy());
+-        target_rpath_env_path.push(':');
+-        target_rpath_env_path.push_str(&dylib_env_paths);
++        let mut target_rpath_env_path = Vec::new();
++        target_rpath_env_path.push(&tmpdir);
++        target_rpath_env_path.extend(&orig_dylib_env_paths);
++        let target_rpath_env_path = env::join_paths(target_rpath_env_path).unwrap();
+ 
+         let mut cmd = Command::new(&recipe_bin);
+         cmd.current_dir(&self.testpaths.file)
+-- 
+2.44.0
+
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index e2da2fe..34ab22a 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,19 +1,19 @@
-From 79bb610c8fc5d9df7dd4720ae847b8f17e7b1ad4 Mon Sep 17 00:00:00 2001
+From e3b7d2e3d3b4fcbc6591de606957c0fd59b5e547 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:18:16 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
 
 ---
- compiler/rustc_codegen_ssa/src/back/link.rs           | 9 +++++++++
- compiler/rustc_target/src/spec/mod.rs                 | 2 ++
- compiler/rustc_target/src/spec/targets/wasm32_wasi.rs | 6 +++++-
- 3 files changed, 16 insertions(+), 1 deletion(-)
+ compiler/rustc_codegen_ssa/src/back/link.rs             | 9 +++++++++
+ compiler/rustc_target/src/spec/mod.rs                   | 4 ++++
+ compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++---
+ 3 files changed, 17 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index dd9d277fb775..3d0f0502f255 100644
+index f5e8d5fc92a9..f4ad3f725427 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1496,6 +1496,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1563,6 +1563,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -26,7 +26,7 @@ index dd9d277fb775..3d0f0502f255 100644
      for search_path in fs.search_paths() {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -1982,6 +1988,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
+@@ -2049,6 +2055,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
          let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
          cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
      }
@@ -37,10 +37,10 @@ index dd9d277fb775..3d0f0502f255 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index f04799482c83..25410b37ba24 100644
+index 941d767b850d..cd0a2ce51989 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -1874,6 +1874,7 @@ pub struct TargetOptions {
+@@ -1881,6 +1881,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -48,7 +48,7 @@ index f04799482c83..25410b37ba24 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2352,6 +2353,7 @@ fn default() -> TargetOptions {
+@@ -2368,6 +2369,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -56,23 +56,42 @@ index f04799482c83..25410b37ba24 100644
              pre_link_objects_self_contained: Default::default(),
              post_link_objects_self_contained: Default::default(),
              link_self_contained: LinkSelfContainedDefault::False,
-diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs
-index 6dbcb01ea436..2151f86d0648 100644
---- a/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs
-+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs
-@@ -86,7 +86,11 @@ pub fn target() -> Target {
-     options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();
+@@ -3064,6 +3066,7 @@ macro_rules! key {
+         key!(linker_is_gnu_json = "linker-is-gnu", bool);
+         key!(pre_link_objects = "pre-link-objects", link_objects);
+         key!(post_link_objects = "post-link-objects", link_objects);
++        key!(external_lib_path, optional);
+         key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
+         key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
+         // Deserializes the backwards-compatible variants of `-Clink-self-contained`
+@@ -3327,6 +3330,7 @@ macro_rules! target_option_val {
+         target_option_val!(linker_is_gnu_json, "linker-is-gnu");
+         target_option_val!(pre_link_objects);
+         target_option_val!(post_link_objects);
++        target_option_val!(external_lib_path);
+         target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback");
+         target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
+         target_option_val!(link_args - pre_link_args_json, "pre-link-args");
+diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
+index 7cbe9f09e6ca..b524890c2ec5 100644
+--- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
++++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
+@@ -20,11 +20,12 @@ pub fn target() -> Target {
+     options.os = "wasi".into();
+     options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]);
+ 
+-    options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained();
+-    options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();
++    options.pre_link_objects = crt_objects::pre_wasi_self_contained();
++    options.post_link_objects = crt_objects::post_wasi_self_contained();
  
      // FIXME: Figure out cases in which WASM needs to link with a native toolchain.
 -    options.link_self_contained = LinkSelfContainedDefault::True;
 +    options.link_self_contained = LinkSelfContainedDefault::False;
-+
-+    options.pre_link_objects = options.pre_link_objects_self_contained.clone();
-+    options.post_link_objects = options.post_link_objects_self_contained.clone();
 +    options.external_lib_path = Some("/usr/wasm32-wasi/lib/wasm32-wasi".into());
  
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.41.0
+2.44.0
 
diff --git a/120529.patch b/120529.patch
deleted file mode 100644
index 9e53295..0000000
--- a/120529.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 8eb48b4f4c6e3d48f2600159a75184ec4d74b249 Mon Sep 17 00:00:00 2001
-From: Nikita Popov 
-Date: Wed, 31 Jan 2024 15:08:08 +0100
-Subject: [PATCH] Update data layouts in custom target tests for LLVM 18
-
-Fixes https://github.com/rust-lang/rust/issues/120492.
----
- tests/run-make/rust-lld-custom-target/custom-target.json        | 2 +-
- tests/run-make/rustdoc-target-spec-json-path/target.json        | 2 +-
- tests/run-make/target-specs/my-awesome-platform.json            | 2 +-
- .../target-specs/my-x86_64-unknown-linux-gnu-platform.json      | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/tests/run-make/rust-lld-custom-target/custom-target.json b/tests/run-make/rust-lld-custom-target/custom-target.json
-index 7828a99f235c1..e2c64cbdb43c2 100644
---- a/tests/run-make/rust-lld-custom-target/custom-target.json
-+++ b/tests/run-make/rust-lld-custom-target/custom-target.json
-@@ -2,7 +2,7 @@
-   "arch": "x86_64",
-   "cpu": "x86-64",
-   "crt-static-respected": true,
--  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
-+  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
-   "dynamic-linking": true,
-   "env": "gnu",
-   "has-rpath": true,
-diff --git a/tests/run-make/rustdoc-target-spec-json-path/target.json b/tests/run-make/rustdoc-target-spec-json-path/target.json
-index 34357182c205e..c478f1196fae0 100644
---- a/tests/run-make/rustdoc-target-spec-json-path/target.json
-+++ b/tests/run-make/rustdoc-target-spec-json-path/target.json
-@@ -2,7 +2,7 @@
-   "arch": "x86_64",
-   "cpu": "x86-64",
-   "crt-static-respected": true,
--  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
-+  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
-   "dynamic-linking": true,
-   "env": "gnu",
-   "executables": true,
-diff --git a/tests/run-make/target-specs/my-awesome-platform.json b/tests/run-make/target-specs/my-awesome-platform.json
-index 00de3de05f07a..1673ef7bd54d1 100644
---- a/tests/run-make/target-specs/my-awesome-platform.json
-+++ b/tests/run-make/target-specs/my-awesome-platform.json
-@@ -1,5 +1,5 @@
- {
--    "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128",
-+    "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
-     "linker-flavor": "gcc",
-     "llvm-target": "i686-unknown-linux-gnu",
-     "target-endian": "little",
-diff --git a/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
-index 6d5e964ed4fee..0cafce15a9fef 100644
---- a/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
-+++ b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
-@@ -1,6 +1,6 @@
- {
-     "pre-link-args": {"gcc": ["-m64"]},
--    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
-+    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
-     "linker-flavor": "gcc",
-     "llvm-target": "x86_64-unknown-linux-gnu",
-     "target-endian": "little",
diff --git a/121088.patch b/121088.patch
deleted file mode 100644
index af436d2..0000000
--- a/121088.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 369fff6c0640fe89be9b915adaa83e66a022e00d Mon Sep 17 00:00:00 2001
-From: Nikita Popov 
-Date: Wed, 14 Feb 2024 16:26:20 +0100
-Subject: [PATCH] Implicitly enable evex512 if avx512 is enabled
-
-LLVM 18 requires the evex512 feature to allow use of zmm registers.
-LLVM automatically sets it when using a generic CPU, but not when
-`-C target-cpu` is specified. This will result either in backend
-legalization crashes, or code unexpectedly using ymm instead of
-zmm registers.
-
-For now, make sure that `avx512*` features imply `evex512`. Long
-term we'll probably have to deal with the AVX10 mess somehow.
----
- compiler/rustc_codegen_llvm/src/llvm_util.rs    |  4 ++++
- tests/ui/asm/x86_64/evex512-implicit-feature.rs | 15 +++++++++++++++
- 2 files changed, 19 insertions(+)
- create mode 100644 tests/ui/asm/x86_64/evex512-implicit-feature.rs
-
-diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
-index e48479c8da279..54e8ed85e3250 100644
---- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
-+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
-@@ -266,6 +266,10 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> LLVMFeature<'a> {
-         ("riscv32" | "riscv64", "fast-unaligned-access") if get_version().0 <= 17 => {
-             LLVMFeature::new("unaligned-scalar-mem")
-         }
-+        // For LLVM 18, enable the evex512 target feature if a avx512 target feature is enabled.
-+        ("x86", s) if get_version().0 >= 18 && s.starts_with("avx512") => {
-+            LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512"))
-+        }
-         (_, s) => LLVMFeature::new(s),
-     }
- }
-diff --git a/tests/ui/asm/x86_64/evex512-implicit-feature.rs b/tests/ui/asm/x86_64/evex512-implicit-feature.rs
-new file mode 100644
-index 0000000000000..a15060857eccb
---- /dev/null
-+++ b/tests/ui/asm/x86_64/evex512-implicit-feature.rs
-@@ -0,0 +1,15 @@
-+// build-pass
-+// only-x86_64
-+// compile-flags: --crate-type=lib -C target-cpu=skylake
-+
-+#![feature(avx512_target_feature)]
-+#![feature(stdsimd)]
-+
-+use std::arch::x86_64::*;
-+
-+#[target_feature(enable = "avx512f")]
-+#[no_mangle]
-+pub unsafe fn test(res: *mut f64, p: *const f64) {
-+    let arg = _mm512_load_pd(p);
-+    _mm512_store_pd(res, _mm512_fmaddsub_pd(arg, arg, arg));
-+}
diff --git a/rust.spec b/rust.spec
index d608a8a..7a56a2c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.77.2
+Version:        1.78.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.76.0
-%global bootstrap_channel 1.76.0
-%global bootstrap_date 2024-02-08
+%global bootstrap_version 1.77.0
+%global bootstrap_channel 1.77.0
+%global bootstrap_date 2024-03-21
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -32,7 +32,9 @@ ExclusiveArch:  %{rust_arches}
 %if 0%{?fedora}
 %global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu
 %endif
-%global wasm_targets wasm32-unknown-unknown wasm32-wasi
+# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1
+# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
+%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1
 %if 0%{?fedora} || 0%{?rhel} >= 10
 %global extra_targets x86_64-unknown-none x86_64-unknown-uefi
 %endif
@@ -63,9 +65,9 @@ ExclusiveArch:  %{rust_arches}
 %bcond_with llvm_static
 
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
-# is insufficient.  Rust currently requires LLVM 15.0+.
-%global min_llvm_version 15.0.0
-%global bundled_llvm_version 17.0.6
+# is insufficient.  Rust currently requires LLVM 16.0+.
+%global min_llvm_version 16.0.0
+%global bundled_llvm_version 18.1.2
 #global llvm_compat_version 17
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -83,7 +85,7 @@ ExclusiveArch:  %{rust_arches}
 
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
-%global bundled_sqlite3_version 3.44.0
+%global bundled_sqlite3_version 3.45.0
 %if 0%{?rhel} && 0%{?rhel} < 10
 %bcond_without bundled_sqlite3
 %else
@@ -149,26 +151,32 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.77.0-unbundle-sqlite.patch
-
-# Backports of fixes for LLVM 18 compatibility
-Patch7:         120529.patch
-Patch8:         121088.patch
+Patch6:         rustc-1.78.0-unbundle-sqlite.patch
 
 # https://github.com/rust-lang/rust/pull/123520
-Patch9:         0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
+Patch7:         0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
 
 # https://github.com/rust-lang/rust/pull/123652
-Patch10:        0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
+Patch8:         0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
 
-# https://github.com/rust-lang/rust/pull/121179 (partial)
-Patch11:        0001-remove-stderr-per-bitwidth-from-some-tests.patch
+# https://github.com/rust-lang/rust/pull/122270
+Patch9:         0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
+
+# https://github.com/rust-lang/rust/pull/123763
+Patch10:        0001-Set-the-host-library-path-in-run-make-v2.patch
+Patch11:        0002-Use-env-split_paths-join_paths-in-runtest.patch
+
+# https://github.com/rust-lang/rust/pull/124597
+Patch12:        0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
 
 # https://github.com/rust-lang/cargo/pull/13744
-Patch12:        0001-test-don-t-compress-test-registry-crates.patch
+Patch20:        0001-test-don-t-compress-test-registry-crates.patch
+
+# https://github.com/rust-lang/cargo/pull/13789
+Patch21:        0001-Fix-2-tests-for-offline-execution.patch
 
 # https://github.com/rust-lang/rust-clippy/pull/12682
-Patch13:        0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
+Patch30:        0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
 
 ### RHEL-specific patches below ###
 
@@ -179,7 +187,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.77.0-disable-libssh2.patch
+Patch100:       rustc-1.78.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -436,6 +444,18 @@ BuildArch:      noarch
 %target_description wasm32-wasi WebAssembly
 %endif
 
+%if %target_enabled wasm32-wasip1
+%target_package wasm32-wasip1
+Requires:       lld >= 8.0
+%if %with bundled_wasi_libc
+Provides:       bundled(wasi-libc)
+%else
+Requires:       wasi-libc-static
+%endif
+BuildArch:      noarch
+%target_description wasm32-wasip1 WebAssembly
+%endif
+
 %if %target_enabled x86_64-unknown-none
 %target_package x86_64-unknown-none
 Requires:       lld
@@ -647,8 +667,12 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P9 -p1
 %patch -P10 -p1
 %patch -P11 -p1
-%patch -P12 -p1 -d src/tools/cargo
-%patch -P13 -p1 -d src/tools/clippy
+%patch -P12 -p1
+
+%patch -P20 -p1 -d src/tools/cargo
+%patch -P21 -p1 -d src/tools/cargo
+
+%patch -P30 -p1 -d src/tools/clippy
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -769,11 +793,16 @@ fi
 %if %defined wasm_targets
 %if %with bundled_wasi_libc
 %make_build --quiet -C %{wasi_libc_dir} MALLOC_IMPL=emmalloc CC=clang AR=llvm-ar NM=llvm-nm
-%define wasm_target_config --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot
+%define wasm_target_config %{shrink:
+  --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot
+  --set target.wasm32-wasip1.wasi-root=%{wasi_libc_dir}/sysroot
+}
 %else
 %define wasm_target_config %{shrink:
   --set target.wasm32-wasi.wasi-root=%{_prefix}/wasm32-wasi
   --set target.wasm32-wasi.self-contained=false
+  --set target.wasm32-wasip1.wasi-root=%{_prefix}/wasm32-wasi
+  --set target.wasm32-wasip1.self-contained=false
 }
 %endif
 %endif
@@ -793,6 +822,7 @@ fi
 test -r "%{profiler}"
 
 %configure --disable-option-checking \
+  --docdir=%{_pkgdocdir} \
   --libdir=%{common_libdir} \
   --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
   --set target.%{rust_triple}.linker=%{__cc} \
@@ -822,7 +852,6 @@ test -r "%{profiler}"
   --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \
   --enable-vendor \
   --enable-verbose-tests \
-  --dist-compression-formats=gz \
   --release-channel=%{channel} \
   --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}"
 
@@ -911,17 +940,17 @@ find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
 find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
 
 # Remove unwanted documentation files (we already package them)
-rm -f %{buildroot}%{_docdir}/%{name}/README.md
-rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
-rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
-rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
-rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
-rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
-rm -f %{buildroot}%{_docdir}/%{name}/*.old
+rm -f %{buildroot}%{_pkgdocdir}/README.md
+rm -f %{buildroot}%{_pkgdocdir}/COPYRIGHT
+rm -f %{buildroot}%{_pkgdocdir}/LICENSE
+rm -f %{buildroot}%{_pkgdocdir}/LICENSE-APACHE
+rm -f %{buildroot}%{_pkgdocdir}/LICENSE-MIT
+rm -f %{buildroot}%{_pkgdocdir}/LICENSE-THIRD-PARTY
+rm -f %{buildroot}%{_pkgdocdir}/*.old
 
 # Sanitize the HTML documentation
-find %{buildroot}%{_docdir}/%{name}/html -empty -delete
-find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
+find %{buildroot}%{_pkgdocdir}/html -empty -delete
+find %{buildroot}%{_pkgdocdir}/html -type f -exec chmod -x '{}' '+'
 
 # Create the path for crate-devel packages
 mkdir -p %{buildroot}%{_datadir}/cargo/registry
@@ -977,7 +1006,11 @@ rm -rf "$TMP_HELLO"
 %{__x} test --no-fail-fast --skip src/bootstrap || :
 rm -rf "./build/%{rust_triple}/test/"
 
-%{__x} test --no-fail-fast cargo || :
+%ifarch aarch64
+# https://github.com/rust-lang/rust/issues/123733
+%define cargo_test_skip --test-args "--skip panic_abort_doc_tests"
+%endif
+%{__x} test --no-fail-fast cargo %{?cargo_test_skip} || :
 rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 %{__x} test --no-fail-fast clippy || :
@@ -1045,6 +1078,15 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %endif
 %endif
 
+%if %target_enabled wasm32-wasip1
+%target_files wasm32-wasip1
+%if %with bundled_wasi_libc
+%dir %{rustlibdir}/wasm32-wasip1/lib/self-contained
+%{rustlibdir}/wasm32-wasip1/lib/self-contained/crt*.o
+%{rustlibdir}/wasm32-wasip1/lib/self-contained/libc.a
+%endif
+%endif
+
 %if %target_enabled x86_64-unknown-none
 %target_files x86_64-unknown-none
 %endif
@@ -1076,9 +1118,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %files doc
-%docdir %{_docdir}/%{name}
-%dir %{_docdir}/%{name}
-%{_docdir}/%{name}/html
+%docdir %{_pkgdocdir}
+%dir %{_pkgdocdir}
+%{_pkgdocdir}/html
 # former cargo-doc
 %docdir %{_docdir}/cargo
 %dir %{_docdir}/cargo
diff --git a/rustc-1.77.0-unbundle-sqlite.patch b/rustc-1.77.0-unbundle-sqlite.patch
deleted file mode 100644
index 50aa4a8..0000000
--- a/rustc-1.77.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-02-14 13:00:20.318976752 +0100
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-02-14 13:00:28.447051475 +0100
-@@ -2110,7 +2110,6 @@ version = "0.27.0"
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-02-14 13:00:14.942927327 +0100
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-02-14 13:00:40.688164017 +0100
-@@ -77,7 +77,7 @@ proptest = "1.4.0"
- pulldown-cmark = { version = "0.9.3", default-features = false }
- rand = "0.8.5"
- regex = "1.10.2"
--rusqlite = { version = "0.30.0", features = ["bundled"] }
-+rusqlite = { version = "0.30.0", features = [] }
- rustfix = { version = "0.8.0", path = "crates/rustfix" }
- same-file = "1.0.6"
- security-framework = "2.9.2"
diff --git a/rustc-1.77.0-disable-libssh2.patch b/rustc-1.78.0-disable-libssh2.patch
similarity index 61%
rename from rustc-1.77.0-disable-libssh2.patch
rename to rustc-1.78.0-disable-libssh2.patch
index 859fecb..3fec448 100644
--- a/rustc-1.77.0-disable-libssh2.patch
+++ b/rustc-1.78.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-02-14 14:06:05.881165093 +0100
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-02-14 14:06:27.169456166 +0100
-@@ -2072,7 +2072,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-04-04 15:01:24.003038403 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-04-04 15:01:24.005038377 -0700
+@@ -2111,7 +2111,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2113,20 +2112,6 @@ dependencies = [
+@@ -2152,20 +2151,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -31,14 +31,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  [[package]]
  name = "libz-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-02-14 14:06:10.400226884 +0100
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-02-14 14:06:51.225785086 +0100
-@@ -44,7 +44,7 @@ curl = "0.4.44"
- curl-sys = "0.4.70"
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-04-04 15:01:24.005038377 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-04-04 15:02:15.816367069 -0700
+@@ -44,7 +44,7 @@ curl = "0.4.46"
+ curl-sys = "0.4.72"
  filetime = "0.2.23"
  flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
 -git2 = "0.18.2"
 +git2 = { version = "0.18.2", default-features = false, features = ["https"] }
  git2-curl = "0.19.0"
- gix = { version = "0.57.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
- gix-features-for-configuration-only = { version = "0.37.1", package = "gix-features", features = [ "parallel" ] }
+ gix = { version = "0.58.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
+ gix-features-for-configuration-only = { version = "0.38.0", package = "gix-features", features = [ "parallel" ] }
diff --git a/rustc-1.78.0-unbundle-sqlite.patch b/rustc-1.78.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..b02529f
--- /dev/null
+++ b/rustc-1.78.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-04-04 14:54:45.433205012 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-04-04 14:55:51.949342725 -0700
+@@ -2149,7 +2149,6 @@ version = "0.28.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-04-04 14:54:45.433205012 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-04-04 14:55:35.823551771 -0700
+@@ -77,7 +77,7 @@ proptest = "1.4.0"
+ pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] }
+ rand = "0.8.5"
+ regex = "1.10.3"
+-rusqlite = { version = "0.31.0", features = ["bundled"] }
++rusqlite = { version = "0.31.0", features = [] }
+ rustfix = { version = "0.8.2", path = "crates/rustfix" }
+ same-file = "1.0.6"
+ security-framework = "2.9.2"
diff --git a/sources b/sources
index aa7b40c..365a648 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.77.2-src.tar.xz) = ab099a5e545892f145af9f4c21f41693463248697accf1c92d9afbe6c711639c3859e89c1bb99b84854c462784cc5970fb84dd7c89260ff92174e3684f76920c
+SHA512 (rustc-1.78.0-src.tar.xz) = d2fb9881e28849d871fda71b1b51652be3839b3283f0d32163f258c5c707a9fb7b589da8dc03bca2fefee1abdd2b44a5f17e85d8c6df7bea119d1e8d22371941
 SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045

From e2464021a8b3170ead9164d90eed065c121ec123 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Fri, 17 May 2024 12:05:26 -0700
Subject: [PATCH 24/86] Write cargo configuration to .cargo/config.toml instead
 of .cargo/config

(Synced from rust-packaging into rust-toolset.)

Co-authored-by: Fabio Valentini 

[skip changelog]
---
 macros.rust-toolset | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/macros.rust-toolset b/macros.rust-toolset
index 396f6c3..135b3e2 100644
--- a/macros.rust-toolset
+++ b/macros.rust-toolset
@@ -48,7 +48,7 @@
 
 # __cargo: cargo command with environment variables
 #
-# CARGO_HOME: This ensures cargo reads configuration file from .cargo/config,
+# CARGO_HOME: This ensures cargo reads configuration file from .cargo/config.toml,
 #       and prevents writing any files to $HOME during RPM builds.
 %__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
 
@@ -61,7 +61,7 @@
 #
 # This involves four steps:
 # - create the ".cargo" directory if it doesn't exist yet
-# - dump custom cargo configuration into ".cargo/config"
+# - dump custom cargo configuration into ".cargo/config.toml"
 # - remove "Cargo.lock" if it exists (it breaks builds with custom cargo config)
 # - remove "Cargo.toml.orig" if it exists (it breaks running "cargo package")
 #
@@ -79,7 +79,7 @@ set -euo pipefail\
 /usr/bin/ln -s rpm target/release\
 %{__rm} -rf .cargo/\
 %{__mkdir} -p .cargo\
-cat > .cargo/config << EOF\
+cat > .cargo/config.toml << EOF\
 [build]\
 rustc = "%{__rustc}"\
 rustdoc = "%{__rustdoc}"\
@@ -104,7 +104,7 @@ verbose = true\
 EOF\
 %{-V:%{__tar} -xoaf %{S:%{-V*}}}\
 %{!?-N:\
-cat >> .cargo/config << EOF\
+cat >> .cargo/config.toml << EOF\
 [source.vendored-sources]\
 directory = "%{-v*}%{-V:./vendor}"\
 \

From 42d132a7af69ffbd66e652e245ed3d3db166adf6 Mon Sep 17 00:00:00 2001
From: Yaakov Selkowitz 
Date: Tue, 28 May 2024 18:53:37 -0400
Subject: [PATCH 25/86] rust-toolset Requires: rust-toolset-srpm-macros

This should prevent rust-toolset and rust-packaging from mixing in ELN.
---
 rust.spec | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rust.spec b/rust.spec
index 7a56a2c..b0b4deb 100644
--- a/rust.spec
+++ b/rust.spec
@@ -623,6 +623,8 @@ Summary:        Rust Toolset
 BuildArch:      noarch
 Requires:       rust = %{version}-%{release}
 Requires:       cargo = %{version}-%{release}
+Requires:       rust-toolset-srpm-macros = %{version}-%{release}
+Conflicts:      cargo-rpm-macros
 
 %description toolset
 This is the metapackage for Rust Toolset, bringing in the Rust compiler,

From 2e8923ba1c2a4e3043a8442628c6ba856f950095 Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Mon, 6 May 2024 14:14:59 +0900
Subject: [PATCH 26/86] Update to 1.79.0

python3-rpm is added (temporarily) to work around
https://bugzilla.redhat.com/show_bug.cgi?id=2275274.

The binutils-gold dependency is needed for one test. Previously
binutils implicitly dependend on binutils-gold.

Backport https://github.com/rust-lang/rust/pull/126263 to fix
one codegen test failure on s390x.

There are some additional test failures on ppc64le and s390x for
which I have filed https://github.com/rust-lang/rust/issues/126260
and https://github.com/rust-lang/rust/issues/126261.
---
 .gitignore                                    |   1 +
 0001-Fix-2-tests-for-offline-execution.patch  |  59 -----
 ...ests-with-dist-vendored-dependencies.patch |  49 ----
 ...ssue-122805.rs-big-endian-compatible.patch |  49 ++++
 ...the-host-library-path-in-run-make-v2.patch |  79 ------
 ..._unsafe_ops_per_block-test-needs-asm.patch | 232 ------------------
 ...-all-of-rustc-s-flags-to-rustc_cargo.patch | 198 ---------------
 ...command-lines-failure-caused-by-rust.patch |  27 --
 ...-don-t-compress-test-registry-crates.patch | 183 --------------
 ...nv-split_paths-join_paths-in-runtest.patch |  63 -----
 rust.spec                                     |  55 ++---
 ...atch => rustc-1.79.0-disable-libssh2.patch |  20 +-
 ...atch => rustc-1.79.0-unbundle-sqlite.patch |  16 +-
 sources                                       |   2 +-
 14 files changed, 86 insertions(+), 947 deletions(-)
 delete mode 100644 0001-Fix-2-tests-for-offline-execution.patch
 delete mode 100644 0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
 create mode 100644 0001-Make-issue-122805.rs-big-endian-compatible.patch
 delete mode 100644 0001-Set-the-host-library-path-in-run-make-v2.patch
 delete mode 100644 0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
 delete mode 100644 0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
 delete mode 100644 0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
 delete mode 100644 0001-test-don-t-compress-test-registry-crates.patch
 delete mode 100644 0002-Use-env-split_paths-join_paths-in-runtest.patch
 rename rustc-1.78.0-disable-libssh2.patch => rustc-1.79.0-disable-libssh2.patch (52%)
 rename rustc-1.78.0-unbundle-sqlite.patch => rustc-1.79.0-unbundle-sqlite.patch (57%)

diff --git a/.gitignore b/.gitignore
index 7632c62..4dff5bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -435,3 +435,4 @@
 /rustc-1.77.0-src.tar.xz
 /rustc-1.77.2-src.tar.xz
 /rustc-1.78.0-src.tar.xz
+/rustc-1.79.0-src.tar.xz
diff --git a/0001-Fix-2-tests-for-offline-execution.patch b/0001-Fix-2-tests-for-offline-execution.patch
deleted file mode 100644
index 49688cf..0000000
--- a/0001-Fix-2-tests-for-offline-execution.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 6dda4e006b0d6d7519ac4a9f540566c81e406a8b Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Mon, 22 Apr 2024 16:19:17 -0700
-Subject: [PATCH] Fix 2 tests for offline execution
-
-In `alt_registry::warn_for_unused_fields`, the second part of the test
-runs on `--registry crates-io`, so it needs a local replacement url.
-
-In `install::install_global_cargo_config`, it was adding to the "config"
-file, but the `pkg` before it configured the dummy registry replacement
-in "config.toml". So that replacement wasn't actually used, and if you
-ran tests online it was trying to install `bar v0.1.1` from the real
-registry! The filename is now fixed, and the test double-checks that
-we're only trying to install the local `bar v0.0.1`.
----
- tests/testsuite/alt_registry.rs | 4 ++++
- tests/testsuite/install.rs      | 3 ++-
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
-index e95f2cbaabbd..1fef04e3ae42 100644
---- a/tests/testsuite/alt_registry.rs
-+++ b/tests/testsuite/alt_registry.rs
-@@ -1572,7 +1572,11 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN",
-         )
-         .run();
- 
-+    let crates_io = registry::RegistryBuilder::new()
-+        .no_configure_token()
-+        .build();
-     p.cargo("publish --registry crates-io")
-+        .replace_crates_io(crates_io.index_url())
-         .with_status(101)
-         .with_stderr(
-             "\
-diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs
-index 89d40ada9543..ef3f4f3ae604 100644
---- a/tests/testsuite/install.rs
-+++ b/tests/testsuite/install.rs
-@@ -1981,7 +1981,7 @@ fn install_ignores_unstable_table_in_local_cargo_config() {
- fn install_global_cargo_config() {
-     pkg("bar", "0.0.1");
- 
--    let config = cargo_home().join("config");
-+    let config = cargo_home().join("config.toml");
-     let mut toml = fs::read_to_string(&config).unwrap_or_default();
- 
-     toml.push_str(
-@@ -1994,6 +1994,7 @@ fn install_global_cargo_config() {
- 
-     cargo_process("install bar")
-         .with_status(101)
-+        .with_stderr_contains("[INSTALLING] bar v0.0.1")
-         .with_stderr_contains("[..]--target nonexistent[..]")
-         .run();
- }
--- 
-2.44.0
-
diff --git a/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch b/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
deleted file mode 100644
index 82c6c35..0000000
--- a/0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Mon, 8 Apr 2024 15:04:44 -0700
-Subject: [PATCH] Fix UI tests with dist-vendored dependencies
-
-There is already a workaround in `compiletest` to deal with custom
-`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`.
-A similar need exists when dependencies come from the local `vendor`
-directory, which distro builds often use, so now we ignore that too.
-
-Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
-expecting a version suffix, but the vendored path doesn't include the
-version. Now that matches `[\\/]hashbrown` instead.
----
- src/tools/compiletest/src/runtest.rs | 5 +++++
- tests/ui/issues/issue-21763.rs       | 2 +-
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
-index bb8509fe4137..770496289e2e 100644
---- a/src/tools/compiletest/src/runtest.rs
-+++ b/src/tools/compiletest/src/runtest.rs
-@@ -2354,6 +2354,11 @@ fn make_compile_args(
-             "ignore-directory-in-diagnostics-source-blocks={}",
-             home::cargo_home().expect("failed to find cargo home").to_str().unwrap()
-         ));
-+        // Similarly, vendored sources shouldn't be shown when running from a dist tarball.
-+        rustc.arg("-Z").arg(format!(
-+            "ignore-directory-in-diagnostics-source-blocks={}",
-+            self.config.find_rust_src_root().unwrap().join("vendor").display(),
-+        ));
- 
-         // Optionally prevent default --sysroot if specified in test compile-flags.
-         if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
-diff --git a/tests/ui/issues/issue-21763.rs b/tests/ui/issues/issue-21763.rs
-index a349253063c0..1d0a0705cbbd 100644
---- a/tests/ui/issues/issue-21763.rs
-+++ b/tests/ui/issues/issue-21763.rs
-@@ -1,6 +1,6 @@
- // Regression test for HashMap only impl'ing Send/Sync if its contents do
- 
--//@ normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"
-+//@ normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"
- 
- use std::collections::HashMap;
- use std::rc::Rc;
--- 
-2.44.0
-
diff --git a/0001-Make-issue-122805.rs-big-endian-compatible.patch b/0001-Make-issue-122805.rs-big-endian-compatible.patch
new file mode 100644
index 0000000..23d9a86
--- /dev/null
+++ b/0001-Make-issue-122805.rs-big-endian-compatible.patch
@@ -0,0 +1,49 @@
+From 26fa5c2c300f3c3a3ee3109c009bd4a6803a2a4c Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Tue, 11 Jun 2024 10:13:07 +0200
+Subject: [PATCH] Make issue-122805.rs big endian compatible
+
+Instead of not generating the function at all on big endian (which
+makes the CHECK lines fail), instead use to_le() on big endian,
+so that we essentially perform a bswap for both endiannesses.
+---
+ tests/codegen/issues/issue-122805.rs | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/tests/codegen/issues/issue-122805.rs b/tests/codegen/issues/issue-122805.rs
+index 6d108ada6dd..8e03c6c8884 100644
+--- a/tests/codegen/issues/issue-122805.rs
++++ b/tests/codegen/issues/issue-122805.rs
+@@ -39,17 +39,20 @@
+ // OPT3WINX64-NEXT: store <8 x i16>
+ // CHECK-NEXT: ret void
+ #[no_mangle]
+-#[cfg(target_endian = "little")]
+ pub fn convert(value: [u16; 8]) -> [u8; 16] {
++    #[cfg(target_endian = "little")]
++    let bswap = u16::to_be;
++    #[cfg(target_endian = "big")]
++    let bswap = u16::to_le;
+     let addr16 = [
+-        value[0].to_be(),
+-        value[1].to_be(),
+-        value[2].to_be(),
+-        value[3].to_be(),
+-        value[4].to_be(),
+-        value[5].to_be(),
+-        value[6].to_be(),
+-        value[7].to_be(),
++        bswap(value[0]),
++        bswap(value[1]),
++        bswap(value[2]),
++        bswap(value[3]),
++        bswap(value[4]),
++        bswap(value[5]),
++        bswap(value[6]),
++        bswap(value[7]),
+     ];
+     unsafe { core::mem::transmute::<_, [u8; 16]>(addr16) }
+ }
+-- 
+2.45.1
+
diff --git a/0001-Set-the-host-library-path-in-run-make-v2.patch b/0001-Set-the-host-library-path-in-run-make-v2.patch
deleted file mode 100644
index b1ed9e1..0000000
--- a/0001-Set-the-host-library-path-in-run-make-v2.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 27593a7ad3796cf3afaf4145275ff20d5aff333f Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Wed, 10 Apr 2024 17:25:10 -0700
-Subject: [PATCH 1/2] Set the host library path in run-make v2
-
-When the build is configured with `[rust] rpath = false`, we need to set
-`LD_LIBRARY_PATH` (or equivalent) to what would have been the `RPATH`,
-so the compiler can find its own libraries. The old `tools.mk` code has
-this environment prefixed in the `$(BARE_RUSTC)` variable, so we just
-need to wire up something similar for run-make v2.
-
-This is now set while building each `rmake.rs` itself, as well as in the
-`rust-make-support` helpers for `rustc` and `rustdoc` commands. This is
-also available in a `set_host_rpath` function for manual commands, like
-in the `compiler-builtins` test.
-
-(cherry picked from commit 8a5409bbdbadb522f25e7e5e3d54b967cb5eee56)
----
- src/tools/compiletest/src/runtest.rs  |  6 ++++++
- src/tools/run-make-support/src/lib.rs | 15 +++++++++++++++
- 2 files changed, 21 insertions(+)
-
-diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
-index 7be0571b1111..3c775ea0651c 100644
---- a/src/tools/compiletest/src/runtest.rs
-+++ b/src/tools/compiletest/src/runtest.rs
-@@ -3767,6 +3767,11 @@ fn run_rmake_v2_test(&self) {
-         debug!(?support_lib_deps);
-         debug!(?support_lib_deps_deps);
- 
-+        let mut host_dylib_env_paths = String::new();
-+        host_dylib_env_paths.push_str(&cwd.join(&self.config.compile_lib_path).to_string_lossy());
-+        host_dylib_env_paths.push(':');
-+        host_dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
-+
-         let res = self.cmd2procres(
-             Command::new(&self.config.rustc_path)
-                 .arg("-o")
-@@ -3787,6 +3792,7 @@ fn run_rmake_v2_test(&self) {
-                 .env("RUSTC", cwd.join(&self.config.rustc_path))
-                 .env("TMPDIR", &tmpdir)
-                 .env("LD_LIB_PATH_ENVVAR", dylib_env_var())
-+                .env(dylib_env_var(), &host_dylib_env_paths)
-                 .env("HOST_RPATH_DIR", cwd.join(&self.config.compile_lib_path))
-                 .env("TARGET_RPATH_DIR", cwd.join(&self.config.run_lib_path))
-                 .env("LLVM_COMPONENTS", &self.config.llvm_components)
-diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
-index 674860f8413b..da3efd292b3f 100644
---- a/src/tools/run-make-support/src/lib.rs
-+++ b/src/tools/run-make-support/src/lib.rs
-@@ -11,6 +11,7 @@ pub fn out_dir() -> PathBuf {
- fn setup_common_build_cmd() -> Command {
-     let rustc = env::var("RUSTC").unwrap();
-     let mut cmd = Command::new(rustc);
-+    set_host_rpath(&mut cmd);
-     cmd.arg("--out-dir").arg(out_dir()).arg("-L").arg(out_dir());
-     cmd
- }
-@@ -157,3 +158,17 @@ pub fn run_fail(bin_name: &str) -> Output {
-     }
-     output
- }
-+
-+/// Set the runtime library path as needed for running the host rustc/rustdoc/etc.
-+pub fn set_host_rpath(cmd: &mut Command) {
-+    let ld_lib_path_envvar = env::var("LD_LIB_PATH_ENVVAR").unwrap();
-+    cmd.env(&ld_lib_path_envvar, {
-+        let mut paths = vec![];
-+        paths.push(PathBuf::from(env::var("TMPDIR").unwrap()));
-+        paths.push(PathBuf::from(env::var("HOST_RPATH_DIR").unwrap()));
-+        for p in env::split_paths(&env::var(&ld_lib_path_envvar).unwrap()) {
-+            paths.push(p.to_path_buf());
-+        }
-+        env::join_paths(paths.iter()).unwrap()
-+    });
-+}
--- 
-2.44.0
-
diff --git a/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch b/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
deleted file mode 100644
index ca9178c..0000000
--- a/0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-From 245fbeef49c2395471498d20e67f4edf4222c865 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Tue, 16 Apr 2024 16:45:59 -0700
-Subject: [PATCH] The `multiple_unsafe_ops_per_block` test needs `asm!`
-
----
- tests/ui/multiple_unsafe_ops_per_block.rs     |  1 +
- tests/ui/multiple_unsafe_ops_per_block.stderr | 58 +++++++++----------
- 2 files changed, 30 insertions(+), 29 deletions(-)
-
-diff --git a/tests/ui/multiple_unsafe_ops_per_block.rs b/tests/ui/multiple_unsafe_ops_per_block.rs
-index 8afb4df20af4..6b8a103d4a94 100644
---- a/tests/ui/multiple_unsafe_ops_per_block.rs
-+++ b/tests/ui/multiple_unsafe_ops_per_block.rs
-@@ -1,3 +1,4 @@
-+//@needs-asm-support
- //@aux-build:proc_macros.rs
- #![allow(unused)]
- #![allow(deref_nullptr)]
-diff --git a/tests/ui/multiple_unsafe_ops_per_block.stderr b/tests/ui/multiple_unsafe_ops_per_block.stderr
-index cff85ae115e0..e732bde0707e 100644
---- a/tests/ui/multiple_unsafe_ops_per_block.stderr
-+++ b/tests/ui/multiple_unsafe_ops_per_block.stderr
-@@ -1,5 +1,5 @@
- error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:36:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:37:5
-    |
- LL | /     unsafe {
- LL | |         STATIC += 1;
-@@ -8,12 +8,12 @@ LL | |     }
-    | |_____^
-    |
- note: modification of a mutable static occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:37:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:38:9
-    |
- LL |         STATIC += 1;
-    |         ^^^^^^^^^^^
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:38:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:39:9
-    |
- LL |         not_very_safe();
-    |         ^^^^^^^^^^^^^^^
-@@ -21,7 +21,7 @@ LL |         not_very_safe();
-    = help: to override `-D warnings` add `#[allow(clippy::multiple_unsafe_ops_per_block)]`
- 
- error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:45:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:46:5
-    |
- LL | /     unsafe {
- LL | |         drop(u.u);
-@@ -30,18 +30,18 @@ LL | |     }
-    | |_____^
-    |
- note: union field access occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:46:14
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:47:14
-    |
- LL |         drop(u.u);
-    |              ^^^
- note: raw pointer dereference occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:47:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:48:9
-    |
- LL |         *raw_ptr();
-    |         ^^^^^^^^^^
- 
- error: this `unsafe` block contains 3 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:52:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:53:5
-    |
- LL | /     unsafe {
- LL | |         asm!("nop");
-@@ -51,23 +51,23 @@ LL | |     }
-    | |_____^
-    |
- note: inline assembly used here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:53:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:54:9
-    |
- LL |         asm!("nop");
-    |         ^^^^^^^^^^^
- note: unsafe method call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:54:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:55:9
-    |
- LL |         sample.not_very_safe();
-    |         ^^^^^^^^^^^^^^^^^^^^^^
- note: modification of a mutable static occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:55:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:56:9
-    |
- LL |         STATIC = 0;
-    |         ^^^^^^^^^^
- 
- error: this `unsafe` block contains 6 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:61:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:62:5
-    |
- LL | /     unsafe {
- LL | |         drop(u.u);
-@@ -79,55 +79,55 @@ LL | |     }
-    | |_____^
-    |
- note: union field access occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:62:14
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:63:14
-    |
- LL |         drop(u.u);
-    |              ^^^
- note: access of a mutable static occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:63:14
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:64:14
-    |
- LL |         drop(STATIC);
-    |              ^^^^^^
- note: unsafe method call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:64:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:65:9
-    |
- LL |         sample.not_very_safe();
-    |         ^^^^^^^^^^^^^^^^^^^^^^
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:65:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:66:9
-    |
- LL |         not_very_safe();
-    |         ^^^^^^^^^^^^^^^
- note: raw pointer dereference occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:66:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:67:9
-    |
- LL |         *raw_ptr();
-    |         ^^^^^^^^^^
- note: inline assembly used here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:67:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:68:9
-    |
- LL |         asm!("nop");
-    |         ^^^^^^^^^^^
- 
- error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:105:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:106:5
-    |
- LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:105:14
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:106:14
-    |
- LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
-    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- note: raw pointer dereference occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:105:39
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:106:39
-    |
- LL |     unsafe { char::from_u32_unchecked(*ptr.cast::()) }
-    |                                       ^^^^^^^^^^^^^^^^^^
- 
- error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:123:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:124:5
-    |
- LL | /     unsafe {
- LL | |         x();
-@@ -136,18 +136,18 @@ LL | |     }
-    | |_____^
-    |
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:124:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:125:9
-    |
- LL |         x();
-    |         ^^^
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:125:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:126:9
-    |
- LL |         x();
-    |         ^^^
- 
- error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:134:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:135:9
-    |
- LL | /         unsafe {
- LL | |             T::X();
-@@ -156,18 +156,18 @@ LL | |         }
-    | |_________^
-    |
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:135:13
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:136:13
-    |
- LL |             T::X();
-    |             ^^^^^^
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:136:13
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:137:13
-    |
- LL |             T::X();
-    |             ^^^^^^
- 
- error: this `unsafe` block contains 2 unsafe operations, expected only one
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:144:5
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:145:5
-    |
- LL | /     unsafe {
- LL | |         x.0();
-@@ -176,12 +176,12 @@ LL | |     }
-    | |_____^
-    |
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:145:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:146:9
-    |
- LL |         x.0();
-    |         ^^^^^
- note: unsafe function call occurs here
--  --> tests/ui/multiple_unsafe_ops_per_block.rs:146:9
-+  --> tests/ui/multiple_unsafe_ops_per_block.rs:147:9
-    |
- LL |         x.0();
-    |         ^^^^^
--- 
-2.44.0
-
diff --git a/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch b/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
deleted file mode 100644
index 5275aba..0000000
--- a/0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
+++ /dev/null
@@ -1,198 +0,0 @@
-From e8fb8c36ca0de817b3d30f603d6d6b3c56e8b0be Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Fri, 5 Apr 2024 15:07:58 -0700
-Subject: [PATCH] bootstrap: move all of rustc's flags to `rustc_cargo`
-
-This ensures that `RUSTFLAGS` will be consistent between all modes of
-building the compiler, so they won't trigger a rebuild by cargo. This
-kind of fix was started in #119414 just for LTO flags, but it's
-applicable to all kinds of flags that might be configured.
----
- src/bootstrap/src/core/build_steps/check.rs   |   2 +-
- src/bootstrap/src/core/build_steps/compile.rs | 107 +++++++++---------
- src/bootstrap/src/core/build_steps/doc.rs     |   2 +-
- src/bootstrap/src/core/build_steps/test.rs    |   2 +-
- 4 files changed, 59 insertions(+), 54 deletions(-)
-
-diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
-index 55180a82885b..37d91b14ca1b 100644
---- a/src/bootstrap/src/core/build_steps/check.rs
-+++ b/src/bootstrap/src/core/build_steps/check.rs
-@@ -296,7 +296,7 @@ fn run(self, builder: &Builder<'_>) {
-             cargo_subcommand(builder.kind),
-         );
- 
--        rustc_cargo(builder, &mut cargo, target, compiler.stage);
-+        rustc_cargo(builder, &mut cargo, target, &compiler);
- 
-         // For ./x.py clippy, don't run with --all-targets because
-         // linting tests and benchmarks can produce very noisy results
-diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index e03997181ee5..9420e40d6c2b 100644
---- a/src/bootstrap/src/core/build_steps/compile.rs
-+++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -945,55 +945,10 @@ fn run(self, builder: &Builder<'_>) -> u32 {
-             "build",
-         );
- 
--        rustc_cargo(builder, &mut cargo, target, compiler.stage);
-+        rustc_cargo(builder, &mut cargo, target, &compiler);
- 
--        if builder.config.rust_profile_use.is_some()
--            && builder.config.rust_profile_generate.is_some()
--        {
--            panic!("Cannot use and generate PGO profiles at the same time");
--        }
--
--        // With LLD, we can use ICF (identical code folding) to reduce the executable size
--        // of librustc_driver/rustc and to improve i-cache utilization.
--        //
--        // -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
--        // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
--        // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
--        // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
--        if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
--            cargo.rustflag("-Clink-args=-Wl,--icf=all");
--        }
--
--        let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
--            if compiler.stage == 1 {
--                cargo.rustflag(&format!("-Cprofile-generate={path}"));
--                // Apparently necessary to avoid overflowing the counters during
--                // a Cargo build profile
--                cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
--                true
--            } else {
--                false
--            }
--        } else if let Some(path) = &builder.config.rust_profile_use {
--            if compiler.stage == 1 {
--                cargo.rustflag(&format!("-Cprofile-use={path}"));
--                if builder.is_verbose() {
--                    cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
--                }
--                true
--            } else {
--                false
--            }
--        } else {
--            false
--        };
--        if is_collecting {
--            // Ensure paths to Rust sources are relative, not absolute.
--            cargo.rustflag(&format!(
--                "-Cllvm-args=-static-func-strip-dirname-prefix={}",
--                builder.config.src.components().count()
--            ));
--        }
-+        // NB: all RUSTFLAGS should be added to `rustc_cargo()` so they will be
-+        // consistently applied by check/doc/test modes too.
- 
-         for krate in &*self.crates {
-             cargo.arg("-p").arg(krate);
-@@ -1044,7 +999,12 @@ fn run(self, builder: &Builder<'_>) -> u32 {
-     }
- }
- 
--pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelection, stage: u32) {
-+pub fn rustc_cargo(
-+    builder: &Builder<'_>,
-+    cargo: &mut Cargo,
-+    target: TargetSelection,
-+    compiler: &Compiler,
-+) {
-     cargo
-         .arg("--features")
-         .arg(builder.rustc_features(builder.kind, target))
-@@ -1055,7 +1015,7 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
- 
-     // We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
-     // and may just be a time sink.
--    if stage != 0 {
-+    if compiler.stage != 0 {
-         match builder.config.rust_lto {
-             RustcLto::Thin | RustcLto::Fat => {
-                 // Since using LTO for optimizing dylibs is currently experimental,
-@@ -1081,7 +1041,52 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
-         cargo.rustflag("-Clto=off");
-     }
- 
--    rustc_cargo_env(builder, cargo, target, stage);
-+    // With LLD, we can use ICF (identical code folding) to reduce the executable size
-+    // of librustc_driver/rustc and to improve i-cache utilization.
-+    //
-+    // -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
-+    // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
-+    // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
-+    // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
-+    if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
-+        cargo.rustflag("-Clink-args=-Wl,--icf=all");
-+    }
-+
-+    if builder.config.rust_profile_use.is_some() && builder.config.rust_profile_generate.is_some() {
-+        panic!("Cannot use and generate PGO profiles at the same time");
-+    }
-+    let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
-+        if compiler.stage == 1 {
-+            cargo.rustflag(&format!("-Cprofile-generate={path}"));
-+            // Apparently necessary to avoid overflowing the counters during
-+            // a Cargo build profile
-+            cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
-+            true
-+        } else {
-+            false
-+        }
-+    } else if let Some(path) = &builder.config.rust_profile_use {
-+        if compiler.stage == 1 {
-+            cargo.rustflag(&format!("-Cprofile-use={path}"));
-+            if builder.is_verbose() {
-+                cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
-+            }
-+            true
-+        } else {
-+            false
-+        }
-+    } else {
-+        false
-+    };
-+    if is_collecting {
-+        // Ensure paths to Rust sources are relative, not absolute.
-+        cargo.rustflag(&format!(
-+            "-Cllvm-args=-static-func-strip-dirname-prefix={}",
-+            builder.config.src.components().count()
-+        ));
-+    }
-+
-+    rustc_cargo_env(builder, cargo, target, compiler.stage);
- }
- 
- pub fn rustc_cargo_env(
-diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
-index 51b5cdc05657..a22cbeacf016 100644
---- a/src/bootstrap/src/core/build_steps/doc.rs
-+++ b/src/bootstrap/src/core/build_steps/doc.rs
-@@ -804,7 +804,7 @@ fn run(self, builder: &Builder<'_>) {
-         // see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
-         // cargo.rustdocflag("--generate-link-to-definition");
- 
--        compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
-+        compile::rustc_cargo(builder, &mut cargo, target, &compiler);
-         cargo.arg("-Zunstable-options");
-         cargo.arg("-Zskip-rustdoc-fingerprint");
- 
-diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
-index bacf5f0d33ce..5277c38a4ad0 100644
---- a/src/bootstrap/src/core/build_steps/test.rs
-+++ b/src/bootstrap/src/core/build_steps/test.rs
-@@ -2671,7 +2671,7 @@ fn run(self, builder: &Builder<'_>) {
-                 }
-             }
-             Mode::Rustc => {
--                compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
-+                compile::rustc_cargo(builder, &mut cargo, target, &compiler);
-             }
-             _ => panic!("can only test libraries"),
-         };
--- 
-2.44.0
-
diff --git a/0001-fix-long-linker-command-lines-failure-caused-by-rust.patch b/0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
deleted file mode 100644
index e2a2a28..0000000
--- a/0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From f25809d2d33e1141d73487e55fe155f41762aef3 Mon Sep 17 00:00:00 2001
-From: onur-ozkan 
-Date: Sun, 10 Mar 2024 09:16:24 +0300
-Subject: [PATCH] fix `long-linker-command-lines` failure caused by
- `rust.rpath=false`
-
-Signed-off-by: onur-ozkan 
----
- tests/run-make/long-linker-command-lines/Makefile | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/tests/run-make/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile
-index f864ea74f4a9..b573038e344a 100644
---- a/tests/run-make/long-linker-command-lines/Makefile
-+++ b/tests/run-make/long-linker-command-lines/Makefile
-@@ -1,6 +1,8 @@
- # ignore-cross-compile
- include ../tools.mk
- 
-+export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
-+
- all:
- 	$(RUSTC) foo.rs -g -O
- 	RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo)
--- 
-2.44.0
-
diff --git a/0001-test-don-t-compress-test-registry-crates.patch b/0001-test-don-t-compress-test-registry-crates.patch
deleted file mode 100644
index a8bdd0c..0000000
--- a/0001-test-don-t-compress-test-registry-crates.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-From a70f23c50b61c1a3335f2943375a04ae7abf2fa4 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 11 Apr 2024 14:58:42 -0700
-Subject: [PATCH] test: don't compress test registry crates
-
-They are still nominally gzipped, but using `Compression::none()` makes
-them consistent even across zlib and zlib-ng, and this fixes checksum
-differences in the testsuite. There is a one-time update of all those
-checksums to catch up with this change though.
----
- crates/cargo-test-support/src/registry.rs        |  2 +-
- tests/testsuite/alt_registry.rs                  |  2 +-
- .../cargo_add/locked_unchanged/in/Cargo.lock     |  2 +-
- .../cargo_add/lockfile_updated/in/Cargo.lock     |  2 +-
- .../cargo_add/lockfile_updated/out/Cargo.lock    |  4 ++--
- .../cargo_remove/update_lock_file/in/Cargo.lock  | 16 ++++++++--------
- .../cargo_remove/update_lock_file/out/Cargo.lock | 12 ++++++------
- 7 files changed, 20 insertions(+), 20 deletions(-)
-
-diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs
-index e65baeab17d7..f8b4b1447822 100644
---- a/crates/cargo-test-support/src/registry.rs
-+++ b/crates/cargo-test-support/src/registry.rs
-@@ -1469,7 +1469,7 @@ impl Package {
-         let dst = self.archive_dst();
-         t!(fs::create_dir_all(dst.parent().unwrap()));
-         let f = t!(File::create(&dst));
--        let mut a = Builder::new(GzEncoder::new(f, Compression::default()));
-+        let mut a = Builder::new(GzEncoder::new(f, Compression::none()));
- 
-         if !self
-             .files
-diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
-index e122199baa41..fb88105374a2 100644
---- a/tests/testsuite/alt_registry.rs
-+++ b/tests/testsuite/alt_registry.rs
-@@ -1493,7 +1493,7 @@ dependencies = [
- name = "foo"
- version = "0.1.0"
- source = "sparse+http://[..]/"
--checksum = "f6a200a9339fef960979d94d5c99cbbfd899b6f5a396a55d9775089119050203""#,
-+checksum = "458c1addb23fde7dfbca0410afdbcc0086f96197281ec304d9e0e10def3cb899""#,
-     );
- }
- 
-diff --git a/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock b/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
-index 011b335926ee..b88709a9e9be 100644
---- a/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
-+++ b/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
-@@ -13,4 +13,4 @@ dependencies = [
- name = "my-package"
- version = "99999.0.0+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915"
-+checksum = "73cfa03cf28feb001362b377a837910c5a6ec1cc5cceaa562b97fc14d15edec8"
-diff --git a/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock b/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
-index d9bcc988d3f2..d8fa962f3069 100644
---- a/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
-+++ b/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
-@@ -14,4 +14,4 @@ dependencies = [
- name = "unrelateed-crate"
- version = "0.2.0+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f"
-+checksum = "b16af1a8ba7e4331ca62d945483a3028c2afbbe06a7f2ffaa0a3538ef0a7d63e"
-diff --git a/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock b/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
-index 4b5fb465f104..e423b3d1f8b7 100644
---- a/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
-+++ b/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
-@@ -14,10 +14,10 @@ dependencies = [
- name = "my-package"
- version = "99999.0.0+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915"
-+checksum = "73cfa03cf28feb001362b377a837910c5a6ec1cc5cceaa562b97fc14d15edec8"
- 
- [[package]]
- name = "unrelateed-crate"
- version = "0.2.0+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f"
-+checksum = "b16af1a8ba7e4331ca62d945483a3028c2afbbe06a7f2ffaa0a3538ef0a7d63e"
-diff --git a/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock b/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
-index 2302220f2fb7..a4018e70eb47 100644
---- a/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
-+++ b/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
-@@ -19,40 +19,40 @@ dependencies = [
- name = "clippy"
- version = "0.4.1+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "47ced0eda54e9ddc6063f0e1d0164493cd16c84c6b6a0329a536967c44e205f7"
-+checksum = "e95568c5ce98de9c470c1d9b387466f4d5efa9687d3af7998e7c9c1da5e399fb"
- 
- [[package]]
- name = "docopt"
- version = "0.6.2+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "b600540c4fafb27bf6e6961f0f1e6f547c9d6126ce581ab3a92f878c8e2c9a2c"
-+checksum = "d4414d2705e6b42fe10772b4ab4e3260f362669e45606eb562dc4c0023e911f6"
- 
- [[package]]
- name = "regex"
- version = "0.1.1+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "84949cb53285a6c481d0133065a7b669871acfd9e20f273f4ce1283c309775d5"
-+checksum = "bc4552a1d503f3a436bb18d1efff62eb95bd97f724d06466c55ef151ea2de9e0"
- 
- [[package]]
- name = "rustc-serialize"
--version = "0.4.1+my-package"
-+version = "0.4.0+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "31162e7d23a085553c42dee375787b451a481275473f7779c4a63bcc267a24fd"
-+checksum = "48c3645ec42f69a343fbe9734a477ae59448192e779206dbcb1a9c3397563fd8"
- 
- [[package]]
- name = "semver"
- version = "0.1.1"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "106bee742e3199d9e59f4269e458dfc825c1b4648c483b1c2b7a45cd2610a308"
-+checksum = "20070289360e74dcdc28f437b08dda0c0c861c2328d749bb0d6e1a428013af83"
- 
- [[package]]
- name = "serde"
- version = "1.0.90"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "be7d269f612a60e3c2c4a4a120e2d878a3f3298a5285eda6e95453905a107d9a"
-+checksum = "ba76b226746eabf28375d5ad184926bbb9cd727425c8d027ea10f6c508895c6c"
- 
- [[package]]
- name = "toml"
- version = "0.1.1+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "a0f6c7804525ce0a968ef270e55a516cf4bdcf1fea0b09d130e0aa34a66745b3"
-+checksum = "a9ea5fa6eaed7d7e6d9fb4571bb9d915b577e19bf2a95321ebb70fd3d894ce49"
-diff --git a/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock b/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
-index 0946cee47717..af60414ddad2 100644
---- a/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
-+++ b/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
-@@ -18,34 +18,34 @@ dependencies = [
- name = "clippy"
- version = "0.4.1+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "47ced0eda54e9ddc6063f0e1d0164493cd16c84c6b6a0329a536967c44e205f7"
-+checksum = "e95568c5ce98de9c470c1d9b387466f4d5efa9687d3af7998e7c9c1da5e399fb"
- 
- [[package]]
- name = "docopt"
- version = "0.6.2+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "b600540c4fafb27bf6e6961f0f1e6f547c9d6126ce581ab3a92f878c8e2c9a2c"
-+checksum = "d4414d2705e6b42fe10772b4ab4e3260f362669e45606eb562dc4c0023e911f6"
- 
- [[package]]
- name = "regex"
- version = "0.1.1+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "84949cb53285a6c481d0133065a7b669871acfd9e20f273f4ce1283c309775d5"
-+checksum = "bc4552a1d503f3a436bb18d1efff62eb95bd97f724d06466c55ef151ea2de9e0"
- 
- [[package]]
- name = "semver"
- version = "0.1.1"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "106bee742e3199d9e59f4269e458dfc825c1b4648c483b1c2b7a45cd2610a308"
-+checksum = "20070289360e74dcdc28f437b08dda0c0c861c2328d749bb0d6e1a428013af83"
- 
- [[package]]
- name = "serde"
- version = "1.0.90"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "be7d269f612a60e3c2c4a4a120e2d878a3f3298a5285eda6e95453905a107d9a"
-+checksum = "ba76b226746eabf28375d5ad184926bbb9cd727425c8d027ea10f6c508895c6c"
- 
- [[package]]
- name = "toml"
- version = "0.1.1+my-package"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "a0f6c7804525ce0a968ef270e55a516cf4bdcf1fea0b09d130e0aa34a66745b3"
-+checksum = "a9ea5fa6eaed7d7e6d9fb4571bb9d915b577e19bf2a95321ebb70fd3d894ce49"
--- 
-2.44.0
-
diff --git a/0002-Use-env-split_paths-join_paths-in-runtest.patch b/0002-Use-env-split_paths-join_paths-in-runtest.patch
deleted file mode 100644
index b1f9311..0000000
--- a/0002-Use-env-split_paths-join_paths-in-runtest.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 642e12326055268c7605b31e7f91edf8f58e54d4 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 11 Apr 2024 15:33:44 -0700
-Subject: [PATCH 2/2] Use `env::split_paths`/`join_paths` in runtest
-
-(cherry picked from commit 7e171c72cbddb0636fa8ce71a0e862486ae72625)
----
- src/tools/compiletest/src/runtest.rs | 31 ++++++++++++++--------------
- 1 file changed, 15 insertions(+), 16 deletions(-)
-
-diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
-index 3c775ea0651c..852ffa0a62a8 100644
---- a/src/tools/compiletest/src/runtest.rs
-+++ b/src/tools/compiletest/src/runtest.rs
-@@ -3767,10 +3767,13 @@ fn run_rmake_v2_test(&self) {
-         debug!(?support_lib_deps);
-         debug!(?support_lib_deps_deps);
- 
--        let mut host_dylib_env_paths = String::new();
--        host_dylib_env_paths.push_str(&cwd.join(&self.config.compile_lib_path).to_string_lossy());
--        host_dylib_env_paths.push(':');
--        host_dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
-+        let orig_dylib_env_paths =
-+            Vec::from_iter(env::split_paths(&env::var(dylib_env_var()).unwrap()));
-+
-+        let mut host_dylib_env_paths = Vec::new();
-+        host_dylib_env_paths.push(cwd.join(&self.config.compile_lib_path));
-+        host_dylib_env_paths.extend(orig_dylib_env_paths.iter().cloned());
-+        let host_dylib_env_paths = env::join_paths(host_dylib_env_paths).unwrap();
- 
-         let res = self.cmd2procres(
-             Command::new(&self.config.rustc_path)
-@@ -3810,19 +3813,15 @@ fn run_rmake_v2_test(&self) {
-         // Finally, we need to run the recipe binary to build and run the actual tests.
-         debug!(?recipe_bin);
- 
--        let mut dylib_env_paths = String::new();
--        dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
--        dylib_env_paths.push(':');
--        dylib_env_paths.push_str(&support_lib_path.parent().unwrap().to_string_lossy());
--        dylib_env_paths.push(':');
--        dylib_env_paths.push_str(
--            &stage_std_path.join("rustlib").join(&self.config.host).join("lib").to_string_lossy(),
--        );
-+        let mut dylib_env_paths = orig_dylib_env_paths.clone();
-+        dylib_env_paths.push(support_lib_path.parent().unwrap().to_path_buf());
-+        dylib_env_paths.push(stage_std_path.join("rustlib").join(&self.config.host).join("lib"));
-+        let dylib_env_paths = env::join_paths(dylib_env_paths).unwrap();
- 
--        let mut target_rpath_env_path = String::new();
--        target_rpath_env_path.push_str(&tmpdir.to_string_lossy());
--        target_rpath_env_path.push(':');
--        target_rpath_env_path.push_str(&dylib_env_paths);
-+        let mut target_rpath_env_path = Vec::new();
-+        target_rpath_env_path.push(&tmpdir);
-+        target_rpath_env_path.extend(&orig_dylib_env_paths);
-+        let target_rpath_env_path = env::join_paths(target_rpath_env_path).unwrap();
- 
-         let mut cmd = Command::new(&recipe_bin);
-         cmd.current_dir(&self.testpaths.file)
--- 
-2.44.0
-
diff --git a/rust.spec b/rust.spec
index b0b4deb..6e196ed 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.78.0
+Version:        1.79.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.77.0
-%global bootstrap_channel 1.77.0
-%global bootstrap_date 2024-03-21
+%global bootstrap_version 1.78.0
+%global bootstrap_channel 1.78.0
+%global bootstrap_date 2024-05-02
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -67,7 +67,7 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient.  Rust currently requires LLVM 16.0+.
 %global min_llvm_version 16.0.0
-%global bundled_llvm_version 18.1.2
+%global bundled_llvm_version 18.1.4
 #global llvm_compat_version 17
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -151,32 +151,13 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.78.0-unbundle-sqlite.patch
-
-# https://github.com/rust-lang/rust/pull/123520
-Patch7:         0001-bootstrap-move-all-of-rustc-s-flags-to-rustc_cargo.patch
-
-# https://github.com/rust-lang/rust/pull/123652
-Patch8:         0001-Fix-UI-tests-with-dist-vendored-dependencies.patch
-
-# https://github.com/rust-lang/rust/pull/122270
-Patch9:         0001-fix-long-linker-command-lines-failure-caused-by-rust.patch
-
-# https://github.com/rust-lang/rust/pull/123763
-Patch10:        0001-Set-the-host-library-path-in-run-make-v2.patch
-Patch11:        0002-Use-env-split_paths-join_paths-in-runtest.patch
+Patch6:         rustc-1.79.0-unbundle-sqlite.patch
 
 # https://github.com/rust-lang/rust/pull/124597
-Patch12:        0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
+Patch7:         0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
 
-# https://github.com/rust-lang/cargo/pull/13744
-Patch20:        0001-test-don-t-compress-test-registry-crates.patch
-
-# https://github.com/rust-lang/cargo/pull/13789
-Patch21:        0001-Fix-2-tests-for-offline-execution.patch
-
-# https://github.com/rust-lang/rust-clippy/pull/12682
-Patch30:        0001-The-multiple_unsafe_ops_per_block-test-needs-asm.patch
+# Fix codegen test failure on big endian: https://github.com/rust-lang/rust/pull/126263
+Patch8:         0001-Make-issue-122805.rs-big-endian-compatible.patch
 
 ### RHEL-specific patches below ###
 
@@ -187,7 +168,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.78.0-disable-libssh2.patch
+Patch100:       rustc-1.79.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -301,10 +282,17 @@ BuildRequires:  procps-ng
 
 # debuginfo-gdb tests need gdb
 BuildRequires:  gdb
+# Work around https://bugzilla.redhat.com/show_bug.cgi?id=2275274:
+# gdb currently prints a "Unable to load 'rpm' module.  Please install the python3-rpm package."
+# message that breaks version detection.
+BuildRequires:  python3-rpm
 
 # For src/test/run-make/static-pie
 BuildRequires:  glibc-static
 
+# For tests/run-make/pgo-branch-weights
+BuildRequires:  binutils-gold
+
 # Virtual provides for folks who attempt "dnf install rustc"
 Provides:       rustc = %{version}-%{release}
 Provides:       rustc%{?_isa} = %{version}-%{release}
@@ -666,15 +654,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %endif
 %patch -P7 -p1
 %patch -P8 -p1
-%patch -P9 -p1
-%patch -P10 -p1
-%patch -P11 -p1
-%patch -P12 -p1
-
-%patch -P20 -p1 -d src/tools/cargo
-%patch -P21 -p1 -d src/tools/cargo
-
-%patch -P30 -p1 -d src/tools/clippy
 
 %if %with disabled_libssh2
 %patch -P100 -p1
diff --git a/rustc-1.78.0-disable-libssh2.patch b/rustc-1.79.0-disable-libssh2.patch
similarity index 52%
rename from rustc-1.78.0-disable-libssh2.patch
rename to rustc-1.79.0-disable-libssh2.patch
index 3fec448..a0cb02d 100644
--- a/rustc-1.78.0-disable-libssh2.patch
+++ b/rustc-1.79.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-04-04 15:01:24.003038403 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-04-04 15:01:24.005038377 -0700
-@@ -2111,7 +2111,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-05-06 14:24:30.239408711 +0900
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-05-06 14:25:22.869989833 +0900
+@@ -2153,7 +2153,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2152,20 +2151,6 @@ dependencies = [
+@@ -2194,20 +2193,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -31,14 +31,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  [[package]]
  name = "libz-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-04-04 15:01:24.005038377 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-04-04 15:02:15.816367069 -0700
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-05-06 14:25:22.869989833 +0900
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-05-06 14:25:57.625377462 +0900
 @@ -44,7 +44,7 @@ curl = "0.4.46"
  curl-sys = "0.4.72"
  filetime = "0.2.23"
  flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
--git2 = "0.18.2"
-+git2 = { version = "0.18.2", default-features = false, features = ["https"] }
+-git2 = "0.18.3"
++git2 = { version = "0.18.3", default-features = false, features = ["https"] }
  git2-curl = "0.19.0"
- gix = { version = "0.58.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
- gix-features-for-configuration-only = { version = "0.38.0", package = "gix-features", features = [ "parallel" ] }
+ gix = { version = "0.62.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision", "parallel", "dirwalk"] }
+ glob = "0.3.1"
diff --git a/rustc-1.78.0-unbundle-sqlite.patch b/rustc-1.79.0-unbundle-sqlite.patch
similarity index 57%
rename from rustc-1.78.0-unbundle-sqlite.patch
rename to rustc-1.79.0-unbundle-sqlite.patch
index b02529f..8101227 100644
--- a/rustc-1.78.0-unbundle-sqlite.patch
+++ b/rustc-1.79.0-unbundle-sqlite.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-04-04 14:54:45.433205012 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-04-04 14:55:51.949342725 -0700
-@@ -2149,7 +2149,6 @@ version = "0.28.0"
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2006-07-24 10:21:28.000000000 +0900
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-05-06 14:13:00.172595245 +0900
+@@ -2191,7 +2191,6 @@ version = "0.28.0"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f"
  dependencies = [
@@ -10,14 +10,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-04-04 14:54:45.433205012 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-04-04 14:55:35.823551771 -0700
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-05-06 14:13:00.173595257 +0900
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-05-06 14:13:54.089275003 +0900
 @@ -77,7 +77,7 @@ proptest = "1.4.0"
- pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] }
+ pulldown-cmark = { version = "0.10.2", default-features = false, features = ["html"] }
  rand = "0.8.5"
- regex = "1.10.3"
+ regex = "1.10.4"
 -rusqlite = { version = "0.31.0", features = ["bundled"] }
 +rusqlite = { version = "0.31.0", features = [] }
  rustfix = { version = "0.8.2", path = "crates/rustfix" }
  same-file = "1.0.6"
- security-framework = "2.9.2"
+ security-framework = "2.10.0"
diff --git a/sources b/sources
index 365a648..1e1bb02 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.78.0-src.tar.xz) = d2fb9881e28849d871fda71b1b51652be3839b3283f0d32163f258c5c707a9fb7b589da8dc03bca2fefee1abdd2b44a5f17e85d8c6df7bea119d1e8d22371941
+SHA512 (rustc-1.79.0-src.tar.xz) = 99d7f276292e5c270648473ff73e9888413a3325ef3a4d7a45f8ce77a42ac87996905f1d875888ce084b621f642017bc9e31a00da1439108dbe19b85d0eab085
 SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045

From c9bf5b6c12e7d3dfcb8614bae15deaeba55f1000 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 13 Jun 2024 16:41:06 -0700
Subject: [PATCH 27/86] Regenerate disable-libssh2.patch

[skip changelog]
---
 rustc-1.79.0-disable-libssh2.patch | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/rustc-1.79.0-disable-libssh2.patch b/rustc-1.79.0-disable-libssh2.patch
index a0cb02d..6b3c90c 100644
--- a/rustc-1.79.0-disable-libssh2.patch
+++ b/rustc-1.79.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-05-06 14:24:30.239408711 +0900
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-05-06 14:25:22.869989833 +0900
-@@ -2153,7 +2153,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
+diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/tools/cargo/Cargo.lock
+--- rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig	2024-06-13 16:37:16.640599290 -0700
++++ rustc-1.79.0-src/src/tools/cargo/Cargo.lock	2024-06-13 16:37:16.646599231 -0700
+@@ -2150,7 +2150,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2194,20 +2193,6 @@ dependencies = [
+@@ -2191,20 +2190,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -30,9 +30,9 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  
  [[package]]
  name = "libz-sys"
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-05-06 14:25:22.869989833 +0900
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-05-06 14:25:57.625377462 +0900
+diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.toml.orig rustc-1.79.0-src/src/tools/cargo/Cargo.toml
+--- rustc-1.79.0-src/src/tools/cargo/Cargo.toml.orig	2024-06-13 16:37:16.646599231 -0700
++++ rustc-1.79.0-src/src/tools/cargo/Cargo.toml	2024-06-13 16:39:06.040526596 -0700
 @@ -44,7 +44,7 @@ curl = "0.4.46"
  curl-sys = "0.4.72"
  filetime = "0.2.23"
@@ -40,5 +40,5 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools
 -git2 = "0.18.3"
 +git2 = { version = "0.18.3", default-features = false, features = ["https"] }
  git2-curl = "0.19.0"
- gix = { version = "0.62.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision", "parallel", "dirwalk"] }
+ gix = { version = "0.63.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision", "parallel", "dirwalk"] }
  glob = "0.3.1"

From 9f26656c96e1187f006f425719e330ac73de50ca Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 13 Jun 2024 16:46:22 -0700
Subject: [PATCH 28/86] Update LLVM versions

[skip changelog]
---
 rust.spec | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rust.spec b/rust.spec
index 6e196ed..fee8d6f 100644
--- a/rust.spec
+++ b/rust.spec
@@ -65,9 +65,9 @@ ExclusiveArch:  %{rust_arches}
 %bcond_with llvm_static
 
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
-# is insufficient.  Rust currently requires LLVM 16.0+.
-%global min_llvm_version 16.0.0
-%global bundled_llvm_version 18.1.4
+# is insufficient.  Rust currently requires LLVM 17.0+.
+%global min_llvm_version 17.0.0
+%global bundled_llvm_version 18.1.7
 #global llvm_compat_version 17
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm

From c960ecf6c1e5e68a42202f195f2075c6771d93b6 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 20 Jun 2024 16:01:30 -0700
Subject: [PATCH 29/86] Update bundled wasi-libc for distinct target triples

---
 .gitignore | 1 +
 rust.spec  | 7 ++++---
 sources    | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4dff5bb..1a1e850 100644
--- a/.gitignore
+++ b/.gitignore
@@ -436,3 +436,4 @@
 /rustc-1.77.2-src.tar.xz
 /rustc-1.78.0-src.tar.xz
 /rustc-1.79.0-src.tar.xz
+/wasi-libc-wasi-sdk-22.tar.gz
diff --git a/rust.spec b/rust.spec
index fee8d6f..11c3d1f 100644
--- a/rust.spec
+++ b/rust.spec
@@ -50,8 +50,7 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-#global wasi_libc_ref wasi-sdk-21
-%global wasi_libc_ref 03b228e46bb02fcc5927253e1b8ad715072b1ae4
+%global wasi_libc_ref wasi-sdk-22
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@@ -773,7 +772,9 @@ fi
 
 %if %defined wasm_targets
 %if %with bundled_wasi_libc
-%make_build --quiet -C %{wasi_libc_dir} MALLOC_IMPL=emmalloc CC=clang AR=llvm-ar NM=llvm-nm
+%define wasi_libc_flags MALLOC_IMPL=emmalloc CC=clang AR=llvm-ar NM=llvm-nm
+%make_build --quiet -C %{wasi_libc_dir} %{wasi_libc_flags} TARGET_TRIPLE=wasm32-wasi
+%make_build --quiet -C %{wasi_libc_dir} %{wasi_libc_flags} TARGET_TRIPLE=wasm32-wasip1
 %define wasm_target_config %{shrink:
   --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot
   --set target.wasm32-wasip1.wasi-root=%{wasi_libc_dir}/sysroot
diff --git a/sources b/sources
index 1e1bb02..e0e1f32 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
 SHA512 (rustc-1.79.0-src.tar.xz) = 99d7f276292e5c270648473ff73e9888413a3325ef3a4d7a45f8ce77a42ac87996905f1d875888ce084b621f642017bc9e31a00da1439108dbe19b85d0eab085
-SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045
+SHA512 (wasi-libc-wasi-sdk-22.tar.gz) = 3fcd5d6c0e09d824702165d8f1236e400b1d5e95fad14f1821d40de05340a044f0ec8a587d8478854252cc938a663aa9f854e6a5e683ef8f8349c60dc6c628ed

From f3243280f0e1f116e4858a954a87b863853d644b Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Fri, 5 Jul 2024 13:51:41 +0200
Subject: [PATCH 30/86] Import gating tests from tests/rust

Modify gating testplan to import tests from tests/rust repo.
Remove tmt tests in rpms/rust as we'll no longer use them.
---
 plans/ci.fmf                                 |  1 +
 tests/Sanity/basic-smoke/Makefile            | 63 -------------------
 tests/Sanity/basic-smoke/PURPOSE             |  3 -
 tests/Sanity/basic-smoke/main.fmf            | 13 ----
 tests/Sanity/basic-smoke/runtest.sh          | 55 -----------------
 tests/Sanity/rpm-rebuild/librsvg2.fmf        | 11 ----
 tests/Sanity/rpm-rebuild/main.fmf            | 13 ----
 tests/Sanity/rpm-rebuild/ripgrep.fmf         | 11 ----
 tests/Sanity/rpm-rebuild/rpm-sequoia.fmf     | 11 ----
 tests/Sanity/rpm-rebuild/runtest.sh          | 55 -----------------
 tests/Sanity/rpm-rebuild/stratisd.fmf        |  6 --
 tests/Sanity/rust-wasm-smoke-test/Makefile   | 64 --------------------
 tests/Sanity/rust-wasm-smoke-test/PURPOSE    |  3 -
 tests/Sanity/rust-wasm-smoke-test/lib.rs     | 12 ----
 tests/Sanity/rust-wasm-smoke-test/main.fmf   | 15 -----
 tests/Sanity/rust-wasm-smoke-test/runtest.sh | 53 ----------------
 tests/Sanity/rust-wasm-smoke-test/test.js    | 28 ---------
 17 files changed, 1 insertion(+), 416 deletions(-)
 delete mode 100644 tests/Sanity/basic-smoke/Makefile
 delete mode 100644 tests/Sanity/basic-smoke/PURPOSE
 delete mode 100644 tests/Sanity/basic-smoke/main.fmf
 delete mode 100755 tests/Sanity/basic-smoke/runtest.sh
 delete mode 100644 tests/Sanity/rpm-rebuild/librsvg2.fmf
 delete mode 100644 tests/Sanity/rpm-rebuild/main.fmf
 delete mode 100644 tests/Sanity/rpm-rebuild/ripgrep.fmf
 delete mode 100644 tests/Sanity/rpm-rebuild/rpm-sequoia.fmf
 delete mode 100755 tests/Sanity/rpm-rebuild/runtest.sh
 delete mode 100644 tests/Sanity/rpm-rebuild/stratisd.fmf
 delete mode 100644 tests/Sanity/rust-wasm-smoke-test/Makefile
 delete mode 100644 tests/Sanity/rust-wasm-smoke-test/PURPOSE
 delete mode 100644 tests/Sanity/rust-wasm-smoke-test/lib.rs
 delete mode 100644 tests/Sanity/rust-wasm-smoke-test/main.fmf
 delete mode 100755 tests/Sanity/rust-wasm-smoke-test/runtest.sh
 delete mode 100644 tests/Sanity/rust-wasm-smoke-test/test.js

diff --git a/plans/ci.fmf b/plans/ci.fmf
index 3fd3ab7..9160802 100644
--- a/plans/ci.fmf
+++ b/plans/ci.fmf
@@ -1,5 +1,6 @@
 summary: CI Gating Plan
 discover:
     how: fmf
+    url: https://src.fedoraproject.org/tests/rust.git
 execute:
     how: tmt
diff --git a/tests/Sanity/basic-smoke/Makefile b/tests/Sanity/basic-smoke/Makefile
deleted file mode 100644
index 3293c52..0000000
--- a/tests/Sanity/basic-smoke/Makefile
+++ /dev/null
@@ -1,63 +0,0 @@
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Makefile of /tools/rust/Sanity/basic-smoke
-#   Description: basic-smoke
-#   Author: Martin Cermak 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2017 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-export TEST=/tools/rust/Sanity/basic-smoke
-export TESTVERSION=1.0
-
-BUILT_FILES=
-
-FILES=$(METADATA) runtest.sh Makefile PURPOSE
-
-.PHONY: all install download clean
-
-run: $(FILES) build
-	./runtest.sh
-
-build: $(BUILT_FILES)
-	test -x runtest.sh || chmod a+x runtest.sh
-
-clean:
-	rm -f *~ $(BUILT_FILES)
-
-
-include /usr/share/rhts/lib/rhts-make.include
-
-$(METADATA): Makefile
-	@echo "Owner:           Martin Cermak " > $(METADATA)
-	@echo "Name:            $(TEST)" >> $(METADATA)
-	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
-	@echo "Path:            $(TEST_DIR)" >> $(METADATA)
-	@echo "Description:     basic-smoke" >> $(METADATA)
-	@echo "Type:            Sanity" >> $(METADATA)
-	@echo "TestTime:        10m" >> $(METADATA)
-	@echo "RunFor:          rust" >> $(METADATA)
-	@echo "Requires:        rust" >> $(METADATA)
-	@echo "Priority:        Normal" >> $(METADATA)
-	@echo "License:         GPLv2+" >> $(METADATA)
-	@echo "Confidential:    no" >> $(METADATA)
-	@echo "Destructive:     no" >> $(METADATA)
-	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
-
-	rhts-lint $(METADATA)
diff --git a/tests/Sanity/basic-smoke/PURPOSE b/tests/Sanity/basic-smoke/PURPOSE
deleted file mode 100644
index a7455dc..0000000
--- a/tests/Sanity/basic-smoke/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of /tools/rust/Sanity/basic-smoke
-Description: basic-smoke
-Author: Martin Cermak 
diff --git a/tests/Sanity/basic-smoke/main.fmf b/tests/Sanity/basic-smoke/main.fmf
deleted file mode 100644
index c414d05..0000000
--- a/tests/Sanity/basic-smoke/main.fmf
+++ /dev/null
@@ -1,13 +0,0 @@
-summary: basic-smoke
-description: ''
-contact:
-  - Jesus Checa Hidalgo 
-component:
-  - rust
-test: ./runtest.sh
-framework: beakerlib
-recommend:
-  - rust
-duration: 10m
-extra-summary: /tools/rust/Sanity/basic-smoke
-extra-task: /tools/rust/Sanity/basic-smoke
diff --git a/tests/Sanity/basic-smoke/runtest.sh b/tests/Sanity/basic-smoke/runtest.sh
deleted file mode 100755
index ed25e86..0000000
--- a/tests/Sanity/basic-smoke/runtest.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   runtest.sh of /tools/rust/Sanity/basic-smoke
-#   Description: basic-smoke
-#   Author: Martin Cermak 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2017 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# Include Beaker environment
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGE="$(rpm -qf $(which rustc))"
-
-rlJournalStart
-    rlPhaseStartSetup
-        rlAssertRpm $PACKAGE
-        rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
-        rlRun "pushd $TmpDir"
-    rlPhaseEnd
-
-    rlPhaseStartTest
-        HELLO_SRC=$( mktemp )
-        HELLO_BIN=$( mktemp )
-        echo 'fn main() { println!("hello"); }' > $HELLO_SRC
-        rlRun "which rustc"
-        rlRun "rustc -V"
-        rlRun "rustc -o $HELLO_BIN $HELLO_SRC"
-        rlRun "$HELLO_BIN"
-    rlPhaseEnd
-
-    rlPhaseStartCleanup
-        rlRun "popd"
-        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
-    rlPhaseEnd
-rlJournalPrintText
-rlJournalEnd
diff --git a/tests/Sanity/rpm-rebuild/librsvg2.fmf b/tests/Sanity/rpm-rebuild/librsvg2.fmf
deleted file mode 100644
index 23e2f33..0000000
--- a/tests/Sanity/rpm-rebuild/librsvg2.fmf
+++ /dev/null
@@ -1,11 +0,0 @@
-summary+: ": librsvg2"
-require+:
-  - librsvg2
-environment+:
-  PKG_TO_BUILD: "librsvg2"
-duration: 20m
-
-adjust+:
-  # building librsvg2 in Fedora is very flaky. Do not run it there
-  - when: distro == fedora
-    enabled: false
\ No newline at end of file
diff --git a/tests/Sanity/rpm-rebuild/main.fmf b/tests/Sanity/rpm-rebuild/main.fmf
deleted file mode 100644
index 72fce8a..0000000
--- a/tests/Sanity/rpm-rebuild/main.fmf
+++ /dev/null
@@ -1,13 +0,0 @@
-summary: rpmbuild package with rust
-description: 'Ensure that rust does not break rpmbuild'
-contact:
-  - Jesus Checa Hidalgo 
-component:
-  - rust
-test: ./runtest.sh
-framework: beakerlib
-require+:
-  - rust
-  - rpm-build
-  - yum-utils
-duration: 1h
diff --git a/tests/Sanity/rpm-rebuild/ripgrep.fmf b/tests/Sanity/rpm-rebuild/ripgrep.fmf
deleted file mode 100644
index 9cb533c..0000000
--- a/tests/Sanity/rpm-rebuild/ripgrep.fmf
+++ /dev/null
@@ -1,11 +0,0 @@
-summary+: ": ripgrep"
-require+:
-  - ripgrep
-environment+:
-  PKG_TO_BUILD: "ripgrep"
-duration: 15m
-
-adjust+:
-  # ripgrep is not part of RHEL
-  - when: distro != fedora
-    enabled: false
diff --git a/tests/Sanity/rpm-rebuild/rpm-sequoia.fmf b/tests/Sanity/rpm-rebuild/rpm-sequoia.fmf
deleted file mode 100644
index d215dfb..0000000
--- a/tests/Sanity/rpm-rebuild/rpm-sequoia.fmf
+++ /dev/null
@@ -1,11 +0,0 @@
-summary+: ": rpm-sequoia"
-require+:
-  - rpm-sequoia
-environment+:
-  PKG_TO_BUILD: "rpm-sequoia"
-duration: 20m
-
-adjust+:
-  - when: distro < rhel-10, centos-stream-10
-    enabled: false
-    because: "rpm-sequoia is available only in RHEL >= 10"
diff --git a/tests/Sanity/rpm-rebuild/runtest.sh b/tests/Sanity/rpm-rebuild/runtest.sh
deleted file mode 100755
index 475d2f9..0000000
--- a/tests/Sanity/rpm-rebuild/runtest.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGE="$(rpm -qf $(which rustc))"
-
-rlJournalStart
-    rlPhaseStartSetup
-        rlAssertRpm $PACKAGE || rlDie "rustc not found. Aborting testcase..."
-        rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
-        rlRun "pushd $TmpDir"
-
-        if [[ "x" == "x${PKG_TO_BUILD}" ]]; then
-            rlLogError "No package was configured to build."
-            rlDie "The package must be passed over PKG_TO_BUILD environment variable."
-        fi
-
-    rlPhaseEnd
-
-    rlPhaseStart FAIL ${PKG_TO_BUILD}FetchSrcAndInstallBuildDeps
-        if ! rlCheckRpm $PKG_TO_BUILD; then
-            rlRun "yum install -y $PKG_TO_BUILD ${YUM_SWITCHES}"
-            rlAssertRpm $PKG_TO_BUILD
-        fi
-        rlFetchSrcForInstalled $PKG_TO_BUILD
-        rlRun SRPM=$(ls -1 *.src.rpm)
-        rlRun "rpm -ivh $SRPM"
-        rlRun SPECDIR="$(rpm -E '%{_specdir}')"
-        # Note about the spec file name: When packaging rust crates, the package
-        # is named rust-, as well as the spec file, but the rpm package
-        # (the one we use in dnf to install and query) is named as the crate,
-        # (without the "rust-" prefix). We have to take that into account to
-        # find the spec:
-        # https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_naming
-        rlRun "SPECNAME=$(rpm -ql $SRPM | grep .spec)"
-
-        # Packages built with rust usually contains dynamic dependencies.
-        # builddep needs to be run from the srpm, not the spec file, to be able
-        # to generate them:
-        # https://fedoraproject.org/wiki/Changes/DynamicBuildRequires#rpmbuild
-        rlRun "yum-builddep -y ${SRPM} ${YUM_SWITCHES}"
-    rlPhaseEnd
-
-    rlPhaseStartTest
-        set -o pipefail
-        rlRun "rpmbuild -bb ${SPECDIR}/${SPECNAME} |& tee ${SRPM}_rpmbuild.log"
-        rlFileSubmit "${SRPM}_rpmbuild.log"
-    rlPhaseEnd
-
-    rlPhaseStartCleanup
-        rlRun "popd"
-        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
-    rlPhaseEnd
-rlJournalPrintText
-rlJournalEnd
diff --git a/tests/Sanity/rpm-rebuild/stratisd.fmf b/tests/Sanity/rpm-rebuild/stratisd.fmf
deleted file mode 100644
index 64cce60..0000000
--- a/tests/Sanity/rpm-rebuild/stratisd.fmf
+++ /dev/null
@@ -1,6 +0,0 @@
-summary+: ": stratisd"
-require+:
-  - stratisd
-environment+:
-  PKG_TO_BUILD: "stratisd"
-duration: 1h
diff --git a/tests/Sanity/rust-wasm-smoke-test/Makefile b/tests/Sanity/rust-wasm-smoke-test/Makefile
deleted file mode 100644
index 437da6b..0000000
--- a/tests/Sanity/rust-wasm-smoke-test/Makefile
+++ /dev/null
@@ -1,64 +0,0 @@
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Makefile of /tools/rust/Sanity/rust-wasm-smoke-test
-#   Description: Test that the rust wasm target is enabled and can compile correctly
-#   Author: Jesus Checa 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2021 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-export TEST=/tools/rust/Sanity/rust-wasm-smoke-test
-export TESTVERSION=1.0
-
-BUILT_FILES=
-
-FILES=$(METADATA) runtest.sh Makefile PURPOSE lib.rs test.js
-
-.PHONY: all install download clean
-
-run: $(FILES) build
-	./runtest.sh
-
-build: $(BUILT_FILES)
-	test -x runtest.sh || chmod a+x runtest.sh
-
-clean:
-	rm -f *~ $(BUILT_FILES)
-
-
-include /usr/share/rhts/lib/rhts-make.include
-
-$(METADATA): Makefile
-	@echo "Owner:           Jesus Checa " > $(METADATA)
-	@echo "Name:            $(TEST)" >> $(METADATA)
-	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
-	@echo "Path:            $(TEST_DIR)" >> $(METADATA)
-	@echo "Description:     Test that the rust wasm target is enabled and can compile correctly" >> $(METADATA)
-	@echo "Type:            Sanity" >> $(METADATA)
-	@echo "TestTime:        5m" >> $(METADATA)
-	@echo "RunFor:          rust" >> $(METADATA)
-	@echo "Requires:        rust rust-std-static-wasm32-unknown-unknown nodejs" >> $(METADATA)
-	@echo "Priority:        Normal" >> $(METADATA)
-	@echo "License:         GPLv2+" >> $(METADATA)
-	@echo "Confidential:    no" >> $(METADATA)
-	@echo "Destructive:     no" >> $(METADATA)
-	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5 -RHEL7" >> $(METADATA)
-	@echo "Architectures:   aarch64 ppc64le x86_64" >> $(METADATA)
-
-	rhts-lint $(METADATA)
diff --git a/tests/Sanity/rust-wasm-smoke-test/PURPOSE b/tests/Sanity/rust-wasm-smoke-test/PURPOSE
deleted file mode 100644
index e21d668..0000000
--- a/tests/Sanity/rust-wasm-smoke-test/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of /tools/rust/Sanity/rust-wasm-smoke-test
-Description: Test that the rust wasm target is enabled and can compile correctly
-Author: Jesus Checa 
diff --git a/tests/Sanity/rust-wasm-smoke-test/lib.rs b/tests/Sanity/rust-wasm-smoke-test/lib.rs
deleted file mode 100644
index 36e7457..0000000
--- a/tests/Sanity/rust-wasm-smoke-test/lib.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-#[no_mangle]
-pub fn fib(index: u32) -> u32 {
-    let mut nminus2;
-    let mut nminus1 = 1;
-    let mut n = 0;
-    for _ in 0..index {
-        nminus2 = nminus1;
-        nminus1 = n;
-        n = nminus2 + nminus1;
-    }
-    n
-}
diff --git a/tests/Sanity/rust-wasm-smoke-test/main.fmf b/tests/Sanity/rust-wasm-smoke-test/main.fmf
deleted file mode 100644
index 0fe807c..0000000
--- a/tests/Sanity/rust-wasm-smoke-test/main.fmf
+++ /dev/null
@@ -1,15 +0,0 @@
-summary: Test that the rust wasm target is enabled and can compile correctly
-description: ''
-contact:
-  - Jesus Checa 
-component:
-  - rust
-test: ./runtest.sh
-framework: beakerlib
-recommend:
-  - rust
-  - rust-std-static-wasm32-unknown-unknown
-  - nodejs
-duration: 5m
-extra-summary: /tools/rust/Sanity/rust-wasm-smoke-test
-extra-task: /tools/rust/Sanity/rust-wasm-smoke-test
diff --git a/tests/Sanity/rust-wasm-smoke-test/runtest.sh b/tests/Sanity/rust-wasm-smoke-test/runtest.sh
deleted file mode 100755
index bee4890..0000000
--- a/tests/Sanity/rust-wasm-smoke-test/runtest.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   runtest.sh of /tools/rust/Sanity/rust-wasm-smoke-test
-#   Description: Test that the rust wasm target is enabled and can compile correctly
-#   Author: Jesus Checa 
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#   Copyright (c) 2021 Red Hat, Inc.
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 2 of
-#   the License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be
-#   useful, but WITHOUT ANY WARRANTY; without even the implied
-#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-#   PURPOSE.  See the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# Include Beaker environment
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGES="$(rpm -qf $(which rustc)) rust-std-static-wasm32-unknown-unknown"
-
-rlJournalStart
-    rlPhaseStartSetup
-        rlAssertRpm --all
-        rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
-        rlRun "cp lib.rs $TmpDir"
-        rlRun "cp test.js $TmpDir"
-        rlRun "pushd $TmpDir"
-    rlPhaseEnd
-
-    rlPhaseStartTest
-        rlRun "rustc --target wasm32-unknown-unknown --crate-type=cdylib lib.rs -o fib.wasm" 0 "Building WASM binary"
-        rlRun "node test.js" 0 "Testing WASM binary"
-    rlPhaseEnd
-
-    rlPhaseStartCleanup
-        rlRun "popd"
-        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
-    rlPhaseEnd
-rlJournalPrintText
-rlJournalEnd
-
diff --git a/tests/Sanity/rust-wasm-smoke-test/test.js b/tests/Sanity/rust-wasm-smoke-test/test.js
deleted file mode 100644
index 921df38..0000000
--- a/tests/Sanity/rust-wasm-smoke-test/test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-function js_fibonacci(index) {
-    let nminus2 = 0;
-    let nminus1 = 1;
-    let n = 0;
-    for(let i = 0; i < index; ++i) {
-        nminus2 = nminus1;
-        nminus1 = n;
-        n = nminus1 + nminus2;
-    }
-    return n;
-}
-
-const fs = require('fs');
-const buf = fs.readFileSync('./fib.wasm');
-const lib = WebAssembly.instantiate(new Uint8Array(buf)).
-    then(res => {
-        var fib = res.instance.exports.fib;
-        for (var i=1; i<=10; i++) {
-            if(fib(i) != js_fibonacci(i)){
-                console.log("Mismatch between wasm and JS functions");
-                process.exit(1);
-            }
-        }
-    }).catch(e => {
-        console.log(e);
-        process.exit(1);
-    }
-);

From 9e272bbc6e64422d34ce0d8b414774b457c74898 Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering 
Date: Fri, 19 Jul 2024 20:14:33 +0000
Subject: [PATCH 31/86] Rebuilt for
 https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild


From c5289e87c39b7adf1f4dff9ccd9b8c9f84a96058 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann 
Date: Fri, 26 Apr 2024 11:18:59 +0200
Subject: [PATCH 32/86] enable aarch64-unknown-uefi

---
 rust.spec | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/rust.spec b/rust.spec
index 11c3d1f..f1f3902 100644
--- a/rust.spec
+++ b/rust.spec
@@ -40,7 +40,7 @@ ExclusiveArch:  %{rust_arches}
 %endif
 %endif
 %ifarch aarch64
-%global extra_targets aarch64-unknown-none-softfloat
+%global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi
 %endif
 %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
 %define target_enabled() %{lua:
@@ -449,6 +449,12 @@ Requires:       lld
 %target_description x86_64-unknown-none embedded
 %endif
 
+%if %target_enabled aarch64-unknown-uefi
+%target_package aarch64-unknown-uefi
+Requires:       lld
+%target_description aarch64-unknown-uefi embedded
+%endif
+
 %if %target_enabled x86_64-unknown-uefi
 %target_package x86_64-unknown-uefi
 Requires:       lld
@@ -1073,6 +1079,10 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %target_files x86_64-unknown-none
 %endif
 
+%if %target_enabled aarch64-unknown-uefi
+%target_files aarch64-unknown-uefi
+%endif
+
 %if %target_enabled x86_64-unknown-uefi
 %target_files x86_64-unknown-uefi
 %endif

From 3492f59d871f7082284dc064cbdfdca1f8fa92da Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann 
Date: Fri, 26 Apr 2024 11:27:03 +0200
Subject: [PATCH 33/86] lld fixup for aarch64-unknown-uefi

---
 0001-Use-lld-provided-by-system.patch | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch
index 8fcf4dc..d5970bd 100644
--- a/0001-Use-lld-provided-by-system.patch
+++ b/0001-Use-lld-provided-by-system.patch
@@ -63,3 +63,13 @@ diff -Naur a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softflo
 -- 
 2.41.0
 
+--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs	2024-04-09 19:20:09.000000000 +0200
++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs	2024-04-26 11:22:31.988601550 +0200
+@@ -9,6 +9,7 @@ pub fn target() -> Target {
+     base.max_atomic_width = Some(128);
+     base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);
+     base.features = "+v8a".into();
++    base.linker = Some("lld".into());
+ 
+     Target {
+         llvm_target: "aarch64-unknown-windows".into(),

From 24a6c91d178e9b00fd5d57e8bec7cbd06d7b86b4 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 25 Jul 2024 09:39:06 -0700
Subject: [PATCH 34/86] Trim %extra_targets on RHEL

[skip changelog]
---
 rust.spec | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rust.spec b/rust.spec
index f1f3902..3672515 100644
--- a/rust.spec
+++ b/rust.spec
@@ -35,13 +35,18 @@ ExclusiveArch:  %{rust_arches}
 # NB: wasm32-wasi is being gradually replaced by wasm32-wasip1
 # https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
 %global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1
-%if 0%{?fedora} || 0%{?rhel} >= 10
+%if 0%{?fedora}
 %global extra_targets x86_64-unknown-none x86_64-unknown-uefi
 %endif
+%if 0%{?rhel} >= 10
+%global extra_targets x86_64-unknown-none
+%endif
 %endif
 %ifarch aarch64
+%if 0%{?fedora}
 %global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi
 %endif
+%endif
 %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
 %define target_enabled() %{lua:
   print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0)

From 8814c5339738e7498dbdc35ffe1e858dc8215cea Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 25 Jul 2024 10:32:14 -0700
Subject: [PATCH 35/86] Update to Rust 1.80.0

Resolves: rhbz#2299871
---
 .gitignore                                    |   1 +
 ...x86-64-cpu-in-tests-that-are-sensiti.patch | 264 ------------------
 rust.spec                                     |  18 +-
 ...atch => rustc-1.80.0-disable-libssh2.patch |  18 +-
 ...atch => rustc-1.80.0-unbundle-sqlite.patch |  12 +-
 sources                                       |   2 +-
 6 files changed, 24 insertions(+), 291 deletions(-)
 delete mode 100644 0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
 rename rustc-1.79.0-disable-libssh2.patch => rustc-1.80.0-disable-libssh2.patch (53%)
 rename rustc-1.79.0-unbundle-sqlite.patch => rustc-1.80.0-unbundle-sqlite.patch (61%)

diff --git a/.gitignore b/.gitignore
index 1a1e850..076c7ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -437,3 +437,4 @@
 /rustc-1.78.0-src.tar.xz
 /rustc-1.79.0-src.tar.xz
 /wasi-libc-wasi-sdk-22.tar.gz
+/rustc-1.80.0-src.tar.xz
diff --git a/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch b/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
deleted file mode 100644
index c427d51..0000000
--- a/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-From 706f06c39a9e08a4708a53722429d13ae4069c2f Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Wed, 1 May 2024 15:25:26 -0700
-Subject: [PATCH] Use an explicit x86-64 cpu in tests that are sensitive to it
-
-There are a few tests that depend on some target features **not** being
-enabled by default, and usually they are correct with the default x86-64
-target CPU. However, in downstream builds we have modified the default
-to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10
--- and the latter especially trips tests that expect not to have AVX.
-
-These cases are few enough that we can just set them back explicitly.
----
- tests/assembly/simd-intrinsic-mask-reduce.rs  |  1 +
- tests/assembly/x86_64-floating-point-clamp.rs |  2 +-
- .../codegen/target-feature-inline-closure.rs  |  2 +-
- tests/ui/asm/x86_64/target-feature-attr.rs    |  1 +
- .../ui/asm/x86_64/target-feature-attr.stderr  |  8 +++---
- .../const-eval/const_fn_target_feature.rs     |  2 +-
- .../rfc-2396-target_feature-11/safe-calls.rs  |  1 +
- .../safe-calls.stderr                         | 28 +++++++++----------
- tests/ui/sse2.rs                              |  4 +--
- 9 files changed, 26 insertions(+), 23 deletions(-)
-
-diff --git a/tests/assembly/simd-intrinsic-mask-reduce.rs b/tests/assembly/simd-intrinsic-mask-reduce.rs
-index 763401755fad..0d77fc410511 100644
---- a/tests/assembly/simd-intrinsic-mask-reduce.rs
-+++ b/tests/assembly/simd-intrinsic-mask-reduce.rs
-@@ -1,6 +1,7 @@
- // verify that simd mask reductions do not introduce additional bit shift operations
- //@ revisions: x86 aarch64
- //@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
-+//@ [x86] compile-flags: -C target-cpu=x86-64
- //@ [x86] needs-llvm-components: x86
- //@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
- //@ [aarch64] needs-llvm-components: aarch64
-diff --git a/tests/assembly/x86_64-floating-point-clamp.rs b/tests/assembly/x86_64-floating-point-clamp.rs
-index 4a72a7f44fa0..b963aee35590 100644
---- a/tests/assembly/x86_64-floating-point-clamp.rs
-+++ b/tests/assembly/x86_64-floating-point-clamp.rs
-@@ -2,7 +2,7 @@
- // so check to make sure that's what it's actually emitting.
- 
- //@ assembly-output: emit-asm
--//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
-+//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -C target-cpu=x86-64
- //@ only-x86_64
- //@ ignore-sgx
- 
-diff --git a/tests/codegen/target-feature-inline-closure.rs b/tests/codegen/target-feature-inline-closure.rs
-index 88bd413a8707..20bb4e66ff21 100644
---- a/tests/codegen/target-feature-inline-closure.rs
-+++ b/tests/codegen/target-feature-inline-closure.rs
-@@ -1,5 +1,5 @@
- //@ only-x86_64
--//@ compile-flags: -Copt-level=3
-+//@ compile-flags: -Copt-level=3 -Ctarget-cpu=x86-64
- 
- #![crate_type = "lib"]
- #![feature(target_feature_11)]
-diff --git a/tests/ui/asm/x86_64/target-feature-attr.rs b/tests/ui/asm/x86_64/target-feature-attr.rs
-index 820be132ef79..51829be15065 100644
---- a/tests/ui/asm/x86_64/target-feature-attr.rs
-+++ b/tests/ui/asm/x86_64/target-feature-attr.rs
-@@ -1,4 +1,5 @@
- //@ only-x86_64
-+//@ compile-flags: -C target-cpu=x86-64
- 
- #![feature(avx512_target_feature)]
- 
-diff --git a/tests/ui/asm/x86_64/target-feature-attr.stderr b/tests/ui/asm/x86_64/target-feature-attr.stderr
-index c852726ee7ff..1a9962732cfb 100644
---- a/tests/ui/asm/x86_64/target-feature-attr.stderr
-+++ b/tests/ui/asm/x86_64/target-feature-attr.stderr
-@@ -1,23 +1,23 @@
- error: register class `ymm_reg` requires the `avx` target feature
--  --> $DIR/target-feature-attr.rs:18:40
-+  --> $DIR/target-feature-attr.rs:19:40
-    |
- LL |     asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
-    |                                        ^^^^^^^^^^^^^
- 
- error: register class `ymm_reg` requires the `avx` target feature
--  --> $DIR/target-feature-attr.rs:18:55
-+  --> $DIR/target-feature-attr.rs:19:55
-    |
- LL |     asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
-    |                                                       ^^^^^^^^^^^^^
- 
- error: register class `ymm_reg` requires the `avx` target feature
--  --> $DIR/target-feature-attr.rs:18:70
-+  --> $DIR/target-feature-attr.rs:19:70
-    |
- LL |     asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
-    |                                                                      ^^^^^^^^^^^^^^^^^^
- 
- error: register class `kreg` requires at least one of the following target features: avx512bw, avx512f
--  --> $DIR/target-feature-attr.rs:33:23
-+  --> $DIR/target-feature-attr.rs:34:23
-    |
- LL |     asm!("/* {0} */", in(kreg) x);
-    |                       ^^^^^^^^^^
-diff --git a/tests/ui/consts/const-eval/const_fn_target_feature.rs b/tests/ui/consts/const-eval/const_fn_target_feature.rs
-index b56b68a57958..d0de9d8d7a34 100644
---- a/tests/ui/consts/const-eval/const_fn_target_feature.rs
-+++ b/tests/ui/consts/const-eval/const_fn_target_feature.rs
-@@ -1,5 +1,5 @@
- //@ only-x86_64
--//@ compile-flags:-C target-feature=+ssse3
-+//@ compile-flags: -C target-cpu=x86-64 -C target-feature=+ssse3
- 
- #![crate_type = "lib"]
- 
-diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
-index c73b8d7e4d29..6fb0688008e6 100644
---- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
-+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
-@@ -1,4 +1,5 @@
- //@ only-x86_64
-+//@ compile-flags: -C target-cpu=x86-64
- 
- #![feature(target_feature_11)]
- 
-diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
-index d9d7e297f8e9..fed3da6594cb 100644
---- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
-+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
-@@ -1,5 +1,5 @@
- error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:25:5
-+  --> $DIR/safe-calls.rs:26:5
-    |
- LL |     sse2();
-    |     ^^^^^^ call to function with `#[target_feature]`
-@@ -8,7 +8,7 @@ LL |     sse2();
-    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
- 
- error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:27:5
-+  --> $DIR/safe-calls.rs:28:5
-    |
- LL |     avx_bmi2();
-    |     ^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -16,7 +16,7 @@ LL |     avx_bmi2();
-    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
- 
- error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:29:5
-+  --> $DIR/safe-calls.rs:30:5
-    |
- LL |     Quux.avx_bmi2();
-    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -24,7 +24,7 @@ LL |     Quux.avx_bmi2();
-    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
- 
- error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:35:5
-+  --> $DIR/safe-calls.rs:36:5
-    |
- LL |     avx_bmi2();
-    |     ^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -32,7 +32,7 @@ LL |     avx_bmi2();
-    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
- 
- error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:37:5
-+  --> $DIR/safe-calls.rs:38:5
-    |
- LL |     Quux.avx_bmi2();
-    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -40,7 +40,7 @@ LL |     Quux.avx_bmi2();
-    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
- 
- error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:43:5
-+  --> $DIR/safe-calls.rs:44:5
-    |
- LL |     sse2();
-    |     ^^^^^^ call to function with `#[target_feature]`
-@@ -49,7 +49,7 @@ LL |     sse2();
-    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
- 
- error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:45:5
-+  --> $DIR/safe-calls.rs:46:5
-    |
- LL |     avx_bmi2();
-    |     ^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -57,7 +57,7 @@ LL |     avx_bmi2();
-    = help: in order for the call to be safe, the context requires the following additional target feature: bmi2
- 
- error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:47:5
-+  --> $DIR/safe-calls.rs:48:5
-    |
- LL |     Quux.avx_bmi2();
-    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -65,7 +65,7 @@ LL |     Quux.avx_bmi2();
-    = help: in order for the call to be safe, the context requires the following additional target feature: bmi2
- 
- error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:54:5
-+  --> $DIR/safe-calls.rs:55:5
-    |
- LL |     sse2();
-    |     ^^^^^^ call to function with `#[target_feature]`
-@@ -74,7 +74,7 @@ LL |     sse2();
-    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
- 
- error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:58:15
-+  --> $DIR/safe-calls.rs:59:15
-    |
- LL | const _: () = sse2();
-    |               ^^^^^^ call to function with `#[target_feature]`
-@@ -83,7 +83,7 @@ LL | const _: () = sse2();
-    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
- 
- error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block
--  --> $DIR/safe-calls.rs:61:15
-+  --> $DIR/safe-calls.rs:62:15
-    |
- LL | const _: () = sse2_and_fxsr();
-    |               ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
-@@ -92,7 +92,7 @@ LL | const _: () = sse2_and_fxsr();
-    = note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]`
- 
- error: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block (error E0133)
--  --> $DIR/safe-calls.rs:68:5
-+  --> $DIR/safe-calls.rs:69:5
-    |
- LL |     sse2();
-    |     ^^^^^^ call to function with `#[target_feature]`
-@@ -101,12 +101,12 @@ LL |     sse2();
-    = help: in order for the call to be safe, the context requires the following additional target feature: sse2
-    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
- note: an unsafe function restricts its caller, but its body is safe by default
--  --> $DIR/safe-calls.rs:67:1
-+  --> $DIR/safe-calls.rs:68:1
-    |
- LL | unsafe fn needs_unsafe_block() {
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- note: the lint level is defined here
--  --> $DIR/safe-calls.rs:64:8
-+  --> $DIR/safe-calls.rs:65:8
-    |
- LL | #[deny(unsafe_op_in_unsafe_fn)]
-    |        ^^^^^^^^^^^^^^^^^^^^^^
-diff --git a/tests/ui/sse2.rs b/tests/ui/sse2.rs
-index fa6d79713b4b..c203ca2716ff 100644
---- a/tests/ui/sse2.rs
-+++ b/tests/ui/sse2.rs
-@@ -20,6 +20,6 @@ fn main() {
-                 "SSE2 was not detected as available on an x86 platform");
-     }
-     // check a negative case too -- allowed on x86, but not enabled by default
--    assert!(cfg!(not(target_feature = "avx2")),
--            "AVX2 shouldn't be detected as available by default on any platform");
-+    assert!(cfg!(not(target_feature = "avx512f")),
-+            "AVX512 shouldn't be detected as available by default on any platform");
- }
--- 
-2.44.0
-
diff --git a/rust.spec b/rust.spec
index 3672515..4a64e3d 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.79.0
+Version:        1.80.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.78.0
-%global bootstrap_channel 1.78.0
-%global bootstrap_date 2024-05-02
+%global bootstrap_version 1.79.0
+%global bootstrap_channel 1.79.0
+%global bootstrap_date 2024-06-13
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -155,13 +155,10 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.79.0-unbundle-sqlite.patch
-
-# https://github.com/rust-lang/rust/pull/124597
-Patch7:         0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch
+Patch6:         rustc-1.80.0-unbundle-sqlite.patch
 
 # Fix codegen test failure on big endian: https://github.com/rust-lang/rust/pull/126263
-Patch8:         0001-Make-issue-122805.rs-big-endian-compatible.patch
+Patch7:         0001-Make-issue-122805.rs-big-endian-compatible.patch
 
 ### RHEL-specific patches below ###
 
@@ -172,7 +169,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.79.0-disable-libssh2.patch
+Patch100:       rustc-1.80.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -663,7 +660,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
-%patch -P8 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
diff --git a/rustc-1.79.0-disable-libssh2.patch b/rustc-1.80.0-disable-libssh2.patch
similarity index 53%
rename from rustc-1.79.0-disable-libssh2.patch
rename to rustc-1.80.0-disable-libssh2.patch
index 6b3c90c..85061b4 100644
--- a/rustc-1.79.0-disable-libssh2.patch
+++ b/rustc-1.80.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
-diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/tools/cargo/Cargo.lock
---- rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig	2024-06-13 16:37:16.640599290 -0700
-+++ rustc-1.79.0-src/src/tools/cargo/Cargo.lock	2024-06-13 16:37:16.646599231 -0700
-@@ -2150,7 +2150,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-07-05 18:14:51.101370053 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-07-05 18:14:51.104370020 -0700
+@@ -2151,7 +2151,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/t
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2191,20 +2190,6 @@ dependencies = [
+@@ -2192,20 +2191,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -30,13 +30,13 @@ diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/t
  
  [[package]]
  name = "libz-sys"
-diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.toml.orig rustc-1.79.0-src/src/tools/cargo/Cargo.toml
---- rustc-1.79.0-src/src/tools/cargo/Cargo.toml.orig	2024-06-13 16:37:16.646599231 -0700
-+++ rustc-1.79.0-src/src/tools/cargo/Cargo.toml	2024-06-13 16:39:06.040526596 -0700
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-07-05 18:14:51.104370020 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-07-05 18:15:36.584867840 -0700
 @@ -44,7 +44,7 @@ curl = "0.4.46"
  curl-sys = "0.4.72"
  filetime = "0.2.23"
- flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
+ flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
 -git2 = "0.18.3"
 +git2 = { version = "0.18.3", default-features = false, features = ["https"] }
  git2-curl = "0.19.0"
diff --git a/rustc-1.79.0-unbundle-sqlite.patch b/rustc-1.80.0-unbundle-sqlite.patch
similarity index 61%
rename from rustc-1.79.0-unbundle-sqlite.patch
rename to rustc-1.80.0-unbundle-sqlite.patch
index 8101227..d38128d 100644
--- a/rustc-1.79.0-unbundle-sqlite.patch
+++ b/rustc-1.80.0-unbundle-sqlite.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2006-07-24 10:21:28.000000000 +0900
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-05-06 14:13:00.172595245 +0900
-@@ -2191,7 +2191,6 @@ version = "0.28.0"
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2006-07-23 18:21:28.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-07-05 18:09:20.585019493 -0700
+@@ -2189,7 +2189,6 @@ version = "0.28.0"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f"
  dependencies = [
@@ -10,10 +10,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-05-06 14:13:00.173595257 +0900
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-05-06 14:13:54.089275003 +0900
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-07-05 18:09:20.585019493 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-07-05 18:10:13.753432408 -0700
 @@ -77,7 +77,7 @@ proptest = "1.4.0"
- pulldown-cmark = { version = "0.10.2", default-features = false, features = ["html"] }
+ pulldown-cmark = { version = "0.10.3", default-features = false, features = ["html"] }
  rand = "0.8.5"
  regex = "1.10.4"
 -rusqlite = { version = "0.31.0", features = ["bundled"] }
diff --git a/sources b/sources
index e0e1f32..c5ddf68 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.79.0-src.tar.xz) = 99d7f276292e5c270648473ff73e9888413a3325ef3a4d7a45f8ce77a42ac87996905f1d875888ce084b621f642017bc9e31a00da1439108dbe19b85d0eab085
+SHA512 (rustc-1.80.0-src.tar.xz) = 548522599122bdff739472c1d120dcff8de171d6f4155c2fb73e47c7d80431694ceceb0439f36ef2a7bea23ac5a76de8e1f75fcade1f3ff2c3fca0ab21e6197a
 SHA512 (wasi-libc-wasi-sdk-22.tar.gz) = 3fcd5d6c0e09d824702165d8f1236e400b1d5e95fad14f1821d40de05340a044f0ec8a587d8478854252cc938a663aa9f854e6a5e683ef8f8349c60dc6c628ed

From 51879d6cd8d481ab9f9ce90f8f9878b0324117e3 Mon Sep 17 00:00:00 2001
From: Songsong Zhang 
Date: Tue, 23 Jul 2024 09:42:03 +0000
Subject: [PATCH 36/86] do not install gold in riscv64

---
 rust.spec | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rust.spec b/rust.spec
index 4a64e3d..9f509c4 100644
--- a/rust.spec
+++ b/rust.spec
@@ -292,7 +292,10 @@ BuildRequires:  python3-rpm
 BuildRequires:  glibc-static
 
 # For tests/run-make/pgo-branch-weights
+# riscv64 does not support binutils-gold yet
+%ifnarch riscv64
 BuildRequires:  binutils-gold
+%endif
 
 # Virtual provides for folks who attempt "dnf install rustc"
 Provides:       rustc = %{version}-%{release}

From 295d43e43e85b5ca5b275c0c4728e12ec40e5242 Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Fri, 9 Aug 2024 17:43:18 +0200
Subject: [PATCH 37/86] Update to Rust 1.80.1

---
 .gitignore | 1 +
 rust.spec  | 2 +-
 sources    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 076c7ff..6c91e62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -438,3 +438,4 @@
 /rustc-1.79.0-src.tar.xz
 /wasi-libc-wasi-sdk-22.tar.gz
 /rustc-1.80.0-src.tar.xz
+/rustc-1.80.1-src.tar.xz
diff --git a/rust.spec b/rust.spec
index 9f509c4..88053b0 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.80.0
+Version:        1.80.1
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
diff --git a/sources b/sources
index c5ddf68..c7d3d82 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.80.0-src.tar.xz) = 548522599122bdff739472c1d120dcff8de171d6f4155c2fb73e47c7d80431694ceceb0439f36ef2a7bea23ac5a76de8e1f75fcade1f3ff2c3fca0ab21e6197a
+SHA512 (rustc-1.80.1-src.tar.xz) = 3c746108a86eeb734c1a8c8f63ba1a45e2cb03a8cb553395a167d07dc3ce5d8d9ea365ddd95533b6952d915069b86cad7ad218d27861e0889f8e878136bd32ab
 SHA512 (wasi-libc-wasi-sdk-22.tar.gz) = 3fcd5d6c0e09d824702165d8f1236e400b1d5e95fad14f1821d40de05340a044f0ec8a587d8478854252cc938a663aa9f854e6a5e683ef8f8349c60dc6c628ed

From 6aa3bad3906ab096a68b57fc7772db2a29ff9b17 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 5 Sep 2024 10:25:31 -0700
Subject: [PATCH 38/86] Update to Rust 1.81.0

---
 .gitignore                                    |   2 +
 ...ssue-122805.rs-big-endian-compatible.patch |  49 ---------
 0001-Use-lld-provided-by-system.patch         |  77 +++++++------
 ...llow-disabling-target-self-contained.patch |  26 ++---
 ...-handle-no_std-targets-on-std-builds.patch | 103 ++++++++++++++++++
 ...xternal-library-path-for-wasm32-wasi.patch |  26 ++---
 rust.spec                                     |  31 +++---
 ...atch => rustc-1.81.0-disable-libssh2.patch |  20 ++--
 ...atch => rustc-1.81.0-unbundle-sqlite.patch |  12 +-
 sources                                       |   4 +-
 10 files changed, 208 insertions(+), 142 deletions(-)
 delete mode 100644 0001-Make-issue-122805.rs-big-endian-compatible.patch
 create mode 100644 0001-handle-no_std-targets-on-std-builds.patch
 rename rustc-1.80.0-disable-libssh2.patch => rustc-1.81.0-disable-libssh2.patch (54%)
 rename rustc-1.80.0-unbundle-sqlite.patch => rustc-1.81.0-unbundle-sqlite.patch (61%)

diff --git a/.gitignore b/.gitignore
index 6c91e62..f306e10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -439,3 +439,5 @@
 /wasi-libc-wasi-sdk-22.tar.gz
 /rustc-1.80.0-src.tar.xz
 /rustc-1.80.1-src.tar.xz
+/wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz
+/rustc-1.81.0-src.tar.xz
diff --git a/0001-Make-issue-122805.rs-big-endian-compatible.patch b/0001-Make-issue-122805.rs-big-endian-compatible.patch
deleted file mode 100644
index 23d9a86..0000000
--- a/0001-Make-issue-122805.rs-big-endian-compatible.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 26fa5c2c300f3c3a3ee3109c009bd4a6803a2a4c Mon Sep 17 00:00:00 2001
-From: Nikita Popov 
-Date: Tue, 11 Jun 2024 10:13:07 +0200
-Subject: [PATCH] Make issue-122805.rs big endian compatible
-
-Instead of not generating the function at all on big endian (which
-makes the CHECK lines fail), instead use to_le() on big endian,
-so that we essentially perform a bswap for both endiannesses.
----
- tests/codegen/issues/issue-122805.rs | 21 ++++++++++++---------
- 1 file changed, 12 insertions(+), 9 deletions(-)
-
-diff --git a/tests/codegen/issues/issue-122805.rs b/tests/codegen/issues/issue-122805.rs
-index 6d108ada6dd..8e03c6c8884 100644
---- a/tests/codegen/issues/issue-122805.rs
-+++ b/tests/codegen/issues/issue-122805.rs
-@@ -39,17 +39,20 @@
- // OPT3WINX64-NEXT: store <8 x i16>
- // CHECK-NEXT: ret void
- #[no_mangle]
--#[cfg(target_endian = "little")]
- pub fn convert(value: [u16; 8]) -> [u8; 16] {
-+    #[cfg(target_endian = "little")]
-+    let bswap = u16::to_be;
-+    #[cfg(target_endian = "big")]
-+    let bswap = u16::to_le;
-     let addr16 = [
--        value[0].to_be(),
--        value[1].to_be(),
--        value[2].to_be(),
--        value[3].to_be(),
--        value[4].to_be(),
--        value[5].to_be(),
--        value[6].to_be(),
--        value[7].to_be(),
-+        bswap(value[0]),
-+        bswap(value[1]),
-+        bswap(value[2]),
-+        bswap(value[3]),
-+        bswap(value[4]),
-+        bswap(value[5]),
-+        bswap(value[6]),
-+        bswap(value[7]),
-     ];
-     unsafe { core::mem::transmute::<_, [u8; 16]>(addr16) }
- }
--- 
-2.45.1
-
diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch
index d5970bd..063d66a 100644
--- a/0001-Use-lld-provided-by-system.patch
+++ b/0001-Use-lld-provided-by-system.patch
@@ -1,19 +1,21 @@
-From 61b5cc96337da2121221dd1bcdb63fd36551d065 Mon Sep 17 00:00:00 2001
+From 3d8c6d095581e8d7585f3772cfd16f6367f3c008 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
-Date: Wed, 1 Nov 2023 15:21:15 -0700
+Date: Fri, 16 Aug 2024 10:12:58 -0700
 Subject: [PATCH] Use lld provided by system
 
 ---
- compiler/rustc_target/src/spec/base/wasm.rs                   | 3 +--
- compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +-
- compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 +
- 3 files changed, 3 insertions(+), 3 deletions(-)
+ compiler/rustc_target/src/spec/base/wasm.rs                    | 3 +--
+ .../src/spec/targets/aarch64_unknown_none_softfloat.rs         | 2 +-
+ compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs | 1 +
+ compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs  | 2 +-
+ compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs  | 1 +
+ 5 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
-index 87ade9e58cf4..2ddff95febab 100644
+index f237391016e7..08bcd9699b4a 100644
 --- a/compiler/rustc_target/src/spec/base/wasm.rs
 +++ b/compiler/rustc_target/src/spec/base/wasm.rs
-@@ -91,8 +91,7 @@ macro_rules! args {
+@@ -85,8 +85,7 @@ macro_rules! args {
          // arguments just yet
          limit_rdylib_exports: false,
  
@@ -23,8 +25,33 @@ index 87ade9e58cf4..2ddff95febab 100644
          linker_flavor: LinkerFlavor::WasmLld(Cc::No),
  
          pre_link_args,
+diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
+index 222d5651b521..4b780bc8a8e7 100644
+--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
+@@ -14,7 +14,7 @@ pub fn target() -> Target {
+     let opts = TargetOptions {
+         abi: "softfloat".into(),
+         linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
+-        linker: Some("rust-lld".into()),
++        linker: Some("lld".into()),
+         features: "+v8a,+strict-align,-neon,-fp-armv8".into(),
+         relocation_model: RelocModel::Static,
+         disable_redzone: true,
+diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
+index 429303170b6b..19d4ec53f6d8 100644
+--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
+@@ -9,6 +9,7 @@ pub fn target() -> Target {
+     base.max_atomic_width = Some(128);
+     base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);
+     base.features = "+v8a".into();
++    base.linker = Some("lld".into());
+ 
+     Target {
+         llvm_target: "aarch64-unknown-windows".into(),
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
-index 9aa95a35f8e5..a9172f9441b7 100644
+index 549706998d46..b7e9158ddef5 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
 @@ -17,7 +17,7 @@ pub fn target() -> Target {
@@ -33,11 +60,11 @@ index 9aa95a35f8e5..a9172f9441b7 100644
          linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
 -        linker: Some("rust-lld".into()),
 +        linker: Some("lld".into()),
-         features:
-             "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
-                 .into(),
+         features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(),
+         supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
+         disable_redzone: true,
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
-index 5abfb8162f70..13cb43bda1a4 100644
+index 6da1fcca58c8..c84ae44576d4 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
 @@ -16,6 +16,7 @@ pub fn target() -> Target {
@@ -48,28 +75,6 @@ index 5abfb8162f70..13cb43bda1a4 100644
  
      // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
      // enable these CPU features explicitly before their first use, otherwise their instructions
-diff -Naur a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
---- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs	2024-03-17 12:03:00.000000000 -0700
-+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs	2024-03-22 10:02:17.742806274 -0700
-@@ -14,7 +14,7 @@
-     let opts = TargetOptions {
-         abi: "softfloat".into(),
-         linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
--        linker: Some("rust-lld".into()),
-+        linker: Some("lld".into()),
-         features: "+v8a,+strict-align,-neon,-fp-armv8".into(),
-         relocation_model: RelocModel::Static,
-         disable_redzone: true,
 -- 
-2.41.0
+2.46.0
 
---- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs	2024-04-09 19:20:09.000000000 +0200
-+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs	2024-04-26 11:22:31.988601550 +0200
-@@ -9,6 +9,7 @@ pub fn target() -> Target {
-     base.max_atomic_width = Some(128);
-     base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);
-     base.features = "+v8a".into();
-+    base.linker = Some("lld".into());
- 
-     Target {
-         llvm_target: "aarch64-unknown-windows".into(),
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index a168218..4913cd8 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From 2b99134e2884fa56bcab6d360885ec5421048e66 Mon Sep 17 00:00:00 2001
+From 937b23ef51b1d2f3d12adc9bd90dfd27936326dd Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:14:28 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/config.example.toml b/config.example.toml
-index f94553dd63f7..5ec969c80a37 100644
+index 26687bcfb370..381a23f9cead 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -869,6 +869,11 @@
+@@ -872,6 +872,11 @@
  # argument as the test binary.
  #runner =  (string)
  
@@ -27,10 +27,10 @@ index f94553dd63f7..5ec969c80a37 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index e927b491c71e..69a80d01d6b9 100644
+index 3e79acad1c4b..525b6e956405 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -356,6 +356,10 @@ fn copy_self_contained_objects(
+@@ -357,6 +357,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,10 +42,10 @@ index e927b491c71e..69a80d01d6b9 100644
      t!(fs::create_dir_all(&libdir_self_contained));
      let mut target_deps = vec![];
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index 3e1bc9a9acdd..5e24a9cc4f60 100644
+index 9d5aa795c6c0..720dc53514d3 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -586,6 +586,7 @@ pub struct Target {
+@@ -565,6 +565,7 @@ pub struct Target {
      pub runner: Option,
      pub no_std: bool,
      pub codegen_backends: Option>,
@@ -53,7 +53,7 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644
  }
  
  impl Target {
-@@ -594,6 +595,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -573,6 +574,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
              target.no_std = true;
          }
@@ -63,7 +63,7 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644
          target
      }
  }
-@@ -1150,6 +1154,7 @@ struct TomlTarget {
+@@ -1140,6 +1144,7 @@ struct TomlTarget {
          no_std: Option = "no-std",
          codegen_backends: Option> = "codegen-backends",
          runner: Option = "runner",
@@ -71,7 +71,7 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644
      }
  }
  
-@@ -1870,6 +1875,9 @@ fn get_table(option: &str) -> Result {
+@@ -1900,6 +1905,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index 5ed6b357e20a..c23b21d65713 100644
+index a8555b2c3673..70c41b51eb96 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1348,6 +1348,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1361,6 +1361,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -98,5 +98,5 @@ index 5ed6b357e20a..c23b21d65713 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.44.0
+2.46.0
 
diff --git a/0001-handle-no_std-targets-on-std-builds.patch b/0001-handle-no_std-targets-on-std-builds.patch
new file mode 100644
index 0000000..964b030
--- /dev/null
+++ b/0001-handle-no_std-targets-on-std-builds.patch
@@ -0,0 +1,103 @@
+From c41f254ad192a4ab402b40f8bdad169a8163140a Mon Sep 17 00:00:00 2001
+From: onur-ozkan 
+Date: Thu, 25 Jul 2024 15:59:25 +0300
+Subject: [PATCH] handle no_std targets on std builds
+
+This change unifies the `Step::run_make` logic and improves it by skipping
+std specific crates for no_std targets.
+
+Signed-off-by: onur-ozkan 
+(cherry picked from commit 6e247195c644aa924a10c98cc8eb3a28e1a87929)
+---
+ src/bootstrap/src/core/build_steps/check.rs   |  4 ++--
+ src/bootstrap/src/core/build_steps/clippy.rs  |  3 ++-
+ src/bootstrap/src/core/build_steps/compile.rs | 23 +++++++++++++++----
+ 3 files changed, 22 insertions(+), 8 deletions(-)
+
+diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
+index 8235d4634b75..bbad3f179ac7 100644
+--- a/src/bootstrap/src/core/build_steps/check.rs
++++ b/src/bootstrap/src/core/build_steps/check.rs
+@@ -1,7 +1,7 @@
+ //! Implementation of compiling the compiler and standard library, in "check"-based modes.
+ 
+ use crate::core::build_steps::compile::{
+-    add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo,
++    add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make,
+ };
+ use crate::core::build_steps::tool::{prepare_tool_cargo, SourceType};
+ use crate::core::builder::{
+@@ -47,7 +47,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+     }
+ 
+     fn make_run(run: RunConfig<'_>) {
+-        let crates = run.make_run_crates(Alias::Library);
++        let crates = std_crates_for_run_make(&run);
+         run.builder.ensure(Std { target: run.target, crates });
+     }
+ 
+diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs
+index 40a2112b1925..a3ab094d799d 100644
+--- a/src/bootstrap/src/core/build_steps/clippy.rs
++++ b/src/bootstrap/src/core/build_steps/clippy.rs
+@@ -4,6 +4,7 @@
+ 
+ use crate::builder::Builder;
+ use crate::builder::ShouldRun;
++use crate::core::build_steps::compile::std_crates_for_run_make;
+ use crate::core::builder;
+ use crate::core::builder::crate_description;
+ use crate::core::builder::Alias;
+@@ -122,7 +123,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+     }
+ 
+     fn make_run(run: RunConfig<'_>) {
+-        let crates = run.make_run_crates(Alias::Library);
++        let crates = std_crates_for_run_make(&run);
+         run.builder.ensure(Std { target: run.target, crates });
+     }
+ 
+diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
+index 525b6e956405..19c8cbc54080 100644
+--- a/src/bootstrap/src/core/build_steps/compile.rs
++++ b/src/bootstrap/src/core/build_steps/compile.rs
+@@ -127,11 +127,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+     }
+ 
+     fn make_run(run: RunConfig<'_>) {
+-        // If the paths include "library", build the entire standard library.
+-        let has_alias =
+-            run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library"));
+-        let crates = if has_alias { Default::default() } else { run.cargo_crates_in_set() };
+-
++        let crates = std_crates_for_run_make(&run);
+         run.builder.ensure(Std {
+             compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()),
+             target: run.target,
+@@ -428,6 +424,23 @@ fn copy_self_contained_objects(
+     target_deps
+ }
+ 
++/// Resolves standard library crates for `Std::run_make` for any build kind (like check, build, clippy, etc.).
++pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec {
++    let has_alias = run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library"));
++    let target_is_no_std = run.builder.no_std(run.target).unwrap_or(false);
++
++    // For no_std targets, do not add any additional crates to the compilation other than what `compile::std_cargo` already adds for no_std targets.
++    if target_is_no_std {
++        vec![]
++    }
++    // If the paths include "library", build the entire standard library.
++    else if has_alias {
++        run.make_run_crates(builder::Alias::Library)
++    } else {
++        run.cargo_crates_in_set()
++    }
++}
++
+ /// Configure cargo to compile the standard library, adding appropriate env vars
+ /// and such.
+ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) {
+-- 
+2.46.0
+
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 34ab22a..5d8c836 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,4 +1,4 @@
-From e3b7d2e3d3b4fcbc6591de606957c0fd59b5e547 Mon Sep 17 00:00:00 2001
+From 348b03695d916ab23a9d66c4ceed2ecbecfc68e7 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:18:16 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
@@ -10,10 +10,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi
  3 files changed, 17 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index f5e8d5fc92a9..f4ad3f725427 100644
+index 8c582fac0d82..169d86cd6224 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1563,6 +1563,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1586,6 +1586,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -26,7 +26,7 @@ index f5e8d5fc92a9..f4ad3f725427 100644
      for search_path in fs.search_paths() {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2049,6 +2055,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
+@@ -2076,6 +2082,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
          let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
          cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
      }
@@ -37,10 +37,10 @@ index f5e8d5fc92a9..f4ad3f725427 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 941d767b850d..cd0a2ce51989 100644
+index 607eeac7ccdc..63070622502e 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -1881,6 +1881,7 @@ pub struct TargetOptions {
+@@ -2033,6 +2033,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -48,7 +48,7 @@ index 941d767b850d..cd0a2ce51989 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2368,6 +2369,7 @@ fn default() -> TargetOptions {
+@@ -2520,6 +2521,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -56,7 +56,7 @@ index 941d767b850d..cd0a2ce51989 100644
              pre_link_objects_self_contained: Default::default(),
              post_link_objects_self_contained: Default::default(),
              link_self_contained: LinkSelfContainedDefault::False,
-@@ -3064,6 +3066,7 @@ macro_rules! key {
+@@ -3202,6 +3204,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -64,7 +64,7 @@ index 941d767b850d..cd0a2ce51989 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -3327,6 +3330,7 @@ macro_rules! target_option_val {
+@@ -3464,6 +3467,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -73,11 +73,11 @@ index 941d767b850d..cd0a2ce51989 100644
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
 diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-index 7cbe9f09e6ca..b524890c2ec5 100644
+index a8e7f22c0689..55949557d6bb 100644
 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-@@ -20,11 +20,12 @@ pub fn target() -> Target {
-     options.os = "wasi".into();
+@@ -21,11 +21,12 @@ pub fn target() -> Target {
+     options.env = "p1".into();
      options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]);
  
 -    options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained();
@@ -93,5 +93,5 @@ index 7cbe9f09e6ca..b524890c2ec5 100644
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.44.0
+2.46.0
 
diff --git a/rust.spec b/rust.spec
index 88053b0..29c67ef 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.80.1
+Version:        1.81.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.79.0
-%global bootstrap_channel 1.79.0
-%global bootstrap_date 2024-06-13
+%global bootstrap_version 1.80.1
+%global bootstrap_channel 1.80.1
+%global bootstrap_date 2024-08-08
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -55,7 +55,8 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-%global wasi_libc_ref wasi-sdk-22
+#global wasi_libc_ref wasi-sdk-23
+%global wasi_libc_ref 3f43ea9abb24ed8d24d760989e1d87ea385f8eaa
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@@ -78,10 +79,10 @@ ExclusiveArch:  %{rust_arches}
 
 # Requires stable libgit2 1.7, and not the next minor soname change.
 # This needs to be consistent with the bindings in vendor/libgit2-sys.
-%global min_libgit2_version 1.7.2
-%global next_libgit2_version 1.8.0~
-%global bundled_libgit2_version 1.7.2
-%if 0%{?fedora} >= 39
+%global min_libgit2_version 1.8.1
+%global next_libgit2_version 1.9.0~
+%global bundled_libgit2_version 1.8.1
+%if 0%{?fedora} >= 42
 %bcond_with bundled_libgit2
 %else
 %bcond_without bundled_libgit2
@@ -155,10 +156,11 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.80.0-unbundle-sqlite.patch
+Patch6:         rustc-1.81.0-unbundle-sqlite.patch
 
-# Fix codegen test failure on big endian: https://github.com/rust-lang/rust/pull/126263
-Patch7:         0001-Make-issue-122805.rs-big-endian-compatible.patch
+# handle no_std targets on std builds
+# https://github.com/rust-lang/rust/pull/128182
+Patch7:         0001-handle-no_std-targets-on-std-builds.patch
 
 ### RHEL-specific patches below ###
 
@@ -169,7 +171,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.80.0-disable-libssh2.patch
+Patch100:       rustc-1.81.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -329,6 +331,7 @@ Requires:       /usr/bin/cc
 # - wasm targets lost the archive index, which we were repairing with llvm-ranlib
 # - uefi targets couldn't link builtins like memcpy, possibly due to lost COMDAT flags
 %global __brp_strip_static_archive %{nil}
+%global __brp_strip_lto %{nil}
 
 %if %{without bundled_llvm}
 %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1}
@@ -832,6 +835,8 @@ test -r "%{profiler}"
     %{!?llvm_has_filecheck: --disable-codegen-tests} \
     %{!?with_llvm_static: --enable-llvm-link-shared } } \
   --disable-llvm-static-stdcpp \
+  --disable-llvm-bitcode-linker \
+  --disable-lld \
   --disable-rpath \
   %{enable_debuginfo} \
   %{enable_rust_opts} \
diff --git a/rustc-1.80.0-disable-libssh2.patch b/rustc-1.81.0-disable-libssh2.patch
similarity index 54%
rename from rustc-1.80.0-disable-libssh2.patch
rename to rustc-1.81.0-disable-libssh2.patch
index 85061b4..abee3c3 100644
--- a/rustc-1.80.0-disable-libssh2.patch
+++ b/rustc-1.81.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-07-05 18:14:51.101370053 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-07-05 18:14:51.104370020 -0700
-@@ -2151,7 +2151,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-08-26 09:03:52.769956890 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-08-26 09:03:52.773956573 -0700
+@@ -2155,7 +2155,6 @@ checksum = "10472326a8a6477c3c20a64547b0
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2192,20 +2191,6 @@ dependencies = [
+@@ -2196,20 +2195,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -31,14 +31,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  [[package]]
  name = "libz-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-07-05 18:14:51.104370020 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-07-05 18:15:36.584867840 -0700
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-08-26 09:03:52.773956573 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-08-26 09:05:08.595934397 -0700
 @@ -44,7 +44,7 @@ curl = "0.4.46"
  curl-sys = "0.4.72"
  filetime = "0.2.23"
  flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
--git2 = "0.18.3"
-+git2 = { version = "0.18.3", default-features = false, features = ["https"] }
- git2-curl = "0.19.0"
- gix = { version = "0.63.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision", "parallel", "dirwalk"] }
+-git2 = "0.19.0"
++git2 = { version = "0.19.0", default-features = false, features = ["https"] }
+ git2-curl = "0.20.0"
+ gix = { version = "0.64.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
  glob = "0.3.1"
diff --git a/rustc-1.80.0-unbundle-sqlite.patch b/rustc-1.81.0-unbundle-sqlite.patch
similarity index 61%
rename from rustc-1.80.0-unbundle-sqlite.patch
rename to rustc-1.81.0-unbundle-sqlite.patch
index d38128d..ec3ed1e 100644
--- a/rustc-1.80.0-unbundle-sqlite.patch
+++ b/rustc-1.81.0-unbundle-sqlite.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2006-07-23 18:21:28.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-07-05 18:09:20.585019493 -0700
-@@ -2189,7 +2189,6 @@ version = "0.28.0"
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-08-15 09:53:53.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-08-16 10:20:52.394575295 -0700
+@@ -2195,7 +2195,6 @@ version = "0.28.0"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f"
  dependencies = [
@@ -10,10 +10,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-07-05 18:09:20.585019493 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-07-05 18:10:13.753432408 -0700
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-08-16 10:20:52.394575295 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-08-16 10:21:50.535122479 -0700
 @@ -77,7 +77,7 @@ proptest = "1.4.0"
- pulldown-cmark = { version = "0.10.3", default-features = false, features = ["html"] }
+ pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] }
  rand = "0.8.5"
  regex = "1.10.4"
 -rusqlite = { version = "0.31.0", features = ["bundled"] }
diff --git a/sources b/sources
index c7d3d82..6e100e8 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.80.1-src.tar.xz) = 3c746108a86eeb734c1a8c8f63ba1a45e2cb03a8cb553395a167d07dc3ce5d8d9ea365ddd95533b6952d915069b86cad7ad218d27861e0889f8e878136bd32ab
-SHA512 (wasi-libc-wasi-sdk-22.tar.gz) = 3fcd5d6c0e09d824702165d8f1236e400b1d5e95fad14f1821d40de05340a044f0ec8a587d8478854252cc938a663aa9f854e6a5e683ef8f8349c60dc6c628ed
+SHA512 (rustc-1.81.0-src.tar.xz) = b8a837ced521d2ca2c7f228a0640da591384519e4dbc1ae768524d50616da6abbd2f7bdae3777caebc0447dac91bf76481282ce5a2264d7f30e173caa6321a51
+SHA512 (wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz) = 845380a421bd002f0ccbbbf49cb16f36b4fb6401f98c9ccfa54d3a75832ca547f2823eedc3788be0a99cd582d9eb8ef5f16d828a6116ded133908ec9a7f20cf7

From 0c755bb834563e126b76d87e95c666c408f2e542 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Mon, 30 Sep 2024 09:50:32 -0700
Subject: [PATCH 39/86] Only add an automatic SONAME for Rust dylibs

Fixes RHBZ#2314879
---
 ...-an-automatic-SONAME-for-Rust-dylibs.patch | 234 ++++++++++++++++++
 rust.spec                                     |   4 +
 2 files changed, 238 insertions(+)
 create mode 100644 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch

diff --git a/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch b/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
new file mode 100644
index 0000000..80970d1
--- /dev/null
+++ b/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
@@ -0,0 +1,234 @@
+From f46057bf1cc0dc24a0ecd7d87c9c93872e685253 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Fri, 27 Sep 2024 15:53:26 -0700
+Subject: [PATCH] Only add an automatic SONAME for Rust dylibs
+
+---
+ compiler/rustc_codegen_ssa/src/back/link.rs   |  2 +-
+ compiler/rustc_codegen_ssa/src/back/linker.rs | 83 +++++++++++++++----
+ tests/run-make/dylib-soname/rmake.rs          | 16 ++--
+ 3 files changed, 80 insertions(+), 21 deletions(-)
+
+diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
+index 80e8111516ee..a23cc5129261 100644
+--- a/compiler/rustc_codegen_ssa/src/back/link.rs
++++ b/compiler/rustc_codegen_ssa/src/back/link.rs
+@@ -2490,7 +2490,7 @@ fn add_order_independent_options(
+         }
+     }
+ 
+-    cmd.set_output_kind(link_output_kind, out_filename);
++    cmd.set_output_kind(link_output_kind, crate_type, out_filename);
+ 
+     add_relro_args(cmd, sess);
+ 
+diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
+index a73ec83ee62c..3f3d305da014 100644
+--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
++++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
+@@ -275,7 +275,12 @@ pub(crate) trait Linker {
+     fn is_cc(&self) -> bool {
+         false
+     }
+-    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path);
++    fn set_output_kind(
++        &mut self,
++        output_kind: LinkOutputKind,
++        crate_type: CrateType,
++        out_filename: &Path,
++    );
+     fn link_dylib_by_name(&mut self, _name: &str, _verbatim: bool, _as_needed: bool) {
+         bug!("dylib linked with unsupported linker")
+     }
+@@ -396,7 +401,7 @@ fn push_linker_plugin_lto_args(&mut self, plugin_path: Option<&OsStr>) {
+         ]);
+     }
+ 
+-    fn build_dylib(&mut self, out_filename: &Path) {
++    fn build_dylib(&mut self, crate_type: CrateType, out_filename: &Path) {
+         // On mac we need to tell the linker to let this library be rpathed
+         if self.sess.target.is_like_osx {
+             if !self.is_ld {
+@@ -427,7 +432,7 @@ fn build_dylib(&mut self, out_filename: &Path) {
+                     let mut out_implib = OsString::from("--out-implib=");
+                     out_implib.push(out_filename.with_file_name(implib_name));
+                     self.link_arg(out_implib);
+-                } else {
++                } else if crate_type == CrateType::Dylib {
+                     // When dylibs are linked by a full path this value will get into `DT_NEEDED`
+                     // instead of the full path, so the library can be later found in some other
+                     // location than that specific path.
+@@ -474,7 +479,12 @@ fn is_cc(&self) -> bool {
+         !self.is_ld
+     }
+ 
+-    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
++    fn set_output_kind(
++        &mut self,
++        output_kind: LinkOutputKind,
++        crate_type: CrateType,
++        out_filename: &Path,
++    ) {
+         match output_kind {
+             LinkOutputKind::DynamicNoPicExe => {
+                 if !self.is_ld && self.is_gnu {
+@@ -509,10 +519,10 @@ fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path)
+                     self.link_args(&["-static", "-pie", "--no-dynamic-linker", "-z", "text"]);
+                 }
+             }
+-            LinkOutputKind::DynamicDylib => self.build_dylib(out_filename),
++            LinkOutputKind::DynamicDylib => self.build_dylib(crate_type, out_filename),
+             LinkOutputKind::StaticDylib => {
+                 self.link_or_cc_arg("-static");
+-                self.build_dylib(out_filename);
++                self.build_dylib(crate_type, out_filename);
+             }
+             LinkOutputKind::WasiReactorExe => {
+                 self.link_args(&["--entry", "_initialize"]);
+@@ -866,7 +876,12 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
++    fn set_output_kind(
++        &mut self,
++        output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        out_filename: &Path,
++    ) {
+         match output_kind {
+             LinkOutputKind::DynamicNoPicExe
+             | LinkOutputKind::DynamicPicExe
+@@ -1124,7 +1139,13 @@ fn is_cc(&self) -> bool {
+         true
+     }
+ 
+-    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
++    fn set_output_kind(
++        &mut self,
++        _output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        _out_filename: &Path,
++    ) {
++    }
+ 
+     fn link_dylib_by_name(&mut self, name: &str, _verbatim: bool, _as_needed: bool) {
+         // Emscripten always links statically
+@@ -1273,7 +1294,12 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, output_kind: LinkOutputKind, _out_filename: &Path) {
++    fn set_output_kind(
++        &mut self,
++        output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        _out_filename: &Path,
++    ) {
+         match output_kind {
+             LinkOutputKind::DynamicNoPicExe
+             | LinkOutputKind::DynamicPicExe
+@@ -1422,7 +1448,13 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
++    fn set_output_kind(
++        &mut self,
++        _output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        _out_filename: &Path,
++    ) {
++    }
+ 
+     fn link_staticlib_by_name(&mut self, name: &str, _verbatim: bool, whole_archive: bool) {
+         self.hint_static();
+@@ -1568,7 +1600,12 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
++    fn set_output_kind(
++        &mut self,
++        output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        out_filename: &Path,
++    ) {
+         match output_kind {
+             LinkOutputKind::DynamicDylib => {
+                 self.hint_dynamic();
+@@ -1775,7 +1812,13 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
++    fn set_output_kind(
++        &mut self,
++        _output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        _out_filename: &Path,
++    ) {
++    }
+ 
+     fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) {
+         panic!("staticlibs not supported")
+@@ -1841,7 +1884,13 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
++    fn set_output_kind(
++        &mut self,
++        _output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        _out_filename: &Path,
++    ) {
++    }
+ 
+     fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) {
+         panic!("staticlibs not supported")
+@@ -1912,7 +1961,13 @@ fn cmd(&mut self) -> &mut Command {
+         &mut self.cmd
+     }
+ 
+-    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
++    fn set_output_kind(
++        &mut self,
++        _output_kind: LinkOutputKind,
++        _crate_type: CrateType,
++        _out_filename: &Path,
++    ) {
++    }
+ 
+     fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) {
+         panic!("staticlibs not supported")
+diff --git a/tests/run-make/dylib-soname/rmake.rs b/tests/run-make/dylib-soname/rmake.rs
+index cec0d4638424..714997cbc1a1 100644
+--- a/tests/run-make/dylib-soname/rmake.rs
++++ b/tests/run-make/dylib-soname/rmake.rs
+@@ -7,12 +7,16 @@
+ use run_make_support::{cmd, run_in_tmpdir, rustc};
+ 
+ fn main() {
++    let check = |ty: &str| {
++        rustc().crate_name("foo").crate_type(ty).input("foo.rs").run();
++        cmd("readelf").arg("-d").arg("libfoo.so").run()
++    };
+     run_in_tmpdir(|| {
+-        rustc().crate_name("foo").crate_type("dylib").input("foo.rs").run();
+-        cmd("readelf")
+-            .arg("-d")
+-            .arg("libfoo.so")
+-            .run()
+-            .assert_stdout_contains("Library soname: [libfoo.so]");
++        // Rust dylibs should get a relative SONAME
++        check("dylib").assert_stdout_contains("Library soname: [libfoo.so]");
++    });
++    run_in_tmpdir(|| {
++        // C dylibs should not implicitly get any SONAME
++        check("cdylib").assert_stdout_not_contains("Library soname:");
+     });
+ }
+-- 
+2.46.1
+
diff --git a/rust.spec b/rust.spec
index 29c67ef..6ae4bfc 100644
--- a/rust.spec
+++ b/rust.spec
@@ -162,6 +162,9 @@ Patch6:         rustc-1.81.0-unbundle-sqlite.patch
 # https://github.com/rust-lang/rust/pull/128182
 Patch7:         0001-handle-no_std-targets-on-std-builds.patch
 
+# https://github.com/rust-lang/rust/pull/130960
+Patch8:         0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -666,6 +669,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
+%patch -P8 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1

From 5dab1210ebd7063bb6bc3e673fd83f68c15eb622 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Mon, 30 Sep 2024 11:57:52 -0700
Subject: [PATCH 40/86] Apply patches for LLVM 19

---
 rust.spec                            |   4 +
 rustc-1.81.0-Update-to-LLVM-19.patch | 560 +++++++++++++++++++++++++++
 2 files changed, 564 insertions(+)
 create mode 100644 rustc-1.81.0-Update-to-LLVM-19.patch

diff --git a/rust.spec b/rust.spec
index 6ae4bfc..e17968b 100644
--- a/rust.spec
+++ b/rust.spec
@@ -165,6 +165,9 @@ Patch7:         0001-handle-no_std-targets-on-std-builds.patch
 # https://github.com/rust-lang/rust/pull/130960
 Patch8:         0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
 
+# https://github.com/rust-lang/rust/pull/127513
+Patch9:         rustc-1.81.0-Update-to-LLVM-19.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -670,6 +673,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %endif
 %patch -P7 -p1
 %patch -P8 -p1
+%patch -P9 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
diff --git a/rustc-1.81.0-Update-to-LLVM-19.patch b/rustc-1.81.0-Update-to-LLVM-19.patch
new file mode 100644
index 0000000..cd8145a
--- /dev/null
+++ b/rustc-1.81.0-Update-to-LLVM-19.patch
@@ -0,0 +1,560 @@
+From 83f32e189ad59109a162a61d7844545c4eda48e7 Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Tue, 9 Jul 2024 09:34:59 +0200
+Subject: [PATCH 1/4] Update to LLVM 19
+
+(cherry picked from commit 579ab05e76f1434f3074195c7291895f1257bc97)
+---
+ .gitmodules      | 2 +-
+ src/llvm-project | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/.gitmodules b/.gitmodules
+index 9ad207a0d522..b5250d493864 100644
+--- a/.gitmodules
++++ b/.gitmodules
+@@ -33,7 +33,7 @@
+ [submodule "src/llvm-project"]
+ 	path = src/llvm-project
+ 	url = https://github.com/rust-lang/llvm-project.git
+-	branch = rustc/18.1-2024-05-19
++	branch = rustc/19.1-2024-07-30
+ 	shallow = true
+ [submodule "src/doc/embedded-book"]
+ 	path = src/doc/embedded-book
+-- 
+2.46.1
+
+
+From 3bdb9f55ed61e1984e9b2ac23c328a4792e41b6e Mon Sep 17 00:00:00 2001
+From: Krasimir Georgiev 
+Date: Mon, 17 Jun 2024 09:35:38 +0000
+Subject: [PATCH 2/4] Disable MC/DC tests on LLVM 19
+
+Disable the tests and generate an error if MC/DC is used on LLVM 19.
+The support will be ported separately, as it is substantially
+different on LLVM 19, and there are no plans to support both
+versions.
+
+(cherry picked from commit 00bfd702dc8c3b760b4f965fd059a5f1db8bb2b1)
+---
+ compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 +-
+ tests/coverage/mcdc/condition-limit.rs           | 1 +
+ tests/coverage/mcdc/if.rs                        | 1 +
+ tests/coverage/mcdc/inlined_expressions.rs       | 1 +
+ tests/coverage/mcdc/nested_if.rs                 | 1 +
+ tests/coverage/mcdc/non_control_flow.rs          | 1 +
+ 6 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+index 14757b27a375..493cfbcec2cf 100644
+--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+@@ -1557,7 +1557,7 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) {
+ 
+ extern "C" LLVMValueRef
+ LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) {
+-#if LLVM_VERSION_GE(18, 0)
++#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0)
+   return wrap(llvm::Intrinsic::getDeclaration(
+       unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update));
+ #else
+diff --git a/tests/coverage/mcdc/condition-limit.rs b/tests/coverage/mcdc/condition-limit.rs
+index 571c600ebd09..2ff46b11a168 100644
+--- a/tests/coverage/mcdc/condition-limit.rs
++++ b/tests/coverage/mcdc/condition-limit.rs
+@@ -1,6 +1,7 @@
+ #![feature(coverage_attribute)]
+ //@ edition: 2021
+ //@ min-llvm-version: 18
++//@ ignore-llvm-version: 19 - 99
+ //@ compile-flags: -Zcoverage-options=mcdc
+ //@ llvm-cov-flags: --show-branches=count --show-mcdc
+ 
+diff --git a/tests/coverage/mcdc/if.rs b/tests/coverage/mcdc/if.rs
+index d8e6b61a9d59..6f589659a3d7 100644
+--- a/tests/coverage/mcdc/if.rs
++++ b/tests/coverage/mcdc/if.rs
+@@ -1,6 +1,7 @@
+ #![feature(coverage_attribute)]
+ //@ edition: 2021
+ //@ min-llvm-version: 18
++//@ ignore-llvm-version: 19 - 99
+ //@ compile-flags: -Zcoverage-options=mcdc
+ //@ llvm-cov-flags: --show-branches=count --show-mcdc
+ 
+diff --git a/tests/coverage/mcdc/inlined_expressions.rs b/tests/coverage/mcdc/inlined_expressions.rs
+index 65f7ee66f399..fc1e4dae37c7 100644
+--- a/tests/coverage/mcdc/inlined_expressions.rs
++++ b/tests/coverage/mcdc/inlined_expressions.rs
+@@ -1,6 +1,7 @@
+ #![feature(coverage_attribute)]
+ //@ edition: 2021
+ //@ min-llvm-version: 18
++//@ ignore-llvm-version: 19 - 99
+ //@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
+ //@ llvm-cov-flags: --show-branches=count --show-mcdc
+ 
+diff --git a/tests/coverage/mcdc/nested_if.rs b/tests/coverage/mcdc/nested_if.rs
+index f5068b5dcc23..f9ce7a0bc254 100644
+--- a/tests/coverage/mcdc/nested_if.rs
++++ b/tests/coverage/mcdc/nested_if.rs
+@@ -1,6 +1,7 @@
+ #![feature(coverage_attribute)]
+ //@ edition: 2021
+ //@ min-llvm-version: 18
++//@ ignore-llvm-version: 19 - 99
+ //@ compile-flags: -Zcoverage-options=mcdc
+ //@ llvm-cov-flags: --show-branches=count --show-mcdc
+ 
+diff --git a/tests/coverage/mcdc/non_control_flow.rs b/tests/coverage/mcdc/non_control_flow.rs
+index 77e64e6625b2..633d381a1aaf 100644
+--- a/tests/coverage/mcdc/non_control_flow.rs
++++ b/tests/coverage/mcdc/non_control_flow.rs
+@@ -1,6 +1,7 @@
+ #![feature(coverage_attribute)]
+ //@ edition: 2021
+ //@ min-llvm-version: 18
++//@ ignore-llvm-version: 19 - 99
+ //@ compile-flags: -Zcoverage-options=mcdc
+ //@ llvm-cov-flags: --show-branches=count --show-mcdc
+ 
+-- 
+2.46.1
+
+
+From d9476247415418ec6cc3478636ada38cf28feb69 Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Wed, 24 Jul 2024 16:03:36 +0200
+Subject: [PATCH 3/4] Crash test for issue 121444 has been fixed
+
+(cherry picked from commit b960390548b373bd80b5d9fe590ae3b577e8e8f2)
+---
+ tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+ rename tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} (68%)
+
+diff --git a/tests/crashes/121444.rs b/tests/ui/abi/large-byval-align.rs
+similarity index 68%
+rename from tests/crashes/121444.rs
+rename to tests/ui/abi/large-byval-align.rs
+index a6373a58c426..e39170df72b4 100644
+--- a/tests/crashes/121444.rs
++++ b/tests/ui/abi/large-byval-align.rs
+@@ -1,11 +1,13 @@
+-//@ known-bug: #121444
+ //@ compile-flags: -Copt-level=0
+-//@ edition:2021
+ //@ only-x86_64
+ //@ ignore-windows
++//@ min-llvm-version: 19
++//@ build-pass
++
+ #[repr(align(536870912))]
+ pub struct A(i64);
+ 
++#[allow(improper_ctypes_definitions)]
+ pub extern "C" fn foo(x: A) {}
+ 
+ fn main() {
+-- 
+2.46.1
+
+
+From 05f84c2aa8853263b650b21637f689255413b923 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Tue, 30 Jul 2024 18:25:05 -0700
+Subject: [PATCH 4/4] Bless coverage/mcdc for line number changes
+
+(cherry picked from commit 33a36ea43851a767d8182938161b0dad4f9ae68c)
+---
+ tests/coverage/mcdc/condition-limit.cov-map   |  8 +++---
+ tests/coverage/mcdc/if.cov-map                | 28 +++++++++----------
+ .../coverage/mcdc/inlined_expressions.cov-map |  4 +--
+ tests/coverage/mcdc/nested_if.cov-map         | 16 +++++------
+ tests/coverage/mcdc/non_control_flow.cov-map  | 28 +++++++++----------
+ 5 files changed, 42 insertions(+), 42 deletions(-)
+
+diff --git a/tests/coverage/mcdc/condition-limit.cov-map b/tests/coverage/mcdc/condition-limit.cov-map
+index b4447a33691a..b565353572a7 100644
+--- a/tests/coverage/mcdc/condition-limit.cov-map
++++ b/tests/coverage/mcdc/condition-limit.cov-map
+@@ -1,5 +1,5 @@
+ Function name: condition_limit::bad
+-Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 14, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
++Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 15, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 44
+@@ -48,7 +48,7 @@ Number of expressions: 44
+ - expression 42 operands: lhs = Expression(43, Add), rhs = Counter(4)
+ - expression 43 operands: lhs = Counter(2), rhs = Counter(3)
+ Number of file 0 mappings: 17
+-- Code(Counter(0)) at (prev + 20, 1) to (start + 3, 9)
++- Code(Counter(0)) at (prev + 21, 1) to (start + 3, 9)
+ - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 3, 8) to (start + 0, 9)
+     true  = c1
+     false = (c0 - c1)
+@@ -88,7 +88,7 @@ Number of file 0 mappings: 17
+     = (c8 + ((((((c2 + c3) + c4) + c5) + c6) + c7) + (c0 - c1)))
+ 
+ Function name: condition_limit::good
+-Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0c, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02]
++Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0d, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 32
+@@ -125,7 +125,7 @@ Number of expressions: 32
+ - expression 30 operands: lhs = Expression(31, Add), rhs = Counter(4)
+ - expression 31 operands: lhs = Counter(2), rhs = Counter(3)
+ Number of file 0 mappings: 16
+-- Code(Counter(0)) at (prev + 12, 1) to (start + 3, 9)
++- Code(Counter(0)) at (prev + 13, 1) to (start + 3, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 6 } at (prev + 3, 8) to (start + 0, 34)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 6, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+diff --git a/tests/coverage/mcdc/if.cov-map b/tests/coverage/mcdc/if.cov-map
+index 9a7d15f700df..ea8dedb0ac36 100644
+--- a/tests/coverage/mcdc/if.cov-map
++++ b/tests/coverage/mcdc/if.cov-map
+@@ -1,5 +1,5 @@
+ Function name: if::mcdc_check_a
+-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 10, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 4
+@@ -8,7 +8,7 @@ Number of expressions: 4
+ - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
+ - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 8
+-- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -24,7 +24,7 @@ Number of file 0 mappings: 8
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: if::mcdc_check_b
+-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 18, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 4
+@@ -33,7 +33,7 @@ Number of expressions: 4
+ - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
+ - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 8
+-- Code(Counter(0)) at (prev + 23, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 24, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -49,7 +49,7 @@ Number of file 0 mappings: 8
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: if::mcdc_check_both
+-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 20, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 4
+@@ -58,7 +58,7 @@ Number of expressions: 4
+ - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
+ - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 8
+-- Code(Counter(0)) at (prev + 31, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 32, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -74,7 +74,7 @@ Number of file 0 mappings: 8
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: if::mcdc_check_neither
+-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 08, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 4
+@@ -83,7 +83,7 @@ Number of expressions: 4
+ - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
+ - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 8
+-- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -99,7 +99,7 @@ Number of file 0 mappings: 8
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: if::mcdc_check_not_tree_decision
+-Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
++Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 32, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 8
+@@ -112,7 +112,7 @@ Number of expressions: 8
+ - expression 6 operands: lhs = Counter(3), rhs = Expression(7, Sub)
+ - expression 7 operands: lhs = Expression(0, Sub), rhs = Counter(2)
+ Number of file 0 mappings: 10
+-- Code(Counter(0)) at (prev + 49, 1) to (start + 3, 10)
++- Code(Counter(0)) at (prev + 50, 1) to (start + 3, 10)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 3 } at (prev + 0, 9) to (start + 0, 10)
+     true  = c1
+@@ -134,7 +134,7 @@ Number of file 0 mappings: 10
+     = (c4 + (c3 + ((c0 - c1) - c2)))
+ 
+ Function name: if::mcdc_check_tree_decision
+-Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
++Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 28, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 8
+@@ -147,7 +147,7 @@ Number of expressions: 8
+ - expression 6 operands: lhs = Counter(3), rhs = Counter(4)
+ - expression 7 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 10
+-- Code(Counter(0)) at (prev + 39, 1) to (start + 3, 9)
++- Code(Counter(0)) at (prev + 40, 1) to (start + 3, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -169,7 +169,7 @@ Number of file 0 mappings: 10
+     = ((c3 + c4) + (c2 + (c0 - c1)))
+ 
+ Function name: if::mcdc_nested_if
+-Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
++Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3c, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 13
+@@ -187,7 +187,7 @@ Number of expressions: 13
+ - expression 11 operands: lhs = Counter(4), rhs = Counter(5)
+ - expression 12 operands: lhs = Expression(0, Sub), rhs = Counter(2)
+ Number of file 0 mappings: 14
+-- Code(Counter(0)) at (prev + 59, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 60, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+diff --git a/tests/coverage/mcdc/inlined_expressions.cov-map b/tests/coverage/mcdc/inlined_expressions.cov-map
+index 09b7291c9649..8bb488c0dc07 100644
+--- a/tests/coverage/mcdc/inlined_expressions.cov-map
++++ b/tests/coverage/mcdc/inlined_expressions.cov-map
+@@ -1,5 +1,5 @@
+ Function name: inlined_expressions::inlined_instance
+-Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 08, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
++Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 09, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 3
+@@ -7,7 +7,7 @@ Number of expressions: 3
+ - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
+ - expression 2 operands: lhs = Counter(2), rhs = Counter(3)
+ Number of file 0 mappings: 6
+-- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 6)
++- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 6)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 5) to (start + 0, 11)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 5) to (start + 0, 6)
+     true  = c1
+diff --git a/tests/coverage/mcdc/nested_if.cov-map b/tests/coverage/mcdc/nested_if.cov-map
+index adeb6cbc1fb8..0bd2aef814c2 100644
+--- a/tests/coverage/mcdc/nested_if.cov-map
++++ b/tests/coverage/mcdc/nested_if.cov-map
+@@ -1,5 +1,5 @@
+ Function name: nested_if::doubly_nested_if_in_condition
+-Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
++Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 10, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 14
+@@ -18,7 +18,7 @@ Number of expressions: 14
+ - expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add)
+ - expression 13 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 20
+-- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -58,7 +58,7 @@ Number of file 0 mappings: 20
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: nested_if::nested_if_in_condition
+-Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
++Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 08, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 11
+@@ -74,7 +74,7 @@ Number of expressions: 11
+ - expression 9 operands: lhs = Counter(3), rhs = Expression(10, Add)
+ - expression 10 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 14
+-- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -103,7 +103,7 @@ Number of file 0 mappings: 14
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: nested_if::nested_in_then_block_in_condition
+-Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
++Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 23, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 18
+@@ -126,7 +126,7 @@ Number of expressions: 18
+ - expression 16 operands: lhs = Counter(3), rhs = Expression(17, Add)
+ - expression 17 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 20
+-- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9)
++- Code(Counter(0)) at (prev + 35, 1) to (start + 1, 9)
+ - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+@@ -167,7 +167,7 @@ Number of file 0 mappings: 20
+     = (c3 + (c2 + (c0 - c1)))
+ 
+ Function name: nested_if::nested_single_condition_decision
+-Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
++Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 18, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 6
+@@ -178,7 +178,7 @@ Number of expressions: 6
+ - expression 4 operands: lhs = Counter(3), rhs = Expression(5, Add)
+ - expression 5 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+ Number of file 0 mappings: 11
+-- Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9)
++- Code(Counter(0)) at (prev + 24, 1) to (start + 4, 9)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+     true  = c1
+diff --git a/tests/coverage/mcdc/non_control_flow.cov-map b/tests/coverage/mcdc/non_control_flow.cov-map
+index f8576831e75f..0c6928b684d6 100644
+--- a/tests/coverage/mcdc/non_control_flow.cov-map
++++ b/tests/coverage/mcdc/non_control_flow.cov-map
+@@ -1,5 +1,5 @@
+ Function name: non_control_flow::assign_3
+-Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 16, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
++Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 17, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 9
+@@ -13,7 +13,7 @@ Number of expressions: 9
+ - expression 7 operands: lhs = Expression(8, Sub), rhs = Counter(4)
+ - expression 8 operands: lhs = Counter(0), rhs = Counter(1)
+ Number of file 0 mappings: 10
+-- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 40)
++- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 40)
+ - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
+     = (c1 + ((c2 + c3) + c4))
+ - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
+@@ -35,7 +35,7 @@ Number of file 0 mappings: 10
+     = (c1 + ((c2 + c3) + c4))
+ 
+ Function name: non_control_flow::assign_3_bis
+-Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1b, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
++Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1c, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 7
+@@ -47,7 +47,7 @@ Number of expressions: 7
+ - expression 5 operands: lhs = Counter(1), rhs = Counter(2)
+ - expression 6 operands: lhs = Counter(0), rhs = Counter(1)
+ Number of file 0 mappings: 10
+-- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 44)
++- Code(Counter(0)) at (prev + 28, 1) to (start + 0, 44)
+ - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
+     = ((c2 + c3) + c4)
+ - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
+@@ -68,7 +68,7 @@ Number of file 0 mappings: 10
+     = ((c2 + c3) + c4)
+ 
+ Function name: non_control_flow::assign_and
+-Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0c, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
++Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0d, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 4
+@@ -77,7 +77,7 @@ Number of expressions: 4
+ - expression 2 operands: lhs = Counter(0), rhs = Counter(1)
+ - expression 3 operands: lhs = Counter(0), rhs = Counter(1)
+ Number of file 0 mappings: 8
+-- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 33)
++- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 33)
+ - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
+     = ((c2 + c3) + (c0 - c1))
+ - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
+@@ -93,7 +93,7 @@ Number of file 0 mappings: 8
+     = ((c2 + c3) + (c0 - c1))
+ 
+ Function name: non_control_flow::assign_or
+-Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 11, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
++Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 12, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 4
+@@ -102,7 +102,7 @@ Number of expressions: 4
+ - expression 2 operands: lhs = Counter(0), rhs = Counter(1)
+ - expression 3 operands: lhs = Counter(0), rhs = Counter(1)
+ Number of file 0 mappings: 8
+-- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 32)
++- Code(Counter(0)) at (prev + 18, 1) to (start + 0, 32)
+ - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
+     = ((c1 + c2) + c3)
+ - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
+@@ -119,15 +119,15 @@ Number of file 0 mappings: 8
+     = ((c1 + c2) + c3)
+ 
+ Function name: non_control_flow::foo
+-Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 02, 02]
++Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 02, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 0
+ Number of file 0 mappings: 1
+-- Code(Counter(0)) at (prev + 37, 1) to (start + 2, 2)
++- Code(Counter(0)) at (prev + 38, 1) to (start + 2, 2)
+ 
+ Function name: non_control_flow::func_call
+-Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 29, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02]
++Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 2a, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 3
+@@ -135,7 +135,7 @@ Number of expressions: 3
+ - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
+ - expression 2 operands: lhs = Counter(2), rhs = Counter(3)
+ Number of file 0 mappings: 6
+-- Code(Counter(0)) at (prev + 41, 1) to (start + 1, 10)
++- Code(Counter(0)) at (prev + 42, 1) to (start + 1, 10)
+ - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 9) to (start + 0, 15)
+ - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 9) to (start + 0, 10)
+     true  = c1
+@@ -148,7 +148,7 @@ Number of file 0 mappings: 6
+     = ((c2 + c3) + (c0 - c1))
+ 
+ Function name: non_control_flow::right_comb_tree
+-Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 20, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02]
++Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 21, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02]
+ Number of files: 1
+ - file 0 => global file 1
+ Number of expressions: 19
+@@ -172,7 +172,7 @@ Number of expressions: 19
+ - expression 17 operands: lhs = Expression(18, Sub), rhs = Counter(5)
+ - expression 18 operands: lhs = Counter(1), rhs = Counter(6)
+ Number of file 0 mappings: 14
+-- Code(Counter(0)) at (prev + 32, 1) to (start + 0, 65)
++- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 65)
+ - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
+     = (((((c2 + c3) + c4) + c5) + c6) + (c0 - c1))
+ - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
+-- 
+2.46.1
+

From 04388f6e65312d834c3c26dc8e1bf6650057d292 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 1 Oct 2024 10:39:20 -0700
Subject: [PATCH 41/86] Skip crash tests

[skip changelog]
---
 rust.spec | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/rust.spec b/rust.spec
index e17968b..b3daf12 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1006,9 +1006,12 @@ rm -rf "$TMP_HELLO"
 # The results are not stable on koji, so mask errors and just log it.
 # Some of the larger test artifacts are manually cleaned to save space.
 
-# Bootstrap is excluded because it's not something we ship, and a lot of its
-# tests are geared toward the upstream CI environment.
-%{__x} test --no-fail-fast --skip src/bootstrap || :
+# - Bootstrap is excluded because it's not something we ship, and a lot of its
+#   tests are geared toward the upstream CI environment.
+# - Crashes are excluded because they are less reliable, especially stuff like
+#   SIGSEGV across different arches -- UB can do all kinds of weird things.
+#   They're only meant to notice "accidental" fixes anyway, not *should* crash.
+%{__x} test --no-fail-fast --skip={src/bootstrap,tests/crashes} || :
 rm -rf "./build/%{rust_triple}/test/"
 
 %ifarch aarch64

From 06c0e45816d0f35409da9b8ee11bc05f28659b85 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Wed, 2 Oct 2024 10:41:49 -0700
Subject: [PATCH 42/86] [eln] Upgrade wasi-libc for clang-19

---
 .gitignore | 1 +
 rust.spec  | 4 ++--
 sources    | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index f306e10..33e1c00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -441,3 +441,4 @@
 /rustc-1.80.1-src.tar.xz
 /wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz
 /rustc-1.81.0-src.tar.xz
+/wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz
diff --git a/rust.spec b/rust.spec
index b3daf12..1a2ee8c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -55,8 +55,8 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-#global wasi_libc_ref wasi-sdk-23
-%global wasi_libc_ref 3f43ea9abb24ed8d24d760989e1d87ea385f8eaa
+#global wasi_libc_ref wasi-sdk-24
+%global wasi_libc_ref b9ef79d7dbd47c6c5bafdae760823467c2f60b70
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
diff --git a/sources b/sources
index 6e100e8..140bdf7 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
 SHA512 (rustc-1.81.0-src.tar.xz) = b8a837ced521d2ca2c7f228a0640da591384519e4dbc1ae768524d50616da6abbd2f7bdae3777caebc0447dac91bf76481282ce5a2264d7f30e173caa6321a51
-SHA512 (wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz) = 845380a421bd002f0ccbbbf49cb16f36b4fb6401f98c9ccfa54d3a75832ca547f2823eedc3788be0a99cd582d9eb8ef5f16d828a6116ded133908ec9a7f20cf7
+SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e

From 57f6a22eeaa0aab106739e427ed42a27573e0109 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 8 Oct 2024 12:44:32 -0700
Subject: [PATCH 43/86] Require rust libraries for rust-analyzer; Fixes
 RHBZ#2316529

---
 rust.spec | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rust.spec b/rust.spec
index 1a2ee8c..63e6097 100644
--- a/rust.spec
+++ b/rust.spec
@@ -572,6 +572,9 @@ A tool for formatting Rust code according to style guidelines.
 %package analyzer
 Summary:        Rust implementation of the Language Server Protocol
 
+# /usr/bin/rust-analyzer is dynamically linked against internal rustc libs
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
 # The standard library sources are needed for most functionality.
 Recommends:     %{name}-src
 

From f737b8c4dddc2d64481479aec6c85bead138c1af Mon Sep 17 00:00:00 2001
From: Davide Cavalca 
Date: Mon, 7 Oct 2024 20:32:16 -0700
Subject: [PATCH 44/86] Reenable the aarch64-unknown-none-softfloat target on
 RHEL

This was dropped in
https://gitlab.com/redhat/centos-stream/rpms/rust/-/commit/bdc2be1e01cc1b9cd63a34a0a4940b450a482863
but it's needed for EPEL 10, so adding it back.

Resolves: RHEL-60808

Signed-off-by: Davide Cavalca 

(cherry picked from commit 175d35473cf8885da93bc888f7f4a54a369c84cd)
---
 rust.spec | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rust.spec b/rust.spec
index 63e6097..b237757 100644
--- a/rust.spec
+++ b/rust.spec
@@ -46,6 +46,9 @@ ExclusiveArch:  %{rust_arches}
 %if 0%{?fedora}
 %global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi
 %endif
+%if 0%{?rhel} >= 10
+%global extra_targets aarch64-unknown-none-softfloat
+%endif
 %endif
 %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
 %define target_enabled() %{lua:

From 5b4a0fd51abd7fb5a0c8ab893ada0b1788adc615 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 17 Oct 2024 10:23:39 -0700
Subject: [PATCH 45/86] Update to Rust 1.82.0

---
 .gitignore                                    |   1 +
 ...sm-component-ld-to-match-other-tools.patch | 147 +++++
 ...-an-automatic-SONAME-for-Rust-dylibs.patch | 234 --------
 ...llow-disabling-target-self-contained.patch |  24 +-
 ...-handle-no_std-targets-on-std-builds.patch | 103 ----
 ...xternal-library-path-for-wasm32-wasi.patch |  39 +-
 rust.spec                                     |  37 +-
 rustc-1.81.0-Update-to-LLVM-19.patch          | 560 ------------------
 rustc-1.81.0-unbundle-sqlite.patch            |  23 -
 ...atch => rustc-1.82.0-disable-libssh2.patch |  14 +-
 rustc-1.82.0-unbundle-sqlite.patch            |  23 +
 sources                                       |   2 +-
 12 files changed, 225 insertions(+), 982 deletions(-)
 create mode 100644 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
 delete mode 100644 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
 delete mode 100644 0001-handle-no_std-targets-on-std-builds.patch
 delete mode 100644 rustc-1.81.0-Update-to-LLVM-19.patch
 delete mode 100644 rustc-1.81.0-unbundle-sqlite.patch
 rename rustc-1.81.0-disable-libssh2.patch => rustc-1.82.0-disable-libssh2.patch (69%)
 create mode 100644 rustc-1.82.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index 33e1c00..61d9a93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -442,3 +442,4 @@
 /wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz
 /rustc-1.81.0-src.tar.xz
 /wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz
+/rustc-1.82.0-src.tar.xz
diff --git a/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch b/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
new file mode 100644
index 0000000..5364012
--- /dev/null
+++ b/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
@@ -0,0 +1,147 @@
+From c15469a7fec811d1a4f69ff26e18c6f383df41d2 Mon Sep 17 00:00:00 2001
+From: Alex Crichton 
+Date: Fri, 6 Sep 2024 09:21:33 -0700
+Subject: [PATCH] Fix enabling wasm-component-ld to match other tools
+
+It was [pointed out recently][comment] that enabling `wasm-component-ld`
+as a host tool is different from other host tools. This commit refactors
+the logic to match by deduplicating selection of when to build other
+tools and then using the same logic for `wasm-component-ld`.
+
+[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720
+---
+ src/bootstrap/src/core/build_steps/compile.rs |  2 +-
+ src/bootstrap/src/core/build_steps/dist.rs    |  2 +-
+ src/bootstrap/src/core/build_steps/tool.rs    | 38 +++----------------
+ src/bootstrap/src/lib.rs                      | 17 +++++----
+ 4 files changed, 17 insertions(+), 42 deletions(-)
+
+diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
+index 1936c91ef83c..102c9fd25543 100644
+--- a/src/bootstrap/src/core/build_steps/compile.rs
++++ b/src/bootstrap/src/core/build_steps/compile.rs
+@@ -1912,7 +1912,7 @@ fn run(self, builder: &Builder<'_>) -> Compiler {
+         // delegates to the `rust-lld` binary for linking and then runs
+         // logic to create the final binary. This is used by the
+         // `wasm32-wasip2` target of Rust.
+-        if builder.build_wasm_component_ld() {
++        if builder.tool_enabled("wasm-component-ld") {
+             let wasm_component_ld_exe =
+                 builder.ensure(crate::core::build_steps::tool::WasmComponentLd {
+                     compiler: build_compiler,
+diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
+index 4957de2e1b79..ccb5656d6716 100644
+--- a/src/bootstrap/src/core/build_steps/dist.rs
++++ b/src/bootstrap/src/core/build_steps/dist.rs
+@@ -473,7 +473,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
+                     );
+                 }
+             }
+-            if builder.build_wasm_component_ld() {
++            if builder.tool_enabled("wasm-component-ld") {
+                 let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin");
+                 let ld = exe("wasm-component-ld", compiler.host);
+                 builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld));
+diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
+index 3a1eb43b801f..3c2d791c2090 100644
+--- a/src/bootstrap/src/core/build_steps/tool.rs
++++ b/src/bootstrap/src/core/build_steps/tool.rs
+@@ -693,14 +693,7 @@ impl Step for Cargo {
+ 
+     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+         let builder = run.builder;
+-        run.path("src/tools/cargo").default_condition(
+-            builder.config.extended
+-                && builder.config.tools.as_ref().map_or(
+-                    true,
+-                    // If `tools` is set, search list for this tool.
+-                    |tools| tools.iter().any(|tool| tool == "cargo"),
+-                ),
+-        )
++        run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo"))
+     }
+ 
+     fn make_run(run: RunConfig<'_>) {
+@@ -772,14 +765,7 @@ impl Step for RustAnalyzer {
+ 
+     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+         let builder = run.builder;
+-        run.path("src/tools/rust-analyzer").default_condition(
+-            builder.config.extended
+-                && builder
+-                    .config
+-                    .tools
+-                    .as_ref()
+-                    .map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
+-        )
++        run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer"))
+     }
+ 
+     fn make_run(run: RunConfig<'_>) {
+@@ -821,12 +807,8 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+         run.path("src/tools/rust-analyzer")
+             .path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
+             .default_condition(
+-                builder.config.extended
+-                    && builder.config.tools.as_ref().map_or(true, |tools| {
+-                        tools.iter().any(|tool| {
+-                            tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
+-                        })
+-                    }),
++                builder.tool_enabled("rust-analyzer")
++                    || builder.tool_enabled("rust-analyzer-proc-macro-srv"),
+             )
+     }
+ 
+@@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker {
+ 
+     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+         let builder = run.builder;
+-        run.path("src/tools/llvm-bitcode-linker").default_condition(
+-            builder.config.extended
+-                && builder
+-                    .config
+-                    .tools
+-                    .as_ref()
+-                    .map_or(builder.build.unstable_features(), |tools| {
+-                        tools.iter().any(|tool| tool == "llvm-bitcode-linker")
+-                    }),
+-        )
++        run.path("src/tools/llvm-bitcode-linker")
++            .default_condition(builder.tool_enabled("llvm-bitcode-linker"))
+     }
+ 
+     fn make_run(run: RunConfig<'_>) {
+diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
+index c76ce3409562..780024e307ed 100644
+--- a/src/bootstrap/src/lib.rs
++++ b/src/bootstrap/src/lib.rs
+@@ -1407,16 +1407,17 @@ fn default_wasi_runner(&self) -> Option {
+         None
+     }
+ 
+-    /// Returns whether it's requested that `wasm-component-ld` is built as part
+-    /// of the sysroot. This is done either with the `extended` key in
+-    /// `config.toml` or with the `tools` set.
+-    fn build_wasm_component_ld(&self) -> bool {
+-        if self.config.extended {
+-            return true;
++    /// Returns whether the specified tool is configured as part of this build.
++    ///
++    /// This requires that both the `extended` key is set and the `tools` key is
++    /// either unset or specifically contains the specified tool.
++    fn tool_enabled(&self, tool: &str) -> bool {
++        if !self.config.extended {
++            return false;
+         }
+         match &self.config.tools {
+-            Some(set) => set.contains("wasm-component-ld"),
+-            None => false,
++            Some(set) => set.contains(tool),
++            None => true,
+         }
+     }
+ 
+-- 
+2.46.0
+
diff --git a/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch b/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
deleted file mode 100644
index 80970d1..0000000
--- a/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-From f46057bf1cc0dc24a0ecd7d87c9c93872e685253 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Fri, 27 Sep 2024 15:53:26 -0700
-Subject: [PATCH] Only add an automatic SONAME for Rust dylibs
-
----
- compiler/rustc_codegen_ssa/src/back/link.rs   |  2 +-
- compiler/rustc_codegen_ssa/src/back/linker.rs | 83 +++++++++++++++----
- tests/run-make/dylib-soname/rmake.rs          | 16 ++--
- 3 files changed, 80 insertions(+), 21 deletions(-)
-
-diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index 80e8111516ee..a23cc5129261 100644
---- a/compiler/rustc_codegen_ssa/src/back/link.rs
-+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -2490,7 +2490,7 @@ fn add_order_independent_options(
-         }
-     }
- 
--    cmd.set_output_kind(link_output_kind, out_filename);
-+    cmd.set_output_kind(link_output_kind, crate_type, out_filename);
- 
-     add_relro_args(cmd, sess);
- 
-diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
-index a73ec83ee62c..3f3d305da014 100644
---- a/compiler/rustc_codegen_ssa/src/back/linker.rs
-+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
-@@ -275,7 +275,12 @@ pub(crate) trait Linker {
-     fn is_cc(&self) -> bool {
-         false
-     }
--    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path);
-+    fn set_output_kind(
-+        &mut self,
-+        output_kind: LinkOutputKind,
-+        crate_type: CrateType,
-+        out_filename: &Path,
-+    );
-     fn link_dylib_by_name(&mut self, _name: &str, _verbatim: bool, _as_needed: bool) {
-         bug!("dylib linked with unsupported linker")
-     }
-@@ -396,7 +401,7 @@ fn push_linker_plugin_lto_args(&mut self, plugin_path: Option<&OsStr>) {
-         ]);
-     }
- 
--    fn build_dylib(&mut self, out_filename: &Path) {
-+    fn build_dylib(&mut self, crate_type: CrateType, out_filename: &Path) {
-         // On mac we need to tell the linker to let this library be rpathed
-         if self.sess.target.is_like_osx {
-             if !self.is_ld {
-@@ -427,7 +432,7 @@ fn build_dylib(&mut self, out_filename: &Path) {
-                     let mut out_implib = OsString::from("--out-implib=");
-                     out_implib.push(out_filename.with_file_name(implib_name));
-                     self.link_arg(out_implib);
--                } else {
-+                } else if crate_type == CrateType::Dylib {
-                     // When dylibs are linked by a full path this value will get into `DT_NEEDED`
-                     // instead of the full path, so the library can be later found in some other
-                     // location than that specific path.
-@@ -474,7 +479,12 @@ fn is_cc(&self) -> bool {
-         !self.is_ld
-     }
- 
--    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
-+    fn set_output_kind(
-+        &mut self,
-+        output_kind: LinkOutputKind,
-+        crate_type: CrateType,
-+        out_filename: &Path,
-+    ) {
-         match output_kind {
-             LinkOutputKind::DynamicNoPicExe => {
-                 if !self.is_ld && self.is_gnu {
-@@ -509,10 +519,10 @@ fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path)
-                     self.link_args(&["-static", "-pie", "--no-dynamic-linker", "-z", "text"]);
-                 }
-             }
--            LinkOutputKind::DynamicDylib => self.build_dylib(out_filename),
-+            LinkOutputKind::DynamicDylib => self.build_dylib(crate_type, out_filename),
-             LinkOutputKind::StaticDylib => {
-                 self.link_or_cc_arg("-static");
--                self.build_dylib(out_filename);
-+                self.build_dylib(crate_type, out_filename);
-             }
-             LinkOutputKind::WasiReactorExe => {
-                 self.link_args(&["--entry", "_initialize"]);
-@@ -866,7 +876,12 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
-+    fn set_output_kind(
-+        &mut self,
-+        output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        out_filename: &Path,
-+    ) {
-         match output_kind {
-             LinkOutputKind::DynamicNoPicExe
-             | LinkOutputKind::DynamicPicExe
-@@ -1124,7 +1139,13 @@ fn is_cc(&self) -> bool {
-         true
-     }
- 
--    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
-+    fn set_output_kind(
-+        &mut self,
-+        _output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        _out_filename: &Path,
-+    ) {
-+    }
- 
-     fn link_dylib_by_name(&mut self, name: &str, _verbatim: bool, _as_needed: bool) {
-         // Emscripten always links statically
-@@ -1273,7 +1294,12 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, output_kind: LinkOutputKind, _out_filename: &Path) {
-+    fn set_output_kind(
-+        &mut self,
-+        output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        _out_filename: &Path,
-+    ) {
-         match output_kind {
-             LinkOutputKind::DynamicNoPicExe
-             | LinkOutputKind::DynamicPicExe
-@@ -1422,7 +1448,13 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
-+    fn set_output_kind(
-+        &mut self,
-+        _output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        _out_filename: &Path,
-+    ) {
-+    }
- 
-     fn link_staticlib_by_name(&mut self, name: &str, _verbatim: bool, whole_archive: bool) {
-         self.hint_static();
-@@ -1568,7 +1600,12 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
-+    fn set_output_kind(
-+        &mut self,
-+        output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        out_filename: &Path,
-+    ) {
-         match output_kind {
-             LinkOutputKind::DynamicDylib => {
-                 self.hint_dynamic();
-@@ -1775,7 +1812,13 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
-+    fn set_output_kind(
-+        &mut self,
-+        _output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        _out_filename: &Path,
-+    ) {
-+    }
- 
-     fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) {
-         panic!("staticlibs not supported")
-@@ -1841,7 +1884,13 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
-+    fn set_output_kind(
-+        &mut self,
-+        _output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        _out_filename: &Path,
-+    ) {
-+    }
- 
-     fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) {
-         panic!("staticlibs not supported")
-@@ -1912,7 +1961,13 @@ fn cmd(&mut self) -> &mut Command {
-         &mut self.cmd
-     }
- 
--    fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {}
-+    fn set_output_kind(
-+        &mut self,
-+        _output_kind: LinkOutputKind,
-+        _crate_type: CrateType,
-+        _out_filename: &Path,
-+    ) {
-+    }
- 
-     fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) {
-         panic!("staticlibs not supported")
-diff --git a/tests/run-make/dylib-soname/rmake.rs b/tests/run-make/dylib-soname/rmake.rs
-index cec0d4638424..714997cbc1a1 100644
---- a/tests/run-make/dylib-soname/rmake.rs
-+++ b/tests/run-make/dylib-soname/rmake.rs
-@@ -7,12 +7,16 @@
- use run_make_support::{cmd, run_in_tmpdir, rustc};
- 
- fn main() {
-+    let check = |ty: &str| {
-+        rustc().crate_name("foo").crate_type(ty).input("foo.rs").run();
-+        cmd("readelf").arg("-d").arg("libfoo.so").run()
-+    };
-     run_in_tmpdir(|| {
--        rustc().crate_name("foo").crate_type("dylib").input("foo.rs").run();
--        cmd("readelf")
--            .arg("-d")
--            .arg("libfoo.so")
--            .run()
--            .assert_stdout_contains("Library soname: [libfoo.so]");
-+        // Rust dylibs should get a relative SONAME
-+        check("dylib").assert_stdout_contains("Library soname: [libfoo.so]");
-+    });
-+    run_in_tmpdir(|| {
-+        // C dylibs should not implicitly get any SONAME
-+        check("cdylib").assert_stdout_not_contains("Library soname:");
-     });
- }
--- 
-2.46.1
-
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 4913cd8..428f354 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From 937b23ef51b1d2f3d12adc9bd90dfd27936326dd Mon Sep 17 00:00:00 2001
+From babdaf8354098399ec98c96eb3a3627664d6ba03 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:14:28 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/config.example.toml b/config.example.toml
-index 26687bcfb370..381a23f9cead 100644
+index f1dc32234ccf..82207f19d471 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -872,6 +872,11 @@
+@@ -880,6 +880,11 @@
  # argument as the test binary.
  #runner =  (string)
  
@@ -27,10 +27,10 @@ index 26687bcfb370..381a23f9cead 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 3e79acad1c4b..525b6e956405 100644
+index edf18e2ebf33..d48d027f329c 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -357,6 +357,10 @@ fn copy_self_contained_objects(
+@@ -367,6 +367,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,10 +42,10 @@ index 3e79acad1c4b..525b6e956405 100644
      t!(fs::create_dir_all(&libdir_self_contained));
      let mut target_deps = vec![];
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index 9d5aa795c6c0..720dc53514d3 100644
+index bdfee55d8d18..47fcd50e7e03 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -565,6 +565,7 @@ pub struct Target {
+@@ -589,6 +589,7 @@ pub struct Target {
      pub runner: Option,
      pub no_std: bool,
      pub codegen_backends: Option>,
@@ -53,7 +53,7 @@ index 9d5aa795c6c0..720dc53514d3 100644
  }
  
  impl Target {
-@@ -573,6 +574,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -597,6 +598,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
              target.no_std = true;
          }
@@ -63,7 +63,7 @@ index 9d5aa795c6c0..720dc53514d3 100644
          target
      }
  }
-@@ -1140,6 +1144,7 @@ struct TomlTarget {
+@@ -1165,6 +1169,7 @@ struct TomlTarget {
          no_std: Option = "no-std",
          codegen_backends: Option> = "codegen-backends",
          runner: Option = "runner",
@@ -71,7 +71,7 @@ index 9d5aa795c6c0..720dc53514d3 100644
      }
  }
  
-@@ -1900,6 +1905,9 @@ fn get_table(option: &str) -> Result {
+@@ -1967,6 +1972,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index 9d5aa795c6c0..720dc53514d3 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index a8555b2c3673..70c41b51eb96 100644
+index 82b640f54234..f724aba50241 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1361,6 +1361,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1326,6 +1326,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
diff --git a/0001-handle-no_std-targets-on-std-builds.patch b/0001-handle-no_std-targets-on-std-builds.patch
deleted file mode 100644
index 964b030..0000000
--- a/0001-handle-no_std-targets-on-std-builds.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From c41f254ad192a4ab402b40f8bdad169a8163140a Mon Sep 17 00:00:00 2001
-From: onur-ozkan 
-Date: Thu, 25 Jul 2024 15:59:25 +0300
-Subject: [PATCH] handle no_std targets on std builds
-
-This change unifies the `Step::run_make` logic and improves it by skipping
-std specific crates for no_std targets.
-
-Signed-off-by: onur-ozkan 
-(cherry picked from commit 6e247195c644aa924a10c98cc8eb3a28e1a87929)
----
- src/bootstrap/src/core/build_steps/check.rs   |  4 ++--
- src/bootstrap/src/core/build_steps/clippy.rs  |  3 ++-
- src/bootstrap/src/core/build_steps/compile.rs | 23 +++++++++++++++----
- 3 files changed, 22 insertions(+), 8 deletions(-)
-
-diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
-index 8235d4634b75..bbad3f179ac7 100644
---- a/src/bootstrap/src/core/build_steps/check.rs
-+++ b/src/bootstrap/src/core/build_steps/check.rs
-@@ -1,7 +1,7 @@
- //! Implementation of compiling the compiler and standard library, in "check"-based modes.
- 
- use crate::core::build_steps::compile::{
--    add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo,
-+    add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make,
- };
- use crate::core::build_steps::tool::{prepare_tool_cargo, SourceType};
- use crate::core::builder::{
-@@ -47,7 +47,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-     }
- 
-     fn make_run(run: RunConfig<'_>) {
--        let crates = run.make_run_crates(Alias::Library);
-+        let crates = std_crates_for_run_make(&run);
-         run.builder.ensure(Std { target: run.target, crates });
-     }
- 
-diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs
-index 40a2112b1925..a3ab094d799d 100644
---- a/src/bootstrap/src/core/build_steps/clippy.rs
-+++ b/src/bootstrap/src/core/build_steps/clippy.rs
-@@ -4,6 +4,7 @@
- 
- use crate::builder::Builder;
- use crate::builder::ShouldRun;
-+use crate::core::build_steps::compile::std_crates_for_run_make;
- use crate::core::builder;
- use crate::core::builder::crate_description;
- use crate::core::builder::Alias;
-@@ -122,7 +123,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-     }
- 
-     fn make_run(run: RunConfig<'_>) {
--        let crates = run.make_run_crates(Alias::Library);
-+        let crates = std_crates_for_run_make(&run);
-         run.builder.ensure(Std { target: run.target, crates });
-     }
- 
-diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 525b6e956405..19c8cbc54080 100644
---- a/src/bootstrap/src/core/build_steps/compile.rs
-+++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -127,11 +127,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-     }
- 
-     fn make_run(run: RunConfig<'_>) {
--        // If the paths include "library", build the entire standard library.
--        let has_alias =
--            run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library"));
--        let crates = if has_alias { Default::default() } else { run.cargo_crates_in_set() };
--
-+        let crates = std_crates_for_run_make(&run);
-         run.builder.ensure(Std {
-             compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()),
-             target: run.target,
-@@ -428,6 +424,23 @@ fn copy_self_contained_objects(
-     target_deps
- }
- 
-+/// Resolves standard library crates for `Std::run_make` for any build kind (like check, build, clippy, etc.).
-+pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec {
-+    let has_alias = run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library"));
-+    let target_is_no_std = run.builder.no_std(run.target).unwrap_or(false);
-+
-+    // For no_std targets, do not add any additional crates to the compilation other than what `compile::std_cargo` already adds for no_std targets.
-+    if target_is_no_std {
-+        vec![]
-+    }
-+    // If the paths include "library", build the entire standard library.
-+    else if has_alias {
-+        run.make_run_crates(builder::Alias::Library)
-+    } else {
-+        run.cargo_crates_in_set()
-+    }
-+}
-+
- /// Configure cargo to compile the standard library, adding appropriate env vars
- /// and such.
- pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) {
--- 
-2.46.0
-
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 5d8c836..feeb0f3 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,19 +1,19 @@
-From 348b03695d916ab23a9d66c4ceed2ecbecfc68e7 Mon Sep 17 00:00:00 2001
+From 3fdce19416e80a48c5b2b77b2cdec697d0b5e225 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:18:16 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
 
 ---
- compiler/rustc_codegen_ssa/src/back/link.rs             | 9 +++++++++
- compiler/rustc_target/src/spec/mod.rs                   | 4 ++++
- compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++---
- 3 files changed, 17 insertions(+), 3 deletions(-)
+ compiler/rustc_codegen_ssa/src/back/link.rs            | 10 ++++++++++
+ compiler/rustc_target/src/spec/mod.rs                  |  4 ++++
+ .../rustc_target/src/spec/targets/wasm32_wasip1.rs     |  7 ++++---
+ 3 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index 8c582fac0d82..169d86cd6224 100644
+index e8143b9a5f38..5a928a18b3ea 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1586,6 +1586,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1621,6 +1621,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -23,13 +23,14 @@ index 8c582fac0d82..169d86cd6224 100644
 +            return file_path;
 +        }
 +    }
-     for search_path in fs.search_paths() {
+     for search_path in sess.target_filesearch(PathKind::Native).search_paths() {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2076,6 +2082,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
-         let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
-         cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
-     }
+@@ -2123,6 +2129,10 @@ fn add_library_search_dirs(
+             ControlFlow::<()>::Continue(())
+         },
+     );
++
 +    if let Some(lib_path) = &sess.target.options.external_lib_path {
 +        cmd.include_path(Path::new(lib_path.as_ref()));
 +    }
@@ -37,10 +38,10 @@ index 8c582fac0d82..169d86cd6224 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 607eeac7ccdc..63070622502e 100644
+index d5f227a84a4c..54c22c8ebed6 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2033,6 +2033,7 @@ pub struct TargetOptions {
+@@ -2053,6 +2053,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -48,7 +49,7 @@ index 607eeac7ccdc..63070622502e 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2520,6 +2521,7 @@ fn default() -> TargetOptions {
+@@ -2540,6 +2541,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -56,7 +57,7 @@ index 607eeac7ccdc..63070622502e 100644
              pre_link_objects_self_contained: Default::default(),
              post_link_objects_self_contained: Default::default(),
              link_self_contained: LinkSelfContainedDefault::False,
-@@ -3202,6 +3204,7 @@ macro_rules! key {
+@@ -3221,6 +3223,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -64,7 +65,7 @@ index 607eeac7ccdc..63070622502e 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -3464,6 +3467,7 @@ macro_rules! target_option_val {
+@@ -3482,6 +3485,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -73,10 +74,10 @@ index 607eeac7ccdc..63070622502e 100644
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
 diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-index a8e7f22c0689..55949557d6bb 100644
+index 29e6dff2068f..dbe021ef064c 100644
 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-@@ -21,11 +21,12 @@ pub fn target() -> Target {
+@@ -19,11 +19,12 @@ pub fn target() -> Target {
      options.env = "p1".into();
      options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]);
  
diff --git a/rust.spec b/rust.spec
index b237757..f67def5 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.81.0
+Version:        1.82.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.80.1
-%global bootstrap_channel 1.80.1
-%global bootstrap_date 2024-08-08
+%global bootstrap_version 1.81.0
+%global bootstrap_channel 1.81.0
+%global bootstrap_date 2024-09-05
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -75,17 +75,17 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient.  Rust currently requires LLVM 17.0+.
 %global min_llvm_version 17.0.0
-%global bundled_llvm_version 18.1.7
+%global bundled_llvm_version 19.1.1
 #global llvm_compat_version 17
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
 
-# Requires stable libgit2 1.7, and not the next minor soname change.
+# Requires stable libgit2 1.8, and not the next minor soname change.
 # This needs to be consistent with the bindings in vendor/libgit2-sys.
 %global min_libgit2_version 1.8.1
 %global next_libgit2_version 1.9.0~
 %global bundled_libgit2_version 1.8.1
-%if 0%{?fedora} >= 42
+%if 0%{?fedora} >= 41
 %bcond_with bundled_libgit2
 %else
 %bcond_without bundled_libgit2
@@ -93,7 +93,7 @@ ExclusiveArch:  %{rust_arches}
 
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
-%global bundled_sqlite3_version 3.45.0
+%global bundled_sqlite3_version 3.46.0
 %if 0%{?rhel} && 0%{?rhel} < 10
 %bcond_without bundled_sqlite3
 %else
@@ -159,17 +159,10 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.81.0-unbundle-sqlite.patch
+Patch6:         rustc-1.82.0-unbundle-sqlite.patch
 
-# handle no_std targets on std builds
-# https://github.com/rust-lang/rust/pull/128182
-Patch7:         0001-handle-no_std-targets-on-std-builds.patch
-
-# https://github.com/rust-lang/rust/pull/130960
-Patch8:         0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch
-
-# https://github.com/rust-lang/rust/pull/127513
-Patch9:         rustc-1.81.0-Update-to-LLVM-19.patch
+# https://github.com/rust-lang/rust/pull/130034
+Patch7:         0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
 
 ### RHEL-specific patches below ###
 
@@ -180,7 +173,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.81.0-disable-libssh2.patch
+Patch100:       rustc-1.82.0-disable-libssh2.patch
 
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
@@ -678,8 +671,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
-%patch -P8 -p1
-%patch -P9 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -775,9 +766,9 @@ end}
 %{export_rust_env}
 
 # Some builders have relatively little memory for their CPU count.
-# At least 2GB per CPU is a good rule of thumb for building rustc.
+# At least 4GB per CPU is a good rule of thumb for building rustc.
 ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN)
-max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 ))
+max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 4 ))
 if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then
   ncpus="$max_cpus"
 fi
diff --git a/rustc-1.81.0-Update-to-LLVM-19.patch b/rustc-1.81.0-Update-to-LLVM-19.patch
deleted file mode 100644
index cd8145a..0000000
--- a/rustc-1.81.0-Update-to-LLVM-19.patch
+++ /dev/null
@@ -1,560 +0,0 @@
-From 83f32e189ad59109a162a61d7844545c4eda48e7 Mon Sep 17 00:00:00 2001
-From: Nikita Popov 
-Date: Tue, 9 Jul 2024 09:34:59 +0200
-Subject: [PATCH 1/4] Update to LLVM 19
-
-(cherry picked from commit 579ab05e76f1434f3074195c7291895f1257bc97)
----
- .gitmodules      | 2 +-
- src/llvm-project | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/.gitmodules b/.gitmodules
-index 9ad207a0d522..b5250d493864 100644
---- a/.gitmodules
-+++ b/.gitmodules
-@@ -33,7 +33,7 @@
- [submodule "src/llvm-project"]
- 	path = src/llvm-project
- 	url = https://github.com/rust-lang/llvm-project.git
--	branch = rustc/18.1-2024-05-19
-+	branch = rustc/19.1-2024-07-30
- 	shallow = true
- [submodule "src/doc/embedded-book"]
- 	path = src/doc/embedded-book
--- 
-2.46.1
-
-
-From 3bdb9f55ed61e1984e9b2ac23c328a4792e41b6e Mon Sep 17 00:00:00 2001
-From: Krasimir Georgiev 
-Date: Mon, 17 Jun 2024 09:35:38 +0000
-Subject: [PATCH 2/4] Disable MC/DC tests on LLVM 19
-
-Disable the tests and generate an error if MC/DC is used on LLVM 19.
-The support will be ported separately, as it is substantially
-different on LLVM 19, and there are no plans to support both
-versions.
-
-(cherry picked from commit 00bfd702dc8c3b760b4f965fd059a5f1db8bb2b1)
----
- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 +-
- tests/coverage/mcdc/condition-limit.rs           | 1 +
- tests/coverage/mcdc/if.rs                        | 1 +
- tests/coverage/mcdc/inlined_expressions.rs       | 1 +
- tests/coverage/mcdc/nested_if.rs                 | 1 +
- tests/coverage/mcdc/non_control_flow.rs          | 1 +
- 6 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-index 14757b27a375..493cfbcec2cf 100644
---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-@@ -1557,7 +1557,7 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) {
- 
- extern "C" LLVMValueRef
- LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) {
--#if LLVM_VERSION_GE(18, 0)
-+#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0)
-   return wrap(llvm::Intrinsic::getDeclaration(
-       unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update));
- #else
-diff --git a/tests/coverage/mcdc/condition-limit.rs b/tests/coverage/mcdc/condition-limit.rs
-index 571c600ebd09..2ff46b11a168 100644
---- a/tests/coverage/mcdc/condition-limit.rs
-+++ b/tests/coverage/mcdc/condition-limit.rs
-@@ -1,6 +1,7 @@
- #![feature(coverage_attribute)]
- //@ edition: 2021
- //@ min-llvm-version: 18
-+//@ ignore-llvm-version: 19 - 99
- //@ compile-flags: -Zcoverage-options=mcdc
- //@ llvm-cov-flags: --show-branches=count --show-mcdc
- 
-diff --git a/tests/coverage/mcdc/if.rs b/tests/coverage/mcdc/if.rs
-index d8e6b61a9d59..6f589659a3d7 100644
---- a/tests/coverage/mcdc/if.rs
-+++ b/tests/coverage/mcdc/if.rs
-@@ -1,6 +1,7 @@
- #![feature(coverage_attribute)]
- //@ edition: 2021
- //@ min-llvm-version: 18
-+//@ ignore-llvm-version: 19 - 99
- //@ compile-flags: -Zcoverage-options=mcdc
- //@ llvm-cov-flags: --show-branches=count --show-mcdc
- 
-diff --git a/tests/coverage/mcdc/inlined_expressions.rs b/tests/coverage/mcdc/inlined_expressions.rs
-index 65f7ee66f399..fc1e4dae37c7 100644
---- a/tests/coverage/mcdc/inlined_expressions.rs
-+++ b/tests/coverage/mcdc/inlined_expressions.rs
-@@ -1,6 +1,7 @@
- #![feature(coverage_attribute)]
- //@ edition: 2021
- //@ min-llvm-version: 18
-+//@ ignore-llvm-version: 19 - 99
- //@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
- //@ llvm-cov-flags: --show-branches=count --show-mcdc
- 
-diff --git a/tests/coverage/mcdc/nested_if.rs b/tests/coverage/mcdc/nested_if.rs
-index f5068b5dcc23..f9ce7a0bc254 100644
---- a/tests/coverage/mcdc/nested_if.rs
-+++ b/tests/coverage/mcdc/nested_if.rs
-@@ -1,6 +1,7 @@
- #![feature(coverage_attribute)]
- //@ edition: 2021
- //@ min-llvm-version: 18
-+//@ ignore-llvm-version: 19 - 99
- //@ compile-flags: -Zcoverage-options=mcdc
- //@ llvm-cov-flags: --show-branches=count --show-mcdc
- 
-diff --git a/tests/coverage/mcdc/non_control_flow.rs b/tests/coverage/mcdc/non_control_flow.rs
-index 77e64e6625b2..633d381a1aaf 100644
---- a/tests/coverage/mcdc/non_control_flow.rs
-+++ b/tests/coverage/mcdc/non_control_flow.rs
-@@ -1,6 +1,7 @@
- #![feature(coverage_attribute)]
- //@ edition: 2021
- //@ min-llvm-version: 18
-+//@ ignore-llvm-version: 19 - 99
- //@ compile-flags: -Zcoverage-options=mcdc
- //@ llvm-cov-flags: --show-branches=count --show-mcdc
- 
--- 
-2.46.1
-
-
-From d9476247415418ec6cc3478636ada38cf28feb69 Mon Sep 17 00:00:00 2001
-From: Nikita Popov 
-Date: Wed, 24 Jul 2024 16:03:36 +0200
-Subject: [PATCH 3/4] Crash test for issue 121444 has been fixed
-
-(cherry picked from commit b960390548b373bd80b5d9fe590ae3b577e8e8f2)
----
- tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
- rename tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} (68%)
-
-diff --git a/tests/crashes/121444.rs b/tests/ui/abi/large-byval-align.rs
-similarity index 68%
-rename from tests/crashes/121444.rs
-rename to tests/ui/abi/large-byval-align.rs
-index a6373a58c426..e39170df72b4 100644
---- a/tests/crashes/121444.rs
-+++ b/tests/ui/abi/large-byval-align.rs
-@@ -1,11 +1,13 @@
--//@ known-bug: #121444
- //@ compile-flags: -Copt-level=0
--//@ edition:2021
- //@ only-x86_64
- //@ ignore-windows
-+//@ min-llvm-version: 19
-+//@ build-pass
-+
- #[repr(align(536870912))]
- pub struct A(i64);
- 
-+#[allow(improper_ctypes_definitions)]
- pub extern "C" fn foo(x: A) {}
- 
- fn main() {
--- 
-2.46.1
-
-
-From 05f84c2aa8853263b650b21637f689255413b923 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Tue, 30 Jul 2024 18:25:05 -0700
-Subject: [PATCH 4/4] Bless coverage/mcdc for line number changes
-
-(cherry picked from commit 33a36ea43851a767d8182938161b0dad4f9ae68c)
----
- tests/coverage/mcdc/condition-limit.cov-map   |  8 +++---
- tests/coverage/mcdc/if.cov-map                | 28 +++++++++----------
- .../coverage/mcdc/inlined_expressions.cov-map |  4 +--
- tests/coverage/mcdc/nested_if.cov-map         | 16 +++++------
- tests/coverage/mcdc/non_control_flow.cov-map  | 28 +++++++++----------
- 5 files changed, 42 insertions(+), 42 deletions(-)
-
-diff --git a/tests/coverage/mcdc/condition-limit.cov-map b/tests/coverage/mcdc/condition-limit.cov-map
-index b4447a33691a..b565353572a7 100644
---- a/tests/coverage/mcdc/condition-limit.cov-map
-+++ b/tests/coverage/mcdc/condition-limit.cov-map
-@@ -1,5 +1,5 @@
- Function name: condition_limit::bad
--Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 14, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
-+Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 15, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 44
-@@ -48,7 +48,7 @@ Number of expressions: 44
- - expression 42 operands: lhs = Expression(43, Add), rhs = Counter(4)
- - expression 43 operands: lhs = Counter(2), rhs = Counter(3)
- Number of file 0 mappings: 17
--- Code(Counter(0)) at (prev + 20, 1) to (start + 3, 9)
-+- Code(Counter(0)) at (prev + 21, 1) to (start + 3, 9)
- - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 3, 8) to (start + 0, 9)
-     true  = c1
-     false = (c0 - c1)
-@@ -88,7 +88,7 @@ Number of file 0 mappings: 17
-     = (c8 + ((((((c2 + c3) + c4) + c5) + c6) + c7) + (c0 - c1)))
- 
- Function name: condition_limit::good
--Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0c, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02]
-+Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0d, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 32
-@@ -125,7 +125,7 @@ Number of expressions: 32
- - expression 30 operands: lhs = Expression(31, Add), rhs = Counter(4)
- - expression 31 operands: lhs = Counter(2), rhs = Counter(3)
- Number of file 0 mappings: 16
--- Code(Counter(0)) at (prev + 12, 1) to (start + 3, 9)
-+- Code(Counter(0)) at (prev + 13, 1) to (start + 3, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 6 } at (prev + 3, 8) to (start + 0, 34)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 6, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-diff --git a/tests/coverage/mcdc/if.cov-map b/tests/coverage/mcdc/if.cov-map
-index 9a7d15f700df..ea8dedb0ac36 100644
---- a/tests/coverage/mcdc/if.cov-map
-+++ b/tests/coverage/mcdc/if.cov-map
-@@ -1,5 +1,5 @@
- Function name: if::mcdc_check_a
--Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
-+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 10, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 4
-@@ -8,7 +8,7 @@ Number of expressions: 4
- - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 8
--- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -24,7 +24,7 @@ Number of file 0 mappings: 8
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: if::mcdc_check_b
--Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
-+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 18, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 4
-@@ -33,7 +33,7 @@ Number of expressions: 4
- - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 8
--- Code(Counter(0)) at (prev + 23, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 24, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -49,7 +49,7 @@ Number of file 0 mappings: 8
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: if::mcdc_check_both
--Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
-+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 20, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 4
-@@ -58,7 +58,7 @@ Number of expressions: 4
- - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 8
--- Code(Counter(0)) at (prev + 31, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 32, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -74,7 +74,7 @@ Number of file 0 mappings: 8
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: if::mcdc_check_neither
--Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
-+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 08, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 4
-@@ -83,7 +83,7 @@ Number of expressions: 4
- - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 8
--- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -99,7 +99,7 @@ Number of file 0 mappings: 8
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: if::mcdc_check_not_tree_decision
--Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
-+Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 32, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 8
-@@ -112,7 +112,7 @@ Number of expressions: 8
- - expression 6 operands: lhs = Counter(3), rhs = Expression(7, Sub)
- - expression 7 operands: lhs = Expression(0, Sub), rhs = Counter(2)
- Number of file 0 mappings: 10
--- Code(Counter(0)) at (prev + 49, 1) to (start + 3, 10)
-+- Code(Counter(0)) at (prev + 50, 1) to (start + 3, 10)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 3 } at (prev + 0, 9) to (start + 0, 10)
-     true  = c1
-@@ -134,7 +134,7 @@ Number of file 0 mappings: 10
-     = (c4 + (c3 + ((c0 - c1) - c2)))
- 
- Function name: if::mcdc_check_tree_decision
--Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
-+Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 28, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 8
-@@ -147,7 +147,7 @@ Number of expressions: 8
- - expression 6 operands: lhs = Counter(3), rhs = Counter(4)
- - expression 7 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 10
--- Code(Counter(0)) at (prev + 39, 1) to (start + 3, 9)
-+- Code(Counter(0)) at (prev + 40, 1) to (start + 3, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -169,7 +169,7 @@ Number of file 0 mappings: 10
-     = ((c3 + c4) + (c2 + (c0 - c1)))
- 
- Function name: if::mcdc_nested_if
--Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
-+Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3c, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 13
-@@ -187,7 +187,7 @@ Number of expressions: 13
- - expression 11 operands: lhs = Counter(4), rhs = Counter(5)
- - expression 12 operands: lhs = Expression(0, Sub), rhs = Counter(2)
- Number of file 0 mappings: 14
--- Code(Counter(0)) at (prev + 59, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 60, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-diff --git a/tests/coverage/mcdc/inlined_expressions.cov-map b/tests/coverage/mcdc/inlined_expressions.cov-map
-index 09b7291c9649..8bb488c0dc07 100644
---- a/tests/coverage/mcdc/inlined_expressions.cov-map
-+++ b/tests/coverage/mcdc/inlined_expressions.cov-map
-@@ -1,5 +1,5 @@
- Function name: inlined_expressions::inlined_instance
--Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 08, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
-+Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 09, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 3
-@@ -7,7 +7,7 @@ Number of expressions: 3
- - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
- - expression 2 operands: lhs = Counter(2), rhs = Counter(3)
- Number of file 0 mappings: 6
--- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 6)
-+- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 6)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 5) to (start + 0, 11)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 5) to (start + 0, 6)
-     true  = c1
-diff --git a/tests/coverage/mcdc/nested_if.cov-map b/tests/coverage/mcdc/nested_if.cov-map
-index adeb6cbc1fb8..0bd2aef814c2 100644
---- a/tests/coverage/mcdc/nested_if.cov-map
-+++ b/tests/coverage/mcdc/nested_if.cov-map
-@@ -1,5 +1,5 @@
- Function name: nested_if::doubly_nested_if_in_condition
--Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
-+Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 10, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 14
-@@ -18,7 +18,7 @@ Number of expressions: 14
- - expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add)
- - expression 13 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 20
--- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -58,7 +58,7 @@ Number of file 0 mappings: 20
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: nested_if::nested_if_in_condition
--Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
-+Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 08, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 11
-@@ -74,7 +74,7 @@ Number of expressions: 11
- - expression 9 operands: lhs = Counter(3), rhs = Expression(10, Add)
- - expression 10 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 14
--- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -103,7 +103,7 @@ Number of file 0 mappings: 14
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: nested_if::nested_in_then_block_in_condition
--Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
-+Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 23, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 18
-@@ -126,7 +126,7 @@ Number of expressions: 18
- - expression 16 operands: lhs = Counter(3), rhs = Expression(17, Add)
- - expression 17 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 20
--- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9)
-+- Code(Counter(0)) at (prev + 35, 1) to (start + 1, 9)
- - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-@@ -167,7 +167,7 @@ Number of file 0 mappings: 20
-     = (c3 + (c2 + (c0 - c1)))
- 
- Function name: nested_if::nested_single_condition_decision
--Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
-+Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 18, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 6
-@@ -178,7 +178,7 @@ Number of expressions: 6
- - expression 4 operands: lhs = Counter(3), rhs = Expression(5, Add)
- - expression 5 operands: lhs = Counter(2), rhs = Expression(0, Sub)
- Number of file 0 mappings: 11
--- Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9)
-+- Code(Counter(0)) at (prev + 24, 1) to (start + 4, 9)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
-     true  = c1
-diff --git a/tests/coverage/mcdc/non_control_flow.cov-map b/tests/coverage/mcdc/non_control_flow.cov-map
-index f8576831e75f..0c6928b684d6 100644
---- a/tests/coverage/mcdc/non_control_flow.cov-map
-+++ b/tests/coverage/mcdc/non_control_flow.cov-map
-@@ -1,5 +1,5 @@
- Function name: non_control_flow::assign_3
--Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 16, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
-+Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 17, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 9
-@@ -13,7 +13,7 @@ Number of expressions: 9
- - expression 7 operands: lhs = Expression(8, Sub), rhs = Counter(4)
- - expression 8 operands: lhs = Counter(0), rhs = Counter(1)
- Number of file 0 mappings: 10
--- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 40)
-+- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 40)
- - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
-     = (c1 + ((c2 + c3) + c4))
- - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
-@@ -35,7 +35,7 @@ Number of file 0 mappings: 10
-     = (c1 + ((c2 + c3) + c4))
- 
- Function name: non_control_flow::assign_3_bis
--Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1b, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
-+Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1c, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 7
-@@ -47,7 +47,7 @@ Number of expressions: 7
- - expression 5 operands: lhs = Counter(1), rhs = Counter(2)
- - expression 6 operands: lhs = Counter(0), rhs = Counter(1)
- Number of file 0 mappings: 10
--- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 44)
-+- Code(Counter(0)) at (prev + 28, 1) to (start + 0, 44)
- - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
-     = ((c2 + c3) + c4)
- - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
-@@ -68,7 +68,7 @@ Number of file 0 mappings: 10
-     = ((c2 + c3) + c4)
- 
- Function name: non_control_flow::assign_and
--Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0c, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
-+Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0d, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 4
-@@ -77,7 +77,7 @@ Number of expressions: 4
- - expression 2 operands: lhs = Counter(0), rhs = Counter(1)
- - expression 3 operands: lhs = Counter(0), rhs = Counter(1)
- Number of file 0 mappings: 8
--- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 33)
-+- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 33)
- - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
-     = ((c2 + c3) + (c0 - c1))
- - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
-@@ -93,7 +93,7 @@ Number of file 0 mappings: 8
-     = ((c2 + c3) + (c0 - c1))
- 
- Function name: non_control_flow::assign_or
--Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 11, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
-+Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 12, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 4
-@@ -102,7 +102,7 @@ Number of expressions: 4
- - expression 2 operands: lhs = Counter(0), rhs = Counter(1)
- - expression 3 operands: lhs = Counter(0), rhs = Counter(1)
- Number of file 0 mappings: 8
--- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 32)
-+- Code(Counter(0)) at (prev + 18, 1) to (start + 0, 32)
- - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
-     = ((c1 + c2) + c3)
- - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
-@@ -119,15 +119,15 @@ Number of file 0 mappings: 8
-     = ((c1 + c2) + c3)
- 
- Function name: non_control_flow::foo
--Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 02, 02]
-+Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 02, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 0
- Number of file 0 mappings: 1
--- Code(Counter(0)) at (prev + 37, 1) to (start + 2, 2)
-+- Code(Counter(0)) at (prev + 38, 1) to (start + 2, 2)
- 
- Function name: non_control_flow::func_call
--Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 29, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02]
-+Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 2a, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 3
-@@ -135,7 +135,7 @@ Number of expressions: 3
- - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
- - expression 2 operands: lhs = Counter(2), rhs = Counter(3)
- Number of file 0 mappings: 6
--- Code(Counter(0)) at (prev + 41, 1) to (start + 1, 10)
-+- Code(Counter(0)) at (prev + 42, 1) to (start + 1, 10)
- - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 9) to (start + 0, 15)
- - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 9) to (start + 0, 10)
-     true  = c1
-@@ -148,7 +148,7 @@ Number of file 0 mappings: 6
-     = ((c2 + c3) + (c0 - c1))
- 
- Function name: non_control_flow::right_comb_tree
--Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 20, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02]
-+Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 21, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02]
- Number of files: 1
- - file 0 => global file 1
- Number of expressions: 19
-@@ -172,7 +172,7 @@ Number of expressions: 19
- - expression 17 operands: lhs = Expression(18, Sub), rhs = Counter(5)
- - expression 18 operands: lhs = Counter(1), rhs = Counter(6)
- Number of file 0 mappings: 14
--- Code(Counter(0)) at (prev + 32, 1) to (start + 0, 65)
-+- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 65)
- - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
-     = (((((c2 + c3) + c4) + c5) + c6) + (c0 - c1))
- - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
--- 
-2.46.1
-
diff --git a/rustc-1.81.0-unbundle-sqlite.patch b/rustc-1.81.0-unbundle-sqlite.patch
deleted file mode 100644
index ec3ed1e..0000000
--- a/rustc-1.81.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-08-15 09:53:53.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-08-16 10:20:52.394575295 -0700
-@@ -2195,7 +2195,6 @@ version = "0.28.0"
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-08-16 10:20:52.394575295 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-08-16 10:21:50.535122479 -0700
-@@ -77,7 +77,7 @@ proptest = "1.4.0"
- pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] }
- rand = "0.8.5"
- regex = "1.10.4"
--rusqlite = { version = "0.31.0", features = ["bundled"] }
-+rusqlite = { version = "0.31.0", features = [] }
- rustfix = { version = "0.8.2", path = "crates/rustfix" }
- same-file = "1.0.6"
- security-framework = "2.10.0"
diff --git a/rustc-1.81.0-disable-libssh2.patch b/rustc-1.82.0-disable-libssh2.patch
similarity index 69%
rename from rustc-1.81.0-disable-libssh2.patch
rename to rustc-1.82.0-disable-libssh2.patch
index abee3c3..69f5704 100644
--- a/rustc-1.81.0-disable-libssh2.patch
+++ b/rustc-1.82.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-08-26 09:03:52.769956890 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-08-26 09:03:52.773956573 -0700
-@@ -2155,7 +2155,6 @@ checksum = "10472326a8a6477c3c20a64547b0
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-09-06 10:36:55.743405666 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-09-06 10:36:55.745405652 -0700
+@@ -2156,7 +2156,6 @@ checksum = "10472326a8a6477c3c20a64547b0
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2196,20 +2195,6 @@ dependencies = [
+@@ -2197,20 +2196,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -31,10 +31,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  [[package]]
  name = "libz-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-08-26 09:03:52.773956573 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-08-26 09:05:08.595934397 -0700
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-09-06 10:36:55.746405645 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-09-06 10:37:13.849280464 -0700
 @@ -44,7 +44,7 @@ curl = "0.4.46"
- curl-sys = "0.4.72"
+ curl-sys = "0.4.73"
  filetime = "0.2.23"
  flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
 -git2 = "0.19.0"
diff --git a/rustc-1.82.0-unbundle-sqlite.patch b/rustc-1.82.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..f01397a
--- /dev/null
+++ b/rustc-1.82.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-09-06 10:30:29.435107742 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-09-06 10:31:57.168492758 -0700
+@@ -2194,7 +2194,6 @@ version = "0.30.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-09-06 10:30:29.435107742 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-09-06 10:31:27.942697616 -0700
+@@ -77,7 +77,7 @@ proptest = "1.5.0"
+ pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] }
+ rand = "0.8.5"
+ regex = "1.10.5"
+-rusqlite = { version = "0.32.0", features = ["bundled"] }
++rusqlite = { version = "0.32.0", features = [] }
+ rustfix = { version = "0.8.2", path = "crates/rustfix" }
+ same-file = "1.0.6"
+ security-framework = "2.11.1"
diff --git a/sources b/sources
index 140bdf7..2f35a76 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.81.0-src.tar.xz) = b8a837ced521d2ca2c7f228a0640da591384519e4dbc1ae768524d50616da6abbd2f7bdae3777caebc0447dac91bf76481282ce5a2264d7f30e173caa6321a51
+SHA512 (rustc-1.82.0-src.tar.xz) = d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0
 SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e

From 8ee619724008c9bf207ad03693b60b9f08a112b7 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 29 Oct 2024 11:05:54 -0700
Subject: [PATCH 46/86] Set build.jobs for everything

---
 ...ap-allow-setting-jobs-in-config.toml.patch | 163 ++++++++++++++++++
 rust.spec                                     |  30 +++-
 2 files changed, 186 insertions(+), 7 deletions(-)
 create mode 100644 0001-bootstrap-allow-setting-jobs-in-config.toml.patch

diff --git a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
new file mode 100644
index 0000000..20f61c5
--- /dev/null
+++ b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
@@ -0,0 +1,163 @@
+From 5d3e8210feabae1d80a9f21c18c9173b1fdc43ca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
+ <39484203+jieyouxu@users.noreply.github.com>
+Date: Thu, 17 Oct 2024 22:58:45 +0800
+Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml
+
+(cherry picked from commit 65458aed68fe6786068bab00e5a46d7ecdd2a072)
+---
+ config.example.toml                       |  5 ++
+ src/bootstrap/src/core/config/config.rs   |  5 +-
+ src/bootstrap/src/core/config/flags.rs    |  3 +-
+ src/bootstrap/src/core/config/tests.rs    | 58 +++++++++++++++++++++++
+ src/bootstrap/src/utils/change_tracker.rs |  5 ++
+ 5 files changed, 73 insertions(+), 3 deletions(-)
+
+diff --git a/config.example.toml b/config.example.toml
+index f1dc32234ccf..40c7ac9f5023 100644
+--- a/config.example.toml
++++ b/config.example.toml
+@@ -401,6 +401,11 @@
+ # Specify the location of the Android NDK. Used when targeting Android.
+ #android-ndk = "/path/to/android-ndk-r26d"
+ 
++# Number of parallel jobs to be used for building and testing. If set to `0` or
++# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag
++# passed to cargo invocations.
++#jobs = 0
++
+ # =============================================================================
+ # General install configuration options
+ # =============================================================================
+diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
+index bdfee55d8d18..c1e0f8c6b338 100644
+--- a/src/bootstrap/src/core/config/config.rs
++++ b/src/bootstrap/src/core/config/config.rs
+@@ -872,6 +872,7 @@ struct Build {
+         metrics: Option = "metrics",
+         android_ndk: Option = "android-ndk",
+         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
++        jobs: Option = "jobs",
+     }
+ }
+ 
+@@ -1256,7 +1257,6 @@ pub(crate) fn parse_inner(
+         config.rustc_error_format = flags.rustc_error_format;
+         config.json_output = flags.json_output;
+         config.on_fail = flags.on_fail;
+-        config.jobs = Some(threads_from_config(flags.jobs as u32));
+         config.cmd = flags.cmd;
+         config.incremental = flags.incremental;
+         config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled };
+@@ -1477,8 +1477,11 @@ fn get_table(option: &str) -> Result {
+             metrics: _,
+             android_ndk,
+             optimized_compiler_builtins,
++            jobs,
+         } = toml.build.unwrap_or_default();
+ 
++        config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
++
+         if let Some(file_build) = build {
+             config.build = TargetSelection::from_user(&file_build);
+         };
+diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs
+index c3f174028149..7fdd5f8b8cae 100644
+--- a/src/bootstrap/src/core/config/flags.rs
++++ b/src/bootstrap/src/core/config/flags.rs
+@@ -110,11 +110,10 @@ pub struct Flags {
+         short,
+         long,
+         value_hint = clap::ValueHint::Other,
+-        default_value_t = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get),
+         value_name = "JOBS"
+     )]
+     /// number of jobs to run in parallel
+-    pub jobs: usize,
++    pub jobs: Option,
+     // This overrides the deny-warnings configuration option,
+     // which passes -Dwarnings to the compiler invocations.
+     #[arg(global = true, long)]
+diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
+index 219c5a6ec914..bc49074fa316 100644
+--- a/src/bootstrap/src/core/config/tests.rs
++++ b/src/bootstrap/src/core/config/tests.rs
+@@ -317,3 +317,61 @@ fn order_of_clippy_rules() {
+ 
+     assert_eq!(expected, actual);
+ }
++
++#[test]
++fn parse_jobs() {
++    assert_eq!(parse("build.jobs = 1").jobs, Some(1));
++}
++
++#[test]
++fn jobs_precedence() {
++    // `--jobs` should take precedence over using `--set build.jobs`.
++
++    let config = Config::parse_inner(
++        Flags::parse(&[
++            "check".to_owned(),
++            "--config=/does/not/exist".to_owned(),
++            "--jobs=67890".to_owned(),
++            "--set=build.jobs=12345".to_owned(),
++        ]),
++        |&_| toml::from_str(""),
++    );
++    assert_eq!(config.jobs, Some(67890));
++
++    // `--set build.jobs` should take precedence over `config.toml`.
++    let config = Config::parse_inner(
++        Flags::parse(&[
++            "check".to_owned(),
++            "--config=/does/not/exist".to_owned(),
++            "--set=build.jobs=12345".to_owned(),
++        ]),
++        |&_| {
++            toml::from_str(
++                r#"
++            [build]
++            jobs = 67890
++        "#,
++            )
++        },
++    );
++    assert_eq!(config.jobs, Some(12345));
++
++    // `--jobs` > `--set build.jobs` > `config.toml`
++    let config = Config::parse_inner(
++        Flags::parse(&[
++            "check".to_owned(),
++            "--jobs=123".to_owned(),
++            "--config=/does/not/exist".to_owned(),
++            "--set=build.jobs=456".to_owned(),
++        ]),
++        |&_| {
++            toml::from_str(
++                r#"
++            [build]
++            jobs = 789
++        "#,
++            )
++        },
++    );
++    assert_eq!(config.jobs, Some(123));
++}
+diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
+index 51a25104e4cf..1f6a1064a5dc 100644
+--- a/src/bootstrap/src/utils/change_tracker.rs
++++ b/src/bootstrap/src/utils/change_tracker.rs
+@@ -235,4 +235,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
+         severity: ChangeSeverity::Info,
+         summary: "The `build.profiler` option now tries to use source code from `download-ci-llvm` if possible, instead of checking out the `src/llvm-project` submodule.",
+     },
++    ChangeInfo {
++        change_id: 131838,
++        severity: ChangeSeverity::Info,
++        summary: "Allow setting `--jobs` in config.toml with `build.jobs`.",
++    },
+ ];
+-- 
+2.47.0
+
diff --git a/rust.spec b/rust.spec
index f67def5..4717bda 100644
--- a/rust.spec
+++ b/rust.spec
@@ -164,6 +164,9 @@ Patch6:         rustc-1.82.0-unbundle-sqlite.patch
 # https://github.com/rust-lang/rust/pull/130034
 Patch7:         0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
 
+# https://github.com/rust-lang/rust/pull/131838
+Patch8:         0001-bootstrap-allow-setting-jobs-in-config.toml.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -671,6 +674,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
+%patch -P8 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -767,11 +771,22 @@ end}
 
 # Some builders have relatively little memory for their CPU count.
 # At least 4GB per CPU is a good rule of thumb for building rustc.
-ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN)
-max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 4 ))
-if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then
-  ncpus="$max_cpus"
-fi
+%if ! %defined constrain_build
+%define constrain_build(m:) %{lua:
+  for l in io.lines('/proc/meminfo') do
+    if l:sub(1, 9) == "MemTotal:" then
+      local opt_m = math.tointeger(rpm.expand("%{-m*}"))
+      local mem_total = math.tointeger(string.match(l, "MemTotal:%s+(%d+)"))
+      local cpu_limit = math.max(1, mem_total // (opt_m * 1024))
+      if cpu_limit < math.tointeger(rpm.expand("%_smp_build_ncpus")) then
+        rpm.define("_smp_build_ncpus " .. cpu_limit)
+      end
+      break
+    end
+  end
+}
+%endif
+%constrain_build -m 4096
 
 %if %defined mingw_targets
 %define mingw_target_config %{shrink:
@@ -845,6 +860,7 @@ test -r "%{profiler}"
   --disable-rpath \
   %{enable_debuginfo} \
   %{enable_rust_opts} \
+  --set build.jobs=%_smp_build_ncpus \
   --set build.build-stage=2 \
   --set build.doc-stage=2 \
   --set build.install-stage=2 \
@@ -864,7 +880,7 @@ test -r "%{profiler}"
 %define profraw $PWD/build/profiles
 %define profdata $PWD/build/rustc.profdata
 mkdir -p "%{profraw}"
-%{__x} build -j "$ncpus" sysroot --rust-profile-generate="%{profraw}"
+%{__x} build sysroot --rust-profile-generate="%{profraw}"
 # Build cargo as a workload to generate compiler profiles
 env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \
   %{__x} --keep-stage=0 --keep-stage=1 build cargo
@@ -876,7 +892,7 @@ rm -r "%{profraw}" build/%{rust_triple}/stage2*/
 %endif
 
 # Build the compiler normally (with or without PGO)
-%{__x} build -j "$ncpus" sysroot
+%{__x} build sysroot
 
 # Build everything else normally
 %{__x} build

From 9d72a7a9c3e78752dd961cda81b8aec4961825a2 Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Wed, 30 Oct 2024 17:06:19 +0100
Subject: [PATCH 47/86] Add unicode exception rules for rpminpect

---
 rpminspect.yaml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/rpminspect.yaml b/rpminspect.yaml
index 15b680b..ac238da 100644
--- a/rpminspect.yaml
+++ b/rpminspect.yaml
@@ -6,3 +6,19 @@ debuginfo:
         # https://github.com/rust-lang/rust/issues/45854
         - /usr/lib/debug/usr/bin/rustc-*.i386.debug
 
+unicode:
+    ignore:
+        # These files are known to contain forbidden unicode chars as
+        # they are tests for those.
+        - rustc-*-src/tests/ui/lint/issue-90614-accept-allow-text-direction-codepoint-in-comment-lint.rs
+        - rustc-*-src/tests/ui/parser/unicode-control-codepoints.rs
+        - rustc-*-src/compiler/rustc_lint/src/hidden_unicode_codepoints.rs
+        - rustc-*-src/compiler/rustc_lint_defs/src/builtin.rs
+        - rustc-*-src/vendor/idna/tests/IdnaTestV2.txt
+        - rustc-*-src/vendor/idna-*/tests/IdnaTestV2.txt
+        - rustc-*-src/vendor/mdbook*/tests/dummy_book/src/first/unicode.md
+        - rustc-*-src/vendor/mdbook*/tests/searchindex_fixture.json
+        - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-string?.wat
+        - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-block-comment?.wat
+        - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-line-comment?.wat
+        - rustc-*-src/src/llvm-project/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst

From 1338df248ac8ffbf796d8d279f24c89abcddec50 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 12 Nov 2024 13:20:32 -0800
Subject: [PATCH 48/86] [eln] update to wasi-libc-24

---
 .gitignore | 1 +
 rust.spec  | 3 +--
 sources    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 61d9a93..4ae8e3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -443,3 +443,4 @@
 /rustc-1.81.0-src.tar.xz
 /wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz
 /rustc-1.82.0-src.tar.xz
+/wasi-libc-wasi-sdk-24.tar.gz
diff --git a/rust.spec b/rust.spec
index 4717bda..6e01ad2 100644
--- a/rust.spec
+++ b/rust.spec
@@ -58,8 +58,7 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-#global wasi_libc_ref wasi-sdk-24
-%global wasi_libc_ref b9ef79d7dbd47c6c5bafdae760823467c2f60b70
+%global wasi_libc_ref wasi-sdk-24
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
diff --git a/sources b/sources
index 2f35a76..86b3e08 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
 SHA512 (rustc-1.82.0-src.tar.xz) = d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0
-SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e
+SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21

From 64ec772902aea5ef1212ce43e76c213b2d8211d9 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 28 Nov 2024 06:52:10 -0800
Subject: [PATCH 49/86] Update to Rust 1.83.0

---
 .gitignore                                    |   1 +
 ...sm-component-ld-to-match-other-tools.patch | 147 ------------------
 ...variables-override-some-default-CPUs.patch |  22 +--
 ...ap-allow-setting-jobs-in-config.toml.patch |  31 ++--
 rust.spec                                     |  18 +--
 sources                                       |   2 +-
 6 files changed, 35 insertions(+), 186 deletions(-)
 delete mode 100644 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch

diff --git a/.gitignore b/.gitignore
index 4ae8e3f..ed7c95b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -444,3 +444,4 @@
 /wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz
 /rustc-1.82.0-src.tar.xz
 /wasi-libc-wasi-sdk-24.tar.gz
+/rustc-1.83.0-src.tar.xz
diff --git a/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch b/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
deleted file mode 100644
index 5364012..0000000
--- a/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From c15469a7fec811d1a4f69ff26e18c6f383df41d2 Mon Sep 17 00:00:00 2001
-From: Alex Crichton 
-Date: Fri, 6 Sep 2024 09:21:33 -0700
-Subject: [PATCH] Fix enabling wasm-component-ld to match other tools
-
-It was [pointed out recently][comment] that enabling `wasm-component-ld`
-as a host tool is different from other host tools. This commit refactors
-the logic to match by deduplicating selection of when to build other
-tools and then using the same logic for `wasm-component-ld`.
-
-[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720
----
- src/bootstrap/src/core/build_steps/compile.rs |  2 +-
- src/bootstrap/src/core/build_steps/dist.rs    |  2 +-
- src/bootstrap/src/core/build_steps/tool.rs    | 38 +++----------------
- src/bootstrap/src/lib.rs                      | 17 +++++----
- 4 files changed, 17 insertions(+), 42 deletions(-)
-
-diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 1936c91ef83c..102c9fd25543 100644
---- a/src/bootstrap/src/core/build_steps/compile.rs
-+++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -1912,7 +1912,7 @@ fn run(self, builder: &Builder<'_>) -> Compiler {
-         // delegates to the `rust-lld` binary for linking and then runs
-         // logic to create the final binary. This is used by the
-         // `wasm32-wasip2` target of Rust.
--        if builder.build_wasm_component_ld() {
-+        if builder.tool_enabled("wasm-component-ld") {
-             let wasm_component_ld_exe =
-                 builder.ensure(crate::core::build_steps::tool::WasmComponentLd {
-                     compiler: build_compiler,
-diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
-index 4957de2e1b79..ccb5656d6716 100644
---- a/src/bootstrap/src/core/build_steps/dist.rs
-+++ b/src/bootstrap/src/core/build_steps/dist.rs
-@@ -473,7 +473,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
-                     );
-                 }
-             }
--            if builder.build_wasm_component_ld() {
-+            if builder.tool_enabled("wasm-component-ld") {
-                 let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin");
-                 let ld = exe("wasm-component-ld", compiler.host);
-                 builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld));
-diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
-index 3a1eb43b801f..3c2d791c2090 100644
---- a/src/bootstrap/src/core/build_steps/tool.rs
-+++ b/src/bootstrap/src/core/build_steps/tool.rs
-@@ -693,14 +693,7 @@ impl Step for Cargo {
- 
-     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-         let builder = run.builder;
--        run.path("src/tools/cargo").default_condition(
--            builder.config.extended
--                && builder.config.tools.as_ref().map_or(
--                    true,
--                    // If `tools` is set, search list for this tool.
--                    |tools| tools.iter().any(|tool| tool == "cargo"),
--                ),
--        )
-+        run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo"))
-     }
- 
-     fn make_run(run: RunConfig<'_>) {
-@@ -772,14 +765,7 @@ impl Step for RustAnalyzer {
- 
-     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-         let builder = run.builder;
--        run.path("src/tools/rust-analyzer").default_condition(
--            builder.config.extended
--                && builder
--                    .config
--                    .tools
--                    .as_ref()
--                    .map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
--        )
-+        run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer"))
-     }
- 
-     fn make_run(run: RunConfig<'_>) {
-@@ -821,12 +807,8 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-         run.path("src/tools/rust-analyzer")
-             .path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
-             .default_condition(
--                builder.config.extended
--                    && builder.config.tools.as_ref().map_or(true, |tools| {
--                        tools.iter().any(|tool| {
--                            tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
--                        })
--                    }),
-+                builder.tool_enabled("rust-analyzer")
-+                    || builder.tool_enabled("rust-analyzer-proc-macro-srv"),
-             )
-     }
- 
-@@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker {
- 
-     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-         let builder = run.builder;
--        run.path("src/tools/llvm-bitcode-linker").default_condition(
--            builder.config.extended
--                && builder
--                    .config
--                    .tools
--                    .as_ref()
--                    .map_or(builder.build.unstable_features(), |tools| {
--                        tools.iter().any(|tool| tool == "llvm-bitcode-linker")
--                    }),
--        )
-+        run.path("src/tools/llvm-bitcode-linker")
-+            .default_condition(builder.tool_enabled("llvm-bitcode-linker"))
-     }
- 
-     fn make_run(run: RunConfig<'_>) {
-diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index c76ce3409562..780024e307ed 100644
---- a/src/bootstrap/src/lib.rs
-+++ b/src/bootstrap/src/lib.rs
-@@ -1407,16 +1407,17 @@ fn default_wasi_runner(&self) -> Option {
-         None
-     }
- 
--    /// Returns whether it's requested that `wasm-component-ld` is built as part
--    /// of the sysroot. This is done either with the `extended` key in
--    /// `config.toml` or with the `tools` set.
--    fn build_wasm_component_ld(&self) -> bool {
--        if self.config.extended {
--            return true;
-+    /// Returns whether the specified tool is configured as part of this build.
-+    ///
-+    /// This requires that both the `extended` key is set and the `tools` key is
-+    /// either unset or specifically contains the specified tool.
-+    fn tool_enabled(&self, tool: &str) -> bool {
-+        if !self.config.extended {
-+            return false;
-         }
-         match &self.config.tools {
--            Some(set) => set.contains("wasm-component-ld"),
--            None => false,
-+            Some(set) => set.contains(tool),
-+            None => true,
-         }
-     }
- 
--- 
-2.46.0
-
diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch
index dc8be55..a590c54 100644
--- a/0001-Let-environment-variables-override-some-default-CPUs.patch
+++ b/0001-Let-environment-variables-override-some-default-CPUs.patch
@@ -1,4 +1,4 @@
-From 184d61d2c12aa2db01de9a14ccb2be0cfae5039b Mon Sep 17 00:00:00 2001
+From e12de251f8513f660bbfbc1c71883383bd1037f4 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 9 Jun 2023 15:23:08 -0700
 Subject: [PATCH] Let environment variables override some default CPUs
@@ -10,12 +10,12 @@ Subject: [PATCH] Let environment variables override some default CPUs
  3 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
-index 194c3170e683..9806ca78297c 100644
+index 23913687a1fd..3253fbc84c74 100644
 --- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
 @@ -2,7 +2,7 @@
  
- pub fn target() -> Target {
+ pub(crate) fn target() -> Target {
      let mut base = base::linux_gnu::opts();
 -    base.cpu = "ppc64le".into();
 +    base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into();
@@ -23,25 +23,25 @@ index 194c3170e683..9806ca78297c 100644
      base.max_atomic_width = Some(64);
      base.stack_probes = StackProbeType::Inline;
 diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
-index 6fc410eb2235..c8f84edb9715 100644
+index 3efbb4648361..bcdaa5b8276d 100644
 --- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
-@@ -5,7 +5,7 @@ pub fn target() -> Target {
+@@ -5,7 +5,7 @@ pub(crate) fn target() -> Target {
      let mut base = base::linux_gnu::opts();
      base.endian = Endian::Big;
      // z10 is the oldest CPU supported by LLVM
 -    base.cpu = "z10".into();
 +    base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into();
-     // FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
-     // ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
-     // also strip v128 from the data_layout below to match the older LLVM's expectation.
+     // FIXME: The ABI implementation in abi/call/s390x.rs is for now hard-coded to assume the no-vector
+     // ABI. Pass the -vector feature string to LLVM to respect this assumption.
+     base.features = "-vector".into();
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
-index 80e267c163fa..8436a00e66d5 100644
+index 59ec6c7f9d5f..b6f1be890b20 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
 @@ -2,7 +2,7 @@
  
- pub fn target() -> Target {
+ pub(crate) fn target() -> Target {
      let mut base = base::linux_gnu::opts();
 -    base.cpu = "x86-64".into();
 +    base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into();
@@ -49,5 +49,5 @@ index 80e267c163fa..8436a00e66d5 100644
      base.max_atomic_width = Some(64);
      base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
 -- 
-2.41.0
+2.47.0
 
diff --git a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
index 20f61c5..577539e 100644
--- a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
+++ b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
@@ -1,10 +1,9 @@
-From 5d3e8210feabae1d80a9f21c18c9173b1fdc43ca Mon Sep 17 00:00:00 2001
+From 65458aed68fe6786068bab00e5a46d7ecdd2a072 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
  <39484203+jieyouxu@users.noreply.github.com>
 Date: Thu, 17 Oct 2024 22:58:45 +0800
 Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml
 
-(cherry picked from commit 65458aed68fe6786068bab00e5a46d7ecdd2a072)
 ---
  config.example.toml                       |  5 ++
  src/bootstrap/src/core/config/config.rs   |  5 +-
@@ -14,10 +13,10 @@ Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml
  5 files changed, 73 insertions(+), 3 deletions(-)
 
 diff --git a/config.example.toml b/config.example.toml
-index f1dc32234ccf..40c7ac9f5023 100644
+index 4b591b949b36..168ac353cff7 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -401,6 +401,11 @@
+@@ -414,6 +414,11 @@
  # Specify the location of the Android NDK. Used when targeting Android.
  #android-ndk = "/path/to/android-ndk-r26d"
  
@@ -30,10 +29,10 @@ index f1dc32234ccf..40c7ac9f5023 100644
  # General install configuration options
  # =============================================================================
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index bdfee55d8d18..c1e0f8c6b338 100644
+index c2ab439891ea..aeb81b146382 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -872,6 +872,7 @@ struct Build {
+@@ -891,6 +891,7 @@ struct Build {
          metrics: Option = "metrics",
          android_ndk: Option = "android-ndk",
          optimized_compiler_builtins: Option = "optimized-compiler-builtins",
@@ -41,7 +40,7 @@ index bdfee55d8d18..c1e0f8c6b338 100644
      }
  }
  
-@@ -1256,7 +1257,6 @@ pub(crate) fn parse_inner(
+@@ -1289,7 +1290,6 @@ pub(crate) fn parse_inner(
          config.rustc_error_format = flags.rustc_error_format;
          config.json_output = flags.json_output;
          config.on_fail = flags.on_fail;
@@ -49,7 +48,7 @@ index bdfee55d8d18..c1e0f8c6b338 100644
          config.cmd = flags.cmd;
          config.incremental = flags.incremental;
          config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled };
-@@ -1477,8 +1477,11 @@ fn get_table(option: &str) -> Result {
+@@ -1511,8 +1511,11 @@ fn get_table(option: &str) -> Result {
              metrics: _,
              android_ndk,
              optimized_compiler_builtins,
@@ -62,7 +61,7 @@ index bdfee55d8d18..c1e0f8c6b338 100644
              config.build = TargetSelection::from_user(&file_build);
          };
 diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs
-index c3f174028149..7fdd5f8b8cae 100644
+index 3aefe517a5be..bfeb811508c0 100644
 --- a/src/bootstrap/src/core/config/flags.rs
 +++ b/src/bootstrap/src/core/config/flags.rs
 @@ -110,11 +110,10 @@ pub struct Flags {
@@ -79,12 +78,12 @@ index c3f174028149..7fdd5f8b8cae 100644
      // which passes -Dwarnings to the compiler invocations.
      #[arg(global = true, long)]
 diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
-index 219c5a6ec914..bc49074fa316 100644
+index 2611b6cf51bb..1f02757682c2 100644
 --- a/src/bootstrap/src/core/config/tests.rs
 +++ b/src/bootstrap/src/core/config/tests.rs
-@@ -317,3 +317,61 @@ fn order_of_clippy_rules() {
- 
-     assert_eq!(expected, actual);
+@@ -352,3 +352,61 @@ fn parse_rust_std_features_empty() {
+ fn parse_rust_std_features_invalid() {
+     parse("rust.std-features = \"backtrace\"");
  }
 +
 +#[test]
@@ -145,12 +144,12 @@ index 219c5a6ec914..bc49074fa316 100644
 +    assert_eq!(config.jobs, Some(123));
 +}
 diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
-index 51a25104e4cf..1f6a1064a5dc 100644
+index b37786496cb5..9169bc90a45d 100644
 --- a/src/bootstrap/src/utils/change_tracker.rs
 +++ b/src/bootstrap/src/utils/change_tracker.rs
-@@ -235,4 +235,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
+@@ -275,4 +275,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
          severity: ChangeSeverity::Info,
-         summary: "The `build.profiler` option now tries to use source code from `download-ci-llvm` if possible, instead of checking out the `src/llvm-project` submodule.",
+         summary: "New option `./x setup editor` added, replacing `./x setup vscode` and adding support for vim, emacs and helix.",
      },
 +    ChangeInfo {
 +        change_id: 131838,
diff --git a/rust.spec b/rust.spec
index 6e01ad2..91323ed 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.82.0
+Version:        1.83.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.81.0
-%global bootstrap_channel 1.81.0
-%global bootstrap_date 2024-09-05
+%global bootstrap_version 1.82.0
+%global bootstrap_channel 1.82.0
+%global bootstrap_date 2024-10-17
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -72,8 +72,8 @@ ExclusiveArch:  %{rust_arches}
 %bcond_with llvm_static
 
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
-# is insufficient.  Rust currently requires LLVM 17.0+.
-%global min_llvm_version 17.0.0
+# is insufficient.  Rust currently requires LLVM 18.0+.
+%global min_llvm_version 18.0.0
 %global bundled_llvm_version 19.1.1
 #global llvm_compat_version 17
 %global llvm llvm%{?llvm_compat_version}
@@ -160,11 +160,8 @@ Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 # We don't want to use the bundled library in libsqlite3-sys
 Patch6:         rustc-1.82.0-unbundle-sqlite.patch
 
-# https://github.com/rust-lang/rust/pull/130034
-Patch7:         0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
-
 # https://github.com/rust-lang/rust/pull/131838
-Patch8:         0001-bootstrap-allow-setting-jobs-in-config.toml.patch
+Patch7:         0001-bootstrap-allow-setting-jobs-in-config.toml.patch
 
 ### RHEL-specific patches below ###
 
@@ -673,7 +670,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
-%patch -P8 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
diff --git a/sources b/sources
index 86b3e08..41e5bf7 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.82.0-src.tar.xz) = d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0
+SHA512 (rustc-1.83.0-src.tar.xz) = 64db57949c6ac1df6a3f4c6bd0938685a5fb1bc3d318b34ccfcfccb0f9eff1cffd4d8a53a190ef0409eeca9ad12bc6234c2c1de69196cc74ae02d6afa20d0ce6
 SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21

From 0f308eb7723e0f2b87103b9aee3842ce7e46143c Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Mon, 2 Dec 2024 16:55:24 -0800
Subject: [PATCH 50/86] Exclude target shared libraries

Now that the compiler is linking `std` statically, we don't really need
that shared library for anything at all, so now it's excluded.
---
 rust.spec | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/rust.spec b/rust.spec
index 91323ed..42f6746 100644
--- a/rust.spec
+++ b/rust.spec
@@ -929,19 +929,6 @@ find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
 find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
   -exec chmod -v +x '{}' '+'
 
-# The libdir libraries are identical to those under rustlib/.  It's easier on
-# library loading if we keep them in libdir, but we do need them in rustlib/
-# to support dynamic linking for compiler plugins, so we'll symlink.
-find %{buildroot}%{rustlibdir}/%{rust_triple}/lib/ -maxdepth 1 -type f -name '*.so' |
-while read lib; do
- lib2="%{buildroot}%{_libdir}/${lib##*/}"
- if [ -f "$lib2" ]; then
-   # make sure they're actually identical!
-   cmp "$lib" "$lib2"
-   ln -v -f -r -s -T "$lib2" "$lib"
- fi
-done
-
 # Remove installer artifacts (manifests, uninstall scripts, etc.)
 find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
 
@@ -1048,10 +1035,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_libexecdir}/rust-analyzer-proc-macro-srv
 %{_mandir}/man1/rustc.1*
 %{_mandir}/man1/rustdoc.1*
-%dir %{rustlibdir}
-%dir %{rustlibdir}/%{rust_triple}
-%dir %{rustlibdir}/%{rust_triple}/lib
-%{rustlibdir}/%{rust_triple}/lib/*.so
 
 
 %files std-static
@@ -1059,6 +1042,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %dir %{rustlibdir}/%{rust_triple}
 %dir %{rustlibdir}/%{rust_triple}/lib
 %{rustlibdir}/%{rust_triple}/lib/*.rlib
+%exclude %{rustlibdir}/%{rust_triple}/lib/*.so
 
 %global target_files()      \
 %files std-static-%1        \

From ed69793c2f23d478f2c886a89deaf8ab824dbf6b Mon Sep 17 00:00:00 2001
From: David Michael 
Date: Sun, 24 Nov 2024 11:29:33 -0500
Subject: [PATCH 51/86] Move the target list definition after the rust_triple
 function

This has no functional effect, it is just to be nice to downstreams
for adding additional ABIs to the target list with minimal changes.
It makes macros parametric to pass parameters to the Lua function,
but this is still unused in this spec.

Also clean up the ppc64 architecture from the list since it's not
being build by ExclusiveArch anymore.

[skip changelog]
---
 rust.spec | 81 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 41 insertions(+), 40 deletions(-)

diff --git a/rust.spec b/rust.spec
index 42f6746..e716faa 100644
--- a/rust.spec
+++ b/rust.spec
@@ -25,36 +25,6 @@ ExclusiveArch:  %{rust_arches}
 # add them to sources. Remember to remove them again after the bootstrap build!
 #global bootstrap_arches %%{rust_arches}
 
-# Define a space-separated list of targets to ship rust-std-static-$triple for
-# cross-compilation. The packages are noarch, but they're not fully
-# reproducible between hosts, so only x86_64 actually builds it.
-%ifarch x86_64
-%if 0%{?fedora}
-%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu
-%endif
-# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1
-# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
-%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1
-%if 0%{?fedora}
-%global extra_targets x86_64-unknown-none x86_64-unknown-uefi
-%endif
-%if 0%{?rhel} >= 10
-%global extra_targets x86_64-unknown-none
-%endif
-%endif
-%ifarch aarch64
-%if 0%{?fedora}
-%global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi
-%endif
-%if 0%{?rhel} >= 10
-%global extra_targets aarch64-unknown-none-softfloat
-%endif
-%endif
-%global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
-%define target_enabled() %{lua:
-  print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0)
-}
-
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
@@ -174,14 +144,12 @@ Source103:      cargo_vendor.prov
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
 Patch100:       rustc-1.82.0-disable-libssh2.patch
 
-# Get the Rust triple for any arch.
-%{lua: function rust_triple(arch)
-  local abi = "gnu"
+# Get the Rust triple for any architecture and ABI.
+%{lua: function rust_triple(arch, abi)
+  abi = abi or "gnu"
   if arch == "armv7hl" then
     arch = "armv7"
-    abi = "gnueabihf"
-  elseif arch == "ppc64" then
-    arch = "powerpc64"
+    abi = abi.."eabihf"
   elseif arch == "ppc64le" then
     arch = "powerpc64le"
   elseif arch == "riscv64" then
@@ -190,11 +158,44 @@ Patch100:       rustc-1.82.0-disable-libssh2.patch
   return arch.."-unknown-linux-"..abi
 end}
 
-%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))}
+%define rust_triple() %{lua: print(rust_triple(
+  rpm.expand("%{?1}%{!?1:%{_target_cpu}}"),
+  rpm.expand("%{?2}%{!?2:gnu}")
+))}
 
-# Get the environment form of the Rust triple
-%global rust_triple_env %{lua:
-  print(string.upper(string.gsub(rpm.expand("%{rust_triple}"), "-", "_")))
+# Get the environment variable form of the Rust triple.
+%define rust_triple_env() %{lua:
+  print(rpm.expand("%{rust_triple %*}"):gsub("-", "_"):upper())
+}
+
+# Define a space-separated list of targets to ship rust-std-static-$triple for
+# cross-compilation. The packages are noarch, but they're not fully
+# reproducible between hosts, so only x86_64 actually builds it.
+%ifarch x86_64
+%if 0%{?fedora}
+%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu
+%endif
+# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1
+# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
+%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1
+%if 0%{?fedora}
+%global extra_targets x86_64-unknown-none x86_64-unknown-uefi
+%endif
+%if 0%{?rhel} >= 10
+%global extra_targets x86_64-unknown-none
+%endif
+%endif
+%ifarch aarch64
+%if 0%{?fedora}
+%global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi
+%endif
+%if 0%{?rhel} >= 10
+%global extra_targets aarch64-unknown-none-softfloat
+%endif
+%endif
+%global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
+%define target_enabled() %{lua:
+  print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0)
 }
 
 %if %defined bootstrap_arches

From 0e396642758c76268ff8962145993ae709882c36 Mon Sep 17 00:00:00 2001
From: David Michael 
Date: Sun, 24 Nov 2024 11:35:23 -0500
Subject: [PATCH 52/86] Put an upper bound on the cargo requirement as well

Rebuilding a previous SRPM version will fail because cargo has the
same version requirement as Rust, e.g.:

Unexpected cargo version: 1.82.0, we should use 1.79.x/1.80.1 to build source with 1.80.1
---
 rust.spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust.spec b/rust.spec
index e716faa..119ca1d 100644
--- a/rust.spec
+++ b/rust.spec
@@ -229,7 +229,7 @@ end}
 %global local_rust_root %{_builddir}/rust-%{bootstrap_suffix}
 Provides:       bundled(%{name}-bootstrap) = %{bootstrap_version}
 %else
-BuildRequires:  cargo >= %{bootstrap_version}
+BuildRequires:  (cargo >= %{bootstrap_version} with cargo <= %{version})
 BuildRequires:  (%{name} >= %{bootstrap_version} with %{name} <= %{version})
 %global local_rust_root %{_prefix}
 %endif

From deb8dc4f03a679dcff6a7ca5e3dd118e802ece1d Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Fri, 13 Dec 2024 11:41:46 +0100
Subject: [PATCH 53/86] Update rpminspect unicode exceptions

rust 1.83.0 ships gcc source, which includes some tests for unicode
characters. This commit blacklists those tests so they won't raise
false positives in rpminspect testing.
---
 rpminspect.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rpminspect.yaml b/rpminspect.yaml
index ac238da..2a29d4a 100644
--- a/rpminspect.yaml
+++ b/rpminspect.yaml
@@ -22,3 +22,4 @@ unicode:
         - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-block-comment?.wat
         - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-line-comment?.wat
         - rustc-*-src/src/llvm-project/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst
+        - rustc-*-src/src/gcc/gcc/testsuite/c-c++-common/*Wbidi*.c

From 86da954d70596006dd60b2d540898e029473393d Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Wed, 18 Dec 2024 14:02:30 -0800
Subject: [PATCH 54/86] prep: Remove submodules we don't need.

---
 rust.spec | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rust.spec b/rust.spec
index 119ca1d..52c82c8 100644
--- a/rust.spec
+++ b/rust.spec
@@ -687,6 +687,10 @@ rm -rf src/llvm-project/
 mkdir -p src/llvm-project/libunwind/
 %endif
 
+# Remove submodules we don't need.
+rm -rf src/gcc
+rm -rf src/tools/enzyme
+rm -rf src/tools/rustc-perf
 
 # Remove other unused vendored libraries. This leaves the directory in place,
 # because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl".

From 27d88bb597e6693a16177439de90f5abada12a7e Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 9 Jan 2025 08:39:49 -0800
Subject: [PATCH 55/86] Update to Rust 1.84.0

---
 .gitignore                                    |   2 +
 ...variables-override-some-default-CPUs.patch |  12 +-
 ...vm-objcopy-if-llvm-tools-are-enabled.patch |  25 +++
 ...llow-disabling-target-self-contained.patch |  34 ++--
 ...ap-allow-setting-jobs-in-config.toml.patch | 162 ------------------
 ...xternal-library-path-for-wasm32-wasi.patch |  28 +--
 rust.spec                                     |  57 ++----
 ...atch => rustc-1.84.0-disable-libssh2.patch |  16 +-
 ...atch => rustc-1.84.0-unbundle-sqlite.patch |  18 +-
 sources                                       |   4 +-
 10 files changed, 100 insertions(+), 258 deletions(-)
 create mode 100644 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
 delete mode 100644 0001-bootstrap-allow-setting-jobs-in-config.toml.patch
 rename rustc-1.82.0-disable-libssh2.patch => rustc-1.84.0-disable-libssh2.patch (64%)
 rename rustc-1.82.0-unbundle-sqlite.patch => rustc-1.84.0-unbundle-sqlite.patch (50%)

diff --git a/.gitignore b/.gitignore
index ed7c95b..b0a96e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -445,3 +445,5 @@
 /rustc-1.82.0-src.tar.xz
 /wasi-libc-wasi-sdk-24.tar.gz
 /rustc-1.83.0-src.tar.xz
+/rustc-1.84.0-src.tar.xz
+/wasi-libc-wasi-sdk-25.tar.gz
diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch
index a590c54..302c7fd 100644
--- a/0001-Let-environment-variables-override-some-default-CPUs.patch
+++ b/0001-Let-environment-variables-override-some-default-CPUs.patch
@@ -1,4 +1,4 @@
-From e12de251f8513f660bbfbc1c71883383bd1037f4 Mon Sep 17 00:00:00 2001
+From 5273432acfae75d6e509bbebcf8d28b0f3d820d0 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 9 Jun 2023 15:23:08 -0700
 Subject: [PATCH] Let environment variables override some default CPUs
@@ -23,7 +23,7 @@ index 23913687a1fd..3253fbc84c74 100644
      base.max_atomic_width = Some(64);
      base.stack_probes = StackProbeType::Inline;
 diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
-index 3efbb4648361..bcdaa5b8276d 100644
+index a84a18a433ff..441af1018ff3 100644
 --- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
 @@ -5,7 +5,7 @@ pub(crate) fn target() -> Target {
@@ -32,9 +32,9 @@ index 3efbb4648361..bcdaa5b8276d 100644
      // z10 is the oldest CPU supported by LLVM
 -    base.cpu = "z10".into();
 +    base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into();
-     // FIXME: The ABI implementation in abi/call/s390x.rs is for now hard-coded to assume the no-vector
-     // ABI. Pass the -vector feature string to LLVM to respect this assumption.
-     base.features = "-vector".into();
+     base.max_atomic_width = Some(128);
+     base.min_global_align = Some(16);
+     base.stack_probes = StackProbeType::Inline;
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
 index 59ec6c7f9d5f..b6f1be890b20 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
@@ -49,5 +49,5 @@ index 59ec6c7f9d5f..b6f1be890b20 100644
      base.max_atomic_width = Some(64);
      base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
 -- 
-2.47.0
+2.47.1
 
diff --git a/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch b/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
new file mode 100644
index 0000000..ff57217
--- /dev/null
+++ b/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
@@ -0,0 +1,25 @@
+From 4c6d793c66993a0f5455f35e73a1549d232c3ae5 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Thu, 12 Dec 2024 17:06:03 -0800
+Subject: [PATCH] Only dist `llvm-objcopy` if llvm tools are enabled
+
+---
+ src/bootstrap/src/core/build_steps/dist.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
+index 0c739115165e..89b2d73f74a8 100644
+--- a/src/bootstrap/src/core/build_steps/dist.rs
++++ b/src/bootstrap/src/core/build_steps/dist.rs
+@@ -471,7 +471,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
+                 }
+             }
+ 
+-            {
++            if builder.config.llvm_enabled(compiler.host) && builder.config.llvm_tools_enabled {
+                 let src_dir = builder.sysroot_target_bindir(compiler, host);
+                 let llvm_objcopy = exe("llvm-objcopy", compiler.host);
+                 let rust_objcopy = exe("rust-objcopy", compiler.host);
+-- 
+2.47.1
+
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 428f354..34d735d 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From babdaf8354098399ec98c96eb3a3627664d6ba03 Mon Sep 17 00:00:00 2001
+From 8d4d52446347872816ab51958e9f3162cf722ee6 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:14:28 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/config.example.toml b/config.example.toml
-index f1dc32234ccf..82207f19d471 100644
+index d3233ad17b51..6a1f097c20cb 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -880,6 +880,11 @@
+@@ -916,6 +916,11 @@
  # argument as the test binary.
  #runner =  (string)
  
@@ -27,10 +27,10 @@ index f1dc32234ccf..82207f19d471 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index edf18e2ebf33..d48d027f329c 100644
+index 8e088682f92d..843b7123b120 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -367,6 +367,10 @@ fn copy_self_contained_objects(
+@@ -346,6 +346,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -38,14 +38,14 @@ index edf18e2ebf33..d48d027f329c 100644
 +        return vec![];
 +    }
 +
-     let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained");
+     let libdir_self_contained =
+         builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
-     let mut target_deps = vec![];
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index bdfee55d8d18..47fcd50e7e03 100644
+index e706aba977b6..a55d98e94dd8 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -589,6 +589,7 @@ pub struct Target {
+@@ -627,6 +627,7 @@ pub struct Target {
      pub runner: Option,
      pub no_std: bool,
      pub codegen_backends: Option>,
@@ -53,9 +53,9 @@ index bdfee55d8d18..47fcd50e7e03 100644
  }
  
  impl Target {
-@@ -597,6 +598,9 @@ pub fn from_triple(triple: &str) -> Self {
-         if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
-             target.no_std = true;
+@@ -638,6 +639,9 @@ pub fn from_triple(triple: &str) -> Self {
+         if triple.contains("emscripten") {
+             target.runner = Some("node".into());
          }
 +        if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
 +            target.self_contained = true;
@@ -63,7 +63,7 @@ index bdfee55d8d18..47fcd50e7e03 100644
          target
      }
  }
-@@ -1165,6 +1169,7 @@ struct TomlTarget {
+@@ -1213,6 +1217,7 @@ struct TomlTarget {
          no_std: Option = "no-std",
          codegen_backends: Option> = "codegen-backends",
          runner: Option = "runner",
@@ -71,7 +71,7 @@ index bdfee55d8d18..47fcd50e7e03 100644
      }
  }
  
-@@ -1967,6 +1972,9 @@ fn get_table(option: &str) -> Result {
+@@ -2038,6 +2043,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index bdfee55d8d18..47fcd50e7e03 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index 82b640f54234..f724aba50241 100644
+index c384fd6bf435..a101c010b740 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1326,6 +1326,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1351,6 +1351,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -98,5 +98,5 @@ index 82b640f54234..f724aba50241 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.46.0
+2.47.1
 
diff --git a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
deleted file mode 100644
index 577539e..0000000
--- a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 65458aed68fe6786068bab00e5a46d7ecdd2a072 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
- <39484203+jieyouxu@users.noreply.github.com>
-Date: Thu, 17 Oct 2024 22:58:45 +0800
-Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml
-
----
- config.example.toml                       |  5 ++
- src/bootstrap/src/core/config/config.rs   |  5 +-
- src/bootstrap/src/core/config/flags.rs    |  3 +-
- src/bootstrap/src/core/config/tests.rs    | 58 +++++++++++++++++++++++
- src/bootstrap/src/utils/change_tracker.rs |  5 ++
- 5 files changed, 73 insertions(+), 3 deletions(-)
-
-diff --git a/config.example.toml b/config.example.toml
-index 4b591b949b36..168ac353cff7 100644
---- a/config.example.toml
-+++ b/config.example.toml
-@@ -414,6 +414,11 @@
- # Specify the location of the Android NDK. Used when targeting Android.
- #android-ndk = "/path/to/android-ndk-r26d"
- 
-+# Number of parallel jobs to be used for building and testing. If set to `0` or
-+# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag
-+# passed to cargo invocations.
-+#jobs = 0
-+
- # =============================================================================
- # General install configuration options
- # =============================================================================
-diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index c2ab439891ea..aeb81b146382 100644
---- a/src/bootstrap/src/core/config/config.rs
-+++ b/src/bootstrap/src/core/config/config.rs
-@@ -891,6 +891,7 @@ struct Build {
-         metrics: Option = "metrics",
-         android_ndk: Option = "android-ndk",
-         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
-+        jobs: Option = "jobs",
-     }
- }
- 
-@@ -1289,7 +1290,6 @@ pub(crate) fn parse_inner(
-         config.rustc_error_format = flags.rustc_error_format;
-         config.json_output = flags.json_output;
-         config.on_fail = flags.on_fail;
--        config.jobs = Some(threads_from_config(flags.jobs as u32));
-         config.cmd = flags.cmd;
-         config.incremental = flags.incremental;
-         config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled };
-@@ -1511,8 +1511,11 @@ fn get_table(option: &str) -> Result {
-             metrics: _,
-             android_ndk,
-             optimized_compiler_builtins,
-+            jobs,
-         } = toml.build.unwrap_or_default();
- 
-+        config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
-+
-         if let Some(file_build) = build {
-             config.build = TargetSelection::from_user(&file_build);
-         };
-diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs
-index 3aefe517a5be..bfeb811508c0 100644
---- a/src/bootstrap/src/core/config/flags.rs
-+++ b/src/bootstrap/src/core/config/flags.rs
-@@ -110,11 +110,10 @@ pub struct Flags {
-         short,
-         long,
-         value_hint = clap::ValueHint::Other,
--        default_value_t = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get),
-         value_name = "JOBS"
-     )]
-     /// number of jobs to run in parallel
--    pub jobs: usize,
-+    pub jobs: Option,
-     // This overrides the deny-warnings configuration option,
-     // which passes -Dwarnings to the compiler invocations.
-     #[arg(global = true, long)]
-diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
-index 2611b6cf51bb..1f02757682c2 100644
---- a/src/bootstrap/src/core/config/tests.rs
-+++ b/src/bootstrap/src/core/config/tests.rs
-@@ -352,3 +352,61 @@ fn parse_rust_std_features_empty() {
- fn parse_rust_std_features_invalid() {
-     parse("rust.std-features = \"backtrace\"");
- }
-+
-+#[test]
-+fn parse_jobs() {
-+    assert_eq!(parse("build.jobs = 1").jobs, Some(1));
-+}
-+
-+#[test]
-+fn jobs_precedence() {
-+    // `--jobs` should take precedence over using `--set build.jobs`.
-+
-+    let config = Config::parse_inner(
-+        Flags::parse(&[
-+            "check".to_owned(),
-+            "--config=/does/not/exist".to_owned(),
-+            "--jobs=67890".to_owned(),
-+            "--set=build.jobs=12345".to_owned(),
-+        ]),
-+        |&_| toml::from_str(""),
-+    );
-+    assert_eq!(config.jobs, Some(67890));
-+
-+    // `--set build.jobs` should take precedence over `config.toml`.
-+    let config = Config::parse_inner(
-+        Flags::parse(&[
-+            "check".to_owned(),
-+            "--config=/does/not/exist".to_owned(),
-+            "--set=build.jobs=12345".to_owned(),
-+        ]),
-+        |&_| {
-+            toml::from_str(
-+                r#"
-+            [build]
-+            jobs = 67890
-+        "#,
-+            )
-+        },
-+    );
-+    assert_eq!(config.jobs, Some(12345));
-+
-+    // `--jobs` > `--set build.jobs` > `config.toml`
-+    let config = Config::parse_inner(
-+        Flags::parse(&[
-+            "check".to_owned(),
-+            "--jobs=123".to_owned(),
-+            "--config=/does/not/exist".to_owned(),
-+            "--set=build.jobs=456".to_owned(),
-+        ]),
-+        |&_| {
-+            toml::from_str(
-+                r#"
-+            [build]
-+            jobs = 789
-+        "#,
-+            )
-+        },
-+    );
-+    assert_eq!(config.jobs, Some(123));
-+}
-diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
-index b37786496cb5..9169bc90a45d 100644
---- a/src/bootstrap/src/utils/change_tracker.rs
-+++ b/src/bootstrap/src/utils/change_tracker.rs
-@@ -275,4 +275,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
-         severity: ChangeSeverity::Info,
-         summary: "New option `./x setup editor` added, replacing `./x setup vscode` and adding support for vim, emacs and helix.",
-     },
-+    ChangeInfo {
-+        change_id: 131838,
-+        severity: ChangeSeverity::Info,
-+        summary: "Allow setting `--jobs` in config.toml with `build.jobs`.",
-+    },
- ];
--- 
-2.47.0
-
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index feeb0f3..3a05424 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,4 +1,4 @@
-From 3fdce19416e80a48c5b2b77b2cdec697d0b5e225 Mon Sep 17 00:00:00 2001
+From 21d53eca2af5f04c0aa6b898f99f58e0e093cfdd Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:18:16 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
@@ -10,10 +10,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi
  3 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index e8143b9a5f38..5a928a18b3ea 100644
+index 5149e3a12f23..cf62fbdc7f59 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1621,6 +1621,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1663,6 +1663,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -23,10 +23,10 @@ index e8143b9a5f38..5a928a18b3ea 100644
 +            return file_path;
 +        }
 +    }
-     for search_path in sess.target_filesearch(PathKind::Native).search_paths() {
+     for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2123,6 +2129,10 @@ fn add_library_search_dirs(
+@@ -2163,6 +2169,10 @@ fn add_library_search_dirs(
              ControlFlow::<()>::Continue(())
          },
      );
@@ -38,10 +38,10 @@ index e8143b9a5f38..5a928a18b3ea 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index d5f227a84a4c..54c22c8ebed6 100644
+index 321ab40403a3..54791c8892d8 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2053,6 +2053,7 @@ pub struct TargetOptions {
+@@ -2155,6 +2155,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -49,7 +49,7 @@ index d5f227a84a4c..54c22c8ebed6 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2540,6 +2541,7 @@ fn default() -> TargetOptions {
+@@ -2651,6 +2652,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -57,7 +57,7 @@ index d5f227a84a4c..54c22c8ebed6 100644
              pre_link_objects_self_contained: Default::default(),
              post_link_objects_self_contained: Default::default(),
              link_self_contained: LinkSelfContainedDefault::False,
-@@ -3221,6 +3223,7 @@ macro_rules! key {
+@@ -3355,6 +3357,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -65,7 +65,7 @@ index d5f227a84a4c..54c22c8ebed6 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -3482,6 +3485,7 @@ macro_rules! target_option_val {
+@@ -3636,6 +3639,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -74,12 +74,12 @@ index d5f227a84a4c..54c22c8ebed6 100644
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
 diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-index 29e6dff2068f..dbe021ef064c 100644
+index 1cd30f21bec1..9a752d5712a6 100644
 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-@@ -19,11 +19,12 @@ pub fn target() -> Target {
+@@ -19,11 +19,12 @@ pub(crate) fn target() -> Target {
      options.env = "p1".into();
-     options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]);
+     options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasip1"]);
  
 -    options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained();
 -    options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();
@@ -94,5 +94,5 @@ index 29e6dff2068f..dbe021ef064c 100644
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.46.0
+2.47.1
 
diff --git a/rust.spec b/rust.spec
index 52c82c8..601e0fc 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.83.0
+Version:        1.84.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.82.0
-%global bootstrap_channel 1.82.0
-%global bootstrap_date 2024-10-17
+%global bootstrap_version 1.83.0
+%global bootstrap_channel 1.83.0
+%global bootstrap_date 2024-11-28
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -28,7 +28,7 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-%global wasi_libc_ref wasi-sdk-24
+%global wasi_libc_ref wasi-sdk-25
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@@ -44,7 +44,7 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient.  Rust currently requires LLVM 18.0+.
 %global min_llvm_version 18.0.0
-%global bundled_llvm_version 19.1.1
+%global bundled_llvm_version 19.1.5
 #global llvm_compat_version 17
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -128,10 +128,10 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.82.0-unbundle-sqlite.patch
+Patch6:         rustc-1.84.0-unbundle-sqlite.patch
 
-# https://github.com/rust-lang/rust/pull/131838
-Patch7:         0001-bootstrap-allow-setting-jobs-in-config.toml.patch
+# https://github.com/rust-lang/rust/pull/134240
+Patch7:         0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
 
 ### RHEL-specific patches below ###
 
@@ -142,7 +142,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.82.0-disable-libssh2.patch
+Patch100:       rustc-1.84.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
@@ -175,9 +175,7 @@ end}
 %if 0%{?fedora}
 %global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu
 %endif
-# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1
-# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
-%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1
+%global wasm_targets wasm32-unknown-unknown wasm32-wasip1
 %if 0%{?fedora}
 %global extra_targets x86_64-unknown-none x86_64-unknown-uefi
 %endif
@@ -234,9 +232,10 @@ BuildRequires:  (%{name} >= %{bootstrap_version} with %{name} <= %{version})
 %global local_rust_root %{_prefix}
 %endif
 
+%global toolchain clang
+
 BuildRequires:  make
-BuildRequires:  gcc
-BuildRequires:  gcc-c++
+BuildRequires:  clang
 BuildRequires:  ncurses-devel
 # explicit curl-devel to avoid httpd24-curl (rhbz1540167)
 BuildRequires:  curl-devel
@@ -429,18 +428,6 @@ BuildArch:      noarch
 %target_description wasm32-unknown-unknown WebAssembly
 %endif
 
-%if %target_enabled wasm32-wasi
-%target_package wasm32-wasi
-Requires:       lld >= 8.0
-%if %with bundled_wasi_libc
-Provides:       bundled(wasi-libc)
-%else
-Requires:       wasi-libc-static
-%endif
-BuildArch:      noarch
-%target_description wasm32-wasi WebAssembly
-%endif
-
 %if %target_enabled wasm32-wasip1
 %target_package wasm32-wasip1
 Requires:       lld >= 8.0
@@ -450,6 +437,8 @@ Provides:       bundled(wasi-libc)
 Requires:       wasi-libc-static
 %endif
 BuildArch:      noarch
+# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
+Obsoletes:      %{name}-std-static-wasm32-wasi < 1.84.0~
 %target_description wasm32-wasip1 WebAssembly
 %endif
 
@@ -806,16 +795,12 @@ end}
 %if %defined wasm_targets
 %if %with bundled_wasi_libc
 %define wasi_libc_flags MALLOC_IMPL=emmalloc CC=clang AR=llvm-ar NM=llvm-nm
-%make_build --quiet -C %{wasi_libc_dir} %{wasi_libc_flags} TARGET_TRIPLE=wasm32-wasi
 %make_build --quiet -C %{wasi_libc_dir} %{wasi_libc_flags} TARGET_TRIPLE=wasm32-wasip1
 %define wasm_target_config %{shrink:
-  --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot
   --set target.wasm32-wasip1.wasi-root=%{wasi_libc_dir}/sysroot
 }
 %else
 %define wasm_target_config %{shrink:
-  --set target.wasm32-wasi.wasi-root=%{_prefix}/wasm32-wasi
-  --set target.wasm32-wasi.self-contained=false
   --set target.wasm32-wasip1.wasi-root=%{_prefix}/wasm32-wasi
   --set target.wasm32-wasip1.self-contained=false
 }
@@ -866,6 +851,7 @@ test -r "%{profiler}"
   --set build.install-stage=2 \
   --set build.test-stage=2 \
   --set build.optimized-compiler-builtins=false \
+  --set rust.llvm-tools=false \
   --enable-extended \
   --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \
   --enable-vendor \
@@ -1074,15 +1060,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %target_files wasm32-unknown-unknown
 %endif
 
-%if %target_enabled wasm32-wasi
-%target_files wasm32-wasi
-%if %with bundled_wasi_libc
-%dir %{rustlibdir}/wasm32-wasi/lib/self-contained
-%{rustlibdir}/wasm32-wasi/lib/self-contained/crt*.o
-%{rustlibdir}/wasm32-wasi/lib/self-contained/libc.a
-%endif
-%endif
-
 %if %target_enabled wasm32-wasip1
 %target_files wasm32-wasip1
 %if %with bundled_wasi_libc
diff --git a/rustc-1.82.0-disable-libssh2.patch b/rustc-1.84.0-disable-libssh2.patch
similarity index 64%
rename from rustc-1.82.0-disable-libssh2.patch
rename to rustc-1.84.0-disable-libssh2.patch
index 69f5704..267bc3c 100644
--- a/rustc-1.82.0-disable-libssh2.patch
+++ b/rustc-1.84.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-09-06 10:36:55.743405666 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-09-06 10:36:55.745405652 -0700
-@@ -2156,7 +2156,6 @@ checksum = "10472326a8a6477c3c20a64547b0
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-12-12 14:07:10.755481543 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-12-12 14:07:10.756481534 -0800
+@@ -2272,7 +2272,6 @@ checksum = "10472326a8a6477c3c20a64547b0
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2197,20 +2196,6 @@ dependencies = [
+@@ -2313,20 +2312,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -31,14 +31,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  [[package]]
  name = "libz-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-09-06 10:36:55.746405645 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-09-06 10:37:13.849280464 -0700
-@@ -44,7 +44,7 @@ curl = "0.4.46"
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-12-12 14:07:10.756481534 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-12-12 14:07:56.866087428 -0800
+@@ -47,7 +47,7 @@ curl = "0.4.46"
  curl-sys = "0.4.73"
  filetime = "0.2.23"
  flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
 -git2 = "0.19.0"
 +git2 = { version = "0.19.0", default-features = false, features = ["https"] }
  git2-curl = "0.20.0"
- gix = { version = "0.64.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
+ gix = { version = "0.67.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
  glob = "0.3.1"
diff --git a/rustc-1.82.0-unbundle-sqlite.patch b/rustc-1.84.0-unbundle-sqlite.patch
similarity index 50%
rename from rustc-1.82.0-unbundle-sqlite.patch
rename to rustc-1.84.0-unbundle-sqlite.patch
index f01397a..2e3ecc3 100644
--- a/rustc-1.82.0-unbundle-sqlite.patch
+++ b/rustc-1.84.0-unbundle-sqlite.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-09-06 10:30:29.435107742 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-09-06 10:31:57.168492758 -0700
-@@ -2194,7 +2194,6 @@ version = "0.30.1"
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-12-07 06:47:38.000000000 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-12-12 14:02:54.412672539 -0800
+@@ -2310,7 +2310,6 @@ version = "0.30.1"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
  dependencies = [
@@ -10,14 +10,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-09-06 10:30:29.435107742 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-09-06 10:31:27.942697616 -0700
-@@ -77,7 +77,7 @@ proptest = "1.5.0"
- pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] }
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-12-12 14:02:54.412672539 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-12-12 14:03:25.665405417 -0800
+@@ -80,7 +80,7 @@ proptest = "1.5.0"
+ pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] }
  rand = "0.8.5"
  regex = "1.10.5"
 -rusqlite = { version = "0.32.0", features = ["bundled"] }
 +rusqlite = { version = "0.32.0", features = [] }
- rustfix = { version = "0.8.2", path = "crates/rustfix" }
+ rustc-hash = "2.0.0"
+ rustfix = { version = "0.9.0", path = "crates/rustfix" }
  same-file = "1.0.6"
- security-framework = "2.11.1"
diff --git a/sources b/sources
index 41e5bf7..5215bc2 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.83.0-src.tar.xz) = 64db57949c6ac1df6a3f4c6bd0938685a5fb1bc3d318b34ccfcfccb0f9eff1cffd4d8a53a190ef0409eeca9ad12bc6234c2c1de69196cc74ae02d6afa20d0ce6
-SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21
+SHA512 (rustc-1.84.0-src.tar.xz) = 9e964c1b964e74083a9002fa04b072fa8fe7a520b24ad55e88a89bb2a2a2cd5727c5438d6db425b824ae7502ab215c2dd3f49777efd65f76bae09965df2e070a
+SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea

From 74986e8d9c6619541b23e6ba2919a7530f1c7556 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 9 Jan 2025 15:04:14 -0800
Subject: [PATCH 56/86] Use lld when building the compiler

---
 rust.spec | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rust.spec b/rust.spec
index 601e0fc..4e916d8 100644
--- a/rust.spec
+++ b/rust.spec
@@ -236,6 +236,7 @@ BuildRequires:  (%{name} >= %{bootstrap_version} with %{name} <= %{version})
 
 BuildRequires:  make
 BuildRequires:  clang
+BuildRequires:  lld
 BuildRequires:  ncurses-devel
 # explicit curl-devel to avoid httpd24-curl (rhbz1540167)
 BuildRequires:  curl-devel
@@ -732,6 +733,9 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
 %global build_rustflags %{nil}
 %endif
 
+# This is mostly needed for lld < 19 which defaulted to a short --build-id=fast.
+%global rustflags -Clink-arg=%{?_build_id_flags}%{!?_build_id_flags:-Wl,--build-id=sha1}
+
 # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros
 %global rustc_target_cpus %{lua: do
   local fedora = tonumber(rpm.expand("0%{?fedora}"))
@@ -841,7 +845,7 @@ test -r "%{profiler}"
     %{!?with_llvm_static: --enable-llvm-link-shared } } \
   --disable-llvm-static-stdcpp \
   --disable-llvm-bitcode-linker \
-  --disable-lld \
+  --disable-lld --set rust.use-lld=true \
   --disable-rpath \
   %{enable_debuginfo} \
   %{enable_rust_opts} \

From 81b4dce86424edc03f64a1b9878fd18671e850c3 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 9 Jan 2025 17:24:50 -0800
Subject: [PATCH 57/86] Revert use of clang/lld; patch cc-rs#1354 instead

---
 ...ly-translate-profile-flags-for-Clang.patch | 39 +++++++++++++++++++
 rust.spec                                     | 20 ++++------
 2 files changed, 46 insertions(+), 13 deletions(-)
 create mode 100644 0001-Only-translate-profile-flags-for-Clang.patch

diff --git a/0001-Only-translate-profile-flags-for-Clang.patch b/0001-Only-translate-profile-flags-for-Clang.patch
new file mode 100644
index 0000000..3353c10
--- /dev/null
+++ b/0001-Only-translate-profile-flags-for-Clang.patch
@@ -0,0 +1,39 @@
+From e4e678eb9cbd90acf2ba51e9ec0209b05c4403b5 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Thu, 9 Jan 2025 16:47:10 -0800
+Subject: [PATCH] Only translate profile flags for Clang
+
+---
+ src/flags.rs | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/src/flags.rs b/src/flags.rs
+index 81834cf625f7..1a53c1b2345c 100644
+--- a/src/flags.rs
++++ b/src/flags.rs
+@@ -201,13 +201,15 @@ impl<'this> RustcCodegenFlags<'this> {
+                 if self.no_vectorize_slp {
+                     push_if_supported("-fno-slp-vectorize".into());
+                 }
+-                // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate
+-                if let Some(value) = self.profile_generate {
+-                    push_if_supported(format!("-fprofile-generate={value}").into());
+-                }
+-                // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use
+-                if let Some(value) = self.profile_use {
+-                    push_if_supported(format!("-fprofile-use={value}").into());
++                if let ToolFamily::Clang { .. } = family {
++                    // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate
++                    if let Some(value) = self.profile_generate {
++                        push_if_supported(format!("-fprofile-generate={value}").into());
++                    }
++                    // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use
++                    if let Some(value) = self.profile_use {
++                        push_if_supported(format!("-fprofile-use={value}").into());
++                    }
+                 }
+                 // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mguard
+                 if let Some(value) = self.control_flow_guard {
+-- 
+2.47.1
+
diff --git a/rust.spec b/rust.spec
index 4e916d8..431b02d 100644
--- a/rust.spec
+++ b/rust.spec
@@ -133,6 +133,9 @@ Patch6:         rustc-1.84.0-unbundle-sqlite.patch
 # https://github.com/rust-lang/rust/pull/134240
 Patch7:         0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
 
+# https://github.com/rust-lang/cc-rs/issues/1354
+Patch8:         0001-Only-translate-profile-flags-for-Clang.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -232,11 +235,9 @@ BuildRequires:  (%{name} >= %{bootstrap_version} with %{name} <= %{version})
 %global local_rust_root %{_prefix}
 %endif
 
-%global toolchain clang
-
 BuildRequires:  make
-BuildRequires:  clang
-BuildRequires:  lld
+BuildRequires:  gcc
+BuildRequires:  gcc-c++
 BuildRequires:  ncurses-devel
 # explicit curl-devel to avoid httpd24-curl (rhbz1540167)
 BuildRequires:  curl-devel
@@ -661,6 +662,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
+%patch -P8 -p1 -d vendor/cc-1.2.5
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -733,9 +735,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
 %global build_rustflags %{nil}
 %endif
 
-# This is mostly needed for lld < 19 which defaulted to a short --build-id=fast.
-%global rustflags -Clink-arg=%{?_build_id_flags}%{!?_build_id_flags:-Wl,--build-id=sha1}
-
 # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros
 %global rustc_target_cpus %{lua: do
   local fedora = tonumber(rpm.expand("0%{?fedora}"))
@@ -816,12 +815,7 @@ end}
 # clang_resource_dir is not defined for compat builds.
 %define profiler /usr/lib/clang/%{llvm_compat_version}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
 %else
-%if 0%{?clang_major_version} >= 17
 %define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
-%else
-# The exact profiler path is version dependent..
-%define profiler %(echo %{_libdir}/clang/??/lib/libclang_rt.profile-*.a)
-%endif
 %endif
 test -r "%{profiler}"
 
@@ -845,7 +839,7 @@ test -r "%{profiler}"
     %{!?with_llvm_static: --enable-llvm-link-shared } } \
   --disable-llvm-static-stdcpp \
   --disable-llvm-bitcode-linker \
-  --disable-lld --set rust.use-lld=true \
+  --disable-lld \
   --disable-rpath \
   %{enable_debuginfo} \
   %{enable_rust_opts} \

From 17a60f7317d03ec0c9d0562d0b8ee267b08fe39b Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 14 Jan 2025 10:03:14 -0800
Subject: [PATCH 58/86] Fully remove the shared standard library

---
 rust.spec | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/rust.spec b/rust.spec
index 431b02d..1976ad8 100644
--- a/rust.spec
+++ b/rust.spec
@@ -907,7 +907,13 @@ rm -rf ./build/dist/ ./build/tmp/
 # Some of the components duplicate-install binaries, leaving backups we don't want
 rm -f %{buildroot}%{_bindir}/*.old
 
-# Make sure the shared libraries are in the proper libdir
+# We don't want to ship the shared standard library, because it has no stable ABI.
+# (and if we merely %%exclude these, then rpmbuild still packages build-id links)
+find %{buildroot}%{rustlibdir} -type f                      \
+  '(' -name '*.so' -o -name '*.dll' -o -name '*.dll.a' ')'  \
+  -exec rm -v '{}' '+'
+
+# Make sure the compiler's shared libraries are in the proper libdir
 %if "%{_libdir}" != "%{common_libdir}"
 mkdir -p %{buildroot}%{_libdir}
 find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
@@ -1031,7 +1037,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %dir %{rustlibdir}/%{rust_triple}
 %dir %{rustlibdir}/%{rust_triple}/lib
 %{rustlibdir}/%{rust_triple}/lib/*.rlib
-%exclude %{rustlibdir}/%{rust_triple}/lib/*.so
 
 %global target_files()      \
 %files std-static-%1        \
@@ -1043,15 +1048,11 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %if %target_enabled i686-pc-windows-gnu
 %target_files i686-pc-windows-gnu
 %{rustlibdir}/i686-pc-windows-gnu/lib/rs*.o
-%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll
-%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll.a
 %endif
 
 %if %target_enabled x86_64-pc-windows-gnu
 %target_files x86_64-pc-windows-gnu
 %{rustlibdir}/x86_64-pc-windows-gnu/lib/rs*.o
-%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll
-%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll.a
 %endif
 
 %if %target_enabled wasm32-unknown-unknown

From b9d8811f3bdfae301c41fbee11cca14ddbf99e2a Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering 
Date: Sun, 19 Jan 2025 00:20:25 +0000
Subject: [PATCH 59/86] Rebuilt for
 https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild


From 780493632fea05247f03578714fdf3b4343b060c Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Mon, 20 Jan 2025 09:45:34 -0800
Subject: [PATCH 60/86] Use system oniguruma for building rust-docs

---
 rust.spec | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/rust.spec b/rust.spec
index 1976ad8..8fe3f68 100644
--- a/rust.spec
+++ b/rust.spec
@@ -60,6 +60,15 @@ ExclusiveArch:  %{rust_arches}
 %bcond_without bundled_libgit2
 %endif
 
+# Try to use system oniguruma (only used at build time for rust-docs)
+# src/tools/rustbook -> ... -> onig_sys v69.8.1 needs at least 6.9.3
+%global min_oniguruma_version 6.9.3
+%if 0%{?rhel} && 0%{?rhel} < 9
+%bcond_without bundled_oniguruma
+%else
+%bcond_with bundled_oniguruma
+%endif
+
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
 %global bundled_sqlite3_version 3.46.0
@@ -250,6 +259,10 @@ BuildRequires:  pkgconfig(zlib)
 BuildRequires:  (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(libgit2) < %{next_libgit2_version})
 %endif
 
+%if %{without bundled_oniguruma}
+BuildRequires:  pkgconfig(oniguruma) >= %{min_oniguruma_version}
+%endif
+
 %if %{without bundled_sqlite3}
 BuildRequires:  pkgconfig(sqlite3) >= %{min_sqlite3_version}
 %endif
@@ -701,6 +714,10 @@ rm -rf src/tools/rustc-perf
 %clear_dir vendor/libgit2-sys*/libgit2/
 %endif
 
+%if %without bundled_oniguruma
+%clear_dir vendor/onig_sys*/oniguruma/
+%endif
+
 %if %without bundled_sqlite3
 %clear_dir vendor/libsqlite3-sys*/sqlite3/
 %endif
@@ -753,6 +770,7 @@ end}
 %global rust_env %{shrink:
   %{?rustflags:RUSTFLAGS="%{rustflags}"}
   %{rustc_target_cpus}
+  %{!?with_bundled_oniguruma:RUSTONIG_SYSTEM_LIBONIG=1}
   %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1}
   %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1}
 }

From 1013e8f026cd2b9d11be2b2bdf9ccea7d083bd86 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Mon, 27 Jan 2025 12:19:36 -0800
Subject: [PATCH 61/86] Restore libstd.so for uses like evcxr

Ref: https://github.com/evcxr/evcxr/issues/394
---
 rust.spec | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/rust.spec b/rust.spec
index 8fe3f68..3f1f1dd 100644
--- a/rust.spec
+++ b/rust.spec
@@ -925,12 +925,6 @@ rm -rf ./build/dist/ ./build/tmp/
 # Some of the components duplicate-install binaries, leaving backups we don't want
 rm -f %{buildroot}%{_bindir}/*.old
 
-# We don't want to ship the shared standard library, because it has no stable ABI.
-# (and if we merely %%exclude these, then rpmbuild still packages build-id links)
-find %{buildroot}%{rustlibdir} -type f                      \
-  '(' -name '*.so' -o -name '*.dll' -o -name '*.dll.a' ')'  \
-  -exec rm -v '{}' '+'
-
 # Make sure the compiler's shared libraries are in the proper libdir
 %if "%{_libdir}" != "%{common_libdir}"
 mkdir -p %{buildroot}%{_libdir}
@@ -942,6 +936,13 @@ find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
 find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
   -exec chmod -v +x '{}' '+'
 
+# The shared standard library is excluded from Provides, because it has no
+# stable ABI. However, we still ship it alongside the static target libraries
+# to enable some niche local use-cases, like the `evcxr` REPL.
+# Make sure those libraries are also executable for debuginfo extraction.
+find %{buildroot}%{rustlibdir} -type f -name '*.so' \
+  -exec chmod -v +x '{}' '+'
+
 # Remove installer artifacts (manifests, uninstall scripts, etc.)
 find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
 
@@ -1044,7 +1045,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %doc README.md
 %{_bindir}/rustc
 %{_bindir}/rustdoc
-%{_libdir}/*.so
+%{_libdir}/librustc_driver-*.so
 %{_libexecdir}/rust-analyzer-proc-macro-srv
 %{_mandir}/man1/rustc.1*
 %{_mandir}/man1/rustdoc.1*
@@ -1055,6 +1056,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %dir %{rustlibdir}/%{rust_triple}
 %dir %{rustlibdir}/%{rust_triple}/lib
 %{rustlibdir}/%{rust_triple}/lib/*.rlib
+%{rustlibdir}/%{rust_triple}/lib/*.so
 
 %global target_files()      \
 %files std-static-%1        \
@@ -1066,11 +1068,15 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %if %target_enabled i686-pc-windows-gnu
 %target_files i686-pc-windows-gnu
 %{rustlibdir}/i686-pc-windows-gnu/lib/rs*.o
+%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll
+%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll.a
 %endif
 
 %if %target_enabled x86_64-pc-windows-gnu
 %target_files x86_64-pc-windows-gnu
 %{rustlibdir}/x86_64-pc-windows-gnu/lib/rs*.o
+%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll
+%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll.a
 %endif
 
 %if %target_enabled wasm32-unknown-unknown

From 8e04e725bbf4eb9213dde7af6750b8fed9fdaa01 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 30 Jan 2025 12:00:33 -0800
Subject: [PATCH 62/86] Update to Rust 1.84.1

---
 .gitignore                                    |  1 +
 ...vm-objcopy-if-llvm-tools-are-enabled.patch | 25 -------------------
 rust.spec                                     | 10 +++-----
 sources                                       |  2 +-
 4 files changed, 5 insertions(+), 33 deletions(-)
 delete mode 100644 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch

diff --git a/.gitignore b/.gitignore
index b0a96e9..ef946c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -447,3 +447,4 @@
 /rustc-1.83.0-src.tar.xz
 /rustc-1.84.0-src.tar.xz
 /wasi-libc-wasi-sdk-25.tar.gz
+/rustc-1.84.1-src.tar.xz
diff --git a/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch b/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
deleted file mode 100644
index ff57217..0000000
--- a/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4c6d793c66993a0f5455f35e73a1549d232c3ae5 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 12 Dec 2024 17:06:03 -0800
-Subject: [PATCH] Only dist `llvm-objcopy` if llvm tools are enabled
-
----
- src/bootstrap/src/core/build_steps/dist.rs | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
-index 0c739115165e..89b2d73f74a8 100644
---- a/src/bootstrap/src/core/build_steps/dist.rs
-+++ b/src/bootstrap/src/core/build_steps/dist.rs
-@@ -471,7 +471,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
-                 }
-             }
- 
--            {
-+            if builder.config.llvm_enabled(compiler.host) && builder.config.llvm_tools_enabled {
-                 let src_dir = builder.sysroot_target_bindir(compiler, host);
-                 let llvm_objcopy = exe("llvm-objcopy", compiler.host);
-                 let rust_objcopy = exe("rust-objcopy", compiler.host);
--- 
-2.47.1
-
diff --git a/rust.spec b/rust.spec
index 3f1f1dd..c03e245 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.84.0
+Version:        1.84.1
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
@@ -139,11 +139,8 @@ Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 # We don't want to use the bundled library in libsqlite3-sys
 Patch6:         rustc-1.84.0-unbundle-sqlite.patch
 
-# https://github.com/rust-lang/rust/pull/134240
-Patch7:         0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch
-
 # https://github.com/rust-lang/cc-rs/issues/1354
-Patch8:         0001-Only-translate-profile-flags-for-Clang.patch
+Patch7:         0001-Only-translate-profile-flags-for-Clang.patch
 
 ### RHEL-specific patches below ###
 
@@ -674,8 +671,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %if %without bundled_sqlite3
 %patch -P6 -p1
 %endif
-%patch -P7 -p1
-%patch -P8 -p1 -d vendor/cc-1.2.5
+%patch -P7 -p1 -d vendor/cc-1.2.5
 
 %if %with disabled_libssh2
 %patch -P100 -p1
diff --git a/sources b/sources
index 5215bc2..24d06bc 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.84.0-src.tar.xz) = 9e964c1b964e74083a9002fa04b072fa8fe7a520b24ad55e88a89bb2a2a2cd5727c5438d6db425b824ae7502ab215c2dd3f49777efd65f76bae09965df2e070a
+SHA512 (rustc-1.84.1-src.tar.xz) = f1cc4765736551508408126e44086988e8ddc30c1a929bf7b61c6be85ad0d65928dd5fb1041cfaeee8eb37d2208f2c1917e276aef2bc9a8e40e34f6713b349e1
 SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea

From ad5a8095c85ce34e4faac6fb39d184c443e9b0c8 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 20 Feb 2025 09:16:51 -0800
Subject: [PATCH 63/86] Update to Rust 1.85.0

---
 .gitignore                                    |  1 +
 ...llow-disabling-target-self-contained.patch | 24 +++----
 ...xternal-library-path-for-wasm32-wasi.patch | 63 ++++++++++---------
 rust.spec                                     | 26 ++++----
 ...atch => rustc-1.85.0-disable-libssh2.patch | 14 ++---
 ...atch => rustc-1.85.0-unbundle-sqlite.patch | 12 ++--
 sources                                       |  2 +-
 7 files changed, 74 insertions(+), 68 deletions(-)
 rename rustc-1.84.0-disable-libssh2.patch => rustc-1.85.0-disable-libssh2.patch (66%)
 rename rustc-1.84.0-unbundle-sqlite.patch => rustc-1.85.0-unbundle-sqlite.patch (64%)

diff --git a/.gitignore b/.gitignore
index ef946c2..771739a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -448,3 +448,4 @@
 /rustc-1.84.0-src.tar.xz
 /wasi-libc-wasi-sdk-25.tar.gz
 /rustc-1.84.1-src.tar.xz
+/rustc-1.85.0-src.tar.xz
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 34d735d..bd6d0ed 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From 8d4d52446347872816ab51958e9f3162cf722ee6 Mon Sep 17 00:00:00 2001
+From eeb171e5de6da8790d01135754cbb9b6c248c476 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:14:28 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/config.example.toml b/config.example.toml
-index d3233ad17b51..6a1f097c20cb 100644
+index 5ea6774ce035..ec08a319e77f 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -916,6 +916,11 @@
+@@ -922,6 +922,11 @@
  # argument as the test binary.
  #runner =  (string)
  
@@ -27,10 +27,10 @@ index d3233ad17b51..6a1f097c20cb 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 8e088682f92d..843b7123b120 100644
+index ca337aa9f4c3..6175f93e50ed 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -346,6 +346,10 @@ fn copy_self_contained_objects(
+@@ -325,6 +325,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,10 +42,10 @@ index 8e088682f92d..843b7123b120 100644
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index e706aba977b6..a55d98e94dd8 100644
+index dd2f11ad4690..e10ed666099c 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -627,6 +627,7 @@ pub struct Target {
+@@ -634,6 +634,7 @@ pub struct Target {
      pub runner: Option,
      pub no_std: bool,
      pub codegen_backends: Option>,
@@ -53,7 +53,7 @@ index e706aba977b6..a55d98e94dd8 100644
  }
  
  impl Target {
-@@ -638,6 +639,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -645,6 +646,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("emscripten") {
              target.runner = Some("node".into());
          }
@@ -63,7 +63,7 @@ index e706aba977b6..a55d98e94dd8 100644
          target
      }
  }
-@@ -1213,6 +1217,7 @@ struct TomlTarget {
+@@ -1219,6 +1223,7 @@ struct TomlTarget {
          no_std: Option = "no-std",
          codegen_backends: Option> = "codegen-backends",
          runner: Option = "runner",
@@ -71,7 +71,7 @@ index e706aba977b6..a55d98e94dd8 100644
      }
  }
  
-@@ -2038,6 +2043,9 @@ fn get_table(option: &str) -> Result {
+@@ -2082,6 +2087,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index e706aba977b6..a55d98e94dd8 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index c384fd6bf435..a101c010b740 100644
+index 8405c22aff08..7e1582207b8a 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1351,6 +1351,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1327,6 +1327,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 3a05424..3534abb 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,19 +1,20 @@
-From 21d53eca2af5f04c0aa6b898f99f58e0e093cfdd Mon Sep 17 00:00:00 2001
+From e8e50258df70b39d2425dacf90c3d5f6d0720bc0 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:18:16 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
 
 ---
  compiler/rustc_codegen_ssa/src/back/link.rs            | 10 ++++++++++
- compiler/rustc_target/src/spec/mod.rs                  |  4 ++++
+ compiler/rustc_target/src/spec/json.rs                 |  2 ++
+ compiler/rustc_target/src/spec/mod.rs                  |  2 ++
  .../rustc_target/src/spec/targets/wasm32_wasip1.rs     |  7 ++++---
- 3 files changed, 18 insertions(+), 3 deletions(-)
+ 4 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index 5149e3a12f23..cf62fbdc7f59 100644
+index e2081ad75633..a308bae8b644 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1663,6 +1663,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1639,6 +1639,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -26,7 +27,7 @@ index 5149e3a12f23..cf62fbdc7f59 100644
      for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2163,6 +2169,10 @@ fn add_library_search_dirs(
+@@ -2139,6 +2145,10 @@ fn add_library_search_dirs(
              ControlFlow::<()>::Continue(())
          },
      );
@@ -37,27 +38,11 @@ index 5149e3a12f23..cf62fbdc7f59 100644
  }
  
  /// Add options making relocation sections in the produced ELF files read-only
-diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 321ab40403a3..54791c8892d8 100644
---- a/compiler/rustc_target/src/spec/mod.rs
-+++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2155,6 +2155,7 @@ pub struct TargetOptions {
-     /// Objects to link before and after all other object code.
-     pub pre_link_objects: CrtObjects,
-     pub post_link_objects: CrtObjects,
-+    pub external_lib_path: Option>,
-     /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
-     pub pre_link_objects_self_contained: CrtObjects,
-     pub post_link_objects_self_contained: CrtObjects,
-@@ -2651,6 +2652,7 @@ fn default() -> TargetOptions {
-             relro_level: RelroLevel::None,
-             pre_link_objects: Default::default(),
-             post_link_objects: Default::default(),
-+            external_lib_path: None,
-             pre_link_objects_self_contained: Default::default(),
-             post_link_objects_self_contained: Default::default(),
-             link_self_contained: LinkSelfContainedDefault::False,
-@@ -3355,6 +3357,7 @@ macro_rules! key {
+diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
+index 9cdc0801b1f0..70fe8396b353 100644
+--- a/compiler/rustc_target/src/spec/json.rs
++++ b/compiler/rustc_target/src/spec/json.rs
+@@ -527,6 +527,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -65,7 +50,7 @@ index 321ab40403a3..54791c8892d8 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -3636,6 +3639,7 @@ macro_rules! target_option_val {
+@@ -708,6 +709,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -73,8 +58,28 @@ index 321ab40403a3..54791c8892d8 100644
          target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback");
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
+diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
+index 02962d55a60e..169f5a74bbfd 100644
+--- a/compiler/rustc_target/src/spec/mod.rs
++++ b/compiler/rustc_target/src/spec/mod.rs
+@@ -2197,6 +2197,7 @@ pub struct TargetOptions {
+     /// Objects to link before and after all other object code.
+     pub pre_link_objects: CrtObjects,
+     pub post_link_objects: CrtObjects,
++    pub external_lib_path: Option>,
+     /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
+     pub pre_link_objects_self_contained: CrtObjects,
+     pub post_link_objects_self_contained: CrtObjects,
+@@ -2712,6 +2713,7 @@ fn default() -> TargetOptions {
+             relro_level: RelroLevel::None,
+             pre_link_objects: Default::default(),
+             post_link_objects: Default::default(),
++            external_lib_path: None,
+             pre_link_objects_self_contained: Default::default(),
+             post_link_objects_self_contained: Default::default(),
+             link_self_contained: LinkSelfContainedDefault::False,
 diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-index 1cd30f21bec1..9a752d5712a6 100644
+index 0862958d05da..b1e736d68627 100644
 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 @@ -19,11 +19,12 @@ pub(crate) fn target() -> Target {
diff --git a/rust.spec b/rust.spec
index c03e245..5b3727f 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,8 +1,8 @@
 Name:           rust
-Version:        1.84.1
+Version:        1.85.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
-License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
+License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
 # ^ written as: (rust itself) and (bundled libraries)
 URL:            https://www.rust-lang.org
 
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.83.0
-%global bootstrap_channel 1.83.0
-%global bootstrap_date 2024-11-28
+%global bootstrap_version 1.84.0
+%global bootstrap_channel 1.84.0
+%global bootstrap_date 2025-01-09
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -44,8 +44,8 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient.  Rust currently requires LLVM 18.0+.
 %global min_llvm_version 18.0.0
-%global bundled_llvm_version 19.1.5
-#global llvm_compat_version 17
+%global bundled_llvm_version 19.1.7
+#global llvm_compat_version 18
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
 
@@ -112,7 +112,7 @@ ExclusiveArch:  %{rust_arches}
 # Detect non-stable channels from the version, like 1.74.0~beta.1
 %{lua: do
   local version = rpm.expand("%{version}")
-  local version_channel, subs = string.gsub(version, "^.*~(%w+).*$", "%1", 1)
+  local version_channel, subs = version:gsub("^.*~(%w+).*$", "%1", 1)
   rpm.define("channel " .. (subs ~= 0 and version_channel or "stable"))
   rpm.define("rustc_package rustc-" .. version_channel .. "-src")
 end}
@@ -137,7 +137,7 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.84.0-unbundle-sqlite.patch
+Patch6:         rustc-1.85.0-unbundle-sqlite.patch
 
 # https://github.com/rust-lang/cc-rs/issues/1354
 Patch7:         0001-Only-translate-profile-flags-for-Clang.patch
@@ -151,7 +151,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.84.0-disable-libssh2.patch
+Patch100:       rustc-1.85.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
@@ -202,7 +202,7 @@ end}
 %endif
 %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets}
 %define target_enabled() %{lua:
-  print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0)
+  print(rpm.expand(" %{all_targets} "):find(rpm.expand(" %1 "), 1, true) or 0)
 }
 
 %if %defined bootstrap_arches
@@ -210,7 +210,7 @@ end}
 # Also define bootstrap_source just for the current target.
 %{lua: do
   local bootstrap_arches = {}
-  for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do
+  for arch in rpm.expand("%{bootstrap_arches}"):gmatch("%S+") do
     table.insert(bootstrap_arches, arch)
   end
   local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}")
@@ -671,7 +671,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %if %without bundled_sqlite3
 %patch -P6 -p1
 %endif
-%patch -P7 -p1 -d vendor/cc-1.2.5
+%patch -P7 -p1 -d vendor/cc-1.2.6
 
 %if %with disabled_libssh2
 %patch -P100 -p1
diff --git a/rustc-1.84.0-disable-libssh2.patch b/rustc-1.85.0-disable-libssh2.patch
similarity index 66%
rename from rustc-1.84.0-disable-libssh2.patch
rename to rustc-1.85.0-disable-libssh2.patch
index 267bc3c..09be945 100644
--- a/rustc-1.84.0-disable-libssh2.patch
+++ b/rustc-1.85.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-12-12 14:07:10.755481543 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-12-12 14:07:10.756481534 -0800
-@@ -2272,7 +2272,6 @@ checksum = "10472326a8a6477c3c20a64547b0
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-01-17 14:26:49.845587361 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-01-17 14:26:49.848587324 -0800
+@@ -2296,7 +2296,6 @@ checksum = "10472326a8a6477c3c20a64547b0
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2313,20 +2312,6 @@ dependencies = [
+@@ -2337,20 +2336,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -31,8 +31,8 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  [[package]]
  name = "libz-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-12-12 14:07:10.756481534 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-12-12 14:07:56.866087428 -0800
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-01-17 14:26:49.848587324 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-01-17 14:27:49.035844397 -0800
 @@ -47,7 +47,7 @@ curl = "0.4.46"
  curl-sys = "0.4.73"
  filetime = "0.2.23"
@@ -40,5 +40,5 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools
 -git2 = "0.19.0"
 +git2 = { version = "0.19.0", default-features = false, features = ["https"] }
  git2-curl = "0.20.0"
- gix = { version = "0.67.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
+ gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
  glob = "0.3.1"
diff --git a/rustc-1.84.0-unbundle-sqlite.patch b/rustc-1.85.0-unbundle-sqlite.patch
similarity index 64%
rename from rustc-1.84.0-unbundle-sqlite.patch
rename to rustc-1.85.0-unbundle-sqlite.patch
index 2e3ecc3..08c395f 100644
--- a/rustc-1.84.0-unbundle-sqlite.patch
+++ b/rustc-1.85.0-unbundle-sqlite.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2024-12-07 06:47:38.000000000 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2024-12-12 14:02:54.412672539 -0800
-@@ -2310,7 +2310,6 @@ version = "0.30.1"
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-01-11 07:18:58.000000000 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-01-17 14:14:33.072839703 -0800
+@@ -2334,7 +2334,6 @@ version = "0.30.1"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
  dependencies = [
@@ -10,8 +10,8 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2024-12-12 14:02:54.412672539 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2024-12-12 14:03:25.665405417 -0800
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-01-17 14:14:33.072839703 -0800
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-01-17 14:15:48.497891366 -0800
 @@ -80,7 +80,7 @@ proptest = "1.5.0"
  pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] }
  rand = "0.8.5"
@@ -19,5 +19,5 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools
 -rusqlite = { version = "0.32.0", features = ["bundled"] }
 +rusqlite = { version = "0.32.0", features = [] }
  rustc-hash = "2.0.0"
+ rustc-stable-hash = "0.1.1"
  rustfix = { version = "0.9.0", path = "crates/rustfix" }
- same-file = "1.0.6"
diff --git a/sources b/sources
index 24d06bc..b0e42b4 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.84.1-src.tar.xz) = f1cc4765736551508408126e44086988e8ddc30c1a929bf7b61c6be85ad0d65928dd5fb1041cfaeee8eb37d2208f2c1917e276aef2bc9a8e40e34f6713b349e1
+SHA512 (rustc-1.85.0-src.tar.xz) = 3e9c933d1d9b6e5fb081837cf07eb1638b1a6b4fd1cb607dd860c5021ba7b521edbaf8ba0fa8f182f62178b72a3e1a3e6b26675e8fb6530871137852a074443c
 SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea

From 36704d2c57e82abbbf99fb4085ad766ed523c951 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Wed, 26 Feb 2025 12:51:03 -0800
Subject: [PATCH 64/86] ld.gold isn't needed for tests anymore

---
 rust.spec | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/rust.spec b/rust.spec
index 5b3727f..737e46c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -306,12 +306,6 @@ BuildRequires:  python3-rpm
 # For src/test/run-make/static-pie
 BuildRequires:  glibc-static
 
-# For tests/run-make/pgo-branch-weights
-# riscv64 does not support binutils-gold yet
-%ifnarch riscv64
-BuildRequires:  binutils-gold
-%endif
-
 # Virtual provides for folks who attempt "dnf install rustc"
 Provides:       rustc = %{version}-%{release}
 Provides:       rustc%{?_isa} = %{version}-%{release}

From f0deba825b02f122953290b8c806ea0c44f241da Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Fri, 7 Mar 2025 16:45:09 -0800
Subject: [PATCH 65/86] Add `Provides: bundled(crate(_))` for vendored
 dependencies

---
 rust.spec | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 49 insertions(+), 2 deletions(-)

diff --git a/rust.spec b/rust.spec
index 737e46c..a3813fe 100644
--- a/rust.spec
+++ b/rust.spec
@@ -45,7 +45,9 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient.  Rust currently requires LLVM 18.0+.
 %global min_llvm_version 18.0.0
 %global bundled_llvm_version 19.1.7
-#global llvm_compat_version 18
+%if 0%{?fedora} >= 42
+%global llvm_compat_version 19
+%endif
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
 
@@ -378,6 +380,29 @@ BuildRequires:  compiler-rt%{?llvm_compat_version}
 # https://github.com/rust-lang/rust/pull/101841
 Obsoletes:      %{name}-analysis < 1.69.0~
 
+# Experimenting with a fine-grained version of %%cargo_vendor_manifest,
+# so we can have different bundled provides for each tool subpackage.
+%define cargo_tree_manifest(n:m:f:t:) (       \
+  %{!-n:%{error:must specify a tool name}}    \
+  set -euo pipefail                           \
+  mkdir -p build/manifests/%{-n*}             \
+  %{shrink:                                   \
+    env RUSTC_BOOTSTRAP=1                     \
+      %{local_rust_root}/bin/cargo tree       \
+      --offline --edges normal,build          \
+      --prefix none --format "{p}"            \
+      %{-m:--manifest-path %{-m*}/Cargo.toml} \
+      %{-f:--features %{-f*}}                 \
+      %{-t:--target %{-t*}}                   \
+      %*                                      \
+    | sed '/([*/]/d; s/ (proc-macro)$//'      \
+    | sort -u                                 \
+    >build/manifests/%{-n*}/cargo-vendor.txt  \
+  }                                           \
+)
+%{?fedora:BuildRequires: cargo-rpm-macros}
+%{?rhel:BuildRequires: rust-toolset}
+
 %description
 Rust is a systems programming language that runs blazingly fast, prevents
 segfaults, and guarantees thread safety.
@@ -894,6 +919,21 @@ for triple in %{?all_targets} ; do
   %{__x} build --target=$triple std
 done
 
+# Collect cargo-vendor.txt for each tool and std
+%{cargo_tree_manifest -n rustc -- -p rustc-main -p rustdoc}
+%{cargo_tree_manifest -n cargo -m src/tools/cargo}
+%{cargo_tree_manifest -n clippy -m src/tools/clippy}
+%{cargo_tree_manifest -n rust-analyzer -m src/tools/rust-analyzer}
+%{cargo_tree_manifest -n rustfmt -m src/tools/rustfmt}
+
+%{cargo_tree_manifest -n std -m library -f backtrace}
+for triple in %{?all_targets} ; do
+  case $triple in
+    *-none*) %{cargo_tree_manifest -n std-$triple -m library/alloc -t $triple} ;;
+    *) %{cargo_tree_manifest -n std-$triple -m library -f backtrace -t $triple} ;;
+  esac
+done
+
 %install
 %if 0%{?rhel} && 0%{?rhel} <= 9
 %{?set_build_flags}
@@ -1039,6 +1079,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_libexecdir}/rust-analyzer-proc-macro-srv
 %{_mandir}/man1/rustc.1*
 %{_mandir}/man1/rustdoc.1*
+%license build/manifests/rustc/cargo-vendor.txt
 
 
 %files std-static
@@ -1047,13 +1088,15 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %dir %{rustlibdir}/%{rust_triple}/lib
 %{rustlibdir}/%{rust_triple}/lib/*.rlib
 %{rustlibdir}/%{rust_triple}/lib/*.so
+%license build/manifests/std/cargo-vendor.txt
 
 %global target_files()      \
 %files std-static-%1        \
 %dir %{rustlibdir}          \
 %dir %{rustlibdir}/%1       \
 %dir %{rustlibdir}/%1/lib   \
-%{rustlibdir}/%1/lib/*.rlib
+%{rustlibdir}/%1/lib/*.rlib \
+%license build/manifests/std-%1/cargo-vendor.txt
 
 %if %target_enabled i686-pc-windows-gnu
 %target_files i686-pc-windows-gnu
@@ -1135,6 +1178,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_datadir}/zsh/site-functions/_cargo
 %dir %{_datadir}/cargo
 %dir %{_datadir}/cargo/registry
+%license build/manifests/cargo/cargo-vendor.txt
 
 
 %files -n rustfmt
@@ -1142,6 +1186,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_bindir}/cargo-fmt
 %doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
 %license src/tools/rustfmt/LICENSE-{APACHE,MIT}
+%license build/manifests/rustfmt/cargo-vendor.txt
 
 
 %files analyzer
@@ -1149,6 +1194,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_bindir}/rust-analyzer
 %doc src/tools/rust-analyzer/README.md
 %license src/tools/rust-analyzer/LICENSE-{APACHE,MIT}
+%license build/manifests/rust-analyzer/cargo-vendor.txt
 
 
 %files -n clippy
@@ -1156,6 +1202,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_bindir}/clippy-driver
 %doc src/tools/clippy/{README.md,CHANGELOG.md}
 %license src/tools/clippy/LICENSE-{APACHE,MIT}
+%license build/manifests/clippy/cargo-vendor.txt
 
 
 %files src

From 53b3e13ae57ce1e53a442ee333127dafaa1ebe6d Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Fri, 7 Mar 2025 17:34:12 -0800
Subject: [PATCH 66/86] Lock cargo to the matching rust version

---
 rust.spec | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rust.spec b/rust.spec
index a3813fe..d98229b 100644
--- a/rust.spec
+++ b/rust.spec
@@ -557,8 +557,9 @@ Provides:       bundled(sqlite) = %{bundled_sqlite3_version}
 %endif
 # For tests:
 BuildRequires:  git-core
-# Cargo is not much use without Rust
-Requires:       %{name}
+# Cargo is not much use without Rust, and it's worth keeping the versions
+# in sync since some feature development depends on them together.
+Requires:       %{name} = %{version}-%{release}
 
 # "cargo vendor" is a builtin command starting with 1.37.  The Obsoletes and
 # Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too

From 5f24112b8e3119ab0e2535022ba3247473e46ff2 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Mon, 10 Mar 2025 16:47:09 -0700
Subject: [PATCH 67/86] Clean up LLVM-compat and enable it on ELN

---
 rust.spec | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/rust.spec b/rust.spec
index d98229b..9ff4cc9 100644
--- a/rust.spec
+++ b/rust.spec
@@ -45,7 +45,7 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient.  Rust currently requires LLVM 18.0+.
 %global min_llvm_version 18.0.0
 %global bundled_llvm_version 19.1.7
-%if 0%{?fedora} >= 42
+%if 0%{?fedora} >= 42 || 0%{?rhel} > 10
 %global llvm_compat_version 19
 %endif
 %global llvm llvm%{?llvm_compat_version}
@@ -285,6 +285,7 @@ Provides:       bundled(llvm) = %{bundled_llvm_version}
 BuildRequires:  cmake >= 3.5.1
 %if %defined llvm_compat_version
 %global llvm_root %{_libdir}/%{llvm}
+%global llvm_path %{llvm_root}/bin
 %else
 %global llvm_root %{_prefix}
 %endif
@@ -342,12 +343,6 @@ Requires:       /usr/bin/cc
 %global __brp_strip_static_archive %{nil}
 %global __brp_strip_lto %{nil}
 
-%if %{without bundled_llvm}
-%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1}
-%global llvm_has_filecheck 1
-%endif
-%endif
-
 # We're going to override --libdir when configuring to get rustlib into a
 # common path, but we'll fix the shared libraries during install.
 %global common_libdir %{_prefix}/lib
@@ -366,11 +361,11 @@ BuildRequires:  mingw64-winpthreads-static
 
 %if %defined wasm_targets
 %if %with bundled_wasi_libc
-BuildRequires:  clang
+BuildRequires:  clang%{?llvm_compat_version}
 %else
 BuildRequires:  wasi-libc-static
 %endif
-BuildRequires:  lld
+BuildRequires:  lld%{?llvm_compat_version}
 %endif
 
 # For profiler_builtins
@@ -789,6 +784,7 @@ end}
   %{!?with_bundled_oniguruma:RUSTONIG_SYSTEM_LIBONIG=1}
   %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1}
   %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1}
+  %{?llvm_path:PATH="%{llvm_path}:$PATH"}
 }
 %global export_rust_env export %{rust_env}
 
@@ -845,12 +841,8 @@ end}
 %endif
 
 # Find the compiler-rt library for the Rust profiler_builtins crate.
-%if %defined llvm_compat_version
-# clang_resource_dir is not defined for compat builds.
-%define profiler /usr/lib/clang/%{llvm_compat_version}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
-%else
-%define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
-%endif
+%define clang_lib %{expand:%%clang%{?llvm_compat_version}_resource_dir}/lib
+%define profiler %{clang_lib}/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
 test -r "%{profiler}"
 
 %configure --disable-option-checking \
@@ -869,7 +861,6 @@ test -r "%{profiler}"
   --local-rust-root=%{local_rust_root} \
   --set build.rustfmt=/bin/true \
   %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \
-    %{!?llvm_has_filecheck: --disable-codegen-tests} \
     %{!?with_llvm_static: --enable-llvm-link-shared } } \
   --disable-llvm-static-stdcpp \
   --disable-llvm-bitcode-linker \
@@ -903,7 +894,7 @@ mkdir -p "%{profraw}"
 env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \
   %{__x} --keep-stage=0 --keep-stage=1 build cargo
 # Finalize the profile data and clean up the raw files
-%{llvm_root}/bin/llvm-profdata merge -o "%{profdata}" "%{profraw}"
+llvm-profdata merge -o "%{profdata}" "%{profraw}"
 rm -r "%{profraw}" build/%{rust_triple}/stage2*/
 # Redefine the macro to use that profile data from now on
 %global __x %{__x} --rust-profile-use="%{profdata}"

From 956ba8047c40bd91123ae44bb66db181e16fb511 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 18 Mar 2025 12:45:47 -0700
Subject: [PATCH 68/86] Update to Rust 1.85.1

---
 .gitignore | 1 +
 rust.spec  | 2 +-
 sources    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 771739a..b2f69fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -449,3 +449,4 @@
 /wasi-libc-wasi-sdk-25.tar.gz
 /rustc-1.84.1-src.tar.xz
 /rustc-1.85.0-src.tar.xz
+/rustc-1.85.1-src.tar.xz
diff --git a/rust.spec b/rust.spec
index 9ff4cc9..877e560 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.85.0
+Version:        1.85.1
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
diff --git a/sources b/sources
index b0e42b4..e45937b 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.85.0-src.tar.xz) = 3e9c933d1d9b6e5fb081837cf07eb1638b1a6b4fd1cb607dd860c5021ba7b521edbaf8ba0fa8f182f62178b72a3e1a3e6b26675e8fb6530871137852a074443c
+SHA512 (rustc-1.85.1-src.tar.xz) = d61afb4f00d0c63eef132e10ca5369202064ecad8ab5bcf4fbd62e9a20b2bd71840b2a769dadcf43452fc0448865975c9de1c129752caa9928d2757027bacf7c
 SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea

From 3436f8c99bd742015560fadea6d2b0e02e631145 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 3 Apr 2025 08:59:19 -0700
Subject: [PATCH 69/86] Update to Rust 1.86.0

---
 .gitignore                                    |  2 +
 ...ly-translate-profile-flags-for-Clang.patch | 39 ----------------
 0001-Use-lld-provided-by-system.patch         | 24 +++++-----
 ...llow-disabling-target-self-contained.patch | 34 +++++++-------
 ...xternal-library-path-for-wasm32-wasi.patch | 22 +++++-----
 rust.spec                                     | 38 ++++++++--------
 rustc-1.85.0-disable-libssh2.patch            | 44 -------------------
 rustc-1.85.0-unbundle-sqlite.patch            | 23 ----------
 rustc-1.86.0-disable-libssh2.patch            | 44 +++++++++++++++++++
 rustc-1.86.0-unbundle-sqlite.patch            | 23 ++++++++++
 sources                                       |  4 +-
 11 files changed, 129 insertions(+), 168 deletions(-)
 delete mode 100644 0001-Only-translate-profile-flags-for-Clang.patch
 delete mode 100644 rustc-1.85.0-disable-libssh2.patch
 delete mode 100644 rustc-1.85.0-unbundle-sqlite.patch
 create mode 100644 rustc-1.86.0-disable-libssh2.patch
 create mode 100644 rustc-1.86.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index b2f69fd..999f79e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -450,3 +450,5 @@
 /rustc-1.84.1-src.tar.xz
 /rustc-1.85.0-src.tar.xz
 /rustc-1.85.1-src.tar.xz
+/rustc-1.86.0-src.tar.xz
+/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
diff --git a/0001-Only-translate-profile-flags-for-Clang.patch b/0001-Only-translate-profile-flags-for-Clang.patch
deleted file mode 100644
index 3353c10..0000000
--- a/0001-Only-translate-profile-flags-for-Clang.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From e4e678eb9cbd90acf2ba51e9ec0209b05c4403b5 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 9 Jan 2025 16:47:10 -0800
-Subject: [PATCH] Only translate profile flags for Clang
-
----
- src/flags.rs | 16 +++++++++-------
- 1 file changed, 9 insertions(+), 7 deletions(-)
-
-diff --git a/src/flags.rs b/src/flags.rs
-index 81834cf625f7..1a53c1b2345c 100644
---- a/src/flags.rs
-+++ b/src/flags.rs
-@@ -201,13 +201,15 @@ impl<'this> RustcCodegenFlags<'this> {
-                 if self.no_vectorize_slp {
-                     push_if_supported("-fno-slp-vectorize".into());
-                 }
--                // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate
--                if let Some(value) = self.profile_generate {
--                    push_if_supported(format!("-fprofile-generate={value}").into());
--                }
--                // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use
--                if let Some(value) = self.profile_use {
--                    push_if_supported(format!("-fprofile-use={value}").into());
-+                if let ToolFamily::Clang { .. } = family {
-+                    // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate
-+                    if let Some(value) = self.profile_generate {
-+                        push_if_supported(format!("-fprofile-generate={value}").into());
-+                    }
-+                    // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use
-+                    if let Some(value) = self.profile_use {
-+                        push_if_supported(format!("-fprofile-use={value}").into());
-+                    }
-                 }
-                 // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mguard
-                 if let Some(value) = self.control_flow_guard {
--- 
-2.47.1
-
diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch
index 063d66a..63c9b14 100644
--- a/0001-Use-lld-provided-by-system.patch
+++ b/0001-Use-lld-provided-by-system.patch
@@ -1,4 +1,4 @@
-From 3d8c6d095581e8d7585f3772cfd16f6367f3c008 Mon Sep 17 00:00:00 2001
+From 687112c89c9058ef1e79f1c3a974940b1ae43ea3 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 16 Aug 2024 10:12:58 -0700
 Subject: [PATCH] Use lld provided by system
@@ -12,7 +12,7 @@ Subject: [PATCH] Use lld provided by system
  5 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
-index f237391016e7..08bcd9699b4a 100644
+index 81b96cd39ffa..4c9916af826b 100644
 --- a/compiler/rustc_target/src/spec/base/wasm.rs
 +++ b/compiler/rustc_target/src/spec/base/wasm.rs
 @@ -85,8 +85,7 @@ macro_rules! args {
@@ -26,10 +26,10 @@ index f237391016e7..08bcd9699b4a 100644
  
          pre_link_args,
 diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
-index 222d5651b521..4b780bc8a8e7 100644
+index 3b719ebaf07e..8b4fecee68f0 100644
 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
 +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
-@@ -14,7 +14,7 @@ pub fn target() -> Target {
+@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
      let opts = TargetOptions {
          abi: "softfloat".into(),
          linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
@@ -39,10 +39,10 @@ index 222d5651b521..4b780bc8a8e7 100644
          relocation_model: RelocModel::Static,
          disable_redzone: true,
 diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
-index 429303170b6b..19d4ec53f6d8 100644
+index 9656024ddaa1..2099fa17229f 100644
 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
 +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
-@@ -9,6 +9,7 @@ pub fn target() -> Target {
+@@ -9,6 +9,7 @@ pub(crate) fn target() -> Target {
      base.max_atomic_width = Some(128);
      base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);
      base.features = "+v8a".into();
@@ -51,23 +51,23 @@ index 429303170b6b..19d4ec53f6d8 100644
      Target {
          llvm_target: "aarch64-unknown-windows".into(),
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
-index 549706998d46..b7e9158ddef5 100644
+index e14a36735894..b493d7d98b46 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
-@@ -17,7 +17,7 @@ pub fn target() -> Target {
+@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
          static_position_independent_executables: true,
          relro_level: RelroLevel::Full,
          linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
 -        linker: Some("rust-lld".into()),
 +        linker: Some("lld".into()),
+         rustc_abi: Some(RustcAbi::X86Softfloat),
          features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(),
          supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
-         disable_redzone: true,
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
-index 6da1fcca58c8..c84ae44576d4 100644
+index bce6aa0ebc6b..7fa1148a1de7 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
-@@ -16,6 +16,7 @@ pub fn target() -> Target {
+@@ -14,6 +14,7 @@ pub(crate) fn target() -> Target {
      base.plt_by_default = false;
      base.max_atomic_width = Some(64);
      base.entry_abi = Conv::X86_64Win64;
@@ -76,5 +76,5 @@ index 6da1fcca58c8..c84ae44576d4 100644
      // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
      // enable these CPU features explicitly before their first use, otherwise their instructions
 -- 
-2.46.0
+2.48.1
 
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index bd6d0ed..9ee7b78 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From eeb171e5de6da8790d01135754cbb9b6c248c476 Mon Sep 17 00:00:00 2001
+From c3307f4e1826cabd8e7e4a54636b0e79afb97835 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:14:28 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -11,12 +11,12 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/config.example.toml b/config.example.toml
-index 5ea6774ce035..ec08a319e77f 100644
+index f5395375afe4..a96368ae4ef2 100644
 --- a/config.example.toml
 +++ b/config.example.toml
-@@ -922,6 +922,11 @@
- # argument as the test binary.
- #runner =  (string)
+@@ -927,6 +927,11 @@
+ # order to run `x check`.
+ #optimized-compiler-builtins = build.optimized-compiler-builtins (bool)
  
 +# Copy libc and CRT objects into the target lib/self-contained/ directory.
 +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
@@ -27,10 +27,10 @@ index 5ea6774ce035..ec08a319e77f 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index ca337aa9f4c3..6175f93e50ed 100644
+index 479327d63695..97d2bf2df8bb 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -325,6 +325,10 @@ fn copy_self_contained_objects(
+@@ -327,6 +327,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,18 +42,18 @@ index ca337aa9f4c3..6175f93e50ed 100644
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index dd2f11ad4690..e10ed666099c 100644
+index 65f286a05bd5..dc4d6f741bcf 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -634,6 +634,7 @@ pub struct Target {
-     pub runner: Option,
+@@ -643,6 +643,7 @@ pub struct Target {
      pub no_std: bool,
      pub codegen_backends: Option>,
+     pub optimized_compiler_builtins: Option,
 +    pub self_contained: bool,
  }
  
  impl Target {
-@@ -645,6 +646,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -654,6 +655,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("emscripten") {
              target.runner = Some("node".into());
          }
@@ -63,15 +63,15 @@ index dd2f11ad4690..e10ed666099c 100644
          target
      }
  }
-@@ -1219,6 +1223,7 @@ struct TomlTarget {
-         no_std: Option = "no-std",
+@@ -1234,6 +1238,7 @@ struct TomlTarget {
          codegen_backends: Option> = "codegen-backends",
          runner: Option = "runner",
+         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
 +        self_contained: Option = "self-contained",
      }
  }
  
-@@ -2082,6 +2087,9 @@ fn get_table(option: &str) -> Result {
+@@ -2146,6 +2151,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index dd2f11ad4690..e10ed666099c 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index 8405c22aff08..7e1582207b8a 100644
+index 21b02a3b541a..6b98c67457e8 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1327,6 +1327,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1366,6 +1366,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -98,5 +98,5 @@ index 8405c22aff08..7e1582207b8a 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.47.1
+2.48.1
 
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 3534abb..2441d07 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,4 +1,4 @@
-From e8e50258df70b39d2425dacf90c3d5f6d0720bc0 Mon Sep 17 00:00:00 2001
+From 9551ffded09131ac225261ab55a7b3c9d09ad3bb Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 28 Sep 2023 18:18:16 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
@@ -11,10 +11,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi
  4 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index e2081ad75633..a308bae8b644 100644
+index 105a4cb81f0d..21bd626842c7 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1639,6 +1639,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1686,6 +1686,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -27,7 +27,7 @@ index e2081ad75633..a308bae8b644 100644
      for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2139,6 +2145,10 @@ fn add_library_search_dirs(
+@@ -2186,6 +2192,10 @@ fn add_library_search_dirs(
              ControlFlow::<()>::Continue(())
          },
      );
@@ -39,10 +39,10 @@ index e2081ad75633..a308bae8b644 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
-index 9cdc0801b1f0..70fe8396b353 100644
+index f703132e51f0..c4821be7d12e 100644
 --- a/compiler/rustc_target/src/spec/json.rs
 +++ b/compiler/rustc_target/src/spec/json.rs
-@@ -527,6 +527,7 @@ macro_rules! key {
+@@ -540,6 +540,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -50,7 +50,7 @@ index 9cdc0801b1f0..70fe8396b353 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -708,6 +709,7 @@ macro_rules! target_option_val {
+@@ -723,6 +724,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -59,10 +59,10 @@ index 9cdc0801b1f0..70fe8396b353 100644
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 02962d55a60e..169f5a74bbfd 100644
+index 794d6457cb78..b2d88a14bb57 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2197,6 +2197,7 @@ pub struct TargetOptions {
+@@ -2237,6 +2237,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -70,7 +70,7 @@ index 02962d55a60e..169f5a74bbfd 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2712,6 +2713,7 @@ fn default() -> TargetOptions {
+@@ -2754,6 +2755,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -99,5 +99,5 @@ index 0862958d05da..b1e736d68627 100644
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.47.1
+2.48.1
 
diff --git a/rust.spec b/rust.spec
index 877e560..370fbb1 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.85.1
+Version:        1.86.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.84.0
-%global bootstrap_channel 1.84.0
-%global bootstrap_date 2025-01-09
+%global bootstrap_version 1.85.0
+%global bootstrap_channel 1.85.0
+%global bootstrap_date 2025-02-20
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -28,7 +28,8 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-%global wasi_libc_ref wasi-sdk-25
+#global wasi_libc_ref wasi-sdk-25
+%global wasi_libc_ref 640c0cfc19a96b099e0791824be5ef0105ce2084
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@@ -45,17 +46,15 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient.  Rust currently requires LLVM 18.0+.
 %global min_llvm_version 18.0.0
 %global bundled_llvm_version 19.1.7
-%if 0%{?fedora} >= 42 || 0%{?rhel} > 10
-%global llvm_compat_version 19
-%endif
+#global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
 
-# Requires stable libgit2 1.8, and not the next minor soname change.
+# Requires stable libgit2 1.9, and not the next minor soname change.
 # This needs to be consistent with the bindings in vendor/libgit2-sys.
-%global min_libgit2_version 1.8.1
-%global next_libgit2_version 1.9.0~
-%global bundled_libgit2_version 1.8.1
+%global min_libgit2_version 1.9.0
+%global next_libgit2_version 1.10.0~
+%global bundled_libgit2_version 1.9.0
 %if 0%{?fedora} >= 41
 %bcond_with bundled_libgit2
 %else
@@ -73,7 +72,7 @@ ExclusiveArch:  %{rust_arches}
 
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
-%global bundled_sqlite3_version 3.46.0
+%global bundled_sqlite3_version 3.48.0
 %if 0%{?rhel} && 0%{?rhel} < 10
 %bcond_without bundled_sqlite3
 %else
@@ -139,10 +138,7 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.85.0-unbundle-sqlite.patch
-
-# https://github.com/rust-lang/cc-rs/issues/1354
-Patch7:         0001-Only-translate-profile-flags-for-Clang.patch
+Patch6:         rustc-1.86.0-unbundle-sqlite.patch
 
 ### RHEL-specific patches below ###
 
@@ -153,7 +149,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.85.0-disable-libssh2.patch
+Patch100:       rustc-1.86.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
@@ -686,7 +682,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %if %without bundled_sqlite3
 %patch -P6 -p1
 %endif
-%patch -P7 -p1 -d vendor/cc-1.2.6
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -706,7 +701,7 @@ mkdir -p src/llvm-project/libunwind/
 # Remove submodules we don't need.
 rm -rf src/gcc
 rm -rf src/tools/enzyme
-rm -rf src/tools/rustc-perf
+rm -rf src/tools/rustc-perf/collector/*-benchmarks/
 
 # Remove other unused vendored libraries. This leaves the directory in place,
 # because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl".
@@ -1072,6 +1067,8 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{_mandir}/man1/rustc.1*
 %{_mandir}/man1/rustdoc.1*
 %license build/manifests/rustc/cargo-vendor.txt
+%license %{_pkgdocdir}/COPYRIGHT.html
+%license %{_pkgdocdir}/licenses/
 
 
 %files std-static
@@ -1081,6 +1078,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %{rustlibdir}/%{rust_triple}/lib/*.rlib
 %{rustlibdir}/%{rust_triple}/lib/*.so
 %license build/manifests/std/cargo-vendor.txt
+%license %{_pkgdocdir}/COPYRIGHT-library.html
 
 %global target_files()      \
 %files std-static-%1        \
diff --git a/rustc-1.85.0-disable-libssh2.patch b/rustc-1.85.0-disable-libssh2.patch
deleted file mode 100644
index 09be945..0000000
--- a/rustc-1.85.0-disable-libssh2.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-01-17 14:26:49.845587361 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-01-17 14:26:49.848587324 -0800
-@@ -2296,7 +2296,6 @@ checksum = "10472326a8a6477c3c20a64547b0
- dependencies = [
-  "cc",
-  "libc",
-- "libssh2-sys",
-  "libz-sys",
-  "openssl-sys",
-  "pkg-config",
-@@ -2337,20 +2336,6 @@ dependencies = [
-  "pkg-config",
-  "vcpkg",
- ]
--
--[[package]]
--name = "libssh2-sys"
--version = "0.3.0"
--source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
--dependencies = [
-- "cc",
-- "libc",
-- "libz-sys",
-- "openssl-sys",
-- "pkg-config",
-- "vcpkg",
--]
- 
- [[package]]
- name = "libz-sys"
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-01-17 14:26:49.848587324 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-01-17 14:27:49.035844397 -0800
-@@ -47,7 +47,7 @@ curl = "0.4.46"
- curl-sys = "0.4.73"
- filetime = "0.2.23"
- flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
--git2 = "0.19.0"
-+git2 = { version = "0.19.0", default-features = false, features = ["https"] }
- git2-curl = "0.20.0"
- gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
- glob = "0.3.1"
diff --git a/rustc-1.85.0-unbundle-sqlite.patch b/rustc-1.85.0-unbundle-sqlite.patch
deleted file mode 100644
index 08c395f..0000000
--- a/rustc-1.85.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-01-11 07:18:58.000000000 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-01-17 14:14:33.072839703 -0800
-@@ -2334,7 +2334,6 @@ version = "0.30.1"
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-01-17 14:14:33.072839703 -0800
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-01-17 14:15:48.497891366 -0800
-@@ -80,7 +80,7 @@ proptest = "1.5.0"
- pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] }
- rand = "0.8.5"
- regex = "1.10.5"
--rusqlite = { version = "0.32.0", features = ["bundled"] }
-+rusqlite = { version = "0.32.0", features = [] }
- rustc-hash = "2.0.0"
- rustc-stable-hash = "0.1.1"
- rustfix = { version = "0.9.0", path = "crates/rustfix" }
diff --git a/rustc-1.86.0-disable-libssh2.patch b/rustc-1.86.0-disable-libssh2.patch
new file mode 100644
index 0000000..8b07bde
--- /dev/null
+++ b/rustc-1.86.0-disable-libssh2.patch
@@ -0,0 +1,44 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-03-11 15:36:38.387335541 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-03-11 15:39:27.491711044 -0700
+@@ -2528,7 +2528,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
+ dependencies = [
+  "cc",
+  "libc",
+- "libssh2-sys",
+  "libz-sys",
+  "openssl-sys",
+  "pkg-config",
+@@ -2574,20 +2573,6 @@ dependencies = [
+  "pkg-config",
+  "vcpkg",
+ ]
+-
+-[[package]]
+-name = "libssh2-sys"
+-version = "0.3.1"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9"
+-dependencies = [
+- "cc",
+- "libc",
+- "libz-sys",
+- "openssl-sys",
+- "pkg-config",
+- "vcpkg",
+-]
+ 
+ [[package]]
+ name = "libz-sys"
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-03-11 15:36:38.389045348 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-03-11 15:38:36.948228456 -0700
+@@ -47,7 +47,7 @@ curl = "0.4.47"
+ curl-sys = "0.4.79"
+ filetime = "0.2.25"
+ flate2 = { version = "1.0.35", default-features = false, features = ["zlib"] }
+-git2 = "0.20.0"
++git2 = { version = "0.20.0", default-features = false, features = ["https"] }
+ git2-curl = "0.21.0"
+ gix = { version = "0.70.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
+ glob = "0.3.2"
diff --git a/rustc-1.86.0-unbundle-sqlite.patch b/rustc-1.86.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..19f5fce
--- /dev/null
+++ b/rustc-1.86.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-03-11 15:30:39.383119717 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-03-11 15:32:12.486164705 -0700
+@@ -2571,7 +2571,6 @@ version = "0.31.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "ad8935b44e7c13394a179a438e0cebba0fe08fe01b54f152e29a93b5cf993fd4"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-03-11 15:30:39.384466481 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-03-11 15:32:05.989298381 -0700
+@@ -80,7 +80,7 @@ proptest = "1.6.0"
+ pulldown-cmark = { version = "0.12.2", default-features = false, features = ["html"] }
+ rand = "0.9.0"
+ regex = "1.11.1"
+-rusqlite = { version = "0.33.0", features = ["bundled"] }
++rusqlite = { version = "0.33.0", features = [] }
+ rustc-hash = "2.1.1"
+ rustc-stable-hash = "0.1.1"
+ rustfix = { version = "0.9.0", path = "crates/rustfix" }
diff --git a/sources b/sources
index e45937b..583e27d 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.85.1-src.tar.xz) = d61afb4f00d0c63eef132e10ca5369202064ecad8ab5bcf4fbd62e9a20b2bd71840b2a769dadcf43452fc0448865975c9de1c129752caa9928d2757027bacf7c
-SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea
+SHA512 (rustc-1.86.0-src.tar.xz) = 9ce195e24a03765f7163de16271e3d19d731d4b80fcc2bfd919106c9d42543eade018f712f6947ea3c6e57c6cb2e6841596aa668d608b8da15101a7da14f3097
+SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e

From c9224a07d6f58b431bab887fa7b6446fbfe265ea Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 24 Apr 2025 14:15:58 -0700
Subject: [PATCH 70/86] Temporarily skip PGO on RHEL ppc64le

---
 rust.spec | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rust.spec b/rust.spec
index 370fbb1..bd234c7 100644
--- a/rust.spec
+++ b/rust.spec
@@ -879,6 +879,9 @@ test -r "%{profiler}"
 
 %global __x %{__python3} ./x.py
 
+# rustc is exibiting signs of miscompilation on pwr9+pgo (root cause TBD),
+# so we're skipping pgo on rhel ppc64le for now.
+%if !( 0%{?rhel} && "%{_target_cpu}" == "ppc64le" )
 %if %with rustc_pgo
 # Build the compiler with profile instrumentation
 %define profraw $PWD/build/profiles
@@ -894,6 +897,7 @@ rm -r "%{profraw}" build/%{rust_triple}/stage2*/
 # Redefine the macro to use that profile data from now on
 %global __x %{__x} --rust-profile-use="%{profdata}"
 %endif
+%endif
 
 # Build the compiler normally (with or without PGO)
 %{__x} build sysroot

From e569cda848693adeaf6cf273be9dd93e3ceb0a4a Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 29 Apr 2025 13:04:03 -0700
Subject: [PATCH 71/86] Fix alternative bootstrap paths

- For llvm-static, the inserted ffi block needs to be extern "C",
  and LLVM now also needs libxml2-devel for linking.
- When using upstream binaries, we should not use the rpm macros that
  pull in the system rust toolchain.

[skip changelog]
---
 rust.spec | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rust.spec b/rust.spec
index bd234c7..1c322e6 100644
--- a/rust.spec
+++ b/rust.spec
@@ -289,6 +289,7 @@ BuildRequires:  %{llvm}-devel >= %{min_llvm_version}
 %if %with llvm_static
 BuildRequires:  %{llvm}-static
 BuildRequires:  libffi-devel
+BuildRequires:  libxml2-devel
 %endif
 %endif
 
@@ -379,6 +380,7 @@ Obsoletes:      %{name}-analysis < 1.69.0~
   mkdir -p build/manifests/%{-n*}             \
   %{shrink:                                   \
     env RUSTC_BOOTSTRAP=1                     \
+      RUSTC=%{local_rust_root}/bin/rustc      \
       %{local_rust_root}/bin/cargo tree       \
       --offline --edges normal,build          \
       --prefix none --format "{p}"            \
@@ -391,8 +393,10 @@ Obsoletes:      %{name}-analysis < 1.69.0~
     >build/manifests/%{-n*}/cargo-vendor.txt  \
   }                                           \
 )
+%ifnarch %{bootstrap_arches}
 %{?fedora:BuildRequires: cargo-rpm-macros}
 %{?rhel:BuildRequires: rust-toolset}
+%endif
 
 %description
 Rust is a systems programming language that runs blazingly fast, prevents
@@ -738,7 +742,7 @@ sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/src/core/build_steps/tool.rs
 %if %{without bundled_llvm} && %{with llvm_static}
 # Static linking to distro LLVM needs to add -lffi
 # https://github.com/rust-lang/rust/issues/34486
-sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
+sed -i.ffi -e '$a #[link(name = "ffi")] extern "C" {}' \
   compiler/rustc_llvm/src/lib.rs
 %endif
 

From b127903104fd70767c9e383f40a4766a8aa32969 Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Mon, 7 Apr 2025 20:20:57 +0200
Subject: [PATCH 72/86] Update to Rust 1.87.0

---
 .gitignore                                    |  1 +
 ...ltins-build-script-to-handle-full-pa.patch | 42 ++++++++++++++++++
 ...llow-disabling-target-self-contained.patch | 44 +++++++++----------
 ...xternal-library-path-for-wasm32-wasi.patch | 34 +++++++-------
 rust.spec                                     | 31 +++++++------
 ...atch => rustc-1.87.0-unbundle-sqlite.patch | 10 ++---
 sources                                       |  2 +-
 7 files changed, 106 insertions(+), 58 deletions(-)
 create mode 100644 0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
 rename rustc-1.86.0-unbundle-sqlite.patch => rustc-1.87.0-unbundle-sqlite.patch (74%)

diff --git a/.gitignore b/.gitignore
index 999f79e..c6fb39d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -452,3 +452,4 @@
 /rustc-1.85.1-src.tar.xz
 /rustc-1.86.0-src.tar.xz
 /wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
+/rustc-1.87.0-src.tar.xz
diff --git a/0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch b/0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
new file mode 100644
index 0000000..2746541
--- /dev/null
+++ b/0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
@@ -0,0 +1,42 @@
+From dc0fbcab7e0673afe62b3e8e74905d9e5f5b74a4 Mon Sep 17 00:00:00 2001
+From: Jesus Checa Hidalgo 
+Date: Fri, 11 Apr 2025 16:57:38 +0200
+Subject: [PATCH] Fix profiler_builtins build script to handle full path to
+ profiler lib
+
+LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds),
+but `-l` expects a library name, not a path. After #138273, this caused builds
+to fail with a "could not find native static library" error.
+
+This patch updates the build script to split the path into directory and
+filename, using `cargo::rustc-link-search` for the directory and
+`cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to
+correctly link the static library even when an absolute path is provided.
+---
+ library/profiler_builtins/build.rs | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs
+index dd85239fa8c..fc1a9ecc1ec 100644
+--- a/library/profiler_builtins/build.rs
++++ b/library/profiler_builtins/build.rs
+@@ -9,8 +9,14 @@
+ 
+ fn main() {
+     if let Ok(rt) = tracked_env_var("LLVM_PROFILER_RT_LIB") {
+-        println!("cargo::rustc-link-lib=static:+verbatim={rt}");
+-        return;
++        let rt = PathBuf::from(rt);
++        if let Some(lib) = rt.file_name() {
++            if let Some(dir) = rt.parent() {
++                println!("cargo::rustc-link-search=native={}", dir.display());
++            }
++            println!("cargo::rustc-link-lib=static:+verbatim={}", lib.to_str().unwrap());
++            return;
++        }
+     }
+ 
+     let target_os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS was not set");
+-- 
+2.49.0
+
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 9ee7b78..655496c 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,22 +1,22 @@
-From c3307f4e1826cabd8e7e4a54636b0e79afb97835 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 28 Sep 2023 18:14:28 -0700
+From e8833a9032b9f5773ef891b3f12b93322d6b4950 Mon Sep 17 00:00:00 2001
+From: Jesus Checa Hidalgo 
+Date: Mon, 7 Apr 2025 16:59:10 +0200
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
 
 ---
- config.example.toml                           | 5 +++++
+ bootstrap.example.toml                        | 5 +++++
  src/bootstrap/src/core/build_steps/compile.rs | 4 ++++
  src/bootstrap/src/core/config/config.rs       | 8 ++++++++
  src/bootstrap/src/lib.rs                      | 5 +++++
  4 files changed, 22 insertions(+)
 
-diff --git a/config.example.toml b/config.example.toml
-index f5395375afe4..a96368ae4ef2 100644
---- a/config.example.toml
-+++ b/config.example.toml
-@@ -927,6 +927,11 @@
- # order to run `x check`.
- #optimized-compiler-builtins = build.optimized-compiler-builtins (bool)
+diff --git a/bootstrap.example.toml b/bootstrap.example.toml
+index 2a98821f225..580d6b2a8a2 100644
+--- a/bootstrap.example.toml
++++ b/bootstrap.example.toml
+@@ -948,6 +948,11 @@
+ # This overrides the global `rust.jemalloc` option. See that option for more info.
+ #jemalloc = rust.jemalloc (bool)
  
 +# Copy libc and CRT objects into the target lib/self-contained/ directory.
 +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
@@ -27,10 +27,10 @@ index f5395375afe4..a96368ae4ef2 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 479327d63695..97d2bf2df8bb 100644
+index 18b5d4426b1..3de9667123b 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -327,6 +327,10 @@ fn copy_self_contained_objects(
+@@ -370,6 +370,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,18 +42,18 @@ index 479327d63695..97d2bf2df8bb 100644
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index 65f286a05bd5..dc4d6f741bcf 100644
+index bbb0fbfbb93..8642a86cbf8 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -643,6 +643,7 @@ pub struct Target {
-     pub no_std: bool,
+@@ -666,6 +666,7 @@ pub struct Target {
      pub codegen_backends: Option>,
      pub optimized_compiler_builtins: Option,
+     pub jemalloc: Option,
 +    pub self_contained: bool,
  }
  
  impl Target {
-@@ -654,6 +655,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -677,6 +678,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("emscripten") {
              target.runner = Some("node".into());
          }
@@ -63,15 +63,15 @@ index 65f286a05bd5..dc4d6f741bcf 100644
          target
      }
  }
-@@ -1234,6 +1238,7 @@ struct TomlTarget {
-         codegen_backends: Option> = "codegen-backends",
+@@ -1292,6 +1296,7 @@ struct TomlTarget {
          runner: Option = "runner",
          optimized_compiler_builtins: Option = "optimized-compiler-builtins",
+         jemalloc: Option = "jemalloc",
 +        self_contained: Option = "self-contained",
      }
  }
  
-@@ -2146,6 +2151,9 @@ fn get_table(option: &str) -> Result {
+@@ -2245,6 +2250,9 @@ fn get_table(option: &str) -> Result {
                  if let Some(s) = cfg.no_std {
                      target.no_std = s;
                  }
@@ -82,10 +82,10 @@ index 65f286a05bd5..dc4d6f741bcf 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index 21b02a3b541a..6b98c67457e8 100644
+index 843d474f92d..3a4398ee1f8 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1366,6 +1366,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1434,6 +1434,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 2441d07..b1f2476 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,6 +1,6 @@
-From 9551ffded09131ac225261ab55a7b3c9d09ad3bb Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 28 Sep 2023 18:18:16 -0700
+From 35a37bd892939b8a1cd194632de3b9dd3a3d479b Mon Sep 17 00:00:00 2001
+From: Jesus Checa Hidalgo 
+Date: Mon, 7 Apr 2025 17:22:56 +0200
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
 
 ---
@@ -11,10 +11,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi
  4 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index 105a4cb81f0d..21bd626842c7 100644
+index b59d73a9aae..2369d73b4e3 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1686,6 +1686,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1583,6 +1583,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -27,10 +27,10 @@ index 105a4cb81f0d..21bd626842c7 100644
      for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2186,6 +2192,10 @@ fn add_library_search_dirs(
-             ControlFlow::<()>::Continue(())
-         },
-     );
+@@ -2140,6 +2146,10 @@ fn add_library_search_dirs(
+         }
+         ControlFlow::<()>::Continue(())
+     });
 +
 +    if let Some(lib_path) = &sess.target.options.external_lib_path {
 +        cmd.include_path(Path::new(lib_path.as_ref()));
@@ -39,10 +39,10 @@ index 105a4cb81f0d..21bd626842c7 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
-index f703132e51f0..c4821be7d12e 100644
+index 4b6de5e18f5..373301d85ab 100644
 --- a/compiler/rustc_target/src/spec/json.rs
 +++ b/compiler/rustc_target/src/spec/json.rs
-@@ -540,6 +540,7 @@ macro_rules! key {
+@@ -559,6 +559,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -50,7 +50,7 @@ index f703132e51f0..c4821be7d12e 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -723,6 +724,7 @@ macro_rules! target_option_val {
+@@ -744,6 +745,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -59,10 +59,10 @@ index f703132e51f0..c4821be7d12e 100644
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 794d6457cb78..b2d88a14bb57 100644
+index 7234d1dc63e..3ec85bbf279 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2237,6 +2237,7 @@ pub struct TargetOptions {
+@@ -2301,6 +2301,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -70,7 +70,7 @@ index 794d6457cb78..b2d88a14bb57 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2754,6 +2755,7 @@ fn default() -> TargetOptions {
+@@ -2821,6 +2822,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -79,10 +79,10 @@ index 794d6457cb78..b2d88a14bb57 100644
              post_link_objects_self_contained: Default::default(),
              link_self_contained: LinkSelfContainedDefault::False,
 diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-index 0862958d05da..b1e736d68627 100644
+index 26add451ed2..3eaf050e682 100644
 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-@@ -19,11 +19,12 @@ pub(crate) fn target() -> Target {
+@@ -21,11 +21,12 @@ pub(crate) fn target() -> Target {
      options.env = "p1".into();
      options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasip1"]);
  
diff --git a/rust.spec b/rust.spec
index 1c322e6..317dbbe 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.86.0
+Version:        1.87.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0.json
 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.85.0
-%global bootstrap_channel 1.85.0
-%global bootstrap_date 2025-02-20
+%global bootstrap_version 1.86.0
+%global bootstrap_channel 1.86.0
+%global bootstrap_date 2025-04-03
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -45,7 +45,7 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient.  Rust currently requires LLVM 18.0+.
 %global min_llvm_version 18.0.0
-%global bundled_llvm_version 19.1.7
+%global bundled_llvm_version 20.1.1
 #global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -138,7 +138,11 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.86.0-unbundle-sqlite.patch
+Patch6:         rustc-1.87.0-unbundle-sqlite.patch
+
+# Split the absolute path of libclang_rt.profile.a when passed to profiler_builtns
+# Upstream PR: https://github.com/rust-lang/rust/pull/139677
+Patch7:         0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
 
 ### RHEL-specific patches below ###
 
@@ -687,6 +691,8 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 
+%patch -P7 -p1
+
 %if %with disabled_libssh2
 %patch -P100 -p1
 %endif
@@ -875,7 +881,7 @@ test -r "%{profiler}"
   --set build.optimized-compiler-builtins=false \
   --set rust.llvm-tools=false \
   --enable-extended \
-  --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \
+  --tools=cargo,clippy,rust-analyzer,rustfmt,src \
   --enable-vendor \
   --enable-verbose-tests \
   --release-channel=%{channel} \
@@ -893,8 +899,12 @@ test -r "%{profiler}"
 mkdir -p "%{profraw}"
 %{__x} build sysroot --rust-profile-generate="%{profraw}"
 # Build cargo as a workload to generate compiler profiles
+# We normally use `x.py`, but in this case we invoke the stage 2 compiler and libs
+# directly to ensure we use the instrumented compiler.
 env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \
-  %{__x} --keep-stage=0 --keep-stage=1 build cargo
+  LD_LIBRARY_PATH=$PWD/build/host/stage2/lib \
+  RUSTC=$PWD/build/host/stage2/bin/rustc \
+  cargo build --manifest-path=src/tools/cargo/Cargo.toml
 # Finalize the profile data and clean up the raw files
 llvm-profdata merge -o "%{profdata}" "%{profraw}"
 rm -r "%{profraw}" build/%{rust_triple}/stage2*/
@@ -941,9 +951,6 @@ for triple in %{?all_targets} ; do
   DESTDIR=%{buildroot} %{__x} install --target=$triple std
 done
 
-# The rls stub doesn't have an install target, but we can just copy it.
-%{__install} -t %{buildroot}%{_bindir} build/%{rust_triple}/stage2-tools-bin/rls
-
 # These are transient files used by x.py dist and install
 rm -rf ./build/dist/ ./build/tmp/
 
@@ -1061,7 +1068,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 %{__x} test --no-fail-fast rustfmt || :
 
-
 %ldconfig_scriptlets
 
 
@@ -1188,7 +1194,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 
 
 %files analyzer
-%{_bindir}/rls
 %{_bindir}/rust-analyzer
 %doc src/tools/rust-analyzer/README.md
 %license src/tools/rust-analyzer/LICENSE-{APACHE,MIT}
diff --git a/rustc-1.86.0-unbundle-sqlite.patch b/rustc-1.87.0-unbundle-sqlite.patch
similarity index 74%
rename from rustc-1.86.0-unbundle-sqlite.patch
rename to rustc-1.87.0-unbundle-sqlite.patch
index 19f5fce..da0fa26 100644
--- a/rustc-1.86.0-unbundle-sqlite.patch
+++ b/rustc-1.87.0-unbundle-sqlite.patch
@@ -10,14 +10,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-03-11 15:30:39.384466481 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-03-11 15:32:05.989298381 -0700
-@@ -80,7 +80,7 @@ proptest = "1.6.0"
- pulldown-cmark = { version = "0.12.2", default-features = false, features = ["html"] }
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-04-07 20:37:44.467359012 +0200
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-04-07 20:38:17.564060339 +0200
+@@ -79,7 +79,7 @@ proptest = "1.6.0"
+ pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
  rand = "0.9.0"
  regex = "1.11.1"
 -rusqlite = { version = "0.33.0", features = ["bundled"] }
 +rusqlite = { version = "0.33.0", features = [] }
  rustc-hash = "2.1.1"
- rustc-stable-hash = "0.1.1"
+ rustc-stable-hash = "0.1.2"
  rustfix = { version = "0.9.0", path = "crates/rustfix" }
diff --git a/sources b/sources
index 583e27d..a5e7cd0 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.86.0-src.tar.xz) = 9ce195e24a03765f7163de16271e3d19d731d4b80fcc2bfd919106c9d42543eade018f712f6947ea3c6e57c6cb2e6841596aa668d608b8da15101a7da14f3097
+SHA512 (rustc-1.87.0-src.tar.xz) = 2ef08c9be45434401f916d54b3739f52d255f8a3a4ce05a717499250c2333eeaf601f1d18085b878c027c609f44da74d0151f5bfc2c9ae1e01166919a91a1d2b
 SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e

From 9786ba6ea92f2b7a8202d8cabb3bf8e44ebbd921 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Tue, 27 May 2025 16:51:15 -0700
Subject: [PATCH 73/86] Skip PGO on all ppc64le builds for now

---
 rust.spec | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust.spec b/rust.spec
index 317dbbe..a1d03a1 100644
--- a/rust.spec
+++ b/rust.spec
@@ -889,10 +889,11 @@ test -r "%{profiler}"
 
 %global __x %{__python3} ./x.py
 
-# rustc is exibiting signs of miscompilation on pwr9+pgo (root cause TBD),
-# so we're skipping pgo on rhel ppc64le for now.
-%if !( 0%{?rhel} && "%{_target_cpu}" == "ppc64le" )
-%if %with rustc_pgo
+# - rustc is exibiting signs of miscompilation on pwr9+pgo (root cause TBD),
+#   so we're skipping pgo on rhel ppc64le for now. See RHEL-88598 for more.
+# - Since 1.87, Fedora started getting ppc64le segfaults, and this also seems
+#   to be avoidable by skipping pgo. See bz2367960 for examples of that.
+%if %{with rustc_pgo} && !( "%{_target_cpu}" == "ppc64le" )
 # Build the compiler with profile instrumentation
 %define profraw $PWD/build/profiles
 %define profdata $PWD/build/rustc.profdata
@@ -911,7 +912,6 @@ rm -r "%{profraw}" build/%{rust_triple}/stage2*/
 # Redefine the macro to use that profile data from now on
 %global __x %{__x} --rust-profile-use="%{profdata}"
 %endif
-%endif
 
 # Build the compiler normally (with or without PGO)
 %{__x} build sysroot

From 17cb547e45d2d49ce6fe61225354b927da6a3d1d Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 26 Jun 2025 13:21:58 -0700
Subject: [PATCH 74/86] Update to Rust 1.88.0

---
 .gitignore                                    |  1 +
 ...ltins-build-script-to-handle-full-pa.patch | 42 ----------
 rust-pr142047.patch                           | 79 +++++++++++++++++++
 rust.spec                                     | 44 +++++------
 rustc-1.87.0-unbundle-sqlite.patch            | 23 ------
 ...atch => rustc-1.88.0-disable-libssh2.patch | 22 +++---
 rustc-1.88.0-unbundle-sqlite.patch            | 23 ++++++
 sources                                       |  2 +-
 8 files changed, 137 insertions(+), 99 deletions(-)
 delete mode 100644 0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
 create mode 100644 rust-pr142047.patch
 delete mode 100644 rustc-1.87.0-unbundle-sqlite.patch
 rename rustc-1.86.0-disable-libssh2.patch => rustc-1.88.0-disable-libssh2.patch (53%)
 create mode 100644 rustc-1.88.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index c6fb39d..24998f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -453,3 +453,4 @@
 /rustc-1.86.0-src.tar.xz
 /wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
 /rustc-1.87.0-src.tar.xz
+/rustc-1.88.0-src.tar.xz
diff --git a/0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch b/0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
deleted file mode 100644
index 2746541..0000000
--- a/0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From dc0fbcab7e0673afe62b3e8e74905d9e5f5b74a4 Mon Sep 17 00:00:00 2001
-From: Jesus Checa Hidalgo 
-Date: Fri, 11 Apr 2025 16:57:38 +0200
-Subject: [PATCH] Fix profiler_builtins build script to handle full path to
- profiler lib
-
-LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds),
-but `-l` expects a library name, not a path. After #138273, this caused builds
-to fail with a "could not find native static library" error.
-
-This patch updates the build script to split the path into directory and
-filename, using `cargo::rustc-link-search` for the directory and
-`cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to
-correctly link the static library even when an absolute path is provided.
----
- library/profiler_builtins/build.rs | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs
-index dd85239fa8c..fc1a9ecc1ec 100644
---- a/library/profiler_builtins/build.rs
-+++ b/library/profiler_builtins/build.rs
-@@ -9,8 +9,14 @@
- 
- fn main() {
-     if let Ok(rt) = tracked_env_var("LLVM_PROFILER_RT_LIB") {
--        println!("cargo::rustc-link-lib=static:+verbatim={rt}");
--        return;
-+        let rt = PathBuf::from(rt);
-+        if let Some(lib) = rt.file_name() {
-+            if let Some(dir) = rt.parent() {
-+                println!("cargo::rustc-link-search=native={}", dir.display());
-+            }
-+            println!("cargo::rustc-link-lib=static:+verbatim={}", lib.to_str().unwrap());
-+            return;
-+        }
-     }
- 
-     let target_os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS was not set");
--- 
-2.49.0
-
diff --git a/rust-pr142047.patch b/rust-pr142047.patch
new file mode 100644
index 0000000..d64d71d
--- /dev/null
+++ b/rust-pr142047.patch
@@ -0,0 +1,79 @@
+From 925e76167ce2465c5c9d990d97c2db99f459640b Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Wed, 4 Jun 2025 15:03:19 -0700
+Subject: [PATCH 1/2] Ensure stack in `ThirBuildCx::mirror_exprs`
+
+This solve a stack overflow found on Fedora s390x when building
+`tests/ui/parser/survive-peano-lesson-queue.rs`. Note that the singular
+`mirror_expr` method already has this stack check, but in this case the
+plural method was the one recursing too deeply.
+---
+ compiler/rustc_mir_build/src/thir/cx/expr.rs | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
+index 226dc920a496c..78c168778ac9d 100644
+--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
++++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
+@@ -38,7 +38,10 @@ impl<'tcx> ThirBuildCx<'tcx> {
+     }
+ 
+     pub(crate) fn mirror_exprs(&mut self, exprs: &'tcx [hir::Expr<'tcx>]) -> Box<[ExprId]> {
+-        exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect()
++        // `mirror_exprs` may also recurse deeply, so it needs protection from stack overflow.
++        // Note that we *could* forward to `mirror_expr` for that, but we can consolidate the
++        // overhead of stack growth by doing it outside the iteration.
++        ensure_sufficient_stack(|| exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect())
+     }
+ 
+     #[instrument(level = "trace", skip(self, hir_expr))]
+
+From af2a85bd75c011fb3453a4963400918e096e1896 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Wed, 4 Jun 2025 15:16:38 -0700
+Subject: [PATCH 2/2] Ensure stack in `Parser::parse_ty`
+
+This solve a stack overflow found on Fedora s390x when building
+`tests/ui/associated-consts/issue-93775.rs`.
+---
+ compiler/rustc_parse/src/parser/ty.rs | 20 ++++++++++++--------
+ 1 file changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
+index 17481731b1107..6eaec2e29ad48 100644
+--- a/compiler/rustc_parse/src/parser/ty.rs
++++ b/compiler/rustc_parse/src/parser/ty.rs
+@@ -7,6 +7,7 @@ use rustc_ast::{
+     Pinnedness, PolyTraitRef, PreciseCapturingArg, TraitBoundModifiers, TraitObjectSyntax, Ty,
+     TyKind, UnsafeBinderTy,
+ };
++use rustc_data_structures::stack::ensure_sufficient_stack;
+ use rustc_errors::{Applicability, Diag, PResult};
+ use rustc_span::{ErrorGuaranteed, Ident, Span, kw, sym};
+ use thin_vec::{ThinVec, thin_vec};
+@@ -104,14 +105,17 @@ fn can_begin_dyn_bound_in_edition_2015(t: &Token) -> bool {
+ impl<'a> Parser<'a> {
+     /// Parses a type.
+     pub fn parse_ty(&mut self) -> PResult<'a, P> {
+-        self.parse_ty_common(
+-            AllowPlus::Yes,
+-            AllowCVariadic::No,
+-            RecoverQPath::Yes,
+-            RecoverReturnSign::Yes,
+-            None,
+-            RecoverQuestionMark::Yes,
+-        )
++        // Make sure deeply nested types don't overflow the stack.
++        ensure_sufficient_stack(|| {
++            self.parse_ty_common(
++                AllowPlus::Yes,
++                AllowCVariadic::No,
++                RecoverQPath::Yes,
++                RecoverReturnSign::Yes,
++                None,
++                RecoverQuestionMark::Yes,
++            )
++        })
+     }
+ 
+     pub(super) fn parse_ty_with_generics_recovery(
diff --git a/rust.spec b/rust.spec
index a1d03a1..e3c986c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.87.0
+Version:        1.88.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -11,12 +11,12 @@ URL:            https://www.rust-lang.org
 %global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x riscv64
 ExclusiveArch:  %{rust_arches}
 
-# To bootstrap from scratch, set the channel and date from src/stage0.json
-# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
+# To bootstrap from scratch, set the channel and date from src/stage0
+# e.g. 1.88.0 wants rustc: 1.87.0-2025-05-15
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.86.0
-%global bootstrap_channel 1.86.0
-%global bootstrap_date 2025-04-03
+%global bootstrap_version 1.87.0
+%global bootstrap_channel 1.87.0
+%global bootstrap_date 2025-05-15
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -43,9 +43,10 @@ ExclusiveArch:  %{rust_arches}
 %bcond_with llvm_static
 
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
-# is insufficient.  Rust currently requires LLVM 18.0+.
-%global min_llvm_version 18.0.0
-%global bundled_llvm_version 20.1.1
+# is insufficient. Rust currently requires LLVM 19.0+.
+# See src/bootstrap/src/core/build_steps/llvm.rs, fn check_llvm_version
+%global min_llvm_version 19.0.0
+%global bundled_llvm_version 20.1.5
 #global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -72,7 +73,7 @@ ExclusiveArch:  %{rust_arches}
 
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
-%global bundled_sqlite3_version 3.48.0
+%global bundled_sqlite3_version 3.49.1
 %if 0%{?rhel} && 0%{?rhel} < 10
 %bcond_without bundled_sqlite3
 %else
@@ -138,11 +139,11 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.87.0-unbundle-sqlite.patch
+Patch6:         rustc-1.88.0-unbundle-sqlite.patch
 
-# Split the absolute path of libclang_rt.profile.a when passed to profiler_builtns
-# Upstream PR: https://github.com/rust-lang/rust/pull/139677
-Patch7:         0001-Fix-profiler_builtins-build-script-to-handle-full-pa.patch
+# Ensure stack in two places that affect s390x
+# https://github.com/rust-lang/rust/pull/142047
+Patch7:         rust-pr142047.patch
 
 ### RHEL-specific patches below ###
 
@@ -153,7 +154,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.86.0-disable-libssh2.patch
+Patch100:       rustc-1.88.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
@@ -303,7 +304,7 @@ BuildRequires:  procps-ng
 # debuginfo-gdb tests need gdb
 BuildRequires:  gdb
 # Work around https://bugzilla.redhat.com/show_bug.cgi?id=2275274:
-# gdb currently prints a "Unable to load 'rpm' module.  Please install the python3-rpm package."
+# gdb currently prints a "Unable to load 'rpm' module. Please install the python3-rpm package."
 # message that breaks version detection.
 BuildRequires:  python3-rpm
 
@@ -317,7 +318,7 @@ Provides:       rustc%{?_isa} = %{version}-%{release}
 # Always require our exact standard library
 Requires:       %{name}-std-static%{?_isa} = %{version}-%{release}
 
-# The C compiler is needed at runtime just for linking.  Someday rustc might
+# The C compiler is needed at runtime just for linking. Someday rustc might
 # invoke the linker directly, and then we'll only need binutils.
 # https://github.com/rust-lang/rust/issues/11937
 Requires:       /usr/bin/cc
@@ -560,7 +561,7 @@ BuildRequires:  git-core
 # in sync since some feature development depends on them together.
 Requires:       %{name} = %{version}-%{release}
 
-# "cargo vendor" is a builtin command starting with 1.37.  The Obsoletes and
+# "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and
 # Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too
 Obsoletes:      cargo-vendor <= 0.1.23
 Provides:       cargo-vendor = %{version}-%{release}
@@ -626,7 +627,7 @@ BuildArch:      noarch
 Recommends:     %{name}-std-static = %{version}-%{release}
 
 %description src
-This package includes source files for the Rust standard library.  It may be
+This package includes source files for the Rust standard library. It may be
 useful as a reference for code completion tools in various editors.
 
 
@@ -690,7 +691,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %if %without bundled_sqlite3
 %patch -P6 -p1
 %endif
-
 %patch -P7 -p1
 
 %if %with disabled_libssh2
@@ -753,7 +753,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern "C" {}' \
 %endif
 
 # The configure macro will modify some autoconf-related files, which upsets
-# cargo when it tries to verify checksums in those files.  If we just truncate
+# cargo when it tries to verify checksums in those files. If we just truncate
 # that file list, cargo won't have anything to complain about.
 find vendor -name .cargo-checksum.json \
   -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
@@ -798,7 +798,7 @@ end}
 
 # Some builders have relatively little memory for their CPU count.
 # At least 4GB per CPU is a good rule of thumb for building rustc.
-%if ! %defined constrain_build
+%if %undefined constrain_build
 %define constrain_build(m:) %{lua:
   for l in io.lines('/proc/meminfo') do
     if l:sub(1, 9) == "MemTotal:" then
diff --git a/rustc-1.87.0-unbundle-sqlite.patch b/rustc-1.87.0-unbundle-sqlite.patch
deleted file mode 100644
index da0fa26..0000000
--- a/rustc-1.87.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-03-11 15:30:39.383119717 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-03-11 15:32:12.486164705 -0700
-@@ -2571,7 +2571,6 @@ version = "0.31.0"
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "ad8935b44e7c13394a179a438e0cebba0fe08fe01b54f152e29a93b5cf993fd4"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-04-07 20:37:44.467359012 +0200
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-04-07 20:38:17.564060339 +0200
-@@ -79,7 +79,7 @@ proptest = "1.6.0"
- pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
- rand = "0.9.0"
- regex = "1.11.1"
--rusqlite = { version = "0.33.0", features = ["bundled"] }
-+rusqlite = { version = "0.33.0", features = [] }
- rustc-hash = "2.1.1"
- rustc-stable-hash = "0.1.2"
- rustfix = { version = "0.9.0", path = "crates/rustfix" }
diff --git a/rustc-1.86.0-disable-libssh2.patch b/rustc-1.88.0-disable-libssh2.patch
similarity index 53%
rename from rustc-1.86.0-disable-libssh2.patch
rename to rustc-1.88.0-disable-libssh2.patch
index 8b07bde..bf39d35 100644
--- a/rustc-1.86.0-disable-libssh2.patch
+++ b/rustc-1.88.0-disable-libssh2.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-03-11 15:36:38.387335541 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-03-11 15:39:27.491711044 -0700
-@@ -2528,7 +2528,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-06-13 15:47:08.609927319 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-06-13 15:47:54.463092386 -0700
+@@ -2530,7 +2530,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2574,20 +2573,6 @@ dependencies = [
+@@ -2576,20 +2575,6 @@ dependencies = [
   "pkg-config",
   "vcpkg",
  ]
@@ -29,16 +29,16 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
 -]
  
  [[package]]
- name = "libz-sys"
+ name = "libz-rs-sys"
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-03-11 15:36:38.389045348 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-03-11 15:38:36.948228456 -0700
-@@ -47,7 +47,7 @@ curl = "0.4.47"
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-06-13 15:47:08.610402846 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-06-13 15:47:51.696071356 -0700
+@@ -46,7 +46,7 @@ curl = "0.4.47"
  curl-sys = "0.4.79"
  filetime = "0.2.25"
- flate2 = { version = "1.0.35", default-features = false, features = ["zlib"] }
+ flate2 = { version = "1.1.1", default-features = false, features = ["zlib-rs"] }
 -git2 = "0.20.0"
 +git2 = { version = "0.20.0", default-features = false, features = ["https"] }
  git2-curl = "0.21.0"
- gix = { version = "0.70.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
- glob = "0.3.2"
+ # When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail.
+ gix = { version = "0.71.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
diff --git a/rustc-1.88.0-unbundle-sqlite.patch b/rustc-1.88.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..11c1e79
--- /dev/null
+++ b/rustc-1.88.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-06-13 01:10:18.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-06-13 15:39:38.597882622 -0700
+@@ -2573,7 +2573,6 @@ version = "0.32.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "fbb8270bb4060bd76c6e96f20c52d80620f1d82a3470885694e41e0f81ef6fe7"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-06-13 01:10:18.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-06-13 15:39:34.583102112 -0700
+@@ -80,7 +80,7 @@ proptest = "1.6.0"
+ pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
+ rand = "0.9.0"
+ regex = "1.11.1"
+-rusqlite = { version = "0.34.0", features = ["bundled"] }
++rusqlite = { version = "0.34.0", features = [] }
+ rustc-hash = "2.1.1"
+ rustc-stable-hash = "0.1.2"
+ rustfix = { version = "0.9.0", path = "crates/rustfix" }
diff --git a/sources b/sources
index a5e7cd0..79ee571 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.87.0-src.tar.xz) = 2ef08c9be45434401f916d54b3739f52d255f8a3a4ce05a717499250c2333eeaf601f1d18085b878c027c609f44da74d0151f5bfc2c9ae1e01166919a91a1d2b
+SHA512 (rustc-1.88.0-src.tar.xz) = e6c62af2953f49462b2369e9551b12f2bec114577f90e3e76049636da4279b1e7f4d53bc6896f5d0d4715d90ef6d29dacff529a45690ffac6af62ad64600db40
 SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e

From 594464056b86e69509b960416b5556a542bc0f3f Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering 
Date: Fri, 25 Jul 2025 12:57:01 +0000
Subject: [PATCH 75/86] Rebuilt for
 https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild


From b26ae543d99ae35aaf778f04b8dd3e1f31aee0a6 Mon Sep 17 00:00:00 2001
From: Paul Murphy 
Date: Wed, 9 Jul 2025 15:21:26 -0500
Subject: [PATCH 76/86] Update to Rust 1.89.0

Turn on rust.verify-llvm-ir, it would have caught the ppc64le pgo
failure when building the compiler. The only impact should be
slightly increased time to build this package.

Also, bump wasi-libc sdk to version 27.
---
 .gitignore                                    |  2 +
 ...ic-if-WASI_SDK_PATH-is-not-set-when-.patch | 39 +++++++++
 ...variables-override-some-default-CPUs.patch | 18 ++---
 0001-Use-lld-provided-by-system.patch         | 20 ++---
 ...llow-disabling-target-self-contained.patch | 48 +++++------
 ...nly-copy-rustlib-into-stage0-sysroot.patch | 28 +++++++
 ...xternal-library-path-for-wasm32-wasi.patch | 22 +++---
 rust-pr142047.patch                           | 79 -------------------
 rust.spec                                     | 29 ++++---
 ...atch => rustc-1.89.0-disable-libssh2.patch | 18 ++---
 sources                                       |  4 +-
 11 files changed, 149 insertions(+), 158 deletions(-)
 create mode 100644 0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
 create mode 100644 0001-only-copy-rustlib-into-stage0-sysroot.patch
 delete mode 100644 rust-pr142047.patch
 rename rustc-1.88.0-disable-libssh2.patch => rustc-1.89.0-disable-libssh2.patch (55%)

diff --git a/.gitignore b/.gitignore
index 24998f3..08bc2dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -454,3 +454,5 @@
 /wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
 /rustc-1.87.0-src.tar.xz
 /rustc-1.88.0-src.tar.xz
+/wasi-libc-wasi-sdk-27.tar.gz
+/rustc-1.89.0-src.tar.xz
diff --git a/0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch b/0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
new file mode 100644
index 0000000..4864900
--- /dev/null
+++ b/0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
@@ -0,0 +1,39 @@
+From 9bdd3b0ee6a6fd5914fea0f56f3b754410733e53 Mon Sep 17 00:00:00 2001
+From: Paul Murphy 
+Date: Thu, 10 Jul 2025 10:58:58 -0500
+Subject: [PATCH] Don't always panic if WASI_SDK_PATH is not set when detecting
+ compilers
+
+They are not always needed when building std, as is the case when
+packaging on Fedora. Panic if building from CI, but warn otherwise.
+---
+ src/bootstrap/src/utils/cc_detect.rs | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
+index dcafeb80f90..2569f95e3ef 100644
+--- a/src/bootstrap/src/utils/cc_detect.rs
++++ b/src/bootstrap/src/utils/cc_detect.rs
+@@ -221,10 +221,15 @@ fn default_compiler(
+         }
+ 
+         t if t.contains("-wasi") => {
+-            let root = build
+-                .wasi_sdk_path
+-                .as_ref()
+-                .expect("WASI_SDK_PATH mut be configured for a -wasi target");
++            let root = if let Some(path) = build.wasi_sdk_path.as_ref() {
++                path
++            } else {
++                if build.config.is_running_on_ci {
++                    panic!("ERROR: WASI_SDK_PATH must be configured for a -wasi target on CI");
++                }
++                println!("WARNING: WASI_SDK_PATH not set, using default cc/cxx compiler");
++                return None;
++            };
+             let compiler = match compiler {
+                 Language::C => format!("{t}-clang"),
+                 Language::CPlusPlus => format!("{t}-clang++"),
+-- 
+2.49.0
+
diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch
index 302c7fd..fa654c6 100644
--- a/0001-Let-environment-variables-override-some-default-CPUs.patch
+++ b/0001-Let-environment-variables-override-some-default-CPUs.patch
@@ -1,4 +1,4 @@
-From 5273432acfae75d6e509bbebcf8d28b0f3d820d0 Mon Sep 17 00:00:00 2001
+From e54c0a4cc8bd8a76b155714b23a61d1d32a8d069 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 9 Jun 2023 15:23:08 -0700
 Subject: [PATCH] Let environment variables override some default CPUs
@@ -10,10 +10,10 @@ Subject: [PATCH] Let environment variables override some default CPUs
  3 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
-index 23913687a1fd..3253fbc84c74 100644
+index 9e406af53b5..9104903673f 100644
 --- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
-@@ -2,7 +2,7 @@
+@@ -4,7 +4,7 @@
  
  pub(crate) fn target() -> Target {
      let mut base = base::linux_gnu::opts();
@@ -23,23 +23,23 @@ index 23913687a1fd..3253fbc84c74 100644
      base.max_atomic_width = Some(64);
      base.stack_probes = StackProbeType::Inline;
 diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
-index a84a18a433ff..441af1018ff3 100644
+index cdcf7d62a3e..02f24274ed2 100644
 --- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
-@@ -5,7 +5,7 @@ pub(crate) fn target() -> Target {
+@@ -6,7 +6,7 @@ pub(crate) fn target() -> Target {
      let mut base = base::linux_gnu::opts();
      base.endian = Endian::Big;
      // z10 is the oldest CPU supported by LLVM
 -    base.cpu = "z10".into();
 +    base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into();
      base.max_atomic_width = Some(128);
-     base.min_global_align = Some(16);
+     base.min_global_align = Some(Align::from_bits(16).unwrap());
      base.stack_probes = StackProbeType::Inline;
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
-index 59ec6c7f9d5f..b6f1be890b20 100644
+index 0c8353fad18..c2515e700bb 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
-@@ -2,7 +2,7 @@
+@@ -4,7 +4,7 @@
  
  pub(crate) fn target() -> Target {
      let mut base = base::linux_gnu::opts();
@@ -49,5 +49,5 @@ index 59ec6c7f9d5f..b6f1be890b20 100644
      base.max_atomic_width = Some(64);
      base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
 -- 
-2.47.1
+2.49.0
 
diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch
index 63c9b14..1e5816b 100644
--- a/0001-Use-lld-provided-by-system.patch
+++ b/0001-Use-lld-provided-by-system.patch
@@ -1,4 +1,4 @@
-From 687112c89c9058ef1e79f1c3a974940b1ae43ea3 Mon Sep 17 00:00:00 2001
+From 0641fdd833785914f1ead6e1ab374beea5b55437 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 16 Aug 2024 10:12:58 -0700
 Subject: [PATCH] Use lld provided by system
@@ -12,10 +12,10 @@ Subject: [PATCH] Use lld provided by system
  5 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
-index 81b96cd39ffa..4c9916af826b 100644
+index 88e7af5e669..14100a683f9 100644
 --- a/compiler/rustc_target/src/spec/base/wasm.rs
 +++ b/compiler/rustc_target/src/spec/base/wasm.rs
-@@ -85,8 +85,7 @@ macro_rules! args {
+@@ -86,8 +86,7 @@ macro_rules! args {
          // arguments just yet
          limit_rdylib_exports: false,
  
@@ -26,7 +26,7 @@ index 81b96cd39ffa..4c9916af826b 100644
  
          pre_link_args,
 diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
-index 3b719ebaf07e..8b4fecee68f0 100644
+index 35a4dd72b86..a9c8fc5edb8 100644
 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
 +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
 @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
@@ -39,7 +39,7 @@ index 3b719ebaf07e..8b4fecee68f0 100644
          relocation_model: RelocModel::Static,
          disable_redzone: true,
 diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
-index 9656024ddaa1..2099fa17229f 100644
+index 327b52389b9..17313d7e8b3 100644
 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
 +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
 @@ -9,6 +9,7 @@ pub(crate) fn target() -> Target {
@@ -51,7 +51,7 @@ index 9656024ddaa1..2099fa17229f 100644
      Target {
          llvm_target: "aarch64-unknown-windows".into(),
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
-index e14a36735894..b493d7d98b46 100644
+index 1a6343595f5..8015b082cd1 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
 @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
@@ -64,17 +64,17 @@ index e14a36735894..b493d7d98b46 100644
          features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(),
          supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
 diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
-index bce6aa0ebc6b..7fa1148a1de7 100644
+index 0cf6a879462..3677fc662de 100644
 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
 +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
-@@ -14,6 +14,7 @@ pub(crate) fn target() -> Target {
+@@ -15,6 +15,7 @@ pub(crate) fn target() -> Target {
      base.plt_by_default = false;
      base.max_atomic_width = Some(64);
-     base.entry_abi = Conv::X86_64Win64;
+     base.entry_abi = CanonAbi::X86(X86Call::Win64);
 +    base.linker = Some("lld".into());
  
      // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
      // enable these CPU features explicitly before their first use, otherwise their instructions
 -- 
-2.48.1
+2.49.0
 
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 655496c..c00d2b9 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From e8833a9032b9f5773ef891b3f12b93322d6b4950 Mon Sep 17 00:00:00 2001
+From 6af71d8ff0932bc14102cd9cbfbca16354c5cd2a Mon Sep 17 00:00:00 2001
 From: Jesus Checa Hidalgo 
 Date: Mon, 7 Apr 2025 16:59:10 +0200
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -6,15 +6,15 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
 ---
  bootstrap.example.toml                        | 5 +++++
  src/bootstrap/src/core/build_steps/compile.rs | 4 ++++
- src/bootstrap/src/core/config/config.rs       | 8 ++++++++
+ src/bootstrap/src/core/config/toml/target.rs  | 8 ++++++++
  src/bootstrap/src/lib.rs                      | 5 +++++
  4 files changed, 22 insertions(+)
 
 diff --git a/bootstrap.example.toml b/bootstrap.example.toml
-index 2a98821f225..580d6b2a8a2 100644
+index 19cf360b0fb..916bae8dc7d 100644
 --- a/bootstrap.example.toml
 +++ b/bootstrap.example.toml
-@@ -948,6 +948,11 @@
+@@ -974,6 +974,11 @@
  # This overrides the global `rust.jemalloc` option. See that option for more info.
  #jemalloc = rust.jemalloc (bool)
  
@@ -27,10 +27,10 @@ index 2a98821f225..580d6b2a8a2 100644
  # Distribution options
  #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 18b5d4426b1..3de9667123b 100644
+index f6efb23e8d8..4d0ae54e1ef 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -370,6 +370,10 @@ fn copy_self_contained_objects(
+@@ -374,6 +374,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -41,11 +41,19 @@ index 18b5d4426b1..3de9667123b 100644
      let libdir_self_contained =
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
-diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index bbb0fbfbb93..8642a86cbf8 100644
---- a/src/bootstrap/src/core/config/config.rs
-+++ b/src/bootstrap/src/core/config/config.rs
-@@ -666,6 +666,7 @@ pub struct Target {
+diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
+index b9f6780ca3f..41a4a815d31 100644
+--- a/src/bootstrap/src/core/config/toml/target.rs
++++ b/src/bootstrap/src/core/config/toml/target.rs
+@@ -47,6 +47,7 @@ struct TomlTarget {
+         runner: Option = "runner",
+         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
+         jemalloc: Option = "jemalloc",
++        self_contained: Option = "self-contained",
+     }
+ }
+ 
+@@ -79,6 +80,7 @@ pub struct Target {
      pub codegen_backends: Option>,
      pub optimized_compiler_builtins: Option,
      pub jemalloc: Option,
@@ -53,7 +61,7 @@ index bbb0fbfbb93..8642a86cbf8 100644
  }
  
  impl Target {
-@@ -677,6 +678,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -90,6 +92,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("emscripten") {
              target.runner = Some("node".into());
          }
@@ -63,15 +71,7 @@ index bbb0fbfbb93..8642a86cbf8 100644
          target
      }
  }
-@@ -1292,6 +1296,7 @@ struct TomlTarget {
-         runner: Option = "runner",
-         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
-         jemalloc: Option = "jemalloc",
-+        self_contained: Option = "self-contained",
-     }
- }
- 
-@@ -2245,6 +2250,9 @@ fn get_table(option: &str) -> Result {
+@@ -126,6 +131,9 @@ pub fn apply_target_config(&mut self, toml_target: Option Option {
+@@ -1331,6 +1331,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -98,5 +98,5 @@ index 843d474f92d..3a4398ee1f8 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.48.1
+2.49.0
 
diff --git a/0001-only-copy-rustlib-into-stage0-sysroot.patch b/0001-only-copy-rustlib-into-stage0-sysroot.patch
new file mode 100644
index 0000000..6cf8aa9
--- /dev/null
+++ b/0001-only-copy-rustlib-into-stage0-sysroot.patch
@@ -0,0 +1,28 @@
+From 7d83bae4e2577ffa2afaf2fddb6948c1756a403c Mon Sep 17 00:00:00 2001
+From: Paul Murphy 
+Date: Thu, 10 Jul 2025 09:06:22 -0500
+Subject: [PATCH] only copy rustlib into stage0 sysroot
+
+Otherwise, much more is copied, and doing so likely runs into
+permissions errors if the bootstrap toolchain lives in the host's
+sysroot.
+---
+ src/bootstrap/src/core/build_steps/compile.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
+index 4d0ae54e1ef..4ef70dd9b97 100644
+--- a/src/bootstrap/src/core/build_steps/compile.rs
++++ b/src/bootstrap/src/core/build_steps/compile.rs
+@@ -811,7 +811,7 @@ fn run(self, builder: &Builder<'_>) {
+                 let _ = fs::remove_dir_all(sysroot.join("lib/rustlib/src/rust"));
+             }
+ 
+-            builder.cp_link_r(&builder.initial_sysroot.join("lib"), &sysroot.join("lib"));
++            builder.cp_link_r(&builder.initial_sysroot.join("lib/rustlib"), &sysroot.join("lib/rustlib"));
+         } else {
+             if builder.download_rustc() {
+                 // Ensure there are no CI-rustc std artifacts.
+-- 
+2.49.0
+
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index b1f2476..79f06ad 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,4 +1,4 @@
-From 35a37bd892939b8a1cd194632de3b9dd3a3d479b Mon Sep 17 00:00:00 2001
+From 0539027ae7a60cd6ddf2190450240d35a147599d Mon Sep 17 00:00:00 2001
 From: Jesus Checa Hidalgo 
 Date: Mon, 7 Apr 2025 17:22:56 +0200
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
@@ -11,10 +11,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi
  4 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index b59d73a9aae..2369d73b4e3 100644
+index 8882ba359b7..914e5c1398f 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1583,6 +1583,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1548,6 +1548,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -27,7 +27,7 @@ index b59d73a9aae..2369d73b4e3 100644
      for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2140,6 +2146,10 @@ fn add_library_search_dirs(
+@@ -2121,6 +2127,10 @@ fn add_library_search_dirs(
          }
          ControlFlow::<()>::Continue(())
      });
@@ -39,10 +39,10 @@ index b59d73a9aae..2369d73b4e3 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
-index 4b6de5e18f5..373301d85ab 100644
+index 6c716f87125..187cc93b2d3 100644
 --- a/compiler/rustc_target/src/spec/json.rs
 +++ b/compiler/rustc_target/src/spec/json.rs
-@@ -559,6 +559,7 @@ macro_rules! key {
+@@ -572,6 +572,7 @@ macro_rules! key {
          key!(linker_is_gnu_json = "linker-is-gnu", bool);
          key!(pre_link_objects = "pre-link-objects", link_objects);
          key!(post_link_objects = "post-link-objects", link_objects);
@@ -50,7 +50,7 @@ index 4b6de5e18f5..373301d85ab 100644
          key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
          key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
          // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -744,6 +745,7 @@ macro_rules! target_option_val {
+@@ -771,6 +772,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -59,10 +59,10 @@ index 4b6de5e18f5..373301d85ab 100644
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 7234d1dc63e..3ec85bbf279 100644
+index 7a49f004072..a693fd74887 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2301,6 +2301,7 @@ pub struct TargetOptions {
+@@ -2293,6 +2293,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -70,7 +70,7 @@ index 7234d1dc63e..3ec85bbf279 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2821,6 +2822,7 @@ fn default() -> TargetOptions {
+@@ -2813,6 +2814,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -99,5 +99,5 @@ index 26add451ed2..3eaf050e682 100644
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.48.1
+2.49.0
 
diff --git a/rust-pr142047.patch b/rust-pr142047.patch
deleted file mode 100644
index d64d71d..0000000
--- a/rust-pr142047.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 925e76167ce2465c5c9d990d97c2db99f459640b Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Wed, 4 Jun 2025 15:03:19 -0700
-Subject: [PATCH 1/2] Ensure stack in `ThirBuildCx::mirror_exprs`
-
-This solve a stack overflow found on Fedora s390x when building
-`tests/ui/parser/survive-peano-lesson-queue.rs`. Note that the singular
-`mirror_expr` method already has this stack check, but in this case the
-plural method was the one recursing too deeply.
----
- compiler/rustc_mir_build/src/thir/cx/expr.rs | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
-index 226dc920a496c..78c168778ac9d 100644
---- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
-+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
-@@ -38,7 +38,10 @@ impl<'tcx> ThirBuildCx<'tcx> {
-     }
- 
-     pub(crate) fn mirror_exprs(&mut self, exprs: &'tcx [hir::Expr<'tcx>]) -> Box<[ExprId]> {
--        exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect()
-+        // `mirror_exprs` may also recurse deeply, so it needs protection from stack overflow.
-+        // Note that we *could* forward to `mirror_expr` for that, but we can consolidate the
-+        // overhead of stack growth by doing it outside the iteration.
-+        ensure_sufficient_stack(|| exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect())
-     }
- 
-     #[instrument(level = "trace", skip(self, hir_expr))]
-
-From af2a85bd75c011fb3453a4963400918e096e1896 Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Wed, 4 Jun 2025 15:16:38 -0700
-Subject: [PATCH 2/2] Ensure stack in `Parser::parse_ty`
-
-This solve a stack overflow found on Fedora s390x when building
-`tests/ui/associated-consts/issue-93775.rs`.
----
- compiler/rustc_parse/src/parser/ty.rs | 20 ++++++++++++--------
- 1 file changed, 12 insertions(+), 8 deletions(-)
-
-diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
-index 17481731b1107..6eaec2e29ad48 100644
---- a/compiler/rustc_parse/src/parser/ty.rs
-+++ b/compiler/rustc_parse/src/parser/ty.rs
-@@ -7,6 +7,7 @@ use rustc_ast::{
-     Pinnedness, PolyTraitRef, PreciseCapturingArg, TraitBoundModifiers, TraitObjectSyntax, Ty,
-     TyKind, UnsafeBinderTy,
- };
-+use rustc_data_structures::stack::ensure_sufficient_stack;
- use rustc_errors::{Applicability, Diag, PResult};
- use rustc_span::{ErrorGuaranteed, Ident, Span, kw, sym};
- use thin_vec::{ThinVec, thin_vec};
-@@ -104,14 +105,17 @@ fn can_begin_dyn_bound_in_edition_2015(t: &Token) -> bool {
- impl<'a> Parser<'a> {
-     /// Parses a type.
-     pub fn parse_ty(&mut self) -> PResult<'a, P> {
--        self.parse_ty_common(
--            AllowPlus::Yes,
--            AllowCVariadic::No,
--            RecoverQPath::Yes,
--            RecoverReturnSign::Yes,
--            None,
--            RecoverQuestionMark::Yes,
--        )
-+        // Make sure deeply nested types don't overflow the stack.
-+        ensure_sufficient_stack(|| {
-+            self.parse_ty_common(
-+                AllowPlus::Yes,
-+                AllowCVariadic::No,
-+                RecoverQPath::Yes,
-+                RecoverReturnSign::Yes,
-+                None,
-+                RecoverQuestionMark::Yes,
-+            )
-+        })
-     }
- 
-     pub(super) fn parse_ty_with_generics_recovery(
diff --git a/rust.spec b/rust.spec
index e3c986c..7f25144 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.88.0
+Version:        1.89.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -12,11 +12,11 @@ URL:            https://www.rust-lang.org
 ExclusiveArch:  %{rust_arches}
 
 # To bootstrap from scratch, set the channel and date from src/stage0
-# e.g. 1.88.0 wants rustc: 1.87.0-2025-05-15
+# e.g. 1.89.0 wants rustc: 1.88.0-2025-06-26
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.87.0
-%global bootstrap_channel 1.87.0
-%global bootstrap_date 2025-05-15
+%global bootstrap_version 1.88.0
+%global bootstrap_channel 1.88.0
+%global bootstrap_date 2025-06-26
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -28,8 +28,7 @@ ExclusiveArch:  %{rust_arches}
 # We need CRT files for *-wasi targets, at least as new as the commit in
 # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
-#global wasi_libc_ref wasi-sdk-25
-%global wasi_libc_ref 640c0cfc19a96b099e0791824be5ef0105ce2084
+%global wasi_libc_ref wasi-sdk-27
 %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
 %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
 %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@@ -46,7 +45,7 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient. Rust currently requires LLVM 19.0+.
 # See src/bootstrap/src/core/build_steps/llvm.rs, fn check_llvm_version
 %global min_llvm_version 19.0.0
-%global bundled_llvm_version 20.1.5
+%global bundled_llvm_version 20.1.7
 #global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -63,7 +62,7 @@ ExclusiveArch:  %{rust_arches}
 %endif
 
 # Try to use system oniguruma (only used at build time for rust-docs)
-# src/tools/rustbook -> ... -> onig_sys v69.8.1 needs at least 6.9.3
+# src/tools/rustbook -> ... -> onig_sys v69.9.1 needs at least 6.9.3
 %global min_oniguruma_version 6.9.3
 %if 0%{?rhel} && 0%{?rhel} < 9
 %bcond_without bundled_oniguruma
@@ -141,9 +140,11 @@ Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 # We don't want to use the bundled library in libsqlite3-sys
 Patch6:         rustc-1.88.0-unbundle-sqlite.patch
 
-# Ensure stack in two places that affect s390x
-# https://github.com/rust-lang/rust/pull/142047
-Patch7:         rust-pr142047.patch
+# stage0 tries to copy all of /usr/lib, sometimes unsuccessfully, see #143735
+Patch7:         0001-only-copy-rustlib-into-stage0-sysroot.patch
+
+# PR #143752, fixed upstream.
+Patch8:         0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
 
 ### RHEL-specific patches below ###
 
@@ -154,7 +155,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.88.0-disable-libssh2.patch
+Patch100:       rustc-1.89.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
@@ -692,6 +693,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
+%patch -P8 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -880,6 +882,7 @@ test -r "%{profiler}"
   --set build.test-stage=2 \
   --set build.optimized-compiler-builtins=false \
   --set rust.llvm-tools=false \
+  --set rust.verify-llvm-ir=true \
   --enable-extended \
   --tools=cargo,clippy,rust-analyzer,rustfmt,src \
   --enable-vendor \
diff --git a/rustc-1.88.0-disable-libssh2.patch b/rustc-1.89.0-disable-libssh2.patch
similarity index 55%
rename from rustc-1.88.0-disable-libssh2.patch
rename to rustc-1.89.0-disable-libssh2.patch
index bf39d35..52690b2 100644
--- a/rustc-1.88.0-disable-libssh2.patch
+++ b/rustc-1.89.0-disable-libssh2.patch
@@ -1,7 +1,6 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-06-13 15:47:08.609927319 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-06-13 15:47:54.463092386 -0700
-@@ -2530,7 +2530,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-07-14 11:57:13.773604132 -0500
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-07-14 11:58:13.305337361 -0500
+@@ -2523,7 +2523,6 @@
  dependencies = [
   "cc",
   "libc",
@@ -9,7 +8,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "libz-sys",
   "openssl-sys",
   "pkg-config",
-@@ -2576,20 +2575,6 @@ dependencies = [
+@@ -2569,20 +2568,6 @@
   "pkg-config",
   "vcpkg",
  ]
@@ -30,10 +29,9 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
  
  [[package]]
  name = "libz-rs-sys"
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-06-13 15:47:08.610402846 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-06-13 15:47:51.696071356 -0700
-@@ -46,7 +46,7 @@ curl = "0.4.47"
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-07-14 11:57:13.773954247 -0500
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-07-14 11:58:13.305708130 -0500
+@@ -46,7 +46,7 @@
  curl-sys = "0.4.79"
  filetime = "0.2.25"
  flate2 = { version = "1.1.1", default-features = false, features = ["zlib-rs"] }
@@ -41,4 +39,4 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools
 +git2 = { version = "0.20.0", default-features = false, features = ["https"] }
  git2-curl = "0.21.0"
  # When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail.
- gix = { version = "0.71.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
+ gix = { version = "0.72.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
diff --git a/sources b/sources
index 79ee571..0a7d170 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.88.0-src.tar.xz) = e6c62af2953f49462b2369e9551b12f2bec114577f90e3e76049636da4279b1e7f4d53bc6896f5d0d4715d90ef6d29dacff529a45690ffac6af62ad64600db40
-SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e
+SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e
+SHA512 (rustc-1.89.0-src.tar.xz) = 3ac0f02baaff12c67fe35cef4d56b315134d0a043bb6103a248a2842456c74733c6e3039f079bacfb8b8ab9b7487f92d678987e588bd41276abf9bf7c2f7870b

From 5a638152c0ad36786da01594940e76ddc6b9428f Mon Sep 17 00:00:00 2001
From: Jakub Jelen 
Date: Thu, 7 Aug 2025 08:03:11 +0000
Subject: [PATCH 77/86] Rust-gdb and lldb require rustc to find a sysroot

otherwise it fails with

```
/usr/bin/rust-gdb: line 14: rustc: command not found
```
---
 rust.spec | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rust.spec b/rust.spec
index 7f25144..c62fee7 100644
--- a/rust.spec
+++ b/rust.spec
@@ -512,6 +512,8 @@ Summary:        GDB pretty printers for Rust
 BuildArch:      noarch
 Requires:       gdb
 Requires:       %{name}-debugger-common = %{version}-%{release}
+# rust-gdb uses rustc to find the sysroot
+Requires:       %{name} = %{version}-%{release}
 
 %description gdb
 This package includes the rust-gdb script, which allows easier debugging of Rust
@@ -524,6 +526,8 @@ BuildArch:      noarch
 Requires:       lldb
 Requires:       python3-lldb
 Requires:       %{name}-debugger-common = %{version}-%{release}
+# rust-lldb uses rustc to find the sysroot
+Requires:       %{name} = %{version}-%{release}
 
 %description lldb
 This package includes the rust-lldb script, which allows easier debugging of Rust

From 6c973e7ddf33c2dcd0d3cc40113a466f6e541868 Mon Sep 17 00:00:00 2001
From: Paul Murphy 
Date: Wed, 2 Jul 2025 16:48:17 -0500
Subject: [PATCH 78/86] Enable optimized-compiler-builtins on the native
 compiler

With the exception of s390x which does not yet provide one.

On aarch64, this adds runtime support for LSE in outline-atomic
operations.
---
 ...prebuilt-optimized-compiler-rt-built.patch | 276 ++++++++++++++++++
 rust.spec                                     |  15 +-
 2 files changed, 290 insertions(+), 1 deletion(-)
 create mode 100644 0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch

diff --git a/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch b/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
new file mode 100644
index 0000000..212c7c8
--- /dev/null
+++ b/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
@@ -0,0 +1,276 @@
+From b5cdd50a21e27bde3fbbff5fe67df79b88fadb05 Mon Sep 17 00:00:00 2001
+From: Paul Murphy 
+Date: Tue, 24 Jun 2025 11:07:54 -0500
+Subject: [PATCH] Allow linking a prebuilt optimized compiler-rt builtins
+ library
+
+Extend the .optimized-compiler-builtins bootstrap option to accept a
+path to a prebuilt compiler-rt builtins library, and update compiler-builtins
+to enable optimized builtins without building compiler-rt builtins.
+---
+ bootstrap.example.toml                        |  4 +-
+ .../compiler-builtins/build.rs                | 55 ++++++++++++++++---
+ src/bootstrap/src/core/build_steps/compile.rs | 44 ++++++++-------
+ src/bootstrap/src/core/config/config.rs       | 10 +++-
+ src/bootstrap/src/core/config/tests.rs        |  4 +-
+ src/bootstrap/src/core/config/toml/target.rs  |  4 +-
+ 6 files changed, 87 insertions(+), 34 deletions(-)
+
+diff --git a/bootstrap.example.toml b/bootstrap.example.toml
+index 916bae8dc7d..cb80c9dd31e 100644
+--- a/bootstrap.example.toml
++++ b/bootstrap.example.toml
+@@ -967,7 +967,9 @@
+ # sources are available.
+ #
+ # Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
+-# order to run `x check`.
++# order to run `x check`. This may also be given a path to an existing build of the builtins
++# runtime library from LLVM's compiler-rt. This option will override the same option under [build]
++# section.
+ #optimized-compiler-builtins = build.optimized-compiler-builtins (bool)
+ 
+ # Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
+diff --git a/library/compiler-builtins/compiler-builtins/build.rs b/library/compiler-builtins/compiler-builtins/build.rs
+index 018899faf1d..3ad888ed26a 100644
+--- a/library/compiler-builtins/compiler-builtins/build.rs
++++ b/library/compiler-builtins/compiler-builtins/build.rs
+@@ -548,12 +548,20 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+             sources.extend(&[("__emutls_get_address", "emutls.c")]);
+         }
+ 
++        // Optionally, link against a prebuilt llvm compiler-rt containing the builtins
++        // library. Only the builtins library is required. On many platforms, this is
++        // available as a library named libclang_rt.builtins.a.
++        let link_against_prebuilt_rt = env::var_os("LLVM_COMPILER_RT_LIB").is_some();
++
+         // When compiling the C code we require the user to tell us where the
+         // source code is, and this is largely done so when we're compiling as
+         // part of rust-lang/rust we can use the same llvm-project repository as
+         // rust-lang/rust.
+         let root = match env::var_os("RUST_COMPILER_RT_ROOT") {
+             Some(s) => PathBuf::from(s),
++            // If a prebuild libcompiler-rt is provided, set a valid
++            // path to simplify later logic. Nothing should be compiled.
++            None if link_against_prebuilt_rt => PathBuf::new(),
+             None => {
+                 panic!(
+                     "RUST_COMPILER_RT_ROOT is not set. You may need to run \
+@@ -561,7 +569,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+                 );
+             }
+         };
+-        if !root.exists() {
++        if !link_against_prebuilt_rt && !root.exists() {
+             panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
+         }
+ 
+@@ -577,7 +585,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+         let src_dir = root.join("lib/builtins");
+         if target.arch == "aarch64" && target.env != "msvc" && target.os != "uefi" {
+             // See below for why we're building these as separate libraries.
+-            build_aarch64_out_of_line_atomics_libraries(&src_dir, cfg);
++            build_aarch64_out_of_line_atomics_libraries(&src_dir, cfg, link_against_prebuilt_rt);
+ 
+             // Some run-time CPU feature detection is necessary, as well.
+             let cpu_model_src = if src_dir.join("cpu_model.c").exists() {
+@@ -591,20 +599,45 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+         let mut added_sources = HashSet::new();
+         for (sym, src) in sources.map.iter() {
+             let src = src_dir.join(src);
+-            if added_sources.insert(src.clone()) {
++            if !link_against_prebuilt_rt && added_sources.insert(src.clone()) {
+                 cfg.file(&src);
+                 println!("cargo:rerun-if-changed={}", src.display());
+             }
+             println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
+         }
+ 
+-        cfg.compile("libcompiler-rt.a");
++        if link_against_prebuilt_rt {
++            let rt_builtins_ext = PathBuf::from(env::var_os("LLVM_COMPILER_RT_LIB").unwrap());
++            if !rt_builtins_ext.exists() {
++                panic!(
++                    "LLVM_COMPILER_RT_LIB={} does not exist",
++                    rt_builtins_ext.display()
++                );
++            }
++            if let Some(dir) = rt_builtins_ext.parent() {
++                println!("cargo::rustc-link-search=native={}", dir.display());
++            }
++            if let Some(lib) = rt_builtins_ext.file_name() {
++                println!(
++                    "cargo::rustc-link-lib=static:+verbatim={}",
++                    lib.to_str().unwrap()
++                );
++            }
++        } else {
++            cfg.compile("libcompiler-rt.a");
++        }
+     }
+ 
+-    fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc::Build) {
++    fn build_aarch64_out_of_line_atomics_libraries(
++        builtins_dir: &Path,
++        cfg: &mut cc::Build,
++        link_against_prebuilt_rt: bool,
++    ) {
+         let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
+         let outlined_atomics_file = builtins_dir.join("aarch64").join("lse.S");
+-        println!("cargo:rerun-if-changed={}", outlined_atomics_file.display());
++        if !link_against_prebuilt_rt {
++            println!("cargo:rerun-if-changed={}", outlined_atomics_file.display());
++        }
+ 
+         cfg.include(&builtins_dir);
+ 
+@@ -617,6 +650,13 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
+                 for (model_number, model_name) in
+                     &[(1, "relax"), (2, "acq"), (3, "rel"), (4, "acq_rel")]
+                 {
++                    let sym = format!("__aarch64_{}{}_{}", instruction_type, size, model_name);
++                    println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
++
++                    if link_against_prebuilt_rt {
++                        continue;
++                    }
++
+                     // The original compiler-rt build system compiles the same
+                     // source file multiple times with different compiler
+                     // options. Here we do something slightly different: we
+@@ -640,9 +680,6 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
+                     .unwrap();
+                     drop(file);
+                     cfg.file(path);
+-
+-                    let sym = format!("__aarch64_{}{}_{}", instruction_type, size, model_name);
+-                    println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
+                 }
+             }
+         }
+diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
+index 4ef70dd9b97..e9393f7dcaa 100644
+--- a/src/bootstrap/src/core/build_steps/compile.rs
++++ b/src/bootstrap/src/core/build_steps/compile.rs
+@@ -578,25 +578,31 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
+     // `compiler-builtins` crate is enabled and it's configured to learn where
+     // `compiler-rt` is located.
+     let compiler_builtins_c_feature = if builder.config.optimized_compiler_builtins(target) {
+-        // NOTE: this interacts strangely with `llvm-has-rust-patches`. In that case, we enforce `submodules = false`, so this is a no-op.
+-        // But, the user could still decide to manually use an in-tree submodule.
+-        //
+-        // NOTE: if we're using system llvm, we'll end up building a version of `compiler-rt` that doesn't match the LLVM we're linking to.
+-        // That's probably ok? At least, the difference wasn't enforced before. There's a comment in
+-        // the compiler_builtins build script that makes me nervous, though:
+-        // https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579
+-        builder.require_submodule(
+-            "src/llvm-project",
+-            Some(
+-                "The `build.optimized-compiler-builtins` config option \
+-                 requires `compiler-rt` sources from LLVM.",
+-            ),
+-        );
+-        let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
+-        assert!(compiler_builtins_root.exists());
+-        // The path to `compiler-rt` is also used by `profiler_builtins` (above),
+-        // so if you're changing something here please also change that as appropriate.
+-        cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
++        if let Some(path) = builder.config.optimized_compiler_builtins_path(target) {
++            cargo.env("LLVM_COMPILER_RT_LIB", path);
++        } else {
++            // NOTE: this interacts strangely with `llvm-has-rust-patches`. In that case, we enforce
++            // `submodules = false`, so this is a no-op. But, the user could still decide to
++            //  manually use an in-tree submodule.
++            //
++            // NOTE: if we're using system llvm, we'll end up building a version of `compiler-rt`
++            // that doesn't match the LLVM we're linking to. That's probably ok? At least, the
++            // difference wasn't enforced before. There's a comment in the compiler_builtins build
++            // script that makes me nervous, though:
++            // https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579
++            builder.require_submodule(
++                "src/llvm-project",
++                Some(
++                    "The `build.optimized-compiler-builtins` config option \
++                     requires `compiler-rt` sources from LLVM.",
++                ),
++            );
++            let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
++            assert!(compiler_builtins_root.exists());
++            // The path to `compiler-rt` is also used by `profiler_builtins` (above),
++            // so if you're changing something here please also change that as appropriate.
++            cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
++        }
+         " compiler-builtins-c"
+     } else {
+         ""
+diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
+index d3393afcae0..5834be7643c 100644
+--- a/src/bootstrap/src/core/config/config.rs
++++ b/src/bootstrap/src/core/config/config.rs
+@@ -1728,10 +1728,18 @@ pub fn rpath_enabled(&self, target: TargetSelection) -> bool {
+     pub fn optimized_compiler_builtins(&self, target: TargetSelection) -> bool {
+         self.target_config
+             .get(&target)
+-            .and_then(|t| t.optimized_compiler_builtins)
++            .and_then(|t| t.optimized_compiler_builtins.as_ref())
++            .map(StringOrBool::is_string_or_true)
+             .unwrap_or(self.optimized_compiler_builtins)
+     }
+ 
++    pub fn optimized_compiler_builtins_path(&self, target: TargetSelection) -> Option<&str> {
++        match self.target_config.get(&target)?.optimized_compiler_builtins.as_ref()? {
++            StringOrBool::String(s) => Some(s),
++            StringOrBool::Bool(_) => None,
++        }
++    }
++
+     pub fn llvm_enabled(&self, target: TargetSelection) -> bool {
+         self.codegen_backends(target).contains(&"llvm".to_owned())
+     }
+diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
+index 50eba12aba7..c32e4384cf6 100644
+--- a/src/bootstrap/src/core/config/tests.rs
++++ b/src/bootstrap/src/core/config/tests.rs
+@@ -17,7 +17,7 @@
+ use crate::core::build_steps::llvm;
+ use crate::core::build_steps::llvm::LLVM_INVALIDATION_PATHS;
+ use crate::core::config::toml::TomlConfig;
+-use crate::core::config::{LldMode, Target, TargetSelection};
++use crate::core::config::{LldMode, StringOrBool, Target, TargetSelection};
+ use crate::utils::tests::git::git_test;
+ 
+ pub(crate) fn parse(config: &str) -> Config {
+@@ -212,7 +212,7 @@ fn override_toml() {
+     let darwin = TargetSelection::from_user("aarch64-apple-darwin");
+     let darwin_values = Target {
+         runner: Some("apple".into()),
+-        optimized_compiler_builtins: Some(false),
++        optimized_compiler_builtins: Some(StringOrBool::Bool(false)),
+         ..Default::default()
+     };
+     assert_eq!(
+diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
+index 41a4a815d31..022d042d271 100644
+--- a/src/bootstrap/src/core/config/toml/target.rs
++++ b/src/bootstrap/src/core/config/toml/target.rs
+@@ -45,7 +45,7 @@ struct TomlTarget {
+         no_std: Option = "no-std",
+         codegen_backends: Option> = "codegen-backends",
+         runner: Option = "runner",
+-        optimized_compiler_builtins: Option = "optimized-compiler-builtins",
++        optimized_compiler_builtins: Option = "optimized-compiler-builtins",
+         jemalloc: Option = "jemalloc",
+         self_contained: Option = "self-contained",
+     }
+@@ -78,7 +78,7 @@ pub struct Target {
+     pub runner: Option,
+     pub no_std: bool,
+     pub codegen_backends: Option>,
+-    pub optimized_compiler_builtins: Option,
++    pub optimized_compiler_builtins: Option,
+     pub jemalloc: Option,
+     pub self_contained: bool,
+ }
+-- 
+2.50.1
+
diff --git a/rust.spec b/rust.spec
index c62fee7..fecaa98 100644
--- a/rust.spec
+++ b/rust.spec
@@ -146,6 +146,9 @@ Patch7:         0001-only-copy-rustlib-into-stage0-sysroot.patch
 # PR #143752, fixed upstream.
 Patch8:         0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
 
+# Support optimized-compiler-builtins via linking against compiler-rt builtins.
+Patch9:         0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -698,6 +701,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %endif
 %patch -P7 -p1
 %patch -P8 -p1
+%patch -P9 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -851,11 +855,19 @@ end}
 %endif
 %endif
 
-# Find the compiler-rt library for the Rust profiler_builtins crate.
+# Find the compiler-rt library for the Rust profiler_builtins and optimized-builtins crates.
 %define clang_lib %{expand:%%clang%{?llvm_compat_version}_resource_dir}/lib
 %define profiler %{clang_lib}/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
 test -r "%{profiler}"
 
+# llvm < 21 does not provide a builtins library for s390x.
+%ifnarch s390x
+%define optimized_builtins %{clang_lib}/%{_arch}-redhat-linux-gnu/libclang_rt.builtins.a
+%else
+%define optimized_builtins false
+%endif
+
+
 %configure --disable-option-checking \
   --docdir=%{_pkgdocdir} \
   --libdir=%{common_libdir} \
@@ -866,6 +878,7 @@ test -r "%{profiler}"
   --set target.%{rust_triple}.ar=%{__ar} \
   --set target.%{rust_triple}.ranlib=%{__ranlib} \
   --set target.%{rust_triple}.profiler="%{profiler}" \
+  --set target.%{rust_triple}.optimized-compiler-builtins="%{optimized_builtins}" \
   %{?mingw_target_config} \
   %{?wasm_target_config} \
   --python=%{__python3} \

From 5337f42bfea42626a93c82982118a3095356cf36 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Fri, 15 Aug 2025 14:21:43 -0700
Subject: [PATCH 79/86] Re-enable PGO for ppc64le

---
 ...ure-stack-in-InvocationCollector-vis.patch | 49 +++++++++++++++++++
 rust.spec                                     | 11 +++--
 2 files changed, 55 insertions(+), 5 deletions(-)
 create mode 100644 0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch

diff --git a/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch b/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
new file mode 100644
index 0000000..264a646
--- /dev/null
+++ b/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
@@ -0,0 +1,49 @@
+From aa701b52fb9b24b7540d49e76e0376f78cc9fdfc Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Thu, 14 Aug 2025 16:02:31 -0700
+Subject: [PATCH] rustc_expand: ensure stack in
+ `InvocationCollector::visit_expr`
+
+In Fedora, when we built rustc with PGO on ppc64le, we started failing
+the test `issue-74564-if-expr-stack-overflow.rs`. This could also be
+reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so
+it's probably just unlucky that ppc64le PGO created a large stack frame
+somewhere in this recursion path. Adding an `ensure_sufficient_stack`
+solves the stack overflow.
+
+Historically, that test and its fix were added in rust-lang/rust#74708,
+which was also an `ensure_sufficient_stack` in this area of code at the
+time. However, the refactor in rust-lang/rust#92573 basically left that
+to the general `MutVisitor`, and then rust-lang/rust#142240 removed even
+that ensure call. It may be luck that our tier-1 tested targets did not
+regress the original issue across those refactors.
+
+(cherry picked from commit f68bcb376da2a34b6809ba76dad20ca400bd9966)
+---
+ compiler/rustc_expand/src/expand.rs | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
+index 0474413e7626..49c9ca1f0508 100644
+--- a/compiler/rustc_expand/src/expand.rs
++++ b/compiler/rustc_expand/src/expand.rs
+@@ -14,6 +14,7 @@
+ };
+ use rustc_ast_pretty::pprust;
+ use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
++use rustc_data_structures::stack::ensure_sufficient_stack;
+ use rustc_errors::PResult;
+ use rustc_feature::Features;
+ use rustc_parse::parser::{
+@@ -2428,7 +2429,7 @@ fn visit_expr(&mut self, node: &mut ast::Expr) {
+         if let Some(attr) = node.attrs.first() {
+             self.cfg().maybe_emit_expr_attr_err(attr);
+         }
+-        self.visit_node(node)
++        ensure_sufficient_stack(|| self.visit_node(node))
+     }
+ 
+     fn visit_method_receiver_expr(&mut self, node: &mut ast::Expr) {
+-- 
+2.50.1
+
diff --git a/rust.spec b/rust.spec
index fecaa98..4a92483 100644
--- a/rust.spec
+++ b/rust.spec
@@ -149,6 +149,10 @@ Patch8:         0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
 # Support optimized-compiler-builtins via linking against compiler-rt builtins.
 Patch9:         0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
 
+# Fix a compiler stack overflow on ppc64le with PGO
+# https://github.com/rust-lang/rust/pull/145410
+Patch10:        0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -702,6 +706,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P7 -p1
 %patch -P8 -p1
 %patch -P9 -p1
+%patch -P10 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -909,11 +914,7 @@ test -r "%{profiler}"
 
 %global __x %{__python3} ./x.py
 
-# - rustc is exibiting signs of miscompilation on pwr9+pgo (root cause TBD),
-#   so we're skipping pgo on rhel ppc64le for now. See RHEL-88598 for more.
-# - Since 1.87, Fedora started getting ppc64le segfaults, and this also seems
-#   to be avoidable by skipping pgo. See bz2367960 for examples of that.
-%if %{with rustc_pgo} && !( "%{_target_cpu}" == "ppc64le" )
+%if %{with rustc_pgo}
 # Build the compiler with profile instrumentation
 %define profraw $PWD/build/profiles
 %define profdata $PWD/build/rustc.profdata

From dfeceeebed1f2a263214e4865ed974a251ae7ad0 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 18 Sep 2025 09:27:17 -0700
Subject: [PATCH 80/86] Update to Rust 1.90.0

---
 .gitignore                                    |  1 +
 ...prebuilt-optimized-compiler-rt-built.patch | 38 +++++++-------
 ...ic-if-WASI_SDK_PATH-is-not-set-when-.patch | 39 --------------
 ...llow-disabling-target-self-contained.patch | 31 +++++------
 ...ure-stack-in-InvocationCollector-vis.patch | 10 ++--
 ...xternal-library-path-for-wasm32-wasi.patch | 51 +++++++++++--------
 rust.spec                                     | 30 +++++------
 rustc-1.88.0-unbundle-sqlite.patch            | 23 ---------
 rustc-1.89.0-disable-libssh2.patch            | 42 ---------------
 rustc-1.90.0-disable-libssh2.patch            | 44 ++++++++++++++++
 rustc-1.90.0-unbundle-sqlite.patch            | 23 +++++++++
 sources                                       |  2 +-
 12 files changed, 152 insertions(+), 182 deletions(-)
 delete mode 100644 0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
 delete mode 100644 rustc-1.88.0-unbundle-sqlite.patch
 delete mode 100644 rustc-1.89.0-disable-libssh2.patch
 create mode 100644 rustc-1.90.0-disable-libssh2.patch
 create mode 100644 rustc-1.90.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index 08bc2dd..b758c03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -456,3 +456,4 @@
 /rustc-1.88.0-src.tar.xz
 /wasi-libc-wasi-sdk-27.tar.gz
 /rustc-1.89.0-src.tar.xz
+/rustc-1.90.0-src.tar.xz
diff --git a/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch b/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
index 212c7c8..3071556 100644
--- a/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
+++ b/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
@@ -1,4 +1,4 @@
-From b5cdd50a21e27bde3fbbff5fe67df79b88fadb05 Mon Sep 17 00:00:00 2001
+From 4815c3cd733812bec777970ff4b1e73c2fcad1a6 Mon Sep 17 00:00:00 2001
 From: Paul Murphy 
 Date: Tue, 24 Jun 2025 11:07:54 -0500
 Subject: [PATCH] Allow linking a prebuilt optimized compiler-rt builtins
@@ -7,6 +7,8 @@ Subject: [PATCH] Allow linking a prebuilt optimized compiler-rt builtins
 Extend the .optimized-compiler-builtins bootstrap option to accept a
 path to a prebuilt compiler-rt builtins library, and update compiler-builtins
 to enable optimized builtins without building compiler-rt builtins.
+
+(cherry picked from commit b382478bba7b8f75c73673c239fa86a29db66223)
 ---
  bootstrap.example.toml                        |  4 +-
  .../compiler-builtins/build.rs                | 55 ++++++++++++++++---
@@ -17,10 +19,10 @@ to enable optimized builtins without building compiler-rt builtins.
  6 files changed, 87 insertions(+), 34 deletions(-)
 
 diff --git a/bootstrap.example.toml b/bootstrap.example.toml
-index 916bae8dc7d..cb80c9dd31e 100644
+index 82041167b444..a11aec1b60e5 100644
 --- a/bootstrap.example.toml
 +++ b/bootstrap.example.toml
-@@ -967,7 +967,9 @@
+@@ -1038,7 +1038,9 @@
  # sources are available.
  #
  # Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
@@ -32,10 +34,10 @@ index 916bae8dc7d..cb80c9dd31e 100644
  
  # Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
 diff --git a/library/compiler-builtins/compiler-builtins/build.rs b/library/compiler-builtins/compiler-builtins/build.rs
-index 018899faf1d..3ad888ed26a 100644
+index 8f51c12b535d..b8de1789ebc7 100644
 --- a/library/compiler-builtins/compiler-builtins/build.rs
 +++ b/library/compiler-builtins/compiler-builtins/build.rs
-@@ -548,12 +548,20 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+@@ -547,12 +547,20 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
              sources.extend(&[("__emutls_get_address", "emutls.c")]);
          }
  
@@ -56,7 +58,7 @@ index 018899faf1d..3ad888ed26a 100644
              None => {
                  panic!(
                      "RUST_COMPILER_RT_ROOT is not set. You may need to run \
-@@ -561,7 +569,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+@@ -560,7 +568,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
                  );
              }
          };
@@ -65,7 +67,7 @@ index 018899faf1d..3ad888ed26a 100644
              panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
          }
  
-@@ -577,7 +585,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+@@ -576,7 +584,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
          let src_dir = root.join("lib/builtins");
          if target.arch == "aarch64" && target.env != "msvc" && target.os != "uefi" {
              // See below for why we're building these as separate libraries.
@@ -74,7 +76,7 @@ index 018899faf1d..3ad888ed26a 100644
  
              // Some run-time CPU feature detection is necessary, as well.
              let cpu_model_src = if src_dir.join("cpu_model.c").exists() {
-@@ -591,20 +599,45 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
+@@ -590,20 +598,45 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
          let mut added_sources = HashSet::new();
          for (sym, src) in sources.map.iter() {
              let src = src_dir.join(src);
@@ -124,7 +126,7 @@ index 018899faf1d..3ad888ed26a 100644
  
          cfg.include(&builtins_dir);
  
-@@ -617,6 +650,13 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
+@@ -616,6 +649,13 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
                  for (model_number, model_name) in
                      &[(1, "relax"), (2, "acq"), (3, "rel"), (4, "acq_rel")]
                  {
@@ -138,7 +140,7 @@ index 018899faf1d..3ad888ed26a 100644
                      // The original compiler-rt build system compiles the same
                      // source file multiple times with different compiler
                      // options. Here we do something slightly different: we
-@@ -640,9 +680,6 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
+@@ -639,9 +679,6 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
                      .unwrap();
                      drop(file);
                      cfg.file(path);
@@ -149,10 +151,10 @@ index 018899faf1d..3ad888ed26a 100644
              }
          }
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 4ef70dd9b97..e9393f7dcaa 100644
+index 7a5533346adf..39c9db3d6c35 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -578,25 +578,31 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
+@@ -572,25 +572,31 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
      // `compiler-builtins` crate is enabled and it's configured to learn where
      // `compiler-rt` is located.
      let compiler_builtins_c_feature = if builder.config.optimized_compiler_builtins(target) {
@@ -204,10 +206,10 @@ index 4ef70dd9b97..e9393f7dcaa 100644
      } else {
          ""
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index d3393afcae0..5834be7643c 100644
+index 6055876c4757..588c3489f898 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -1728,10 +1728,18 @@ pub fn rpath_enabled(&self, target: TargetSelection) -> bool {
+@@ -1769,10 +1769,18 @@ pub fn rpath_enabled(&self, target: TargetSelection) -> bool {
      pub fn optimized_compiler_builtins(&self, target: TargetSelection) -> bool {
          self.target_config
              .get(&target)
@@ -225,10 +227,10 @@ index d3393afcae0..5834be7643c 100644
 +    }
 +
      pub fn llvm_enabled(&self, target: TargetSelection) -> bool {
-         self.codegen_backends(target).contains(&"llvm".to_owned())
+         self.codegen_backends(target).contains(&CodegenBackendKind::Llvm)
      }
 diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
-index 50eba12aba7..c32e4384cf6 100644
+index 50eba12aba74..c32e4384cf62 100644
 --- a/src/bootstrap/src/core/config/tests.rs
 +++ b/src/bootstrap/src/core/config/tests.rs
 @@ -17,7 +17,7 @@
@@ -250,7 +252,7 @@ index 50eba12aba7..c32e4384cf6 100644
      };
      assert_eq!(
 diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
-index 41a4a815d31..022d042d271 100644
+index 69afa8af3419..5ddb8c50c146 100644
 --- a/src/bootstrap/src/core/config/toml/target.rs
 +++ b/src/bootstrap/src/core/config/toml/target.rs
 @@ -45,7 +45,7 @@ struct TomlTarget {
@@ -265,7 +267,7 @@ index 41a4a815d31..022d042d271 100644
 @@ -78,7 +78,7 @@ pub struct Target {
      pub runner: Option,
      pub no_std: bool,
-     pub codegen_backends: Option>,
+     pub codegen_backends: Option>,
 -    pub optimized_compiler_builtins: Option,
 +    pub optimized_compiler_builtins: Option,
      pub jemalloc: Option,
diff --git a/0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch b/0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
deleted file mode 100644
index 4864900..0000000
--- a/0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 9bdd3b0ee6a6fd5914fea0f56f3b754410733e53 Mon Sep 17 00:00:00 2001
-From: Paul Murphy 
-Date: Thu, 10 Jul 2025 10:58:58 -0500
-Subject: [PATCH] Don't always panic if WASI_SDK_PATH is not set when detecting
- compilers
-
-They are not always needed when building std, as is the case when
-packaging on Fedora. Panic if building from CI, but warn otherwise.
----
- src/bootstrap/src/utils/cc_detect.rs | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
-index dcafeb80f90..2569f95e3ef 100644
---- a/src/bootstrap/src/utils/cc_detect.rs
-+++ b/src/bootstrap/src/utils/cc_detect.rs
-@@ -221,10 +221,15 @@ fn default_compiler(
-         }
- 
-         t if t.contains("-wasi") => {
--            let root = build
--                .wasi_sdk_path
--                .as_ref()
--                .expect("WASI_SDK_PATH mut be configured for a -wasi target");
-+            let root = if let Some(path) = build.wasi_sdk_path.as_ref() {
-+                path
-+            } else {
-+                if build.config.is_running_on_ci {
-+                    panic!("ERROR: WASI_SDK_PATH must be configured for a -wasi target on CI");
-+                }
-+                println!("WARNING: WASI_SDK_PATH not set, using default cc/cxx compiler");
-+                return None;
-+            };
-             let compiler = match compiler {
-                 Language::C => format!("{t}-clang"),
-                 Language::CPlusPlus => format!("{t}-clang++"),
--- 
-2.49.0
-
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index c00d2b9..5949461 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,6 +1,6 @@
-From 6af71d8ff0932bc14102cd9cbfbca16354c5cd2a Mon Sep 17 00:00:00 2001
-From: Jesus Checa Hidalgo 
-Date: Mon, 7 Apr 2025 16:59:10 +0200
+From b51b8d1854e7e2e7b7b431da26adad6b3677f6d2 Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Mon, 18 Aug 2025 17:11:07 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
 
 ---
@@ -11,26 +11,23 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
  4 files changed, 22 insertions(+)
 
 diff --git a/bootstrap.example.toml b/bootstrap.example.toml
-index 19cf360b0fb..916bae8dc7d 100644
+index 31966af33012..82041167b444 100644
 --- a/bootstrap.example.toml
 +++ b/bootstrap.example.toml
-@@ -974,6 +974,11 @@
+@@ -1044,3 +1044,8 @@
+ # Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
  # This overrides the global `rust.jemalloc` option. See that option for more info.
  #jemalloc = rust.jemalloc (bool)
- 
++
 +# Copy libc and CRT objects into the target lib/self-contained/ directory.
 +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
 +# targets may ignore this setting if they have nothing to be contained.
 +#self-contained =  (bool)
-+
- # =============================================================================
- # Distribution options
- #
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index f6efb23e8d8..4d0ae54e1ef 100644
+index 59541bf12def..7a5533346adf 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -374,6 +374,10 @@ fn copy_self_contained_objects(
+@@ -370,6 +370,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -42,7 +39,7 @@ index f6efb23e8d8..4d0ae54e1ef 100644
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
 diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
-index b9f6780ca3f..41a4a815d31 100644
+index 9dedadff3a19..69afa8af3419 100644
 --- a/src/bootstrap/src/core/config/toml/target.rs
 +++ b/src/bootstrap/src/core/config/toml/target.rs
 @@ -47,6 +47,7 @@ struct TomlTarget {
@@ -54,7 +51,7 @@ index b9f6780ca3f..41a4a815d31 100644
  }
  
 @@ -79,6 +80,7 @@ pub struct Target {
-     pub codegen_backends: Option>,
+     pub codegen_backends: Option>,
      pub optimized_compiler_builtins: Option,
      pub jemalloc: Option,
 +    pub self_contained: bool,
@@ -82,10 +79,10 @@ index b9f6780ca3f..41a4a815d31 100644
                  target.cxx = cfg.cxx.map(PathBuf::from);
                  target.ar = cfg.ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index f44fe4548a1..8ce9f09efb1 100644
+index 011b52df97bb..77b2d9205a43 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1331,6 +1331,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1423,6 +1423,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -98,5 +95,5 @@ index f44fe4548a1..8ce9f09efb1 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.49.0
+2.50.1
 
diff --git a/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch b/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
index 264a646..e847c1d 100644
--- a/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
+++ b/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
@@ -1,4 +1,4 @@
-From aa701b52fb9b24b7540d49e76e0376f78cc9fdfc Mon Sep 17 00:00:00 2001
+From 8ff00974436f25585850e3029d8e5a3e2a8340da Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Thu, 14 Aug 2025 16:02:31 -0700
 Subject: [PATCH] rustc_expand: ensure stack in
@@ -24,18 +24,18 @@ regress the original issue across those refactors.
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
-index 0474413e7626..49c9ca1f0508 100644
+index f02aa6c120f9..0cfda7c4739f 100644
 --- a/compiler/rustc_expand/src/expand.rs
 +++ b/compiler/rustc_expand/src/expand.rs
-@@ -14,6 +14,7 @@
- };
+@@ -15,6 +15,7 @@
  use rustc_ast_pretty::pprust;
+ use rustc_attr_parsing::{EvalConfigResult, ShouldEmit};
  use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
 +use rustc_data_structures::stack::ensure_sufficient_stack;
  use rustc_errors::PResult;
  use rustc_feature::Features;
  use rustc_parse::parser::{
-@@ -2428,7 +2429,7 @@ fn visit_expr(&mut self, node: &mut ast::Expr) {
+@@ -2439,7 +2440,7 @@ fn visit_expr(&mut self, node: &mut ast::Expr) {
          if let Some(attr) = node.attrs.first() {
              self.cfg().maybe_emit_expr_attr_err(attr);
          }
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 79f06ad..4921bb9 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,17 +1,17 @@
-From 0539027ae7a60cd6ddf2190450240d35a147599d Mon Sep 17 00:00:00 2001
-From: Jesus Checa Hidalgo 
-Date: Mon, 7 Apr 2025 17:22:56 +0200
+From 3730abcf2b86d650da97a11190af8dcbfeae311a Mon Sep 17 00:00:00 2001
+From: Josh Stone 
+Date: Mon, 18 Aug 2025 17:13:28 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
 
 ---
  compiler/rustc_codegen_ssa/src/back/link.rs            | 10 ++++++++++
- compiler/rustc_target/src/spec/json.rs                 |  2 ++
+ compiler/rustc_target/src/spec/json.rs                 |  4 ++++
  compiler/rustc_target/src/spec/mod.rs                  |  2 ++
  .../rustc_target/src/spec/targets/wasm32_wasip1.rs     |  7 ++++---
- 4 files changed, 18 insertions(+), 3 deletions(-)
+ 4 files changed, 20 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index 8882ba359b7..914e5c1398f 100644
+index 162fbf3d6e24..2acfd6dd96b2 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
 @@ -1548,6 +1548,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
@@ -39,18 +39,18 @@ index 8882ba359b7..914e5c1398f 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
-index 6c716f87125..187cc93b2d3 100644
+index d27c1929aef7..b995896450e0 100644
 --- a/compiler/rustc_target/src/spec/json.rs
 +++ b/compiler/rustc_target/src/spec/json.rs
-@@ -572,6 +572,7 @@ macro_rules! key {
-         key!(linker_is_gnu_json = "linker-is-gnu", bool);
-         key!(pre_link_objects = "pre-link-objects", link_objects);
-         key!(post_link_objects = "post-link-objects", link_objects);
-+        key!(external_lib_path, optional);
-         key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
-         key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
-         // Deserializes the backwards-compatible variants of `-Clink-self-contained`
-@@ -771,6 +772,7 @@ macro_rules! target_option_val {
+@@ -84,6 +84,7 @@ macro_rules! forward_opt {
+         forward!(linker_is_gnu_json);
+         forward!(pre_link_objects);
+         forward!(post_link_objects);
++        forward_opt!(external_lib_path);
+         forward!(pre_link_objects_self_contained);
+         forward!(post_link_objects_self_contained);
+ 
+@@ -306,6 +307,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -58,11 +58,20 @@ index 6c716f87125..187cc93b2d3 100644
          target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback");
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
+@@ -490,6 +492,8 @@ struct TargetSpecJson {
+     pre_link_objects: Option,
+     #[serde(rename = "post-link-objects")]
+     post_link_objects: Option,
++    #[serde(rename = "external-lib-path")]
++    external_lib_path: Option>,
+     #[serde(rename = "pre-link-objects-fallback")]
+     pre_link_objects_self_contained: Option,
+     #[serde(rename = "post-link-objects-fallback")]
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 7a49f004072..a693fd74887 100644
+index 033590e01a67..15a012639472 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2293,6 +2293,7 @@ pub struct TargetOptions {
+@@ -2439,6 +2439,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -70,7 +79,7 @@ index 7a49f004072..a693fd74887 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2813,6 +2814,7 @@ fn default() -> TargetOptions {
+@@ -2964,6 +2965,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -79,7 +88,7 @@ index 7a49f004072..a693fd74887 100644
              post_link_objects_self_contained: Default::default(),
              link_self_contained: LinkSelfContainedDefault::False,
 diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
-index 26add451ed2..3eaf050e682 100644
+index 26add451ed25..3eaf050e6823 100644
 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
 @@ -21,11 +21,12 @@ pub(crate) fn target() -> Target {
@@ -99,5 +108,5 @@ index 26add451ed2..3eaf050e682 100644
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.49.0
+2.50.1
 
diff --git a/rust.spec b/rust.spec
index 4a92483..fb685e2 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.89.0
+Version:        1.90.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0
 # e.g. 1.89.0 wants rustc: 1.88.0-2025-06-26
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.88.0
-%global bootstrap_channel 1.88.0
-%global bootstrap_date 2025-06-26
+%global bootstrap_version 1.89.0
+%global bootstrap_channel 1.89.0
+%global bootstrap_date 2025-08-07
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -45,7 +45,7 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient. Rust currently requires LLVM 19.0+.
 # See src/bootstrap/src/core/build_steps/llvm.rs, fn check_llvm_version
 %global min_llvm_version 19.0.0
-%global bundled_llvm_version 20.1.7
+%global bundled_llvm_version 20.1.8
 #global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -54,7 +54,7 @@ ExclusiveArch:  %{rust_arches}
 # This needs to be consistent with the bindings in vendor/libgit2-sys.
 %global min_libgit2_version 1.9.0
 %global next_libgit2_version 1.10.0~
-%global bundled_libgit2_version 1.9.0
+%global bundled_libgit2_version 1.9.1
 %if 0%{?fedora} >= 41
 %bcond_with bundled_libgit2
 %else
@@ -72,7 +72,7 @@ ExclusiveArch:  %{rust_arches}
 
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
-%global bundled_sqlite3_version 3.49.1
+%global bundled_sqlite3_version 3.49.2
 %if 0%{?rhel} && 0%{?rhel} < 10
 %bcond_without bundled_sqlite3
 %else
@@ -138,20 +138,18 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.88.0-unbundle-sqlite.patch
+Patch6:         rustc-1.90.0-unbundle-sqlite.patch
 
 # stage0 tries to copy all of /usr/lib, sometimes unsuccessfully, see #143735
 Patch7:         0001-only-copy-rustlib-into-stage0-sysroot.patch
 
-# PR #143752, fixed upstream.
-Patch8:         0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch
-
 # Support optimized-compiler-builtins via linking against compiler-rt builtins.
-Patch9:         0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
+# https://github.com/rust-lang/rust/pull/143689
+Patch8:         0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
 
 # Fix a compiler stack overflow on ppc64le with PGO
 # https://github.com/rust-lang/rust/pull/145410
-Patch10:        0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
+Patch9:        0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
 
 ### RHEL-specific patches below ###
 
@@ -162,7 +160,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.89.0-disable-libssh2.patch
+Patch100:       rustc-1.90.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
@@ -706,7 +704,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P7 -p1
 %patch -P8 -p1
 %patch -P9 -p1
-%patch -P10 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -866,8 +863,9 @@ end}
 test -r "%{profiler}"
 
 # llvm < 21 does not provide a builtins library for s390x.
-%ifnarch s390x
+%if "%{_arch}" != "s390x" || 0%{?clang_major_version} >= 21
 %define optimized_builtins %{clang_lib}/%{_arch}-redhat-linux-gnu/libclang_rt.builtins.a
+test -r "%{optimized_builtins}"
 %else
 %define optimized_builtins false
 %endif
diff --git a/rustc-1.88.0-unbundle-sqlite.patch b/rustc-1.88.0-unbundle-sqlite.patch
deleted file mode 100644
index 11c1e79..0000000
--- a/rustc-1.88.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-06-13 01:10:18.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-06-13 15:39:38.597882622 -0700
-@@ -2573,7 +2573,6 @@ version = "0.32.0"
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "fbb8270bb4060bd76c6e96f20c52d80620f1d82a3470885694e41e0f81ef6fe7"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-06-13 01:10:18.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-06-13 15:39:34.583102112 -0700
-@@ -80,7 +80,7 @@ proptest = "1.6.0"
- pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
- rand = "0.9.0"
- regex = "1.11.1"
--rusqlite = { version = "0.34.0", features = ["bundled"] }
-+rusqlite = { version = "0.34.0", features = [] }
- rustc-hash = "2.1.1"
- rustc-stable-hash = "0.1.2"
- rustfix = { version = "0.9.0", path = "crates/rustfix" }
diff --git a/rustc-1.89.0-disable-libssh2.patch b/rustc-1.89.0-disable-libssh2.patch
deleted file mode 100644
index 52690b2..0000000
--- a/rustc-1.89.0-disable-libssh2.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-07-14 11:57:13.773604132 -0500
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-07-14 11:58:13.305337361 -0500
-@@ -2523,7 +2523,6 @@
- dependencies = [
-  "cc",
-  "libc",
-- "libssh2-sys",
-  "libz-sys",
-  "openssl-sys",
-  "pkg-config",
-@@ -2569,20 +2568,6 @@
-  "pkg-config",
-  "vcpkg",
- ]
--
--[[package]]
--name = "libssh2-sys"
--version = "0.3.1"
--source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9"
--dependencies = [
-- "cc",
-- "libc",
-- "libz-sys",
-- "openssl-sys",
-- "pkg-config",
-- "vcpkg",
--]
- 
- [[package]]
- name = "libz-rs-sys"
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-07-14 11:57:13.773954247 -0500
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-07-14 11:58:13.305708130 -0500
-@@ -46,7 +46,7 @@
- curl-sys = "0.4.79"
- filetime = "0.2.25"
- flate2 = { version = "1.1.1", default-features = false, features = ["zlib-rs"] }
--git2 = "0.20.0"
-+git2 = { version = "0.20.0", default-features = false, features = ["https"] }
- git2-curl = "0.21.0"
- # When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail.
- gix = { version = "0.72.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
diff --git a/rustc-1.90.0-disable-libssh2.patch b/rustc-1.90.0-disable-libssh2.patch
new file mode 100644
index 0000000..23dc6d8
--- /dev/null
+++ b/rustc-1.90.0-disable-libssh2.patch
@@ -0,0 +1,44 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-08-16 15:47:14.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-08-18 17:31:39.554771554 -0700
+@@ -2800,7 +2800,6 @@ checksum = "1c42fe03df2bd3c53a3a9c7317ad
+ dependencies = [
+  "cc",
+  "libc",
+- "libssh2-sys",
+  "libz-sys",
+  "openssl-sys",
+  "pkg-config",
+@@ -2847,20 +2846,6 @@ dependencies = [
+  "pkg-config",
+  "vcpkg",
+ ]
+-
+-[[package]]
+-name = "libssh2-sys"
+-version = "0.3.1"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9"
+-dependencies = [
+- "cc",
+- "libc",
+- "libz-sys",
+- "openssl-sys",
+- "pkg-config",
+- "vcpkg",
+-]
+ 
+ [[package]]
+ name = "libz-rs-sys"
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-08-16 15:47:14.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-08-18 17:33:02.401743230 -0700
+@@ -46,7 +46,7 @@ curl = "0.4.48"
+ curl-sys = "0.4.82"
+ filetime = "0.2.25"
+ flate2 = { version = "1.1.2", default-features = false, features = ["zlib-rs"] }
+-git2 = "0.20.2"
++git2 = { version = "0.20.2", default-features = false, features = ["https"] }
+ git2-curl = "0.21.0"
+ # When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail.
+ gix = { version = "0.73.0", default-features = false, features = ["progress-tree", "parallel", "dirwalk", "status"] }
diff --git a/rustc-1.90.0-unbundle-sqlite.patch b/rustc-1.90.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..645e95c
--- /dev/null
+++ b/rustc-1.90.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-08-16 15:47:14.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-08-18 17:17:50.150641231 -0700
+@@ -2843,7 +2843,6 @@ version = "0.34.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "91632f3b4fb6bd1d72aa3d78f41ffecfcf2b1a6648d8c241dbe7dbfaf4875e15"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-08-16 15:47:14.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-08-18 17:17:46.729082558 -0700
+@@ -81,7 +81,7 @@ proptest = "1.7.0"
+ pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
+ rand = "0.9.1"
+ regex = "1.11.1"
+-rusqlite = { version = "0.36.0", features = ["bundled"] }
++rusqlite = { version = "0.36.0", features = [] }
+ rustc-hash = "2.1.1"
+ rustc-stable-hash = "0.1.2"
+ rustfix = { version = "0.9.2", path = "crates/rustfix" }
diff --git a/sources b/sources
index 0a7d170..9588449 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
+SHA512 (rustc-1.90.0-src.tar.xz) = fb0798b4c7450754db2fcbb641202909d209c6db2d9181d7df7282217b8320dc52f5e9853de9d7bdb79177f1f920389450cab07674dea5fb5501eaab5816662a
 SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e
-SHA512 (rustc-1.89.0-src.tar.xz) = 3ac0f02baaff12c67fe35cef4d56b315134d0a043bb6103a248a2842456c74733c6e3039f079bacfb8b8ab9b7487f92d678987e588bd41276abf9bf7c2f7870b

From ef3ce219ca657920b418bf388f07ff76e2cc73f3 Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 30 Oct 2025 11:57:25 -0700
Subject: [PATCH 81/86] Update to Rust 1.91.0

---
 .gitignore                                    |   1 +
 ...prebuilt-optimized-compiler-rt-built.patch | 278 ------------------
 ...llow-disabling-target-self-contained.patch |  85 +++---
 ...ure-stack-in-InvocationCollector-vis.patch |  49 ---
 ...xternal-library-path-for-wasm32-wasi.patch |  24 +-
 rust.spec                                     |  29 +-
 rustc-1.90.0-unbundle-sqlite.patch            |  23 --
 rustc-1.91.0-unbundle-sqlite.patch            |  23 ++
 sources                                       |   2 +-
 9 files changed, 92 insertions(+), 422 deletions(-)
 delete mode 100644 0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
 delete mode 100644 0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
 delete mode 100644 rustc-1.90.0-unbundle-sqlite.patch
 create mode 100644 rustc-1.91.0-unbundle-sqlite.patch

diff --git a/.gitignore b/.gitignore
index b758c03..cfedf38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -457,3 +457,4 @@
 /wasi-libc-wasi-sdk-27.tar.gz
 /rustc-1.89.0-src.tar.xz
 /rustc-1.90.0-src.tar.xz
+/rustc-1.91.0-src.tar.xz
diff --git a/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch b/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
deleted file mode 100644
index 3071556..0000000
--- a/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
+++ /dev/null
@@ -1,278 +0,0 @@
-From 4815c3cd733812bec777970ff4b1e73c2fcad1a6 Mon Sep 17 00:00:00 2001
-From: Paul Murphy 
-Date: Tue, 24 Jun 2025 11:07:54 -0500
-Subject: [PATCH] Allow linking a prebuilt optimized compiler-rt builtins
- library
-
-Extend the .optimized-compiler-builtins bootstrap option to accept a
-path to a prebuilt compiler-rt builtins library, and update compiler-builtins
-to enable optimized builtins without building compiler-rt builtins.
-
-(cherry picked from commit b382478bba7b8f75c73673c239fa86a29db66223)
----
- bootstrap.example.toml                        |  4 +-
- .../compiler-builtins/build.rs                | 55 ++++++++++++++++---
- src/bootstrap/src/core/build_steps/compile.rs | 44 ++++++++-------
- src/bootstrap/src/core/config/config.rs       | 10 +++-
- src/bootstrap/src/core/config/tests.rs        |  4 +-
- src/bootstrap/src/core/config/toml/target.rs  |  4 +-
- 6 files changed, 87 insertions(+), 34 deletions(-)
-
-diff --git a/bootstrap.example.toml b/bootstrap.example.toml
-index 82041167b444..a11aec1b60e5 100644
---- a/bootstrap.example.toml
-+++ b/bootstrap.example.toml
-@@ -1038,7 +1038,9 @@
- # sources are available.
- #
- # Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
--# order to run `x check`.
-+# order to run `x check`. This may also be given a path to an existing build of the builtins
-+# runtime library from LLVM's compiler-rt. This option will override the same option under [build]
-+# section.
- #optimized-compiler-builtins = build.optimized-compiler-builtins (bool)
- 
- # Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
-diff --git a/library/compiler-builtins/compiler-builtins/build.rs b/library/compiler-builtins/compiler-builtins/build.rs
-index 8f51c12b535d..b8de1789ebc7 100644
---- a/library/compiler-builtins/compiler-builtins/build.rs
-+++ b/library/compiler-builtins/compiler-builtins/build.rs
-@@ -547,12 +547,20 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
-             sources.extend(&[("__emutls_get_address", "emutls.c")]);
-         }
- 
-+        // Optionally, link against a prebuilt llvm compiler-rt containing the builtins
-+        // library. Only the builtins library is required. On many platforms, this is
-+        // available as a library named libclang_rt.builtins.a.
-+        let link_against_prebuilt_rt = env::var_os("LLVM_COMPILER_RT_LIB").is_some();
-+
-         // When compiling the C code we require the user to tell us where the
-         // source code is, and this is largely done so when we're compiling as
-         // part of rust-lang/rust we can use the same llvm-project repository as
-         // rust-lang/rust.
-         let root = match env::var_os("RUST_COMPILER_RT_ROOT") {
-             Some(s) => PathBuf::from(s),
-+            // If a prebuild libcompiler-rt is provided, set a valid
-+            // path to simplify later logic. Nothing should be compiled.
-+            None if link_against_prebuilt_rt => PathBuf::new(),
-             None => {
-                 panic!(
-                     "RUST_COMPILER_RT_ROOT is not set. You may need to run \
-@@ -560,7 +568,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
-                 );
-             }
-         };
--        if !root.exists() {
-+        if !link_against_prebuilt_rt && !root.exists() {
-             panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
-         }
- 
-@@ -576,7 +584,7 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
-         let src_dir = root.join("lib/builtins");
-         if target.arch == "aarch64" && target.env != "msvc" && target.os != "uefi" {
-             // See below for why we're building these as separate libraries.
--            build_aarch64_out_of_line_atomics_libraries(&src_dir, cfg);
-+            build_aarch64_out_of_line_atomics_libraries(&src_dir, cfg, link_against_prebuilt_rt);
- 
-             // Some run-time CPU feature detection is necessary, as well.
-             let cpu_model_src = if src_dir.join("cpu_model.c").exists() {
-@@ -590,20 +598,45 @@ pub fn compile(llvm_target: &[&str], target: &Target) {
-         let mut added_sources = HashSet::new();
-         for (sym, src) in sources.map.iter() {
-             let src = src_dir.join(src);
--            if added_sources.insert(src.clone()) {
-+            if !link_against_prebuilt_rt && added_sources.insert(src.clone()) {
-                 cfg.file(&src);
-                 println!("cargo:rerun-if-changed={}", src.display());
-             }
-             println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
-         }
- 
--        cfg.compile("libcompiler-rt.a");
-+        if link_against_prebuilt_rt {
-+            let rt_builtins_ext = PathBuf::from(env::var_os("LLVM_COMPILER_RT_LIB").unwrap());
-+            if !rt_builtins_ext.exists() {
-+                panic!(
-+                    "LLVM_COMPILER_RT_LIB={} does not exist",
-+                    rt_builtins_ext.display()
-+                );
-+            }
-+            if let Some(dir) = rt_builtins_ext.parent() {
-+                println!("cargo::rustc-link-search=native={}", dir.display());
-+            }
-+            if let Some(lib) = rt_builtins_ext.file_name() {
-+                println!(
-+                    "cargo::rustc-link-lib=static:+verbatim={}",
-+                    lib.to_str().unwrap()
-+                );
-+            }
-+        } else {
-+            cfg.compile("libcompiler-rt.a");
-+        }
-     }
- 
--    fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc::Build) {
-+    fn build_aarch64_out_of_line_atomics_libraries(
-+        builtins_dir: &Path,
-+        cfg: &mut cc::Build,
-+        link_against_prebuilt_rt: bool,
-+    ) {
-         let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
-         let outlined_atomics_file = builtins_dir.join("aarch64").join("lse.S");
--        println!("cargo:rerun-if-changed={}", outlined_atomics_file.display());
-+        if !link_against_prebuilt_rt {
-+            println!("cargo:rerun-if-changed={}", outlined_atomics_file.display());
-+        }
- 
-         cfg.include(&builtins_dir);
- 
-@@ -616,6 +649,13 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
-                 for (model_number, model_name) in
-                     &[(1, "relax"), (2, "acq"), (3, "rel"), (4, "acq_rel")]
-                 {
-+                    let sym = format!("__aarch64_{}{}_{}", instruction_type, size, model_name);
-+                    println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
-+
-+                    if link_against_prebuilt_rt {
-+                        continue;
-+                    }
-+
-                     // The original compiler-rt build system compiles the same
-                     // source file multiple times with different compiler
-                     // options. Here we do something slightly different: we
-@@ -639,9 +679,6 @@ fn build_aarch64_out_of_line_atomics_libraries(builtins_dir: &Path, cfg: &mut cc
-                     .unwrap();
-                     drop(file);
-                     cfg.file(path);
--
--                    let sym = format!("__aarch64_{}{}_{}", instruction_type, size, model_name);
--                    println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
-                 }
-             }
-         }
-diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 7a5533346adf..39c9db3d6c35 100644
---- a/src/bootstrap/src/core/build_steps/compile.rs
-+++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -572,25 +572,31 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
-     // `compiler-builtins` crate is enabled and it's configured to learn where
-     // `compiler-rt` is located.
-     let compiler_builtins_c_feature = if builder.config.optimized_compiler_builtins(target) {
--        // NOTE: this interacts strangely with `llvm-has-rust-patches`. In that case, we enforce `submodules = false`, so this is a no-op.
--        // But, the user could still decide to manually use an in-tree submodule.
--        //
--        // NOTE: if we're using system llvm, we'll end up building a version of `compiler-rt` that doesn't match the LLVM we're linking to.
--        // That's probably ok? At least, the difference wasn't enforced before. There's a comment in
--        // the compiler_builtins build script that makes me nervous, though:
--        // https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579
--        builder.require_submodule(
--            "src/llvm-project",
--            Some(
--                "The `build.optimized-compiler-builtins` config option \
--                 requires `compiler-rt` sources from LLVM.",
--            ),
--        );
--        let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
--        assert!(compiler_builtins_root.exists());
--        // The path to `compiler-rt` is also used by `profiler_builtins` (above),
--        // so if you're changing something here please also change that as appropriate.
--        cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
-+        if let Some(path) = builder.config.optimized_compiler_builtins_path(target) {
-+            cargo.env("LLVM_COMPILER_RT_LIB", path);
-+        } else {
-+            // NOTE: this interacts strangely with `llvm-has-rust-patches`. In that case, we enforce
-+            // `submodules = false`, so this is a no-op. But, the user could still decide to
-+            //  manually use an in-tree submodule.
-+            //
-+            // NOTE: if we're using system llvm, we'll end up building a version of `compiler-rt`
-+            // that doesn't match the LLVM we're linking to. That's probably ok? At least, the
-+            // difference wasn't enforced before. There's a comment in the compiler_builtins build
-+            // script that makes me nervous, though:
-+            // https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579
-+            builder.require_submodule(
-+                "src/llvm-project",
-+                Some(
-+                    "The `build.optimized-compiler-builtins` config option \
-+                     requires `compiler-rt` sources from LLVM.",
-+                ),
-+            );
-+            let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
-+            assert!(compiler_builtins_root.exists());
-+            // The path to `compiler-rt` is also used by `profiler_builtins` (above),
-+            // so if you're changing something here please also change that as appropriate.
-+            cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
-+        }
-         " compiler-builtins-c"
-     } else {
-         ""
-diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index 6055876c4757..588c3489f898 100644
---- a/src/bootstrap/src/core/config/config.rs
-+++ b/src/bootstrap/src/core/config/config.rs
-@@ -1769,10 +1769,18 @@ pub fn rpath_enabled(&self, target: TargetSelection) -> bool {
-     pub fn optimized_compiler_builtins(&self, target: TargetSelection) -> bool {
-         self.target_config
-             .get(&target)
--            .and_then(|t| t.optimized_compiler_builtins)
-+            .and_then(|t| t.optimized_compiler_builtins.as_ref())
-+            .map(StringOrBool::is_string_or_true)
-             .unwrap_or(self.optimized_compiler_builtins)
-     }
- 
-+    pub fn optimized_compiler_builtins_path(&self, target: TargetSelection) -> Option<&str> {
-+        match self.target_config.get(&target)?.optimized_compiler_builtins.as_ref()? {
-+            StringOrBool::String(s) => Some(s),
-+            StringOrBool::Bool(_) => None,
-+        }
-+    }
-+
-     pub fn llvm_enabled(&self, target: TargetSelection) -> bool {
-         self.codegen_backends(target).contains(&CodegenBackendKind::Llvm)
-     }
-diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
-index 50eba12aba74..c32e4384cf62 100644
---- a/src/bootstrap/src/core/config/tests.rs
-+++ b/src/bootstrap/src/core/config/tests.rs
-@@ -17,7 +17,7 @@
- use crate::core::build_steps::llvm;
- use crate::core::build_steps::llvm::LLVM_INVALIDATION_PATHS;
- use crate::core::config::toml::TomlConfig;
--use crate::core::config::{LldMode, Target, TargetSelection};
-+use crate::core::config::{LldMode, StringOrBool, Target, TargetSelection};
- use crate::utils::tests::git::git_test;
- 
- pub(crate) fn parse(config: &str) -> Config {
-@@ -212,7 +212,7 @@ fn override_toml() {
-     let darwin = TargetSelection::from_user("aarch64-apple-darwin");
-     let darwin_values = Target {
-         runner: Some("apple".into()),
--        optimized_compiler_builtins: Some(false),
-+        optimized_compiler_builtins: Some(StringOrBool::Bool(false)),
-         ..Default::default()
-     };
-     assert_eq!(
-diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
-index 69afa8af3419..5ddb8c50c146 100644
---- a/src/bootstrap/src/core/config/toml/target.rs
-+++ b/src/bootstrap/src/core/config/toml/target.rs
-@@ -45,7 +45,7 @@ struct TomlTarget {
-         no_std: Option = "no-std",
-         codegen_backends: Option> = "codegen-backends",
-         runner: Option = "runner",
--        optimized_compiler_builtins: Option = "optimized-compiler-builtins",
-+        optimized_compiler_builtins: Option = "optimized-compiler-builtins",
-         jemalloc: Option = "jemalloc",
-         self_contained: Option = "self-contained",
-     }
-@@ -78,7 +78,7 @@ pub struct Target {
-     pub runner: Option,
-     pub no_std: bool,
-     pub codegen_backends: Option>,
--    pub optimized_compiler_builtins: Option,
-+    pub optimized_compiler_builtins: Option,
-     pub jemalloc: Option,
-     pub self_contained: bool,
- }
--- 
-2.50.1
-
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index 5949461..e4645a5 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,4 +1,4 @@
-From b51b8d1854e7e2e7b7b431da26adad6b3677f6d2 Mon Sep 17 00:00:00 2001
+From 3a89cbb0ff0352fc6ab4bf329124f961fddb1e2a Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Mon, 18 Aug 2025 17:11:07 -0700
 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
@@ -6,15 +6,16 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
 ---
  bootstrap.example.toml                        | 5 +++++
  src/bootstrap/src/core/build_steps/compile.rs | 4 ++++
- src/bootstrap/src/core/config/toml/target.rs  | 8 ++++++++
+ src/bootstrap/src/core/config/config.rs       | 3 +++
+ src/bootstrap/src/core/config/toml/target.rs  | 5 +++++
  src/bootstrap/src/lib.rs                      | 5 +++++
- 4 files changed, 22 insertions(+)
+ 5 files changed, 22 insertions(+)
 
 diff --git a/bootstrap.example.toml b/bootstrap.example.toml
-index 31966af33012..82041167b444 100644
+index eac939577979..db72e0fd29c5 100644
 --- a/bootstrap.example.toml
 +++ b/bootstrap.example.toml
-@@ -1044,3 +1044,8 @@
+@@ -1060,3 +1060,8 @@
  # Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
  # This overrides the global `rust.jemalloc` option. See that option for more info.
  #jemalloc = rust.jemalloc (bool)
@@ -24,7 +25,7 @@ index 31966af33012..82041167b444 100644
 +# targets may ignore this setting if they have nothing to be contained.
 +#self-contained =  (bool)
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 59541bf12def..7a5533346adf 100644
+index 1458b0beefa8..08757f3283cf 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
 @@ -370,6 +370,10 @@ fn copy_self_contained_objects(
@@ -38,37 +39,11 @@ index 59541bf12def..7a5533346adf 100644
      let libdir_self_contained =
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
-diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
-index 9dedadff3a19..69afa8af3419 100644
---- a/src/bootstrap/src/core/config/toml/target.rs
-+++ b/src/bootstrap/src/core/config/toml/target.rs
-@@ -47,6 +47,7 @@ struct TomlTarget {
-         runner: Option = "runner",
-         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
-         jemalloc: Option = "jemalloc",
-+        self_contained: Option = "self-contained",
-     }
- }
- 
-@@ -79,6 +80,7 @@ pub struct Target {
-     pub codegen_backends: Option>,
-     pub optimized_compiler_builtins: Option,
-     pub jemalloc: Option,
-+    pub self_contained: bool,
- }
- 
- impl Target {
-@@ -90,6 +92,9 @@ pub fn from_triple(triple: &str) -> Self {
-         if triple.contains("emscripten") {
-             target.runner = Some("node".into());
-         }
-+        if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
-+            target.self_contained = true;
-+        }
-         target
-     }
- }
-@@ -126,6 +131,9 @@ pub fn apply_target_config(&mut self, toml_target: Option = "runner",
+         optimized_compiler_builtins: Option = "optimized-compiler-builtins",
+         jemalloc: Option = "jemalloc",
++        self_contained: Option = "self-contained",
+     }
+ }
+ 
+@@ -75,6 +76,7 @@ pub struct Target {
+     pub codegen_backends: Option>,
+     pub optimized_compiler_builtins: Option,
+     pub jemalloc: Option,
++    pub self_contained: bool,
+ }
+ 
+ impl Target {
+@@ -86,6 +88,9 @@ pub fn from_triple(triple: &str) -> Self {
+         if triple.contains("emscripten") {
+             target.runner = Some("node".into());
+         }
++        if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
++            target.self_contained = true;
++        }
+         target
+     }
+ }
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index 011b52df97bb..77b2d9205a43 100644
+index a2aeed20948e..e530e1ceb99e 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1423,6 +1423,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1453,6 +1453,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
@@ -95,5 +100,5 @@ index 011b52df97bb..77b2d9205a43 100644
      /// and `remote-test-server` binaries.
      fn remote_tested(&self, target: TargetSelection) -> bool {
 -- 
-2.50.1
+2.51.0
 
diff --git a/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch b/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
deleted file mode 100644
index e847c1d..0000000
--- a/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 8ff00974436f25585850e3029d8e5a3e2a8340da Mon Sep 17 00:00:00 2001
-From: Josh Stone 
-Date: Thu, 14 Aug 2025 16:02:31 -0700
-Subject: [PATCH] rustc_expand: ensure stack in
- `InvocationCollector::visit_expr`
-
-In Fedora, when we built rustc with PGO on ppc64le, we started failing
-the test `issue-74564-if-expr-stack-overflow.rs`. This could also be
-reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so
-it's probably just unlucky that ppc64le PGO created a large stack frame
-somewhere in this recursion path. Adding an `ensure_sufficient_stack`
-solves the stack overflow.
-
-Historically, that test and its fix were added in rust-lang/rust#74708,
-which was also an `ensure_sufficient_stack` in this area of code at the
-time. However, the refactor in rust-lang/rust#92573 basically left that
-to the general `MutVisitor`, and then rust-lang/rust#142240 removed even
-that ensure call. It may be luck that our tier-1 tested targets did not
-regress the original issue across those refactors.
-
-(cherry picked from commit f68bcb376da2a34b6809ba76dad20ca400bd9966)
----
- compiler/rustc_expand/src/expand.rs | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
-index f02aa6c120f9..0cfda7c4739f 100644
---- a/compiler/rustc_expand/src/expand.rs
-+++ b/compiler/rustc_expand/src/expand.rs
-@@ -15,6 +15,7 @@
- use rustc_ast_pretty::pprust;
- use rustc_attr_parsing::{EvalConfigResult, ShouldEmit};
- use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
-+use rustc_data_structures::stack::ensure_sufficient_stack;
- use rustc_errors::PResult;
- use rustc_feature::Features;
- use rustc_parse::parser::{
-@@ -2439,7 +2440,7 @@ fn visit_expr(&mut self, node: &mut ast::Expr) {
-         if let Some(attr) = node.attrs.first() {
-             self.cfg().maybe_emit_expr_attr_err(attr);
-         }
--        self.visit_node(node)
-+        ensure_sufficient_stack(|| self.visit_node(node))
-     }
- 
-     fn visit_method_receiver_expr(&mut self, node: &mut ast::Expr) {
--- 
-2.50.1
-
diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch
index 4921bb9..89b148f 100644
--- a/0002-set-an-external-library-path-for-wasm32-wasi.patch
+++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch
@@ -1,4 +1,4 @@
-From 3730abcf2b86d650da97a11190af8dcbfeae311a Mon Sep 17 00:00:00 2001
+From 862d09fe2e8b0f5ce8fe7bfc592cda66a1d74c08 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Mon, 18 Aug 2025 17:13:28 -0700
 Subject: [PATCH 2/2] set an external library path for wasm32-wasi
@@ -11,10 +11,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi
  4 files changed, 20 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
-index 162fbf3d6e24..2acfd6dd96b2 100644
+index 48b01ea2df19..59b87396fed2 100644
 --- a/compiler/rustc_codegen_ssa/src/back/link.rs
 +++ b/compiler/rustc_codegen_ssa/src/back/link.rs
-@@ -1548,6 +1548,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
+@@ -1559,6 +1559,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
              return file_path;
          }
      }
@@ -27,7 +27,7 @@ index 162fbf3d6e24..2acfd6dd96b2 100644
      for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
          let file_path = search_path.dir.join(name);
          if file_path.exists() {
-@@ -2121,6 +2127,10 @@ fn add_library_search_dirs(
+@@ -2140,6 +2146,10 @@ fn add_library_search_dirs(
          }
          ControlFlow::<()>::Continue(())
      });
@@ -39,10 +39,10 @@ index 162fbf3d6e24..2acfd6dd96b2 100644
  
  /// Add options making relocation sections in the produced ELF files read-only
 diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
-index d27c1929aef7..b995896450e0 100644
+index f236be92b3b6..eea6e0c203d2 100644
 --- a/compiler/rustc_target/src/spec/json.rs
 +++ b/compiler/rustc_target/src/spec/json.rs
-@@ -84,6 +84,7 @@ macro_rules! forward_opt {
+@@ -81,6 +81,7 @@ macro_rules! forward_opt {
          forward!(linker_is_gnu_json);
          forward!(pre_link_objects);
          forward!(post_link_objects);
@@ -50,7 +50,7 @@ index d27c1929aef7..b995896450e0 100644
          forward!(pre_link_objects_self_contained);
          forward!(post_link_objects_self_contained);
  
-@@ -306,6 +307,7 @@ macro_rules! target_option_val {
+@@ -301,6 +302,7 @@ macro_rules! target_option_val {
          target_option_val!(linker_is_gnu_json, "linker-is-gnu");
          target_option_val!(pre_link_objects);
          target_option_val!(post_link_objects);
@@ -58,7 +58,7 @@ index d27c1929aef7..b995896450e0 100644
          target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback");
          target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
          target_option_val!(link_args - pre_link_args_json, "pre-link-args");
-@@ -490,6 +492,8 @@ struct TargetSpecJson {
+@@ -511,6 +513,8 @@ struct TargetSpecJson {
      pre_link_objects: Option,
      #[serde(rename = "post-link-objects")]
      post_link_objects: Option,
@@ -68,10 +68,10 @@ index d27c1929aef7..b995896450e0 100644
      pre_link_objects_self_contained: Option,
      #[serde(rename = "post-link-objects-fallback")]
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index 033590e01a67..15a012639472 100644
+index 07fb1ce63f7c..c076c2836f84 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -2439,6 +2439,7 @@ pub struct TargetOptions {
+@@ -1992,6 +1992,7 @@ pub struct TargetOptions {
      /// Objects to link before and after all other object code.
      pub pre_link_objects: CrtObjects,
      pub post_link_objects: CrtObjects,
@@ -79,7 +79,7 @@ index 033590e01a67..15a012639472 100644
      /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
      pub pre_link_objects_self_contained: CrtObjects,
      pub post_link_objects_self_contained: CrtObjects,
-@@ -2964,6 +2965,7 @@ fn default() -> TargetOptions {
+@@ -2518,6 +2519,7 @@ fn default() -> TargetOptions {
              relro_level: RelroLevel::None,
              pre_link_objects: Default::default(),
              post_link_objects: Default::default(),
@@ -108,5 +108,5 @@ index 26add451ed25..3eaf050e6823 100644
      // Right now this is a bit of a workaround but we're currently saying that
      // the target by default has a static crt which we're taking as a signal
 -- 
-2.50.1
+2.51.0
 
diff --git a/rust.spec b/rust.spec
index fb685e2..03ea06d 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.90.0
+Version:        1.91.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0
 # e.g. 1.89.0 wants rustc: 1.88.0-2025-06-26
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.89.0
-%global bootstrap_channel 1.89.0
-%global bootstrap_date 2025-08-07
+%global bootstrap_version 1.90.0
+%global bootstrap_channel 1.90.0
+%global bootstrap_date 2025-09-18
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -44,8 +44,8 @@ ExclusiveArch:  %{rust_arches}
 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
 # is insufficient. Rust currently requires LLVM 19.0+.
 # See src/bootstrap/src/core/build_steps/llvm.rs, fn check_llvm_version
-%global min_llvm_version 19.0.0
-%global bundled_llvm_version 20.1.8
+%global min_llvm_version 20.0.0
+%global bundled_llvm_version 21.1.1
 #global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -72,7 +72,7 @@ ExclusiveArch:  %{rust_arches}
 
 # Cargo uses UPSERTs with omitted conflict targets
 %global min_sqlite3_version 3.35
-%global bundled_sqlite3_version 3.49.2
+%global bundled_sqlite3_version 3.50.2
 %if 0%{?rhel} && 0%{?rhel} < 10
 %bcond_without bundled_sqlite3
 %else
@@ -138,19 +138,11 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.90.0-unbundle-sqlite.patch
+Patch6:         rustc-1.91.0-unbundle-sqlite.patch
 
 # stage0 tries to copy all of /usr/lib, sometimes unsuccessfully, see #143735
 Patch7:         0001-only-copy-rustlib-into-stage0-sysroot.patch
 
-# Support optimized-compiler-builtins via linking against compiler-rt builtins.
-# https://github.com/rust-lang/rust/pull/143689
-Patch8:         0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch
-
-# Fix a compiler stack overflow on ppc64le with PGO
-# https://github.com/rust-lang/rust/pull/145410
-Patch9:        0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch
-
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -702,8 +694,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
 %patch -P6 -p1
 %endif
 %patch -P7 -p1
-%patch -P8 -p1
-%patch -P9 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1
@@ -904,7 +894,7 @@ test -r "%{optimized_builtins}"
   --set rust.llvm-tools=false \
   --set rust.verify-llvm-ir=true \
   --enable-extended \
-  --tools=cargo,clippy,rust-analyzer,rustfmt,src \
+  --tools=cargo,clippy,rust-analyzer,rustdoc,rustfmt,src \
   --enable-vendor \
   --enable-verbose-tests \
   --release-channel=%{channel} \
@@ -1102,6 +1092,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
 %license build/manifests/rustc/cargo-vendor.txt
 %license %{_pkgdocdir}/COPYRIGHT.html
 %license %{_pkgdocdir}/licenses/
+%exclude %{_sysconfdir}/target-spec-json-schema.json
 
 
 %files std-static
diff --git a/rustc-1.90.0-unbundle-sqlite.patch b/rustc-1.90.0-unbundle-sqlite.patch
deleted file mode 100644
index 645e95c..0000000
--- a/rustc-1.90.0-unbundle-sqlite.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-08-16 15:47:14.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-08-18 17:17:50.150641231 -0700
-@@ -2843,7 +2843,6 @@ version = "0.34.0"
- source = "registry+https://github.com/rust-lang/crates.io-index"
- checksum = "91632f3b4fb6bd1d72aa3d78f41ffecfcf2b1a6648d8c241dbe7dbfaf4875e15"
- dependencies = [
-- "cc",
-  "pkg-config",
-  "vcpkg",
- ]
-diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-08-16 15:47:14.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-08-18 17:17:46.729082558 -0700
-@@ -81,7 +81,7 @@ proptest = "1.7.0"
- pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
- rand = "0.9.1"
- regex = "1.11.1"
--rusqlite = { version = "0.36.0", features = ["bundled"] }
-+rusqlite = { version = "0.36.0", features = [] }
- rustc-hash = "2.1.1"
- rustc-stable-hash = "0.1.2"
- rustfix = { version = "0.9.2", path = "crates/rustfix" }
diff --git a/rustc-1.91.0-unbundle-sqlite.patch b/rustc-1.91.0-unbundle-sqlite.patch
new file mode 100644
index 0000000..797cb03
--- /dev/null
+++ b/rustc-1.91.0-unbundle-sqlite.patch
@@ -0,0 +1,23 @@
+diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-09-27 05:39:02.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-10-06 09:42:27.244710359 -0700
+@@ -2844,7 +2844,6 @@ version = "0.35.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
+ dependencies = [
+- "cc",
+  "pkg-config",
+  "vcpkg",
+ ]
+diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-09-27 05:39:02.000000000 -0700
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-10-06 09:42:06.219898468 -0700
+@@ -81,7 +81,7 @@ proptest = "1.7.0"
+ pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
+ rand = "0.9.2"
+ regex = "1.11.1"
+-rusqlite = { version = "0.37.0", features = ["bundled"] }
++rusqlite = { version = "0.37.0", features = [] }
+ rustc-hash = "2.1.1"
+ rustc-stable-hash = "0.1.2"
+ rustfix = { version = "0.9.2", path = "crates/rustfix" }
diff --git a/sources b/sources
index 9588449..a8166b0 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.90.0-src.tar.xz) = fb0798b4c7450754db2fcbb641202909d209c6db2d9181d7df7282217b8320dc52f5e9853de9d7bdb79177f1f920389450cab07674dea5fb5501eaab5816662a
+SHA512 (rustc-1.91.0-src.tar.xz) = 1e4c7a2435dc5bccfc63f34f5d210f7cafb0113787a4b5069d61f03528a32cd0a29ac516673cbc0eb564089f1dc5e13b962e6c3714bd0109de664c22ed340fb3
 SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e

From 904f412226b656765f5ffe6123d16eb0ceb61cb4 Mon Sep 17 00:00:00 2001
From: Paul Murphy 
Date: Mon, 10 Nov 2025 14:15:26 -0600
Subject: [PATCH 82/86] Update to Rust 1.91.1

---
 .gitignore | 1 +
 rust.spec  | 2 +-
 sources    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index cfedf38..f37e010 100644
--- a/.gitignore
+++ b/.gitignore
@@ -458,3 +458,4 @@
 /rustc-1.89.0-src.tar.xz
 /rustc-1.90.0-src.tar.xz
 /rustc-1.91.0-src.tar.xz
+/rustc-1.91.1-src.tar.xz
diff --git a/rust.spec b/rust.spec
index 03ea06d..e4d9f7c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.91.0
+Version:        1.91.1
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
diff --git a/sources b/sources
index a8166b0..121c3e5 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.91.0-src.tar.xz) = 1e4c7a2435dc5bccfc63f34f5d210f7cafb0113787a4b5069d61f03528a32cd0a29ac516673cbc0eb564089f1dc5e13b962e6c3714bd0109de664c22ed340fb3
+SHA512 (rustc-1.91.1-src.tar.xz) = 68b6bebff2e1b3bc5762951bec60f55cb7f23fd516ca85195f8050790f20c6cefdc3c5ffe0c40aa2d34635f48fa01f567874bcea3076ad5c260eae1afd759870
 SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e

From d443ef9fa36a6a41606880f1a2e3374e4092582d Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Thu, 11 Dec 2025 16:41:33 +0100
Subject: [PATCH 83/86] Update to Rust 1.92.0

---
 .gitignore                                    |  1 +
 0001-Use-lld-provided-by-system.patch         | 12 ++--
 ...llow-disabling-target-self-contained.patch | 56 +++++++++++--------
 rust.spec                                     | 32 ++++++++---
 ...atch => rustc-1.92.0-unbundle-sqlite.patch | 14 ++---
 sources                                       |  2 +-
 6 files changed, 72 insertions(+), 45 deletions(-)
 rename rustc-1.91.0-unbundle-sqlite.patch => rustc-1.92.0-unbundle-sqlite.patch (62%)

diff --git a/.gitignore b/.gitignore
index f37e010..34be546 100644
--- a/.gitignore
+++ b/.gitignore
@@ -459,3 +459,4 @@
 /rustc-1.90.0-src.tar.xz
 /rustc-1.91.0-src.tar.xz
 /rustc-1.91.1-src.tar.xz
+/rustc-1.92.0-src.tar.xz
diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch
index 1e5816b..522865f 100644
--- a/0001-Use-lld-provided-by-system.patch
+++ b/0001-Use-lld-provided-by-system.patch
@@ -1,4 +1,4 @@
-From 0641fdd833785914f1ead6e1ab374beea5b55437 Mon Sep 17 00:00:00 2001
+From e9405caf32dfb31bf17c3da0299df515a3755107 Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Fri, 16 Aug 2024 10:12:58 -0700
 Subject: [PATCH] Use lld provided by system
@@ -12,12 +12,12 @@ Subject: [PATCH] Use lld provided by system
  5 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
-index 88e7af5e669..14100a683f9 100644
+index 7ede45766ea..b22362227bb 100644
 --- a/compiler/rustc_target/src/spec/base/wasm.rs
 +++ b/compiler/rustc_target/src/spec/base/wasm.rs
-@@ -86,8 +86,7 @@ macro_rules! args {
-         // arguments just yet
-         limit_rdylib_exports: false,
+@@ -81,8 +81,7 @@ macro_rules! args {
+         // threaded model which will legalize atomics to normal operations.
+         singlethread: true,
  
 -        // we use the LLD shipped with the Rust toolchain by default
 -        linker: Some("rust-lld".into()),
@@ -76,5 +76,5 @@ index 0cf6a879462..3677fc662de 100644
      // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
      // enable these CPU features explicitly before their first use, otherwise their instructions
 -- 
-2.49.0
+2.51.0
 
diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch
index e4645a5..54ca101 100644
--- a/0001-bootstrap-allow-disabling-target-self-contained.patch
+++ b/0001-bootstrap-allow-disabling-target-self-contained.patch
@@ -1,34 +1,34 @@
-From 3a89cbb0ff0352fc6ab4bf329124f961fddb1e2a Mon Sep 17 00:00:00 2001
+From 8364de4cb8edab85efcb895824ce06f4a95bd26f Mon Sep 17 00:00:00 2001
 From: Josh Stone 
 Date: Mon, 18 Aug 2025 17:11:07 -0700
-Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
+Subject: [PATCH] bootstrap: allow disabling target self-contained
 
 ---
  bootstrap.example.toml                        | 5 +++++
  src/bootstrap/src/core/build_steps/compile.rs | 4 ++++
- src/bootstrap/src/core/config/config.rs       | 3 +++
+ src/bootstrap/src/core/config/config.rs       | 4 ++++
  src/bootstrap/src/core/config/toml/target.rs  | 5 +++++
  src/bootstrap/src/lib.rs                      | 5 +++++
- 5 files changed, 22 insertions(+)
+ 5 files changed, 23 insertions(+)
 
 diff --git a/bootstrap.example.toml b/bootstrap.example.toml
-index eac939577979..db72e0fd29c5 100644
+index 6f37e51a47d..ee21bc06bea 100644
 --- a/bootstrap.example.toml
 +++ b/bootstrap.example.toml
-@@ -1060,3 +1060,8 @@
- # Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
- # This overrides the global `rust.jemalloc` option. See that option for more info.
- #jemalloc = rust.jemalloc (bool)
+@@ -1077,3 +1077,8 @@
+ # pass `off`:
+ # - x86_64-unknown-linux-gnu
+ #default-linker-linux-override = "off" (for most targets)
 +
 +# Copy libc and CRT objects into the target lib/self-contained/ directory.
 +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
 +# targets may ignore this setting if they have nothing to be contained.
 +#self-contained =  (bool)
 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
-index 1458b0beefa8..08757f3283cf 100644
+index 6857a40ada8..9a98323a704 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -370,6 +370,10 @@ fn copy_self_contained_objects(
+@@ -368,6 +368,10 @@ fn copy_self_contained_objects(
      compiler: &Compiler,
      target: TargetSelection,
  ) -> Vec<(PathBuf, DependencyType)> {
@@ -40,24 +40,32 @@ index 1458b0beefa8..08757f3283cf 100644
          builder.sysroot_target_libdir(*compiler, target).join("self-contained");
      t!(fs::create_dir_all(&libdir_self_contained));
 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
-index 678a9b639522..9e45efc72d1a 100644
+index 4b7ae6df360..6bab269a33c 100644
 --- a/src/bootstrap/src/core/config/config.rs
 +++ b/src/bootstrap/src/core/config/config.rs
-@@ -819,6 +819,9 @@ pub(crate) fn parse_inner(
-                 if let Some(s) = cfg.no_std {
+@@ -864,6 +864,7 @@ pub(crate) fn parse_inner(
+                     runner: target_runner,
+                     optimized_compiler_builtins: target_optimized_compiler_builtins,
+                     jemalloc: target_jemalloc,
++                    self_contained: target_self_contained
+                 } = cfg;
+ 
+                 let mut target = Target::from_triple(&triple);
+@@ -921,6 +922,9 @@ pub(crate) fn parse_inner(
+                 if let Some(s) = target_no_std {
                      target.no_std = s;
                  }
-+                if let Some(s) = cfg.self_contained {
++                if let Some(s) = target_self_contained {
 +                    target.self_contained = s;
 +                }
-                 target.cc = cfg.cc.map(PathBuf::from);
-                 target.cxx = cfg.cxx.map(PathBuf::from);
-                 target.ar = cfg.ar.map(PathBuf::from);
+                 target.cc = target_cc.map(PathBuf::from);
+                 target.cxx = target_cxx.map(PathBuf::from);
+                 target.ar = target_ar.map(PathBuf::from);
 diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
-index 020602e6a199..a944e1d194dd 100644
+index 4c7afa50b96..83b8a1b50ca 100644
 --- a/src/bootstrap/src/core/config/toml/target.rs
 +++ b/src/bootstrap/src/core/config/toml/target.rs
-@@ -43,6 +43,7 @@ struct TomlTarget {
+@@ -47,6 +47,7 @@ struct TomlTarget {
          runner: Option = "runner",
          optimized_compiler_builtins: Option = "optimized-compiler-builtins",
          jemalloc: Option = "jemalloc",
@@ -65,7 +73,7 @@ index 020602e6a199..a944e1d194dd 100644
      }
  }
  
-@@ -75,6 +76,7 @@ pub struct Target {
+@@ -80,6 +81,7 @@ pub struct Target {
      pub codegen_backends: Option>,
      pub optimized_compiler_builtins: Option,
      pub jemalloc: Option,
@@ -73,7 +81,7 @@ index 020602e6a199..a944e1d194dd 100644
  }
  
  impl Target {
-@@ -86,6 +88,9 @@ pub fn from_triple(triple: &str) -> Self {
+@@ -91,6 +93,9 @@ pub fn from_triple(triple: &str) -> Self {
          if triple.contains("emscripten") {
              target.runner = Some("node".into());
          }
@@ -84,10 +92,10 @@ index 020602e6a199..a944e1d194dd 100644
      }
  }
 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
-index a2aeed20948e..e530e1ceb99e 100644
+index dd30f05b728..cc89a84071e 100644
 --- a/src/bootstrap/src/lib.rs
 +++ b/src/bootstrap/src/lib.rs
-@@ -1453,6 +1453,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
+@@ -1441,6 +1441,11 @@ fn no_std(&self, target: TargetSelection) -> Option {
          self.config.target_config.get(&target).map(|t| t.no_std)
      }
  
diff --git a/rust.spec b/rust.spec
index e4d9f7c..663275c 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1,5 +1,5 @@
 Name:           rust
-Version:        1.91.1
+Version:        1.92.0
 Release:        %autorelease
 Summary:        The Rust Programming Language
 License:        (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
@@ -14,9 +14,9 @@ ExclusiveArch:  %{rust_arches}
 # To bootstrap from scratch, set the channel and date from src/stage0
 # e.g. 1.89.0 wants rustc: 1.88.0-2025-06-26
 # or nightly wants some beta-YYYY-MM-DD
-%global bootstrap_version 1.90.0
-%global bootstrap_channel 1.90.0
-%global bootstrap_date 2025-09-18
+%global bootstrap_version 1.91.0
+%global bootstrap_channel 1.91.0
+%global bootstrap_date 2025-10-30
 
 # Only the specified arches will use bootstrap binaries.
 # NOTE: Those binaries used to be uploaded with every new release, but that was
@@ -45,7 +45,7 @@ ExclusiveArch:  %{rust_arches}
 # is insufficient. Rust currently requires LLVM 19.0+.
 # See src/bootstrap/src/core/build_steps/llvm.rs, fn check_llvm_version
 %global min_llvm_version 20.0.0
-%global bundled_llvm_version 21.1.1
+%global bundled_llvm_version 21.1.3
 #global llvm_compat_version 19
 %global llvm llvm%{?llvm_compat_version}
 %bcond_with bundled_llvm
@@ -138,7 +138,7 @@ Patch4:         0001-bootstrap-allow-disabling-target-self-contained.patch
 Patch5:         0002-set-an-external-library-path-for-wasm32-wasi.patch
 
 # We don't want to use the bundled library in libsqlite3-sys
-Patch6:         rustc-1.91.0-unbundle-sqlite.patch
+Patch6:         rustc-1.92.0-unbundle-sqlite.patch
 
 # stage0 tries to copy all of /usr/lib, sometimes unsuccessfully, see #143735
 Patch7:         0001-only-copy-rustlib-into-stage0-sysroot.patch
@@ -1064,9 +1064,27 @@ rm -rf "$TMP_HELLO"
 %{__x} test --no-fail-fast --skip={src/bootstrap,tests/crashes} || :
 rm -rf "./build/%{rust_triple}/test/"
 
+# Cargo tests skip list
+# Every test skipped here must have a documented reason to be skipped.
+# Duplicates are safe to add.
+
+# This test relies on the DNS to fail to resolve the host. DNS is not enabled
+# in mock in koji so the DNS resolution doesn't take place to begin with.
+# We test this after packaging
+%global cargo_test_skip_list net_err_suggests_fetch_with_cli
+
 %ifarch aarch64
 # https://github.com/rust-lang/rust/issues/123733
-%define cargo_test_skip --test-args "--skip panic_abort_doc_tests"
+%global cargo_test_skip_list %{cargo_test_skip_list} panic_abort_doc_tests
+%endif
+%if %with disabled_libssh2
+# These tests need ssh - guaranteed to fail when libssh2 is disabled.
+%global cargo_test_skip_list  %{cargo_test_skip_list} \\\
+  net_err_suggests_fetch_with_cli \\\
+  ssh_something_happens
+%endif
+%if "%{cargo_test_skip_list}" != ""
+%define cargo_test_skip --test-args "%(printf -- '--skip %%s ' %{cargo_test_skip_list})"
 %endif
 %{__x} test --no-fail-fast cargo %{?cargo_test_skip} || :
 rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
diff --git a/rustc-1.91.0-unbundle-sqlite.patch b/rustc-1.92.0-unbundle-sqlite.patch
similarity index 62%
rename from rustc-1.91.0-unbundle-sqlite.patch
rename to rustc-1.92.0-unbundle-sqlite.patch
index 797cb03..fb0b284 100644
--- a/rustc-1.91.0-unbundle-sqlite.patch
+++ b/rustc-1.92.0-unbundle-sqlite.patch
@@ -1,7 +1,7 @@
 diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-09-27 05:39:02.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-10-06 09:42:27.244710359 -0700
-@@ -2844,7 +2844,6 @@ version = "0.35.0"
+--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig	2025-11-07 13:31:19.003737886 +0100
++++ rustc-beta-src/src/tools/cargo/Cargo.lock	2025-11-07 13:14:41.637982893 +0100
+@@ -2835,7 +2835,6 @@ version = "0.35.0"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
  dependencies = [
@@ -10,12 +10,12 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools
   "vcpkg",
  ]
 diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-09-27 05:39:02.000000000 -0700
-+++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-10-06 09:42:06.219898468 -0700
-@@ -81,7 +81,7 @@ proptest = "1.7.0"
+--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-11-07 13:31:28.338643618 +0100
++++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-11-07 13:15:00.266505214 +0100
+@@ -81,7 +81,7 @@ proptest = "1.8.0"
  pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
  rand = "0.9.2"
- regex = "1.11.1"
+ regex = "1.11.3"
 -rusqlite = { version = "0.37.0", features = ["bundled"] }
 +rusqlite = { version = "0.37.0", features = [] }
  rustc-hash = "2.1.1"
diff --git a/sources b/sources
index 121c3e5..682e418 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (rustc-1.91.1-src.tar.xz) = 68b6bebff2e1b3bc5762951bec60f55cb7f23fd516ca85195f8050790f20c6cefdc3c5ffe0c40aa2d34635f48fa01f567874bcea3076ad5c260eae1afd759870
+SHA512 (rustc-1.92.0-src.tar.xz) = a2c0b127933595b9bc2063d7b7c88d9af512c4664b18f29d44c9a6e2c68d194b87a3071717e8f1b7c858ae940baca888e10be95cd31e0201916d0bfc312a3b15
 SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e

From 36c15e96eeda56fcc46b37435eddfb3d43702e80 Mon Sep 17 00:00:00 2001
From: Yaakov Selkowitz 
Date: Mon, 15 Dec 2025 00:45:10 -0500
Subject: [PATCH 84/86] Update disable-libssh2 patch for 1.92.0

---
 rust.spec                                                     | 2 +-
 ...isable-libssh2.patch => rustc-1.92.0-disable-libssh2.patch | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename rustc-1.90.0-disable-libssh2.patch => rustc-1.92.0-disable-libssh2.patch (97%)

diff --git a/rust.spec b/rust.spec
index 663275c..af88a70 100644
--- a/rust.spec
+++ b/rust.spec
@@ -152,7 +152,7 @@ Source102:      cargo_vendor.attr
 Source103:      cargo_vendor.prov
 
 # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
-Patch100:       rustc-1.90.0-disable-libssh2.patch
+Patch100:       rustc-1.92.0-disable-libssh2.patch
 
 # Get the Rust triple for any architecture and ABI.
 %{lua: function rust_triple(arch, abi)
diff --git a/rustc-1.90.0-disable-libssh2.patch b/rustc-1.92.0-disable-libssh2.patch
similarity index 97%
rename from rustc-1.90.0-disable-libssh2.patch
rename to rustc-1.92.0-disable-libssh2.patch
index 23dc6d8..a03668f 100644
--- a/rustc-1.90.0-disable-libssh2.patch
+++ b/rustc-1.92.0-disable-libssh2.patch
@@ -34,8 +34,8 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools
 --- rustc-beta-src/src/tools/cargo/Cargo.toml.orig	2025-08-16 15:47:14.000000000 -0700
 +++ rustc-beta-src/src/tools/cargo/Cargo.toml	2025-08-18 17:33:02.401743230 -0700
 @@ -46,7 +46,7 @@ curl = "0.4.48"
- curl-sys = "0.4.82"
- filetime = "0.2.25"
+ curl-sys = "0.4.83"
+ filetime = "0.2.26"
  flate2 = { version = "1.1.2", default-features = false, features = ["zlib-rs"] }
 -git2 = "0.20.2"
 +git2 = { version = "0.20.2", default-features = false, features = ["https"] }

From 65fd388eb79f84abce60d592a076ccfd903cc89d Mon Sep 17 00:00:00 2001
From: Jesus Checa Hidalgo 
Date: Mon, 15 Dec 2025 19:45:10 +0100
Subject: [PATCH 85/86] Update rpminspect.yaml

Add known exceptions for unicode test.
---
 rpminspect.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rpminspect.yaml b/rpminspect.yaml
index 2a29d4a..a12c8a4 100644
--- a/rpminspect.yaml
+++ b/rpminspect.yaml
@@ -12,12 +12,14 @@ unicode:
         # they are tests for those.
         - rustc-*-src/tests/ui/lint/issue-90614-accept-allow-text-direction-codepoint-in-comment-lint.rs
         - rustc-*-src/tests/ui/parser/unicode-control-codepoints.rs
+        - rustc-*-src/tests/ui/parser/macro/unicode-control-codepoints-macros.rs
+        - rustc-*-src/tests/ui/parser/macro/auxiliary/unicode-control.rs
         - rustc-*-src/compiler/rustc_lint/src/hidden_unicode_codepoints.rs
         - rustc-*-src/compiler/rustc_lint_defs/src/builtin.rs
         - rustc-*-src/vendor/idna/tests/IdnaTestV2.txt
         - rustc-*-src/vendor/idna-*/tests/IdnaTestV2.txt
-        - rustc-*-src/vendor/mdbook*/tests/dummy_book/src/first/unicode.md
-        - rustc-*-src/vendor/mdbook*/tests/searchindex_fixture.json
+        - rustc-*-src/vendor/mdbook*/tests/testsuite/search/reasonable_search_index/expected_index.js
+        - rustc-*-src/vendor/mdbook*/tests/testsuite/search/reasonable_search_index/src/first/unicode.md
         - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-string?.wat
         - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-block-comment?.wat
         - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-line-comment?.wat

From a9b80468cac9ee08f6a1cea6cf5ef85a0f83192b Mon Sep 17 00:00:00 2001
From: Josh Stone 
Date: Thu, 8 Jan 2026 17:07:11 -0800
Subject: [PATCH 86/86] Use %shrink for multi-line cargo_test_skip_list

This fixes macro expansion errors on el8-era rpm.

[skip changelog]
---
 rust.spec | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rust.spec b/rust.spec
index af88a70..b789949 100644
--- a/rust.spec
+++ b/rust.spec
@@ -1079,9 +1079,11 @@ rm -rf "./build/%{rust_triple}/test/"
 %endif
 %if %with disabled_libssh2
 # These tests need ssh - guaranteed to fail when libssh2 is disabled.
-%global cargo_test_skip_list  %{cargo_test_skip_list} \\\
-  net_err_suggests_fetch_with_cli \\\
+%global cargo_test_skip_list %{shrink:
+  %{cargo_test_skip_list}
+  net_err_suggests_fetch_with_cli
   ssh_something_happens
+}
 %endif
 %if "%{cargo_test_skip_list}" != ""
 %define cargo_test_skip --test-args "%(printf -- '--skip %%s ' %{cargo_test_skip_list})"