From 13639c9e59c115eb2f87389f9d610d4dbcf23d35 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 12 Nov 2019 11:36:54 -0800 Subject: [PATCH 001/222] Fix a couple build and test issues with rustdoc. --- 0001-Hopefully-fix-rustdoc-build.patch | 38 +++++++++++++++++++++++++ rust-pr66317-bindir-relative.patch | 39 ++++++++++++++++++++++++++ rust.spec | 15 +++++++++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 0001-Hopefully-fix-rustdoc-build.patch create mode 100644 rust-pr66317-bindir-relative.patch diff --git a/0001-Hopefully-fix-rustdoc-build.patch b/0001-Hopefully-fix-rustdoc-build.patch new file mode 100644 index 0000000..06ca58e --- /dev/null +++ b/0001-Hopefully-fix-rustdoc-build.patch @@ -0,0 +1,38 @@ +From 73369f32621f6a844a80a8513ae3ded901e4a406 Mon Sep 17 00:00:00 2001 +From: Mark Rousskov +Date: Tue, 5 Nov 2019 11:16:46 -0500 +Subject: [PATCH] Hopefully fix rustdoc build + +It's super unclear why this broke when we switched to beta but not +previously -- but at least it's hopefully fixed now. +--- + src/bootstrap/builder.rs | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 2748903f2d47..2edcef203ad2 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -886,7 +886,18 @@ impl<'a> Builder<'a> { + // things still build right, please do! + match mode { + Mode::Std => metadata.push_str("std"), +- _ => {}, ++ // When we're building rustc tools, they're built with a search path ++ // that contains things built during the rustc build. For example, ++ // bitflags is built during the rustc build, and is a dependency of ++ // rustdoc as well. We're building rustdoc in a different target ++ // directory, though, which means that Cargo will rebuild the ++ // dependency. When we go on to build rustdoc, we'll look for ++ // bitflags, and find two different copies: one built during the ++ // rustc step and one that we just built. This isn't always a ++ // problem, somehow -- not really clear why -- but we know that this ++ // fixes things. ++ Mode::ToolRustc => metadata.push_str("tool-rustc"), ++ _ => {} + } + cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); + +-- +2.23.0 + diff --git a/rust-pr66317-bindir-relative.patch b/rust-pr66317-bindir-relative.patch new file mode 100644 index 0000000..71d3b0c --- /dev/null +++ b/rust-pr66317-bindir-relative.patch @@ -0,0 +1,39 @@ +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 2748903f2d47..10d02d6db829 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -1231,7 +1231,8 @@ impl<'a> Builder<'a> { + cargo.arg("--frozen"); + } + +- cargo.env("RUSTC_INSTALL_BINDIR", &self.config.bindir); ++ // Try to use a sysroot-relative bindir, in case it was configured absolutely. ++ cargo.env("RUSTC_INSTALL_BINDIR", self.config.bindir_relative()); + + self.ci_env.force_coloring_in_ci(&mut cargo); + +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index d1bdfa0a7676..0c03b95c7b25 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -647,6 +647,20 @@ impl Config { + config + } + ++ /// Try to find the relative path of `bindir`, otherwise return it in full. ++ pub fn bindir_relative(&self) -> &Path { ++ let bindir = &self.bindir; ++ if bindir.is_absolute() { ++ // Try to make it relative to the prefix. ++ if let Some(prefix) = &self.prefix { ++ if let Ok(stripped) = bindir.strip_prefix(prefix) { ++ return stripped; ++ } ++ } ++ } ++ bindir ++ } ++ + /// Try to find the relative path of `libdir`. + pub fn libdir_relative(&self) -> Option<&Path> { + let libdir = self.libdir.as_ref()?; diff --git a/rust.spec b/rust.spec index 6de3a28..5309f63 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.39.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -71,6 +71,14 @@ Patch1: rust-pr57840-llvm7-debuginfo-variants.patch # https://github.com/rust-lang/rust/pull/65474 Patch2: rust-pr65474-split-rustc-dev.patch +# Fix conflicting libraries of rustc tools +# https://github.com/rust-lang/rust/commit/73369f32621f6a844a80a8513ae3ded901e4a406 +Patch3: 0001-Hopefully-fix-rustdoc-build.patch + +# Fix the bindir used by rustdoc to find rustc +# https://github.com/rust-lang/rust/pull/66317 +Patch4: rust-pr66317-bindir-relative.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -402,6 +410,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -711,6 +721,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. From f88be12b0c768fa992924c75ad5cfefd695c5922 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 08:54:43 -0800 Subject: [PATCH 002/222] Update to 1.40.0. --- .gitignore | 8 + 0001-Hopefully-fix-rustdoc-build.patch | 38 -- ...-67242-ignore-arm-foreign-exceptions.patch | 10 + rust-pr65474-split-rustc-dev.patch | 479 ------------------ rust.spec | 33 +- sources | 2 +- sources-bootstrap | 16 +- 7 files changed, 41 insertions(+), 545 deletions(-) delete mode 100644 0001-Hopefully-fix-rustdoc-build.patch create mode 100644 rust-issue-67242-ignore-arm-foreign-exceptions.patch delete mode 100644 rust-pr65474-split-rustc-dev.patch diff --git a/.gitignore b/.gitignore index 65f499a..1c16ae6 100644 --- a/.gitignore +++ b/.gitignore @@ -236,3 +236,11 @@ /rust-1.38.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.38.0-s390x-unknown-linux-gnu.tar.xz /rust-1.38.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.40.0-src.tar.xz +/rust-1.39.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.39.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.39.0-i686-unknown-linux-gnu.tar.xz +/rust-1.39.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.39.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.39.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.39.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Hopefully-fix-rustdoc-build.patch b/0001-Hopefully-fix-rustdoc-build.patch deleted file mode 100644 index 06ca58e..0000000 --- a/0001-Hopefully-fix-rustdoc-build.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 73369f32621f6a844a80a8513ae3ded901e4a406 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Tue, 5 Nov 2019 11:16:46 -0500 -Subject: [PATCH] Hopefully fix rustdoc build - -It's super unclear why this broke when we switched to beta but not -previously -- but at least it's hopefully fixed now. ---- - src/bootstrap/builder.rs | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 2748903f2d47..2edcef203ad2 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -886,7 +886,18 @@ impl<'a> Builder<'a> { - // things still build right, please do! - match mode { - Mode::Std => metadata.push_str("std"), -- _ => {}, -+ // When we're building rustc tools, they're built with a search path -+ // that contains things built during the rustc build. For example, -+ // bitflags is built during the rustc build, and is a dependency of -+ // rustdoc as well. We're building rustdoc in a different target -+ // directory, though, which means that Cargo will rebuild the -+ // dependency. When we go on to build rustdoc, we'll look for -+ // bitflags, and find two different copies: one built during the -+ // rustc step and one that we just built. This isn't always a -+ // problem, somehow -- not really clear why -- but we know that this -+ // fixes things. -+ Mode::ToolRustc => metadata.push_str("tool-rustc"), -+ _ => {} - } - cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); - --- -2.23.0 - diff --git a/rust-issue-67242-ignore-arm-foreign-exceptions.patch b/rust-issue-67242-ignore-arm-foreign-exceptions.patch new file mode 100644 index 0000000..127c435 --- /dev/null +++ b/rust-issue-67242-ignore-arm-foreign-exceptions.patch @@ -0,0 +1,10 @@ +--- rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile.orig 2019-12-07 18:36:56.000000000 -0800 ++++ rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile 2019-12-12 15:49:24.655515206 -0800 +@@ -1,3 +1,7 @@ ++# ignore-arm ++# ignore-armeb ++# https://github.com/rust-lang/rust/issues/67242 ++ + -include ../tools.mk + + all: foo diff --git a/rust-pr65474-split-rustc-dev.patch b/rust-pr65474-split-rustc-dev.patch deleted file mode 100644 index 7e1c57a..0000000 --- a/rust-pr65474-split-rustc-dev.patch +++ /dev/null @@ -1,479 +0,0 @@ -From 8e0007f829661e57d008d2e908c95f6e84b04b25 Mon Sep 17 00:00:00 2001 -From: bors -Date: Thu, 24 Oct 2019 07:27:00 +0000 -Subject: [PATCH] Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, - r=pietroalbini - -Split the rustc target libraries into separate rustc-dev component - -This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR. - -The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case. - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index b8071b98f707..2748903f2d47 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -443,6 +443,7 @@ impl<'a> Builder<'a> { - dist::Rustc, - dist::DebuggerScripts, - dist::Std, -+ dist::RustcDev, - dist::Analysis, - dist::Src, - dist::PlainSourceTarball, -diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs -index cadb9a7e441f..df1c72575846 100644 ---- a/src/bootstrap/check.rs -+++ b/src/bootstrap/check.rs -@@ -55,6 +55,7 @@ impl Step for Std { - cargo, - args(builder.kind), - &libstd_stamp(builder, compiler, target), -+ vec![], - true); - - let libdir = builder.sysroot_libdir(compiler, target); -@@ -103,6 +104,7 @@ impl Step for Rustc { - cargo, - args(builder.kind), - &librustc_stamp(builder, compiler, target), -+ vec![], - true); - - let libdir = builder.sysroot_libdir(compiler, target); -@@ -155,6 +157,7 @@ impl Step for CodegenBackend { - cargo, - args(builder.kind), - &codegen_backend_stamp(builder, compiler, target, backend), -+ vec![], - true); - } - } -@@ -199,6 +202,7 @@ impl Step for Rustdoc { - cargo, - args(builder.kind), - &rustdoc_stamp(builder, compiler, target), -+ vec![], - true); - - let libdir = builder.sysroot_libdir(compiler, target); -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 5074b035789a..da8d43ed49b7 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -69,7 +69,7 @@ impl Step for Std { - return; - } - -- builder.ensure(StartupObjects { compiler, target }); -+ let mut target_deps = builder.ensure(StartupObjects { compiler, target }); - - let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); - if compiler_to_use != compiler { -@@ -91,7 +91,7 @@ impl Step for Std { - return; - } - -- copy_third_party_objects(builder, &compiler, target); -+ target_deps.extend(copy_third_party_objects(builder, &compiler, target).into_iter()); - - let mut cargo = builder.cargo(compiler, Mode::Std, target, "build"); - std_cargo(builder, &compiler, target, &mut cargo); -@@ -102,6 +102,7 @@ impl Step for Std { - cargo, - vec![], - &libstd_stamp(builder, compiler, target), -+ target_deps, - false); - - builder.ensure(StdLink { -@@ -113,9 +114,22 @@ impl Step for Std { - } - - /// Copies third pary objects needed by various targets. --fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned) { -+fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned) -+ -> Vec -+{ - let libdir = builder.sysroot_libdir(*compiler, target); - -+ let mut target_deps = vec![]; -+ -+ let mut copy_and_stamp = |sourcedir: &Path, name: &str| { -+ let target = libdir.join(name); -+ builder.copy( -+ &sourcedir.join(name), -+ &target, -+ ); -+ target_deps.push(target); -+ }; -+ - // Copies the crt(1,i,n).o startup objects - // - // Since musl supports fully static linking, we can cross link for it even -@@ -123,19 +137,13 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: - // files. As those shipped with glibc won't work, copy the ones provided by - // musl so we have them on linux-gnu hosts. - if target.contains("musl") { -+ let srcdir = builder.musl_root(target).unwrap().join("lib"); - for &obj in &["crt1.o", "crti.o", "crtn.o"] { -- builder.copy( -- &builder.musl_root(target).unwrap().join("lib").join(obj), -- &libdir.join(obj), -- ); -+ copy_and_stamp(&srcdir, obj); - } - } else if target.ends_with("-wasi") { -- for &obj in &["crt1.o"] { -- builder.copy( -- &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj), -- &libdir.join(obj), -- ); -- } -+ let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi"); -+ copy_and_stamp(&srcdir, "crt1.o"); - } - - // Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx. -@@ -145,11 +153,11 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: - // which is provided by std for this target. - if target == "x86_64-fortanix-unknown-sgx" { - let src_path_env = "X86_FORTANIX_SGX_LIBS"; -- let obj = "libunwind.a"; - let src = env::var(src_path_env).expect(&format!("{} not found in env", src_path_env)); -- let src = Path::new(&src).join(obj); -- builder.copy(&src, &libdir.join(obj)); -+ copy_and_stamp(Path::new(&src), "libunwind.a"); - } -+ -+ target_deps - } - - /// Configure cargo to compile the standard library, adding appropriate env vars -@@ -306,7 +314,7 @@ pub struct StartupObjects { - } - - impl Step for StartupObjects { -- type Output = (); -+ type Output = Vec; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/rtstartup") -@@ -325,13 +333,15 @@ impl Step for StartupObjects { - /// They don't require any library support as they're just plain old object - /// files, so we just use the nightly snapshot compiler to always build them (as - /// no other compilers are guaranteed to be available). -- fn run(self, builder: &Builder<'_>) { -+ fn run(self, builder: &Builder<'_>) -> Vec { - let for_compiler = self.compiler; - let target = self.target; - if !target.contains("windows-gnu") { -- return -+ return vec![] - } - -+ let mut target_deps = vec![]; -+ - let src_dir = &builder.src.join("src/rtstartup"); - let dst_dir = &builder.native_dir(target).join("rtstartup"); - let sysroot_dir = &builder.sysroot_libdir(for_compiler, target); -@@ -350,7 +360,9 @@ impl Step for StartupObjects { - .arg(src_file)); - } - -- builder.copy(dst_file, &sysroot_dir.join(file.to_string() + ".o")); -+ let target = sysroot_dir.join(file.to_string() + ".o"); -+ builder.copy(dst_file, &target); -+ target_deps.push(target); - } - - for obj in ["crt2.o", "dllcrt2.o"].iter() { -@@ -358,8 +370,12 @@ impl Step for StartupObjects { - builder.cc(target), - target, - obj); -- builder.copy(&src, &sysroot_dir.join(obj)); -+ let target = sysroot_dir.join(obj); -+ builder.copy(&src, &target); -+ target_deps.push(target); - } -+ -+ target_deps - } - } - -@@ -437,6 +453,7 @@ impl Step for Rustc { - cargo, - vec![], - &librustc_stamp(builder, compiler, target), -+ vec![], - false); - - builder.ensure(RustcLink { -@@ -585,7 +602,7 @@ impl Step for CodegenBackend { - - let tmp_stamp = out_dir.join(".tmp.stamp"); - -- let files = run_cargo(builder, cargo, vec![], &tmp_stamp, false); -+ let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false); - if builder.config.dry_run { - return; - } -@@ -941,6 +958,7 @@ pub fn run_cargo(builder: &Builder<'_>, - cargo: Cargo, - tail_args: Vec, - stamp: &Path, -+ additional_target_deps: Vec, - is_check: bool) - -> Vec - { -@@ -1057,6 +1075,7 @@ pub fn run_cargo(builder: &Builder<'_>, - deps.push((path_to_add.into(), false)); - } - -+ deps.extend(additional_target_deps.into_iter().map(|d| (d, false))); - deps.sort(); - let mut new_contents = Vec::new(); - for (dep, proc_macro) in deps.iter() { -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index 514ad1144491..93143570b0fe 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -637,6 +637,28 @@ impl Step for DebuggerScripts { - } - } - -+fn skip_host_target_lib(builder: &Builder<'_>, compiler: Compiler) -> bool { -+ // The only true set of target libraries came from the build triple, so -+ // let's reduce redundant work by only producing archives from that host. -+ if compiler.host != builder.config.build { -+ builder.info("\tskipping, not a build host"); -+ true -+ } else { -+ false -+ } -+} -+ -+/// Copy stamped files into an image's `target/lib` directory. -+fn copy_target_libs(builder: &Builder<'_>, target: &str, image: &Path, stamp: &Path) { -+ let dst = image.join("lib/rustlib").join(target).join("lib"); -+ t!(fs::create_dir_all(&dst)); -+ for (path, host) in builder.read_stamp_file(stamp) { -+ if !host || builder.config.build == target { -+ builder.copy(&path, &dst.join(path.file_name().unwrap())); -+ } -+ } -+} -+ - #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] - pub struct Std { - pub compiler: Compiler, -@@ -667,44 +689,19 @@ impl Step for Std { - let target = self.target; - - let name = pkgname(builder, "rust-std"); -- -- // The only true set of target libraries came from the build triple, so -- // let's reduce redundant work by only producing archives from that host. -- if compiler.host != builder.config.build { -- builder.info("\tskipping, not a build host"); -- return distdir(builder).join(format!("{}-{}.tar.gz", name, target)); -+ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target)); -+ if skip_host_target_lib(builder, compiler) { -+ return archive; - } - -- // We want to package up as many target libraries as possible -- // for the `rust-std` package, so if this is a host target we -- // depend on librustc and otherwise we just depend on libtest. -- if builder.hosts.iter().any(|t| t == target) { -- builder.ensure(compile::Rustc { compiler, target }); -- } else { -- builder.ensure(compile::Std { compiler, target }); -- } -+ builder.ensure(compile::Std { compiler, target }); - - let image = tmpdir(builder).join(format!("{}-{}-image", name, target)); - let _ = fs::remove_dir_all(&image); - -- let dst = image.join("lib/rustlib").join(target); -- t!(fs::create_dir_all(&dst)); -- let mut src = builder.sysroot_libdir(compiler, target).to_path_buf(); -- src.pop(); // Remove the trailing /lib folder from the sysroot_libdir -- builder.cp_filtered(&src, &dst, &|path| { -- if let Some(name) = path.file_name().and_then(|s| s.to_str()) { -- if name == builder.config.rust_codegen_backends_dir.as_str() { -- return false -- } -- if name == "bin" { -- return false -- } -- if name.contains("LLVM") { -- return false -- } -- } -- true -- }); -+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); -+ let stamp = compile::libstd_stamp(builder, compiler_to_use, target); -+ copy_target_libs(builder, &target, &image, &stamp); - - let mut cmd = rust_installer(builder); - cmd.arg("generate") -@@ -723,7 +720,73 @@ impl Step for Std { - let _time = timeit(builder); - builder.run(&mut cmd); - builder.remove_dir(&image); -- distdir(builder).join(format!("{}-{}.tar.gz", name, target)) -+ archive -+ } -+} -+ -+#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] -+pub struct RustcDev { -+ pub compiler: Compiler, -+ pub target: Interned, -+} -+ -+impl Step for RustcDev { -+ type Output = PathBuf; -+ const DEFAULT: bool = true; -+ const ONLY_HOSTS: bool = true; -+ -+ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -+ run.path("rustc-dev") -+ } -+ -+ fn make_run(run: RunConfig<'_>) { -+ run.builder.ensure(RustcDev { -+ compiler: run.builder.compiler_for( -+ run.builder.top_stage, -+ run.builder.config.build, -+ run.target, -+ ), -+ target: run.target, -+ }); -+ } -+ -+ fn run(self, builder: &Builder<'_>) -> PathBuf { -+ let compiler = self.compiler; -+ let target = self.target; -+ -+ let name = pkgname(builder, "rustc-dev"); -+ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target)); -+ if skip_host_target_lib(builder, compiler) { -+ return archive; -+ } -+ -+ builder.ensure(compile::Rustc { compiler, target }); -+ -+ let image = tmpdir(builder).join(format!("{}-{}-image", name, target)); -+ let _ = fs::remove_dir_all(&image); -+ -+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); -+ let stamp = compile::librustc_stamp(builder, compiler_to_use, target); -+ copy_target_libs(builder, &target, &image, &stamp); -+ -+ let mut cmd = rust_installer(builder); -+ cmd.arg("generate") -+ .arg("--product-name=Rust") -+ .arg("--rel-manifest-dir=rustlib") -+ .arg("--success-message=Rust-is-ready-to-develop.") -+ .arg("--image-dir").arg(&image) -+ .arg("--work-dir").arg(&tmpdir(builder)) -+ .arg("--output-dir").arg(&distdir(builder)) -+ .arg(format!("--package-name={}-{}", name, target)) -+ .arg(format!("--component-name=rustc-dev-{}", target)) -+ .arg("--legacy-manifest-dirs=rustlib,cargo"); -+ -+ builder.info(&format!("Dist rustc-dev stage{} ({} -> {})", -+ compiler.stage, &compiler.host, target)); -+ let _time = timeit(builder); -+ builder.run(&mut cmd); -+ builder.remove_dir(&image); -+ archive - } - } - -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index a182405f3b2d..d1cf1cbca784 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -1137,6 +1137,7 @@ impl Build { - pub fn copy(&self, src: &Path, dst: &Path) { - if self.config.dry_run { return; } - self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst)); -+ if src == dst { return; } - let _ = fs::remove_file(&dst); - let metadata = t!(src.symlink_metadata()); - if metadata.file_type().is_symlink() { -diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs -index f41e7dd17ede..c0d2deab2f8b 100644 ---- a/src/tools/build-manifest/src/main.rs -+++ b/src/tools/build-manifest/src/main.rs -@@ -399,6 +399,7 @@ impl Builder { - fn add_packages_to(&mut self, manifest: &mut Manifest) { - let mut package = |name, targets| self.package(name, &mut manifest.pkg, targets); - package("rustc", HOSTS); -+ package("rustc-dev", HOSTS); - package("cargo", HOSTS); - package("rust-mingw", MINGW); - package("rust-std", TARGETS); -@@ -426,6 +427,13 @@ impl Builder { - "rls-preview", "rust-src", "llvm-tools-preview", - "lldb-preview", "rust-analysis", "miri-preview" - ]); -+ -+ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently -+ // split out of `rust-std`. We'll include it by default as a transition for nightly users. -+ if self.rust_release == "nightly" { -+ self.extend_profile("default", &mut manifest.profiles, &["rustc-dev"]); -+ self.extend_profile("complete", &mut manifest.profiles, &["rustc-dev"]); -+ } - } - - fn add_renames_to(&self, manifest: &mut Manifest) { -@@ -481,6 +489,15 @@ impl Builder { - components.push(host_component("rust-mingw")); - } - -+ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently -+ // split out of `rust-std`. We'll include it by default as a transition for nightly users, -+ // but ship it as an optional component on the beta and stable channels. -+ if self.rust_release == "nightly" { -+ components.push(host_component("rustc-dev")); -+ } else { -+ extensions.push(host_component("rustc-dev")); -+ } -+ - // Tools are always present in the manifest, - // but might be marked as unavailable if they weren't built. - extensions.extend(vec![ -@@ -498,6 +515,11 @@ impl Builder { - .filter(|&&target| target != host) - .map(|target| Component::from_str("rust-std", target)) - ); -+ extensions.extend( -+ HOSTS.iter() -+ .filter(|&&target| target != host) -+ .map(|target| Component::from_str("rustc-dev", target)) -+ ); - extensions.push(Component::from_str("rust-src", "*")); - - // If the components/extensions don't actually exist for this -@@ -534,6 +556,14 @@ impl Builder { - dst.insert(profile_name.to_owned(), pkgs.iter().map(|s| (*s).to_owned()).collect()); - } - -+ fn extend_profile(&mut self, -+ profile_name: &str, -+ dst: &mut BTreeMap>, -+ pkgs: &[&str]) { -+ dst.get_mut(profile_name).expect("existing profile") -+ .extend(pkgs.iter().map(|s| (*s).to_owned())); -+ } -+ - fn package(&mut self, - pkgname: &str, - dst: &mut BTreeMap, diff --git a/rust.spec b/rust.spec index 5309f63..3813405 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.38.0 -%global bootstrap_cargo 1.38.0 -%global bootstrap_channel 1.38.0 -%global bootstrap_date 2019-09-26 +%global bootstrap_rust 1.39.0 +%global bootstrap_cargo 1.39.0 +%global bootstrap_channel 1.39.0 +%global bootstrap_date 2019-11-07 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.39.0 -Release: 2%{?dist} +Version: 1.40.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,17 +67,13 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# Reduce the size of rust-std -# https://github.com/rust-lang/rust/pull/65474 -Patch2: rust-pr65474-split-rustc-dev.patch - -# Fix conflicting libraries of rustc tools -# https://github.com/rust-lang/rust/commit/73369f32621f6a844a80a8513ae3ded901e4a406 -Patch3: 0001-Hopefully-fix-rustdoc-build.patch - # Fix the bindir used by rustdoc to find rustc # https://github.com/rust-lang/rust/pull/66317 -Patch4: rust-pr66317-bindir-relative.patch +Patch2: rust-pr66317-bindir-relative.patch + +# ARM loops when C++ tries to catch and rethrow a Rust exception +# https://github.com/rust-lang/rust/issues/67242 +Patch3: rust-issue-67242-ignore-arm-foreign-exceptions.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -411,7 +407,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 %patch3 -p1 -%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -421,9 +416,6 @@ sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure rm -rf src/llvm-project/ %endif -# We never enable emscripten. -rm -rf src/llvm-emscripten/ - # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ @@ -721,6 +713,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index 3be13be..f2f74e3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.39.0-src.tar.xz) = 8610b2ec77722087c572bd84ac562a5b7c5f1a644aea58c5d5daa07a9aed242703b7816e73e2eaa049f773d5907859e259744a0de700622df005584fd798dab0 +SHA512 (rustc-1.40.0-src.tar.xz) = b5ac3079acefb62d3c985b77f624d7fb68de23a59396fed9ccb292db61641c064f3146ee54d3cf59067b17ebfaadd14a6b2b466def60316bb5b13ba3aef01e1f diff --git a/sources-bootstrap b/sources-bootstrap index 820432c..b6006b2 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.39.0-src.tar.xz) = 8610b2ec77722087c572bd84ac562a5b7c5f1a644aea58c5d5daa07a9aed242703b7816e73e2eaa049f773d5907859e259744a0de700622df005584fd798dab0 -SHA512 (rust-1.38.0-aarch64-unknown-linux-gnu.tar.xz) = c9dea8907d05af938c1936139c1fb8673d0db90503552f53645d71637bb7248263fd20b1c16db140694b2d467a12c474015a2077d9b26c782b44e965a01544c6 -SHA512 (rust-1.38.0-armv7-unknown-linux-gnueabihf.tar.xz) = ddbb2c8d2e7112c5871155890c8308080ac800795c685c4b4d06b9dd8c5abd28ee13961686c9be465d1bbd33d476c6478b90af8de0ca5a451f8b07eaff42f97d -SHA512 (rust-1.38.0-i686-unknown-linux-gnu.tar.xz) = ffdea264378510c6df687a173211427f4cb5930553c9d14e33c5776b0e15d435d1be719bba8a1db50f50a3171a38802e090451dc92a6ea764cc8fdca24651f24 -SHA512 (rust-1.38.0-powerpc64le-unknown-linux-gnu.tar.xz) = 5f3e1dd233ef17d8a296dcb55738fa119e40c32b154a7575f149bf1475b64e34f7e805f206b9862dc6499be470f179290d8abb7ad8d2b5cb355cef03d95ae374 -SHA512 (rust-1.38.0-powerpc64-unknown-linux-gnu.tar.xz) = 26240976834e510fa5a47c35b747b42db4651ea8decdb5498704432c9a21563e603046994fcc2b070d06361bf2c36fe02a15c7f02d88161b299a410f1995983a -SHA512 (rust-1.38.0-s390x-unknown-linux-gnu.tar.xz) = 7af64849236e0173d2aea723f3462682fde7d2e1e04d61c28d215163415e1b15cfb8cac57010ce55bdd928ea74076506ef50376d7550999e0fb00f9d20c4f5ff -SHA512 (rust-1.38.0-x86_64-unknown-linux-gnu.tar.xz) = 0b25c3049a7a213e9151c898979ec9b5b45e46a9072f9853d8f048cf401ef7ac343526d6919e68607a490e3e7bd0375b12ed9fb253caed26bb60f46473d3699b +SHA512 (rustc-1.40.0-src.tar.xz) = b5ac3079acefb62d3c985b77f624d7fb68de23a59396fed9ccb292db61641c064f3146ee54d3cf59067b17ebfaadd14a6b2b466def60316bb5b13ba3aef01e1f +SHA512 (rust-1.39.0-aarch64-unknown-linux-gnu.tar.xz) = ad37a8454acb8985a5c2b42d7f8bc4212651a16fb5af6b4314dd97faa47de79893f2f74b516af89cd7e77ef3db64247c4764585eb0a17ac328c9cba5e5b9c407 +SHA512 (rust-1.39.0-armv7-unknown-linux-gnueabihf.tar.xz) = db2b001a5587e2d5c8cdcb53c974f2332e76f58e362cba55fc971d7244754f1fa0b7e708ad7e73e7250652b442f06929dc1e8981536d7d76850b45ade275d406 +SHA512 (rust-1.39.0-i686-unknown-linux-gnu.tar.xz) = 930546e79c0b1105eb0604ae33ccdbd8b00b56e56d069f19f0d802093a052fd3f940eaf1390cdecd79833b0c70457ebfee2ce3b9674fff72df1367076584394a +SHA512 (rust-1.39.0-powerpc64le-unknown-linux-gnu.tar.xz) = e15585150370514e580e171faa749218aeef04ce0493f5ad3928a0cb6cd0bddbf7c75ba8ed0783a2c954bbd7166e0445b4c33be4ab48479b0104f032b3d4b0af +SHA512 (rust-1.39.0-powerpc64-unknown-linux-gnu.tar.xz) = ff99ad6b120631346af8afac092f8b620e50fb8e118ef1e0ff5668103c01f4b9f082fae72e31a767be35d0647fd9fecc7e6b7b215bb1906e06b20bf3e2685619 +SHA512 (rust-1.39.0-s390x-unknown-linux-gnu.tar.xz) = d2b588f802d4fbe153dbd88cb745d34d1f5434cb3134cc9e091ebfb336a48b4c886cd80311cf92b5e1c6a16374302853a67e8a0576b02a89dbcf61d27919a045 +SHA512 (rust-1.39.0-x86_64-unknown-linux-gnu.tar.xz) = 02ca6c821877379d8bd0bcc38281a87e6f86bdbae1270da19e41336cc3a812d9c11c1e976655c192c39153f92cda90ddbd7b4b0bcb4f6787d6d354d2be827a8a From f1f40ebcbe7008d3619675ad758eeec196500480 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 Jan 2020 09:02:41 -0800 Subject: [PATCH 003/222] Fix compiletest with newer (local-rebuild) libtest Fix ARM EHABI unwinding --- ...est-bump-to-stage0-bootstrap-libtest.patch | 32 ++++++++++++ ...ier-cache-during-ARM-EHABI-unwinding.patch | 52 +++++++++++++++++++ ...-67242-ignore-arm-foreign-exceptions.patch | 10 ---- rust.spec | 17 ++++-- 4 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch create mode 100644 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch delete mode 100644 rust-issue-67242-ignore-arm-foreign-exceptions.patch diff --git a/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch b/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch new file mode 100644 index 0000000..c8062bf --- /dev/null +++ b/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch @@ -0,0 +1,32 @@ +From f6832adadb84364ce0c81fa02910b3706f441abc Mon Sep 17 00:00:00 2001 +From: Mark Rousskov +Date: Wed, 6 Nov 2019 15:17:02 -0500 +Subject: [PATCH] Compiletest bump to stage0 bootstrap libtest + +--- + src/tools/compiletest/src/main.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs +index 34435819a2c4..b115539b4af3 100644 +--- a/src/tools/compiletest/src/main.rs ++++ b/src/tools/compiletest/src/main.rs +@@ -568,6 +568,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { + skip: vec![], + list: false, + options: test::Options::new(), ++ time_options: None, + } + } + +@@ -703,6 +704,7 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec +Date: Wed, 1 Jan 2020 17:11:45 +0100 +Subject: [PATCH] Update the barrier cache during ARM EHABI unwinding + +--- + src/libpanic_unwind/gcc.rs | 8 +++++++- + src/libunwind/libunwind.rs | 2 ++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs +index 4f572fe21b30..328d0d4ce7be 100644 +--- a/src/libpanic_unwind/gcc.rs ++++ b/src/libpanic_unwind/gcc.rs +@@ -187,7 +187,13 @@ cfg_if::cfg_if! { + match eh_action { + EHAction::None | + EHAction::Cleanup(_) => return continue_unwind(exception_object, context), +- EHAction::Catch(_) => return uw::_URC_HANDLER_FOUND, ++ EHAction::Catch(_) => { ++ // EHABI requires the personality routine to update the ++ // SP value in the barrier cache of the exception object. ++ (*exception_object).private[5] = ++ uw::_Unwind_GetGR(context, uw::UNWIND_SP_REG); ++ return uw::_URC_HANDLER_FOUND; ++ } + EHAction::Terminate => return uw::_URC_FAILURE, + } + } else { +diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs +index 0b39503c0d03..30658ce328d8 100644 +--- a/src/libunwind/libunwind.rs ++++ b/src/libunwind/libunwind.rs +@@ -23,6 +23,7 @@ pub type _Unwind_Word = uintptr_t; + pub type _Unwind_Ptr = uintptr_t; + pub type _Unwind_Trace_Fn = extern "C" fn(ctx: *mut _Unwind_Context, arg: *mut c_void) + -> _Unwind_Reason_Code; ++ + #[cfg(target_arch = "x86")] + pub const unwinder_private_data_size: usize = 5; + +@@ -151,6 +152,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm + use _Unwind_VRS_DataRepresentation::*; + + pub const UNWIND_POINTER_REG: c_int = 12; ++ pub const UNWIND_SP_REG: c_int = 13; + pub const UNWIND_IP_REG: c_int = 15; + + #[cfg_attr(all(feature = "llvm-libunwind", +-- +2.24.1 + diff --git a/rust-issue-67242-ignore-arm-foreign-exceptions.patch b/rust-issue-67242-ignore-arm-foreign-exceptions.patch deleted file mode 100644 index 127c435..0000000 --- a/rust-issue-67242-ignore-arm-foreign-exceptions.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile.orig 2019-12-07 18:36:56.000000000 -0800 -+++ rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile 2019-12-12 15:49:24.655515206 -0800 -@@ -1,3 +1,7 @@ -+# ignore-arm -+# ignore-armeb -+# https://github.com/rust-lang/rust/issues/67242 -+ - -include ../tools.mk - - all: foo diff --git a/rust.spec b/rust.spec index 3813405..3bd2f3e 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.40.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -71,9 +71,13 @@ Patch1: rust-pr57840-llvm7-debuginfo-variants.patch # https://github.com/rust-lang/rust/pull/66317 Patch2: rust-pr66317-bindir-relative.patch -# ARM loops when C++ tries to catch and rethrow a Rust exception -# https://github.com/rust-lang/rust/issues/67242 -Patch3: rust-issue-67242-ignore-arm-foreign-exceptions.patch +# Fix compiletest with newer (local-rebuild) libtest +# https://github.com/rust-lang/rust/pull/66156/commits/f6832adadb84364ce0c81fa02910b3706f441abc +Patch3: 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch + +# Fix ARM unwinding for foreign-exceptions +# https://github.com/rust-lang/rust/pull/67779 +Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -407,6 +411,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 %patch3 -p1 +%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -713,6 +718,10 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. From d39c26097cc486059ffe05b8363141dc630408c0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 Jan 2020 16:52:05 -0800 Subject: [PATCH 004/222] Build compiletest with in-tree libtest --- rust-pr68019-in-tree-compiletest.patch | 97 ++++++++++++++++++++++++++ rust.spec | 10 ++- 2 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 rust-pr68019-in-tree-compiletest.patch diff --git a/rust-pr68019-in-tree-compiletest.patch b/rust-pr68019-in-tree-compiletest.patch new file mode 100644 index 0000000..a0b28bf --- /dev/null +++ b/rust-pr68019-in-tree-compiletest.patch @@ -0,0 +1,97 @@ +From ed8e55fe8d732d8a87343441db3bfbb974f043df Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Wed, 8 Jan 2020 09:44:45 -0800 +Subject: [PATCH 1/2] Remove obsolete llvm_tools flag + +--- + src/bootstrap/tool.rs | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs +index 815498047fd5..f785a0989a36 100644 +--- a/src/bootstrap/tool.rs ++++ b/src/bootstrap/tool.rs +@@ -293,7 +293,6 @@ fn rustbook_features() -> Vec { + macro_rules! bootstrap_tool { + ($( + $name:ident, $path:expr, $tool_name:expr +- $(,llvm_tools = $llvm:expr)* + $(,is_external_tool = $external:expr)* + $(,features = $features:expr)* + ; +@@ -305,15 +304,6 @@ macro_rules! bootstrap_tool { + )+ + } + +- impl Tool { +- /// Whether this tool requires LLVM to run +- pub fn uses_llvm_tools(&self) -> bool { +- match self { +- $(Tool::$name => false $(|| $llvm)*,)+ +- } +- } +- } +- + impl<'a> Builder<'a> { + pub fn tool_exe(&self, tool: Tool) -> PathBuf { + match tool { +@@ -381,7 +371,7 @@ bootstrap_tool!( + Tidy, "src/tools/tidy", "tidy"; + Linkchecker, "src/tools/linkchecker", "linkchecker"; + CargoTest, "src/tools/cargotest", "cargotest"; +- Compiletest, "src/tools/compiletest", "compiletest", llvm_tools = true; ++ Compiletest, "src/tools/compiletest", "compiletest"; + BuildManifest, "src/tools/build-manifest", "build-manifest"; + RemoteTestClient, "src/tools/remote-test-client", "remote-test-client"; + RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true; +-- +2.24.1 + + +From cc4688d66d75e149a0136f701045cbf7ee672725 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Wed, 8 Jan 2020 10:04:18 -0800 +Subject: [PATCH 2/2] Build compiletest with in-tree libtest + +--- + src/bootstrap/tool.rs | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs +index f785a0989a36..73a4dda74e88 100644 +--- a/src/bootstrap/tool.rs ++++ b/src/bootstrap/tool.rs +@@ -294,6 +294,7 @@ macro_rules! bootstrap_tool { + ($( + $name:ident, $path:expr, $tool_name:expr + $(,is_external_tool = $external:expr)* ++ $(,is_unstable_tool = $unstable:expr)* + $(,features = $features:expr)* + ; + )+) => { +@@ -344,7 +345,12 @@ macro_rules! bootstrap_tool { + compiler: self.compiler, + target: self.target, + tool: $tool_name, +- mode: Mode::ToolBootstrap, ++ mode: if false $(|| $unstable)* { ++ // use in-tree libraries for unstable features ++ Mode::ToolStd ++ } else { ++ Mode::ToolBootstrap ++ }, + path: $path, + is_optional_tool: false, + source_type: if false $(|| $external)* { +@@ -371,7 +377,7 @@ bootstrap_tool!( + Tidy, "src/tools/tidy", "tidy"; + Linkchecker, "src/tools/linkchecker", "linkchecker"; + CargoTest, "src/tools/cargotest", "cargotest"; +- Compiletest, "src/tools/compiletest", "compiletest"; ++ Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true; + BuildManifest, "src/tools/build-manifest", "build-manifest"; + RemoteTestClient, "src/tools/remote-test-client", "remote-test-client"; + RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true; +-- +2.24.1 + diff --git a/rust.spec b/rust.spec index 3bd2f3e..5651c38 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.40.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -74,10 +74,12 @@ Patch2: rust-pr66317-bindir-relative.patch # Fix compiletest with newer (local-rebuild) libtest # https://github.com/rust-lang/rust/pull/66156/commits/f6832adadb84364ce0c81fa02910b3706f441abc Patch3: 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch +# https://github.com/rust-lang/rust/pull/68019 +Patch4: rust-pr68019-in-tree-compiletest.patch # Fix ARM unwinding for foreign-exceptions # https://github.com/rust-lang/rust/pull/67779 -Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch +Patch5: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -412,6 +414,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -718,6 +721,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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 From b2dedbd4bd501e7d8e0fb7bd7f494f6326dd3d25 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 30 Jan 2020 10:42:52 -0800 Subject: [PATCH 005/222] Update to 1.41.0. --- .gitignore | 8 ++++ ...est-bump-to-stage0-bootstrap-libtest.patch | 32 --------------- ...compiletest-fallout-from-stage0-bump.patch | 24 ++++++++++++ rust-pr57840-llvm7-debuginfo-variants.patch | 2 +- rust-pr66317-bindir-relative.patch | 39 ------------------- rust.spec | 35 ++++++++--------- sources | 2 +- sources-bootstrap | 16 ++++---- 8 files changed, 58 insertions(+), 100 deletions(-) delete mode 100644 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch create mode 100644 0001-Fix-compiletest-fallout-from-stage0-bump.patch delete mode 100644 rust-pr66317-bindir-relative.patch diff --git a/.gitignore b/.gitignore index 1c16ae6..f487e25 100644 --- a/.gitignore +++ b/.gitignore @@ -244,3 +244,11 @@ /rust-1.39.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.39.0-s390x-unknown-linux-gnu.tar.xz /rust-1.39.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.41.0-src.tar.xz +/rust-1.40.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.40.0-i686-unknown-linux-gnu.tar.xz +/rust-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.40.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.40.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch b/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch deleted file mode 100644 index c8062bf..0000000 --- a/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f6832adadb84364ce0c81fa02910b3706f441abc Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Wed, 6 Nov 2019 15:17:02 -0500 -Subject: [PATCH] Compiletest bump to stage0 bootstrap libtest - ---- - src/tools/compiletest/src/main.rs | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs -index 34435819a2c4..b115539b4af3 100644 ---- a/src/tools/compiletest/src/main.rs -+++ b/src/tools/compiletest/src/main.rs -@@ -568,6 +568,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { - skip: vec![], - list: false, - options: test::Options::new(), -+ time_options: None, - } - } - -@@ -703,6 +704,7 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec +Date: Wed, 18 Dec 2019 13:28:14 -0500 +Subject: [PATCH] Fix compiletest fallout from stage0 bump + +--- + src/tools/compiletest/src/main.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs +index 15f8abd75d59..32965bbb292d 100644 +--- a/src/tools/compiletest/src/main.rs ++++ b/src/tools/compiletest/src/main.rs +@@ -569,6 +569,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { + list: false, + options: test::Options::new(), + time_options: None, ++ force_run_in_process: false, + } + } + +-- +2.24.1 + diff --git a/rust-pr57840-llvm7-debuginfo-variants.patch b/rust-pr57840-llvm7-debuginfo-variants.patch index 71996bc..b1fd427 100644 --- a/rust-pr57840-llvm7-debuginfo-variants.patch +++ b/rust-pr57840-llvm7-debuginfo-variants.patch @@ -29,4 +29,4 @@ index 6deedd0b5ea3..9f63038c3623 100644 + || llvm_util::get_major_version() < 8; } - // Describes the members of an enum value: An enum is described as a union of + // FIXME(eddyb) maybe precompute this? Right now it's computed once diff --git a/rust-pr66317-bindir-relative.patch b/rust-pr66317-bindir-relative.patch deleted file mode 100644 index 71d3b0c..0000000 --- a/rust-pr66317-bindir-relative.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 2748903f2d47..10d02d6db829 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -1231,7 +1231,8 @@ impl<'a> Builder<'a> { - cargo.arg("--frozen"); - } - -- cargo.env("RUSTC_INSTALL_BINDIR", &self.config.bindir); -+ // Try to use a sysroot-relative bindir, in case it was configured absolutely. -+ cargo.env("RUSTC_INSTALL_BINDIR", self.config.bindir_relative()); - - self.ci_env.force_coloring_in_ci(&mut cargo); - -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index d1bdfa0a7676..0c03b95c7b25 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -647,6 +647,20 @@ impl Config { - config - } - -+ /// Try to find the relative path of `bindir`, otherwise return it in full. -+ pub fn bindir_relative(&self) -> &Path { -+ let bindir = &self.bindir; -+ if bindir.is_absolute() { -+ // Try to make it relative to the prefix. -+ if let Some(prefix) = &self.prefix { -+ if let Ok(stripped) = bindir.strip_prefix(prefix) { -+ return stripped; -+ } -+ } -+ } -+ bindir -+ } -+ - /// Try to find the relative path of `libdir`. - pub fn libdir_relative(&self) -> Option<&Path> { - let libdir = self.libdir.as_ref()?; diff --git a/rust.spec b/rust.spec index 5651c38..5ea65c1 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.39.0 -%global bootstrap_cargo 1.39.0 -%global bootstrap_channel 1.39.0 -%global bootstrap_date 2019-11-07 +%global bootstrap_rust 1.40.0 +%global bootstrap_cargo 1.40.0 +%global bootstrap_channel 1.40.0 +%global bootstrap_date 2019-12-19 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -21,7 +21,7 @@ %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 6.0+. +# is insufficient. Rust currently requires LLVM 7.0+. %if 0%{?rhel} && !0%{?epel} %bcond_without bundled_llvm %else @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.40.0 -Release: 3%{?dist} +Version: 1.41.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,19 +67,15 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# Fix the bindir used by rustdoc to find rustc -# https://github.com/rust-lang/rust/pull/66317 -Patch2: rust-pr66317-bindir-relative.patch - # Fix compiletest with newer (local-rebuild) libtest -# https://github.com/rust-lang/rust/pull/66156/commits/f6832adadb84364ce0c81fa02910b3706f441abc -Patch3: 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch +# https://github.com/rust-lang/rust/commit/241d2e765dc7401e642812e43b75dbc3950f2c98 +Patch2: 0001-Fix-compiletest-fallout-from-stage0-bump.patch # https://github.com/rust-lang/rust/pull/68019 -Patch4: rust-pr68019-in-tree-compiletest.patch +Patch3: rust-pr68019-in-tree-compiletest.patch # Fix ARM unwinding for foreign-exceptions # https://github.com/rust-lang/rust/pull/67779 -Patch5: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch +Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -161,7 +157,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 8.0.0 +Provides: bundled(llvm) = 9.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} @@ -173,7 +169,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 6.0 +BuildRequires: %{llvm}-devel >= 7.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -414,7 +410,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -628,7 +623,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so -%{rustlibdir}/%{rust_triple}/codegen-backends/ %exclude %{_bindir}/*miri @@ -721,6 +715,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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 diff --git a/sources b/sources index f2f74e3..cbe64cc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.40.0-src.tar.xz) = b5ac3079acefb62d3c985b77f624d7fb68de23a59396fed9ccb292db61641c064f3146ee54d3cf59067b17ebfaadd14a6b2b466def60316bb5b13ba3aef01e1f +SHA512 (rustc-1.41.0-src.tar.xz) = 0e30fe53b77860085bea0f1f60315eb835b00dd796c5d1b98ed44fe6fc27336dfb064908c86e1669a9cbe81c9ca1495e1c259a8a268bef23b23805a719cef0dd diff --git a/sources-bootstrap b/sources-bootstrap index b6006b2..ae403f7 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.40.0-src.tar.xz) = b5ac3079acefb62d3c985b77f624d7fb68de23a59396fed9ccb292db61641c064f3146ee54d3cf59067b17ebfaadd14a6b2b466def60316bb5b13ba3aef01e1f -SHA512 (rust-1.39.0-aarch64-unknown-linux-gnu.tar.xz) = ad37a8454acb8985a5c2b42d7f8bc4212651a16fb5af6b4314dd97faa47de79893f2f74b516af89cd7e77ef3db64247c4764585eb0a17ac328c9cba5e5b9c407 -SHA512 (rust-1.39.0-armv7-unknown-linux-gnueabihf.tar.xz) = db2b001a5587e2d5c8cdcb53c974f2332e76f58e362cba55fc971d7244754f1fa0b7e708ad7e73e7250652b442f06929dc1e8981536d7d76850b45ade275d406 -SHA512 (rust-1.39.0-i686-unknown-linux-gnu.tar.xz) = 930546e79c0b1105eb0604ae33ccdbd8b00b56e56d069f19f0d802093a052fd3f940eaf1390cdecd79833b0c70457ebfee2ce3b9674fff72df1367076584394a -SHA512 (rust-1.39.0-powerpc64le-unknown-linux-gnu.tar.xz) = e15585150370514e580e171faa749218aeef04ce0493f5ad3928a0cb6cd0bddbf7c75ba8ed0783a2c954bbd7166e0445b4c33be4ab48479b0104f032b3d4b0af -SHA512 (rust-1.39.0-powerpc64-unknown-linux-gnu.tar.xz) = ff99ad6b120631346af8afac092f8b620e50fb8e118ef1e0ff5668103c01f4b9f082fae72e31a767be35d0647fd9fecc7e6b7b215bb1906e06b20bf3e2685619 -SHA512 (rust-1.39.0-s390x-unknown-linux-gnu.tar.xz) = d2b588f802d4fbe153dbd88cb745d34d1f5434cb3134cc9e091ebfb336a48b4c886cd80311cf92b5e1c6a16374302853a67e8a0576b02a89dbcf61d27919a045 -SHA512 (rust-1.39.0-x86_64-unknown-linux-gnu.tar.xz) = 02ca6c821877379d8bd0bcc38281a87e6f86bdbae1270da19e41336cc3a812d9c11c1e976655c192c39153f92cda90ddbd7b4b0bcb4f6787d6d354d2be827a8a +SHA512 (rustc-1.41.0-src.tar.xz) = 0e30fe53b77860085bea0f1f60315eb835b00dd796c5d1b98ed44fe6fc27336dfb064908c86e1669a9cbe81c9ca1495e1c259a8a268bef23b23805a719cef0dd +SHA512 (rust-1.40.0-aarch64-unknown-linux-gnu.tar.xz) = f601e4251e08a6d66edb0489b6ab840b57622b506547e81036e6dfe08eb71005a22a2777a0b8b2d07a6f88286d58f513482b863116311a6f43c7284769af6e7f +SHA512 (rust-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz) = d3345946c5a3d5cb3d7fca4d3200710704d64547ebfa4ab11c45ea1a18ca3c49b429783d499845f31dcb150abe2f6836fe203fd9d7aa53e0475b940da5549492 +SHA512 (rust-1.40.0-i686-unknown-linux-gnu.tar.xz) = d727149afbbc3b2709360dd6080ff301e781aaa94459c1348d3e35382bc9c7ad65c4d70f9bfc7b44ac92ddaf89e3aab92b75b9d184eba86916da25bd629592b6 +SHA512 (rust-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz) = 8b82f3bacc503aa23cfa7a6cd6232e34b734becffbbe02df9f766878d526d24d7409d8c104f39fa791c0f7a8b3fa61f6b8a528e89e8ab94d6a131b2d0ac11f0f +SHA512 (rust-1.40.0-powerpc64-unknown-linux-gnu.tar.xz) = eae2e0ba3a6a9ba07945112c17962ca3c77737fa187759e674e78f626777da85a5ee6107168fe2866b5beb1ecf2e655652cb7d9b51867b247d76e174dfb103ce +SHA512 (rust-1.40.0-s390x-unknown-linux-gnu.tar.xz) = e71d3a1d85975653b6d972a4854c9e53be7f2d093a601145261c97f7917f869399fbc6322a04f63b782a5a28b91c3be40041a8c77367d19dec8d0e857cbbef14 +SHA512 (rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz) = 11a2ad1d8b9e91cbe9ee6a1954d46ac75eeaa83f0c2425a8ad70d191727b02e86ead33d6464222effca6f5134c31a165801a854aa57bdb5f12944d605de3c1d1 From a22d8f719ca0e18ecbfc7dd3761ddcf0c8146072 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 31 Jan 2020 13:50:52 -0800 Subject: [PATCH 006/222] Reintroduce the workaround for LLVM library path This reverts commit 93ecbc5a139208a2eeff691980d8e513b6b1b406, reintroducing the workaround for rust#40717, now rust#68714. --- rust.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust.spec b/rust.spec index 5ea65c1..cab311c 100644 --- a/rust.spec +++ b/rust.spec @@ -224,6 +224,10 @@ Requires: /usr/bin/cc %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} %global llvm_has_filecheck 1 %endif +%if "%{llvm_root}" != "%{_prefix}" +# https://github.com/rust-lang/rust/issues/68714 +%global library_path $(%{llvm_root}/bin/llvm-config --libdir) +%endif %endif %description @@ -477,6 +481,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif %{?cmake_path:export PATH=%{cmake_path}:$PATH} +%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # We're going to override --libdir when configuring to get rustlib into a @@ -527,6 +532,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %install %{?cmake_path:export PATH=%{cmake_path}:$PATH} +%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} %{python} ./x.py install @@ -597,6 +603,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %check %{?cmake_path:export PATH=%{cmake_path}:$PATH} +%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # The results are not stable on koji, so mask errors and just log it. From 9b4ad1ffb1b385d4a4ca77445ae564067195ef03 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 20 Feb 2020 14:49:18 -0800 Subject: [PATCH 007/222] Rebuild with llvm9.0 --- rust.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index cab311c..bb1bd1c 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.41.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -162,6 +162,8 @@ Provides: bundled(llvm) = 9.0.0 BuildRequires: cmake >= 2.8.11 %if 0%{?epel} %global llvm llvm7.0 +%elif 0%{?fedora} >= 32 +%global llvm llvm9.0 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -722,6 +724,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. From 269b322b5cd802fe6db8517d23ba0aae3480700d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 27 Feb 2020 09:21:31 -0800 Subject: [PATCH 008/222] Update to 1.41.1. --- rust.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index bb1bd1c..1e618cc 100644 --- a/rust.spec +++ b/rust.spec @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.41.0 -Release: 2%{?dist} +Version: 1.41.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -724,6 +724,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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 From f5e3ba57291326d8d55ef7c060b19fd09630904c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 27 Feb 2020 09:23:45 -0800 Subject: [PATCH 009/222] fedpkg new-sources --- .gitignore | 1 + sources | 2 +- sources-bootstrap | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f487e25..89b4046 100644 --- a/.gitignore +++ b/.gitignore @@ -252,3 +252,4 @@ /rust-1.40.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.40.0-s390x-unknown-linux-gnu.tar.xz /rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.41.1-src.tar.xz diff --git a/sources b/sources index cbe64cc..8b5147c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.41.0-src.tar.xz) = 0e30fe53b77860085bea0f1f60315eb835b00dd796c5d1b98ed44fe6fc27336dfb064908c86e1669a9cbe81c9ca1495e1c259a8a268bef23b23805a719cef0dd +SHA512 (rustc-1.41.1-src.tar.xz) = ef33565c9cf4e27ca279072bfed3301e0276c09407d49727640746ba78d289de285278d64b1cce8708461fd6c97c7ab2ea8d56e7a4c4a23b2e66e2d164c35fc9 diff --git a/sources-bootstrap b/sources-bootstrap index ae403f7..ad40ecc 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.41.0-src.tar.xz) = 0e30fe53b77860085bea0f1f60315eb835b00dd796c5d1b98ed44fe6fc27336dfb064908c86e1669a9cbe81c9ca1495e1c259a8a268bef23b23805a719cef0dd +SHA512 (rustc-1.41.1-src.tar.xz) = ef33565c9cf4e27ca279072bfed3301e0276c09407d49727640746ba78d289de285278d64b1cce8708461fd6c97c7ab2ea8d56e7a4c4a23b2e66e2d164c35fc9 SHA512 (rust-1.40.0-aarch64-unknown-linux-gnu.tar.xz) = f601e4251e08a6d66edb0489b6ab840b57622b506547e81036e6dfe08eb71005a22a2777a0b8b2d07a6f88286d58f513482b863116311a6f43c7284769af6e7f SHA512 (rust-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz) = d3345946c5a3d5cb3d7fca4d3200710704d64547ebfa4ab11c45ea1a18ca3c49b429783d499845f31dcb150abe2f6836fe203fd9d7aa53e0475b940da5549492 SHA512 (rust-1.40.0-i686-unknown-linux-gnu.tar.xz) = d727149afbbc3b2709360dd6080ff301e781aaa94459c1348d3e35382bc9c7ad65c4d70f9bfc7b44ac92ddaf89e3aab92b75b9d184eba86916da25bd629592b6 From 682c207f089529adb201f8bd31e775acc4d291d7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 27 Feb 2020 13:31:18 -0800 Subject: [PATCH 010/222] For older rpm's sake, don't use %elif --- rust.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 1e618cc..a6be1a7 100644 --- a/rust.spec +++ b/rust.spec @@ -162,7 +162,8 @@ Provides: bundled(llvm) = 9.0.0 BuildRequires: cmake >= 2.8.11 %if 0%{?epel} %global llvm llvm7.0 -%elif 0%{?fedora} >= 32 +%endif +%if 0%{?fedora} >= 32 %global llvm llvm9.0 %endif %if %defined llvm From a4c430044f977fcf79dd3ee63f1e69a6ba1f5489 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 12 Mar 2020 10:06:33 -0700 Subject: [PATCH 011/222] Update to 1.42.0. --- .gitignore | 8 ++ ...compiletest-fallout-from-stage0-bump.patch | 24 ----- ...ier-cache-during-ARM-EHABI-unwinding.patch | 52 ---------- rust-pr68019-in-tree-compiletest.patch | 97 ------------------- rust.spec | 31 ++---- sources | 2 +- sources-bootstrap | 16 +-- 7 files changed, 27 insertions(+), 203 deletions(-) delete mode 100644 0001-Fix-compiletest-fallout-from-stage0-bump.patch delete mode 100644 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch delete mode 100644 rust-pr68019-in-tree-compiletest.patch diff --git a/.gitignore b/.gitignore index 89b4046..8c01968 100644 --- a/.gitignore +++ b/.gitignore @@ -253,3 +253,11 @@ /rust-1.40.0-s390x-unknown-linux-gnu.tar.xz /rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz /rustc-1.41.1-src.tar.xz +/rustc-1.42.0-src.tar.xz +/rust-1.41.1-aarch64-unknown-linux-gnu.tar.xz +/rust-1.41.1-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.41.1-i686-unknown-linux-gnu.tar.xz +/rust-1.41.1-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.41.1-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.41.1-s390x-unknown-linux-gnu.tar.xz +/rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Fix-compiletest-fallout-from-stage0-bump.patch b/0001-Fix-compiletest-fallout-from-stage0-bump.patch deleted file mode 100644 index dfffce9..0000000 --- a/0001-Fix-compiletest-fallout-from-stage0-bump.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 241d2e765dc7401e642812e43b75dbc3950f2c98 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Wed, 18 Dec 2019 13:28:14 -0500 -Subject: [PATCH] Fix compiletest fallout from stage0 bump - ---- - src/tools/compiletest/src/main.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs -index 15f8abd75d59..32965bbb292d 100644 ---- a/src/tools/compiletest/src/main.rs -+++ b/src/tools/compiletest/src/main.rs -@@ -569,6 +569,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { - list: false, - options: test::Options::new(), - time_options: None, -+ force_run_in_process: false, - } - } - --- -2.24.1 - diff --git a/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch b/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch deleted file mode 100644 index 82d928d..0000000 --- a/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch +++ /dev/null @@ -1,52 +0,0 @@ -From b6fd4598c5367e78b5841fd99412484f0e86fc21 Mon Sep 17 00:00:00 2001 -From: Amanieu d'Antras -Date: Wed, 1 Jan 2020 17:11:45 +0100 -Subject: [PATCH] Update the barrier cache during ARM EHABI unwinding - ---- - src/libpanic_unwind/gcc.rs | 8 +++++++- - src/libunwind/libunwind.rs | 2 ++ - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs -index 4f572fe21b30..328d0d4ce7be 100644 ---- a/src/libpanic_unwind/gcc.rs -+++ b/src/libpanic_unwind/gcc.rs -@@ -187,7 +187,13 @@ cfg_if::cfg_if! { - match eh_action { - EHAction::None | - EHAction::Cleanup(_) => return continue_unwind(exception_object, context), -- EHAction::Catch(_) => return uw::_URC_HANDLER_FOUND, -+ EHAction::Catch(_) => { -+ // EHABI requires the personality routine to update the -+ // SP value in the barrier cache of the exception object. -+ (*exception_object).private[5] = -+ uw::_Unwind_GetGR(context, uw::UNWIND_SP_REG); -+ return uw::_URC_HANDLER_FOUND; -+ } - EHAction::Terminate => return uw::_URC_FAILURE, - } - } else { -diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs -index 0b39503c0d03..30658ce328d8 100644 ---- a/src/libunwind/libunwind.rs -+++ b/src/libunwind/libunwind.rs -@@ -23,6 +23,7 @@ pub type _Unwind_Word = uintptr_t; - pub type _Unwind_Ptr = uintptr_t; - pub type _Unwind_Trace_Fn = extern "C" fn(ctx: *mut _Unwind_Context, arg: *mut c_void) - -> _Unwind_Reason_Code; -+ - #[cfg(target_arch = "x86")] - pub const unwinder_private_data_size: usize = 5; - -@@ -151,6 +152,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm - use _Unwind_VRS_DataRepresentation::*; - - pub const UNWIND_POINTER_REG: c_int = 12; -+ pub const UNWIND_SP_REG: c_int = 13; - pub const UNWIND_IP_REG: c_int = 15; - - #[cfg_attr(all(feature = "llvm-libunwind", --- -2.24.1 - diff --git a/rust-pr68019-in-tree-compiletest.patch b/rust-pr68019-in-tree-compiletest.patch deleted file mode 100644 index a0b28bf..0000000 --- a/rust-pr68019-in-tree-compiletest.patch +++ /dev/null @@ -1,97 +0,0 @@ -From ed8e55fe8d732d8a87343441db3bfbb974f043df Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 8 Jan 2020 09:44:45 -0800 -Subject: [PATCH 1/2] Remove obsolete llvm_tools flag - ---- - src/bootstrap/tool.rs | 12 +----------- - 1 file changed, 1 insertion(+), 11 deletions(-) - -diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs -index 815498047fd5..f785a0989a36 100644 ---- a/src/bootstrap/tool.rs -+++ b/src/bootstrap/tool.rs -@@ -293,7 +293,6 @@ fn rustbook_features() -> Vec { - macro_rules! bootstrap_tool { - ($( - $name:ident, $path:expr, $tool_name:expr -- $(,llvm_tools = $llvm:expr)* - $(,is_external_tool = $external:expr)* - $(,features = $features:expr)* - ; -@@ -305,15 +304,6 @@ macro_rules! bootstrap_tool { - )+ - } - -- impl Tool { -- /// Whether this tool requires LLVM to run -- pub fn uses_llvm_tools(&self) -> bool { -- match self { -- $(Tool::$name => false $(|| $llvm)*,)+ -- } -- } -- } -- - impl<'a> Builder<'a> { - pub fn tool_exe(&self, tool: Tool) -> PathBuf { - match tool { -@@ -381,7 +371,7 @@ bootstrap_tool!( - Tidy, "src/tools/tidy", "tidy"; - Linkchecker, "src/tools/linkchecker", "linkchecker"; - CargoTest, "src/tools/cargotest", "cargotest"; -- Compiletest, "src/tools/compiletest", "compiletest", llvm_tools = true; -+ Compiletest, "src/tools/compiletest", "compiletest"; - BuildManifest, "src/tools/build-manifest", "build-manifest"; - RemoteTestClient, "src/tools/remote-test-client", "remote-test-client"; - RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true; --- -2.24.1 - - -From cc4688d66d75e149a0136f701045cbf7ee672725 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 8 Jan 2020 10:04:18 -0800 -Subject: [PATCH 2/2] Build compiletest with in-tree libtest - ---- - src/bootstrap/tool.rs | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs -index f785a0989a36..73a4dda74e88 100644 ---- a/src/bootstrap/tool.rs -+++ b/src/bootstrap/tool.rs -@@ -294,6 +294,7 @@ macro_rules! bootstrap_tool { - ($( - $name:ident, $path:expr, $tool_name:expr - $(,is_external_tool = $external:expr)* -+ $(,is_unstable_tool = $unstable:expr)* - $(,features = $features:expr)* - ; - )+) => { -@@ -344,7 +345,12 @@ macro_rules! bootstrap_tool { - compiler: self.compiler, - target: self.target, - tool: $tool_name, -- mode: Mode::ToolBootstrap, -+ mode: if false $(|| $unstable)* { -+ // use in-tree libraries for unstable features -+ Mode::ToolStd -+ } else { -+ Mode::ToolBootstrap -+ }, - path: $path, - is_optional_tool: false, - source_type: if false $(|| $external)* { -@@ -371,7 +377,7 @@ bootstrap_tool!( - Tidy, "src/tools/tidy", "tidy"; - Linkchecker, "src/tools/linkchecker", "linkchecker"; - CargoTest, "src/tools/cargotest", "cargotest"; -- Compiletest, "src/tools/compiletest", "compiletest"; -+ Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true; - BuildManifest, "src/tools/build-manifest", "build-manifest"; - RemoteTestClient, "src/tools/remote-test-client", "remote-test-client"; - RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true; --- -2.24.1 - diff --git a/rust.spec b/rust.spec index a6be1a7..fdef18b 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.40.0 -%global bootstrap_cargo 1.40.0 -%global bootstrap_channel 1.40.0 -%global bootstrap_date 2019-12-19 +%global bootstrap_rust 1.41.0 +%global bootstrap_cargo 1.41.0 +%global bootstrap_channel 1.41.1 +%global bootstrap_date 2020-02-27 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.41.1 +Version: 1.42.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -67,16 +67,6 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# Fix compiletest with newer (local-rebuild) libtest -# https://github.com/rust-lang/rust/commit/241d2e765dc7401e642812e43b75dbc3950f2c98 -Patch2: 0001-Fix-compiletest-fallout-from-stage0-bump.patch -# https://github.com/rust-lang/rust/pull/68019 -Patch3: rust-pr68019-in-tree-compiletest.patch - -# Fix ARM unwinding for foreign-exceptions -# https://github.com/rust-lang/rust/pull/67779 -Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch - # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -187,7 +177,6 @@ BuildRequires: gdb # TODO: work on unbundling these! Provides: bundled(libbacktrace) = 8.1.0 -Provides: bundled(miniz) = 2.0.7 # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} @@ -305,7 +294,7 @@ Summary: Rust's package manager and build tool Provides: bundled(libgit2) = 0.28.2 %endif %if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.8.1~dev +Provides: bundled(libssh2) = 1.9.0~dev %endif # For tests: BuildRequires: git @@ -351,7 +340,7 @@ Summary: Rust Language Server for IDE integration Provides: bundled(libgit2) = 0.28.2 %endif %if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.8.1~dev +Provides: bundled(libssh2) = 1.9.0~dev %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs @@ -414,9 +403,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -R -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -725,6 +711,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index 8b5147c..63fa9dd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.41.1-src.tar.xz) = ef33565c9cf4e27ca279072bfed3301e0276c09407d49727640746ba78d289de285278d64b1cce8708461fd6c97c7ab2ea8d56e7a4c4a23b2e66e2d164c35fc9 +SHA512 (rustc-1.42.0-src.tar.xz) = 589bfdc92deedd33b8ea0df7f7c64c2a9a085fbea64936eff92f81e812309c060ed7a7adc96f6010d7adf62a68434a230da0f6c5b3540df4e0a5c6de05a31b16 diff --git a/sources-bootstrap b/sources-bootstrap index ad40ecc..4a4c06d 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.41.1-src.tar.xz) = ef33565c9cf4e27ca279072bfed3301e0276c09407d49727640746ba78d289de285278d64b1cce8708461fd6c97c7ab2ea8d56e7a4c4a23b2e66e2d164c35fc9 -SHA512 (rust-1.40.0-aarch64-unknown-linux-gnu.tar.xz) = f601e4251e08a6d66edb0489b6ab840b57622b506547e81036e6dfe08eb71005a22a2777a0b8b2d07a6f88286d58f513482b863116311a6f43c7284769af6e7f -SHA512 (rust-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz) = d3345946c5a3d5cb3d7fca4d3200710704d64547ebfa4ab11c45ea1a18ca3c49b429783d499845f31dcb150abe2f6836fe203fd9d7aa53e0475b940da5549492 -SHA512 (rust-1.40.0-i686-unknown-linux-gnu.tar.xz) = d727149afbbc3b2709360dd6080ff301e781aaa94459c1348d3e35382bc9c7ad65c4d70f9bfc7b44ac92ddaf89e3aab92b75b9d184eba86916da25bd629592b6 -SHA512 (rust-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz) = 8b82f3bacc503aa23cfa7a6cd6232e34b734becffbbe02df9f766878d526d24d7409d8c104f39fa791c0f7a8b3fa61f6b8a528e89e8ab94d6a131b2d0ac11f0f -SHA512 (rust-1.40.0-powerpc64-unknown-linux-gnu.tar.xz) = eae2e0ba3a6a9ba07945112c17962ca3c77737fa187759e674e78f626777da85a5ee6107168fe2866b5beb1ecf2e655652cb7d9b51867b247d76e174dfb103ce -SHA512 (rust-1.40.0-s390x-unknown-linux-gnu.tar.xz) = e71d3a1d85975653b6d972a4854c9e53be7f2d093a601145261c97f7917f869399fbc6322a04f63b782a5a28b91c3be40041a8c77367d19dec8d0e857cbbef14 -SHA512 (rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz) = 11a2ad1d8b9e91cbe9ee6a1954d46ac75eeaa83f0c2425a8ad70d191727b02e86ead33d6464222effca6f5134c31a165801a854aa57bdb5f12944d605de3c1d1 +SHA512 (rustc-1.42.0-src.tar.xz) = 589bfdc92deedd33b8ea0df7f7c64c2a9a085fbea64936eff92f81e812309c060ed7a7adc96f6010d7adf62a68434a230da0f6c5b3540df4e0a5c6de05a31b16 +SHA512 (rust-1.41.1-aarch64-unknown-linux-gnu.tar.xz) = 54eac5c380b418c1714931ead7d6284b225bb427fcc501e147240000b71d31b667e308aea7f38f3299b1311ab04f19011b914d37a4581c7a64028965569cd58e +SHA512 (rust-1.41.1-armv7-unknown-linux-gnueabihf.tar.xz) = 400bf8d013fe5030243bc0ccb7066ea3d03a2c10727e04b6830ab91dfe9b04f78cfef10794a1c7bb6276fb00c86f1e1c42a74faba19f3125859b3464726d01c2 +SHA512 (rust-1.41.1-i686-unknown-linux-gnu.tar.xz) = c6d74b2653c537043eb2ea721095ff053def592b4c330bdc104690cfb51d648f515288cc0451743d94260f18a55d6757bcb8eb1e6c0217da3498d08b681ca6af +SHA512 (rust-1.41.1-powerpc64le-unknown-linux-gnu.tar.xz) = 1b2bf6d35321dd0a0fc9735005317f09f8b9a81b520612484530e29156ea254d5cada583e44f7e4a840edde09d70c34f7ead1208d8aa6037c652540dfa38cede +SHA512 (rust-1.41.1-powerpc64-unknown-linux-gnu.tar.xz) = 50367685783085cc384be944d4321dfde850f3a0e94de0625a08f17160af2c0b795276f96574d1bea84092cbc1cd3cde619d97fe2e37b07ead17f49164e1c995 +SHA512 (rust-1.41.1-s390x-unknown-linux-gnu.tar.xz) = f809adc626876df5c6e050362d59189ede5e3991ac41fd129922540abeb728f618e1a3f3925cee34895de5e037141aabb1f8c2b94d4069945d174e38446e8153 +SHA512 (rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz) = c75d4a18cf9300c6ab480d34c5e4b41be971535931455239330cb2a0e927bcf9cf102498cad5dd1d5d802fd1d9c9d214b80e8ff15aa6be68d3e7f41420cad666 From 3d7a297b89c75d8f59c13af52f6cdaf26785172f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 12 Mar 2020 13:07:46 -0700 Subject: [PATCH 012/222] Fix 1.42 bootstrapping itself --- 0001-Drop-cfg-bootstrap-code.patch | 25 +++++++++++++++++++++++++ rust.spec | 5 +++++ 2 files changed, 30 insertions(+) create mode 100644 0001-Drop-cfg-bootstrap-code.patch diff --git a/0001-Drop-cfg-bootstrap-code.patch b/0001-Drop-cfg-bootstrap-code.patch new file mode 100644 index 0000000..3d8f202 --- /dev/null +++ b/0001-Drop-cfg-bootstrap-code.patch @@ -0,0 +1,25 @@ +From 31dcdc9e13c324d33a18db3aed7f4b3208ff3744 Mon Sep 17 00:00:00 2001 +From: Mark Rousskov +Date: Fri, 31 Jan 2020 12:30:17 -0500 +Subject: [PATCH] Drop cfg(bootstrap) code + +--- + src/bootstrap/lib.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 1fee3fd9ac1d..637323331f58 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -1026,7 +1026,7 @@ impl Build { + } + + fn llvm_link_tools_dynamically(&self, target: Interned) -> bool { +- (target.contains("linux-gnu") || target.contains("apple-darwin")) ++ target.contains("linux-gnu") || target.contains("apple-darwin") + } + + /// Returns the `version` string associated with this compiler for Rust +-- +2.24.1 + diff --git a/rust.spec b/rust.spec index fdef18b..f0875a3 100644 --- a/rust.spec +++ b/rust.spec @@ -67,6 +67,10 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch +# Fix 1.42 bootstrapping itself +# https://github.com/rust-lang/rust/issues/69953 +Patch2: 0001-Drop-cfg-bootstrap-code.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -403,6 +407,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -R +%patch2 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure From dd62b3568394ee83ca9b47089b30489e46af6cf2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 23 Apr 2020 10:51:59 -0700 Subject: [PATCH 013/222] Update to 1.43.0. --- .gitignore | 8 + 0001-Drop-cfg-bootstrap-code.patch | 25 --- ...0123-ensure-llvm-is-in-the-link-path.patch | 210 ++++++++++++++++++ ...-pr70163-prepare-for-llvm-10-upgrade.patch | 175 +++++++++++++++ ...0591-ensure-llvm-is-in-the-link-path.patch | 40 ++++ rust.spec | 41 ++-- sources | 2 +- sources-bootstrap | 16 +- 8 files changed, 463 insertions(+), 54 deletions(-) delete mode 100644 0001-Drop-cfg-bootstrap-code.patch create mode 100644 rust-pr70123-ensure-llvm-is-in-the-link-path.patch create mode 100644 rust-pr70163-prepare-for-llvm-10-upgrade.patch create mode 100644 rust-pr70591-ensure-llvm-is-in-the-link-path.patch diff --git a/.gitignore b/.gitignore index 8c01968..2e5822a 100644 --- a/.gitignore +++ b/.gitignore @@ -261,3 +261,11 @@ /rust-1.41.1-powerpc64-unknown-linux-gnu.tar.xz /rust-1.41.1-s390x-unknown-linux-gnu.tar.xz /rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.43.0-src.tar.xz +/rust-1.42.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.42.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.42.0-i686-unknown-linux-gnu.tar.xz +/rust-1.42.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.42.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.42.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Drop-cfg-bootstrap-code.patch b/0001-Drop-cfg-bootstrap-code.patch deleted file mode 100644 index 3d8f202..0000000 --- a/0001-Drop-cfg-bootstrap-code.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 31dcdc9e13c324d33a18db3aed7f4b3208ff3744 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Fri, 31 Jan 2020 12:30:17 -0500 -Subject: [PATCH] Drop cfg(bootstrap) code - ---- - src/bootstrap/lib.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 1fee3fd9ac1d..637323331f58 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -1026,7 +1026,7 @@ impl Build { - } - - fn llvm_link_tools_dynamically(&self, target: Interned) -> bool { -- (target.contains("linux-gnu") || target.contains("apple-darwin")) -+ target.contains("linux-gnu") || target.contains("apple-darwin") - } - - /// Returns the `version` string associated with this compiler for Rust --- -2.24.1 - diff --git a/rust-pr70123-ensure-llvm-is-in-the-link-path.patch b/rust-pr70123-ensure-llvm-is-in-the-link-path.patch new file mode 100644 index 0000000..d076d35 --- /dev/null +++ b/rust-pr70123-ensure-llvm-is-in-the-link-path.patch @@ -0,0 +1,210 @@ +commit 9423c4f0dda638ec2a925140850b85e8d3e6d455 (from bee074f032970fd1b59650c04a70e75eeee9c63b) +Merge: bee074f03297 3a2a4429a288 +Author: Mazdak Farrokhzad +Date: Mon Mar 23 10:29:13 2020 +0100 + + Rollup merge of #70123 - cuviper:library-path, r=Mark-Simulacrum + + Ensure LLVM is in the link path for rustc tools + + The build script for `rustc_llvm` outputs LLVM information in `cargo:rustc-link-lib` and `cargo:rustc-link-search` so the compiler can be linked correctly. However, while the lib is carried along in metadata, the search paths are not. So when cargo is invoked again later for rustc _tools_, they'll also try to link with LLVM, but the necessary paths may be left out. + + Rustbuild can use the environment to set the LLVM link path for tools -- `LIB` for MSVC toolchains and `LIBRARY_PATH` for everyone else. + + Fixes #68714. + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 602e4511ea58..dd519506d42a 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; + use std::process::Command; + use std::time::{Duration, Instant}; + +-use build_helper::t; ++use build_helper::{output, t}; + + use crate::cache::{Cache, Interned, INTERNER}; + use crate::check; +@@ -23,7 +23,7 @@ use crate::install; + use crate::native; + use crate::test; + use crate::tool; +-use crate::util::{self, add_lib_path, exe, libdir}; ++use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir}; + use crate::{Build, DocTests, GitRepo, Mode}; + + pub use crate::Compiler; +@@ -660,7 +660,7 @@ impl<'a> Builder<'a> { + return; + } + +- add_lib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); ++ add_dylib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); + } + + /// Gets a path to the compiler specified. +@@ -698,6 +698,20 @@ impl<'a> Builder<'a> { + cmd + } + ++ /// Return the path to `llvm-config` for the target, if it exists. ++ /// ++ /// Note that this returns `None` if LLVM is disabled, or if we're in a ++ /// check build or dry-run, where there's no need to build all of LLVM. ++ fn llvm_config(&self, target: Interned) -> Option { ++ if self.config.llvm_enabled() && self.kind != Kind::Check && !self.config.dry_run { ++ let llvm_config = self.ensure(native::Llvm { target }); ++ if llvm_config.is_file() { ++ return Some(llvm_config); ++ } ++ } ++ None ++ } ++ + /// Prepares an invocation of `cargo` to be run. + /// + /// This will create a `Command` that represents a pending execution of +@@ -1034,6 +1048,17 @@ impl<'a> Builder<'a> { + .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler)); + } + ++ // Tools that use compiler libraries may inherit the `-lLLVM` link ++ // requirement, but the `-L` library path is not propagated across ++ // separate Cargo projects. We can add LLVM's library path to the ++ // platform-specific environment variable as a workaround. ++ if mode == Mode::ToolRustc { ++ if let Some(llvm_config) = self.llvm_config(target) { ++ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); ++ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cargo); ++ } ++ } ++ + if self.config.incremental { + cargo.env("CARGO_INCREMENTAL", "1"); + } else { +diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs +index 65a00db33949..ad494b88b3af 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -451,44 +451,6 @@ impl Step for Rustc { + false, + ); + +- // We used to build librustc_codegen_llvm as a separate step, +- // which produced a dylib that the compiler would dlopen() at runtime. +- // This meant that we only needed to make sure that libLLVM.so was +- // installed by the time we went to run a tool using it - since +- // librustc_codegen_llvm was effectively a standalone artifact, +- // other crates were completely oblivious to its dependency +- // on `libLLVM.so` during build time. +- // +- // However, librustc_codegen_llvm is now built as an ordinary +- // crate during the same step as the rest of the compiler crates. +- // This means that any crates depending on it will see the fact +- // that it uses `libLLVM.so` as a native library, and will +- // cause us to pass `-llibLLVM.so` to the linker when we link +- // a binary. +- // +- // For `rustc` itself, this works out fine. +- // During the `Assemble` step, we call `dist::maybe_install_llvm_dylib` +- // to copy libLLVM.so into the `stage` directory. We then link +- // the compiler binary, which will find `libLLVM.so` in the correct place. +- // +- // However, this is insufficient for tools that are build against stage0 +- // (e.g. stage1 rustdoc). Since `Assemble` for stage0 doesn't actually do anything, +- // we won't have `libLLVM.so` in the stage0 sysroot. In the past, this wasn't +- // a problem - we would copy the tool binary into its correct stage directory +- // (e.g. stage1 for a stage1 rustdoc built against a stage0 compiler). +- // Since libLLVM.so wasn't resolved until runtime, it was fine for it to +- // not exist while we were building it. +- // +- // To ensure that we can still build stage1 tools against a stage0 compiler, +- // we explicitly copy libLLVM.so into the stage0 sysroot when building +- // the stage0 compiler. This ensures that tools built against stage0 +- // will see libLLVM.so at build time, making the linker happy. +- if compiler.stage == 0 { +- builder.info(&format!("Installing libLLVM.so to stage 0 ({})", compiler.host)); +- let sysroot = builder.sysroot(compiler); +- dist::maybe_install_llvm_dylib(builder, compiler.host, &sysroot); +- } +- + builder.ensure(RustcLink { + compiler: builder.compiler(compiler.stage, builder.config.build), + target_compiler: compiler, +diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs +index 67e0ed5c5802..c8ccba467e50 100644 +--- a/src/bootstrap/tool.rs ++++ b/src/bootstrap/tool.rs +@@ -12,7 +12,7 @@ use crate::channel; + use crate::channel::GitInfo; + use crate::compile; + use crate::toolstate::ToolState; +-use crate::util::{add_lib_path, exe, CiEnv}; ++use crate::util::{add_dylib_path, exe, CiEnv}; + use crate::Compiler; + use crate::Mode; + +@@ -388,7 +388,7 @@ pub struct ErrorIndex { + impl ErrorIndex { + pub fn command(builder: &Builder<'_>, compiler: Compiler) -> Command { + let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); +- add_lib_path( ++ add_dylib_path( + vec![PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host))], + &mut cmd, + ); +@@ -689,7 +689,7 @@ impl<'a> Builder<'a> { + } + } + +- add_lib_path(lib_paths, &mut cmd); ++ add_dylib_path(lib_paths, &mut cmd); + cmd + } + } +diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs +index eac790fe504b..2bc6f1939d97 100644 +--- a/src/bootstrap/util.rs ++++ b/src/bootstrap/util.rs +@@ -40,7 +40,7 @@ pub fn libdir(target: &str) -> &'static str { + } + + /// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. +-pub fn add_lib_path(path: Vec, cmd: &mut Command) { ++pub fn add_dylib_path(path: Vec, cmd: &mut Command) { + let mut list = dylib_path(); + for path in path { + list.insert(0, path); +@@ -72,6 +72,31 @@ pub fn dylib_path() -> Vec { + env::split_paths(&var).collect() + } + ++/// Adds a list of lookup paths to `cmd`'s link library lookup path. ++pub fn add_link_lib_path(path: Vec, cmd: &mut Command) { ++ let mut list = link_lib_path(); ++ for path in path { ++ list.insert(0, path); ++ } ++ cmd.env(link_lib_path_var(), t!(env::join_paths(list))); ++} ++ ++/// Returns the environment variable which the link library lookup path ++/// resides in for this platform. ++fn link_lib_path_var() -> &'static str { ++ if cfg!(target_env = "msvc") { "LIB" } else { "LIBRARY_PATH" } ++} ++ ++/// Parses the `link_lib_path_var()` environment variable, returning a list of ++/// paths that are members of this lookup path. ++fn link_lib_path() -> Vec { ++ let var = match env::var_os(link_lib_path_var()) { ++ Some(v) => v, ++ None => return vec![], ++ }; ++ env::split_paths(&var).collect() ++} ++ + /// `push` all components to `buf`. On windows, append `.exe` to the last component. + pub fn push_exe_path(mut buf: PathBuf, components: &[&str]) -> PathBuf { + let (&file, components) = components.split_last().expect("at least one component required"); diff --git a/rust-pr70163-prepare-for-llvm-10-upgrade.patch b/rust-pr70163-prepare-for-llvm-10-upgrade.patch new file mode 100644 index 0000000..765c2e9 --- /dev/null +++ b/rust-pr70163-prepare-for-llvm-10-upgrade.patch @@ -0,0 +1,175 @@ +commit 374ab25585f0a817fe7bd6986737f12347b12d0b (from 1add455ec6f81045e7651c6225902823f5d4fbfa) +Merge: 1add455ec6f8 497f879b1e24 +Author: bors +Date: Tue Mar 24 12:42:54 2020 +0000 + + Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper + + Prepare for LLVM 10 upgrade + + This is #67759 minus the submodule update. + + * Fix two compatibility issues in the rustllvm wrapper. + * Update data layout strings in tests. + * Fix LLVM version comparison (this become a problem because the major version has two digits now). + + r? @cuviper + +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index aa1d1b7c4241..b52fbe4666eb 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -1141,6 +1141,8 @@ impl Step for Compiletest { + let llvm_config = builder.ensure(native::Llvm { target: builder.config.build }); + if !builder.config.dry_run { + let llvm_version = output(Command::new(&llvm_config).arg("--version")); ++ // Remove trailing newline from llvm-config output. ++ let llvm_version = llvm_version.trim_end(); + cmd.arg("--llvm-version").arg(llvm_version); + } + if !builder.is_rust_llvm(target) { +diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp +index 90d24d20737d..9e8614e3b6d3 100644 +--- a/src/rustllvm/PassWrapper.cpp ++++ b/src/rustllvm/PassWrapper.cpp +@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() { + } + + extern "C" void LLVMTimeTraceProfilerInitialize() { +-#if LLVM_VERSION_GE(9, 0) ++#if LLVM_VERSION_GE(10, 0) ++ timeTraceProfilerInitialize( ++ /* TimeTraceGranularity */ 0, ++ /* ProcName */ "rustc"); ++#elif LLVM_VERSION_GE(9, 0) + timeTraceProfilerInitialize(); + #endif + } +diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp +index 25cfee3373dc..799adb418822 100644 +--- a/src/rustllvm/RustWrapper.cpp ++++ b/src/rustllvm/RustWrapper.cpp +@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B, + LLVMValueRef Dst, unsigned DstAlign, + LLVMValueRef Val, + LLVMValueRef Size, bool IsVolatile) { ++#if LLVM_VERSION_GE(10, 0) ++ return wrap(unwrap(B)->CreateMemSet( ++ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile)); ++#else + return wrap(unwrap(B)->CreateMemSet( + unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile)); ++#endif + } + + extern "C" LLVMValueRef +diff --git a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json +index 8d028280a8da..00de3de05f07 100644 +--- a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json ++++ b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json +@@ -1,5 +1,5 @@ + { +- "data-layout": "e-m:e-p:32:32-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-f64:32:64-f80:32-n8:16:32-S128", + "linker-flavor": "gcc", + "llvm-target": "i686-unknown-linux-gnu", + "target-endian": "little", +diff --git a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json +index 48040ae3da0e..6d5e964ed4fe 100644 +--- a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json ++++ b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json +@@ -1,6 +1,6 @@ + { + "pre-link-args": {"gcc": ["-m64"]}, +- "data-layout": "e-m:e-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-f80:128-n8:16:32:64-S128", + "linker-flavor": "gcc", + "llvm-target": "x86_64-unknown-linux-gnu", + "target-endian": "little", +diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs +index 2a24a8c3c948..cb648db8830e 100644 +--- a/src/tools/compiletest/src/header.rs ++++ b/src/tools/compiletest/src/header.rs +@@ -191,6 +191,7 @@ impl EarlyProps { + return true; + } + if let Some(ref actual_version) = config.llvm_version { ++ let actual_version = version_to_int(actual_version); + if line.starts_with("min-llvm-version") { + let min_version = line + .trim_end() +@@ -199,7 +200,7 @@ impl EarlyProps { + .expect("Malformed llvm version directive"); + // Ignore if actual version is smaller the minimum required + // version +- &actual_version[..] < min_version ++ actual_version < version_to_int(min_version) + } else if line.starts_with("min-system-llvm-version") { + let min_version = line + .trim_end() +@@ -208,7 +209,7 @@ impl EarlyProps { + .expect("Malformed llvm version directive"); + // Ignore if using system LLVM and actual version + // is smaller the minimum required version +- config.system_llvm && &actual_version[..] < min_version ++ config.system_llvm && actual_version < version_to_int(min_version) + } else if line.starts_with("ignore-llvm-version") { + // Syntax is: "ignore-llvm-version [- ]" + let range_components = line +@@ -219,15 +220,15 @@ impl EarlyProps { + .take(3) // 3 or more = invalid, so take at most 3. + .collect::>(); + match range_components.len() { +- 1 => &actual_version[..] == range_components[0], ++ 1 => actual_version == version_to_int(range_components[0]), + 2 => { +- let v_min = range_components[0]; +- let v_max = range_components[1]; ++ let v_min = version_to_int(range_components[0]); ++ let v_max = version_to_int(range_components[1]); + if v_max < v_min { + panic!("Malformed LLVM version range: max < min") + } + // Ignore if version lies inside of range. +- &actual_version[..] >= v_min && &actual_version[..] <= v_max ++ actual_version >= v_min && actual_version <= v_max + } + _ => panic!("Malformed LLVM version directive"), + } +@@ -238,6 +239,20 @@ impl EarlyProps { + false + } + } ++ ++ fn version_to_int(version: &str) -> u32 { ++ let version_without_suffix = version.split('-').next().unwrap(); ++ let components: Vec = version_without_suffix ++ .split('.') ++ .map(|s| s.parse().expect("Malformed version component")) ++ .collect(); ++ match components.len() { ++ 1 => components[0] * 10000, ++ 2 => components[0] * 10000 + components[1] * 100, ++ 3 => components[0] * 10000 + components[1] * 100 + components[2], ++ _ => panic!("Malformed version"), ++ } ++ } + } + } + +diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs +index 6c478f7e29da..31d991e0c2f8 100644 +--- a/src/tools/compiletest/src/header/tests.rs ++++ b/src/tools/compiletest/src/header/tests.rs +@@ -122,9 +122,8 @@ fn llvm_version() { + config.llvm_version = Some("9.3.1-rust-1.43.0-dev".to_owned()); + assert!(!parse_rs(&config, "// min-llvm-version 9.2").ignore); + +- // FIXME. +- // config.llvm_version = Some("10.0.0-rust".to_owned()); +- // assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); ++ config.llvm_version = Some("10.0.0-rust".to_owned()); ++ assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); + } + + #[test] diff --git a/rust-pr70591-ensure-llvm-is-in-the-link-path.patch b/rust-pr70591-ensure-llvm-is-in-the-link-path.patch new file mode 100644 index 0000000..9f5722b --- /dev/null +++ b/rust-pr70591-ensure-llvm-is-in-the-link-path.patch @@ -0,0 +1,40 @@ +commit 6067315d58ff3d49b305ae3c99810656856c8e21 +Author: Josh Stone +Date: Mon Mar 30 14:03:39 2020 -0700 + + Ensure LLVM is in the link path for "fulldeps" tests + + This is a follow-up to #70123, which added `llvm-config --libdir` to the + `LIBRARY_PATH` for rustc tools. We need the same for "run-make-fulldeps" + and "ui-fulldeps" tests which depend on compiler libraries, implicitly + needing to link to `-lLLVM` as well. + +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index 5b946b05735d..2499856235f1 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -21,7 +21,7 @@ use crate::flags::Subcommand; + use crate::native; + use crate::tool::{self, SourceType, Tool}; + use crate::toolstate::ToolState; +-use crate::util::{self, dylib_path, dylib_path_var}; ++use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var}; + use crate::Crate as CargoCrate; + use crate::{envify, DocTests, GitRepo, Mode}; + +@@ -1178,6 +1178,15 @@ impl Step for Compiletest { + cmd.arg("--system-llvm"); + } + ++ // Tests that use compiler libraries may inherit the `-lLLVM` link ++ // requirement, but the `-L` library path is not propagated across ++ // separate compilations. We can add LLVM's library path to the ++ // platform-specific environment variable as a workaround. ++ if !builder.config.dry_run && suite.ends_with("fulldeps") { ++ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); ++ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd); ++ } ++ + // Only pass correct values for these flags for the `run-make` suite as it + // requires that a C++ compiler was configured which isn't always the case. + if !builder.config.dry_run && suite == "run-make-fulldeps" { diff --git a/rust.spec b/rust.spec index f0875a3..83ee5a9 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.41.0 -%global bootstrap_cargo 1.41.0 -%global bootstrap_channel 1.41.1 -%global bootstrap_date 2020-02-27 +%global bootstrap_rust 1.42.0 +%global bootstrap_cargo 1.42.0 +%global bootstrap_channel 1.42.0 +%global bootstrap_date 2020-03-12 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.42.0 +Version: 1.43.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -67,9 +67,15 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# Fix 1.42 bootstrapping itself -# https://github.com/rust-lang/rust/issues/69953 -Patch2: 0001-Drop-cfg-bootstrap-code.patch +# Ensure LLVM is in the link path for rustc tools and "fulldeps" tests +# https://github.com/rust-lang/rust/pull/70123 +# https://github.com/rust-lang/rust/pull/70591 +Patch2: rust-pr70123-ensure-llvm-is-in-the-link-path.patch +Patch3: rust-pr70591-ensure-llvm-is-in-the-link-path.patch + +# Prepare for LLVM 10 upgrade +# https://github.com/rust-lang/rust/pull/70163 +Patch4: rust-pr70163-prepare-for-llvm-10-upgrade.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -157,9 +163,6 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} %global llvm llvm7.0 %endif -%if 0%{?fedora} >= 32 -%global llvm llvm9.0 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -220,10 +223,6 @@ Requires: /usr/bin/cc %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} %global llvm_has_filecheck 1 %endif -%if "%{llvm_root}" != "%{_prefix}" -# https://github.com/rust-lang/rust/issues/68714 -%global library_path $(%{llvm_root}/bin/llvm-config --libdir) -%endif %endif %description @@ -295,7 +294,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.28.2 +Provides: bundled(libgit2) = 0.99.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -341,7 +340,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.28.2 +Provides: bundled(libgit2) = 0.99.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -408,6 +407,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -475,7 +476,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # We're going to override --libdir when configuring to get rustlib into a @@ -526,7 +526,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %install %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} %{python} ./x.py install @@ -597,7 +596,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %check %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # The results are not stable on koji, so mask errors and just log it. @@ -716,6 +714,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index 63fa9dd..2a8be05 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.42.0-src.tar.xz) = 589bfdc92deedd33b8ea0df7f7c64c2a9a085fbea64936eff92f81e812309c060ed7a7adc96f6010d7adf62a68434a230da0f6c5b3540df4e0a5c6de05a31b16 +SHA512 (rustc-1.43.0-src.tar.xz) = dbff18567f2971da4eb13c670c30b136757692df1bc5024cdc0406f3c30574d3485fd616724987bcc765bc5f64c8ed5026f0e96f11eacb035e00256ed190b4f3 diff --git a/sources-bootstrap b/sources-bootstrap index 4a4c06d..741fae5 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.42.0-src.tar.xz) = 589bfdc92deedd33b8ea0df7f7c64c2a9a085fbea64936eff92f81e812309c060ed7a7adc96f6010d7adf62a68434a230da0f6c5b3540df4e0a5c6de05a31b16 -SHA512 (rust-1.41.1-aarch64-unknown-linux-gnu.tar.xz) = 54eac5c380b418c1714931ead7d6284b225bb427fcc501e147240000b71d31b667e308aea7f38f3299b1311ab04f19011b914d37a4581c7a64028965569cd58e -SHA512 (rust-1.41.1-armv7-unknown-linux-gnueabihf.tar.xz) = 400bf8d013fe5030243bc0ccb7066ea3d03a2c10727e04b6830ab91dfe9b04f78cfef10794a1c7bb6276fb00c86f1e1c42a74faba19f3125859b3464726d01c2 -SHA512 (rust-1.41.1-i686-unknown-linux-gnu.tar.xz) = c6d74b2653c537043eb2ea721095ff053def592b4c330bdc104690cfb51d648f515288cc0451743d94260f18a55d6757bcb8eb1e6c0217da3498d08b681ca6af -SHA512 (rust-1.41.1-powerpc64le-unknown-linux-gnu.tar.xz) = 1b2bf6d35321dd0a0fc9735005317f09f8b9a81b520612484530e29156ea254d5cada583e44f7e4a840edde09d70c34f7ead1208d8aa6037c652540dfa38cede -SHA512 (rust-1.41.1-powerpc64-unknown-linux-gnu.tar.xz) = 50367685783085cc384be944d4321dfde850f3a0e94de0625a08f17160af2c0b795276f96574d1bea84092cbc1cd3cde619d97fe2e37b07ead17f49164e1c995 -SHA512 (rust-1.41.1-s390x-unknown-linux-gnu.tar.xz) = f809adc626876df5c6e050362d59189ede5e3991ac41fd129922540abeb728f618e1a3f3925cee34895de5e037141aabb1f8c2b94d4069945d174e38446e8153 -SHA512 (rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz) = c75d4a18cf9300c6ab480d34c5e4b41be971535931455239330cb2a0e927bcf9cf102498cad5dd1d5d802fd1d9c9d214b80e8ff15aa6be68d3e7f41420cad666 +SHA512 (rustc-1.43.0-src.tar.xz) = dbff18567f2971da4eb13c670c30b136757692df1bc5024cdc0406f3c30574d3485fd616724987bcc765bc5f64c8ed5026f0e96f11eacb035e00256ed190b4f3 +SHA512 (rust-1.42.0-aarch64-unknown-linux-gnu.tar.xz) = 691a11e279efdcafa6bdafacb7fb48ccf653e180e0e85909b6031105a297d47538efb36d63216f6185427f818483a51aa827f351ca2123840d72caf60079fe13 +SHA512 (rust-1.42.0-armv7-unknown-linux-gnueabihf.tar.xz) = 26768ec530506e20fed8f9ef2c1ca85eec155fc90949f2063836b6109b296a976c8430a698971a8b1c11e8f6ad043d854a36e9f0e849417178411dc5cbd30e59 +SHA512 (rust-1.42.0-i686-unknown-linux-gnu.tar.xz) = 7376be5abed573bbf68f73ed5609fa8e22dfa3ead19a3f3d78d553347e3ae01604ab9906f5317f1687a8ab3f9ad9c38cde44ef6f56d7da65a788a74aee9df057 +SHA512 (rust-1.42.0-powerpc64le-unknown-linux-gnu.tar.xz) = e1db9bbef45e88e7d1d5b905379c04786a015c90d0d9de6a6c16276a3e91c342a8231dda7a4d46ecc7adc969d07fd7dd8595975647b9ab69f8997fee74401219 +SHA512 (rust-1.42.0-powerpc64-unknown-linux-gnu.tar.xz) = 668d1d353bdaf676043ab7f4baad464b202e8ae1be7713e3481b8e9fb5fabd1020e10e178d69d099541cb1b23362b50b826790740156f1c96efa3d2a7457e404 +SHA512 (rust-1.42.0-s390x-unknown-linux-gnu.tar.xz) = 85b1331a9a71cc43a2fa628b8510590ff072e409c2c38ebfd9089ab7a245182e23b52f6221b25c63f6048e1bf4ada0f561dd8f3f810680c9727040bc8a0d8d46 +SHA512 (rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz) = 87c06d4503e7ba12bd3dfc8dd279a3bdf33a24d2c22eec1378b79b2c17ccdad9b4c8dbd0d4704eae1f3476aec5639d3ba143e8c74a296d631b17b57da7447e70 From 52b63674b5f83aa949aacf44bcbeb27d7d7c691b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 7 May 2020 11:29:23 -0700 Subject: [PATCH 014/222] Update to 1.43.1. --- .gitignore | 1 + ...pr71782-Use-a-non-existent-test-path.patch | 56 +++++++++++++++++++ rust.spec | 9 ++- sources | 2 +- sources-bootstrap | 2 +- 5 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 rust-pr71782-Use-a-non-existent-test-path.patch diff --git a/.gitignore b/.gitignore index 2e5822a..e06b217 100644 --- a/.gitignore +++ b/.gitignore @@ -269,3 +269,4 @@ /rust-1.42.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.42.0-s390x-unknown-linux-gnu.tar.xz /rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.43.1-src.tar.xz diff --git a/rust-pr71782-Use-a-non-existent-test-path.patch b/rust-pr71782-Use-a-non-existent-test-path.patch new file mode 100644 index 0000000..df02449 --- /dev/null +++ b/rust-pr71782-Use-a-non-existent-test-path.patch @@ -0,0 +1,56 @@ +From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 1 May 2020 16:50:10 -0700 +Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null + +--- + src/test/ui/non-ice-error-on-worker-io-fail.rs | 10 +++++++--- + src/test/ui/non-ice-error-on-worker-io-fail.stderr | 2 +- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.rs b/src/test/ui/non-ice-error-on-worker-io-fail.rs +index 8af17742850d..30779fc65c0f 100644 +--- a/src/test/ui/non-ice-error-on-worker-io-fail.rs ++++ b/src/test/ui/non-ice-error-on-worker-io-fail.rs +@@ -4,8 +4,12 @@ + // + // An attempt to `-o` into a directory we cannot write into should indeed + // be an error; but not an ICE. ++// ++// However, some folks run tests as root, which can write `/dev/` and end ++// up clobbering `/dev/null`. Instead we'll use a non-existent path, which ++// also used to ICE, but even root can't magically write there. + +-// compile-flags: -o /dev/null ++// compile-flags: -o /does-not-exist/output + + // The error-pattern check occurs *before* normalization, and the error patterns + // are wildly different between build environments. So this is a cop-out (and we +@@ -15,10 +19,10 @@ + // error-pattern: error + + // On Mac OS X, we get an error like the below +-// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/" ++// normalize-stderr-test "failed to write bytecode to /does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying /does-not-exist/" + + // On Linux, we get an error like the below +-// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/" ++// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /does-not-exist/" + + // ignore-tidy-linelength + // ignore-windows - this is a unix-specific test +diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.stderr b/src/test/ui/non-ice-error-on-worker-io-fail.stderr +index f732abc52b71..edadecf273a7 100644 +--- a/src/test/ui/non-ice-error-on-worker-io-fail.stderr ++++ b/src/test/ui/non-ice-error-on-worker-io-fail.stderr +@@ -1,6 +1,6 @@ + warning: ignoring --out-dir flag due to -o flag + +-error: io error modifying /dev/ ++error: io error modifying /does-not-exist/ + + error: aborting due to previous error + +-- +2.26.2 + diff --git a/rust.spec b/rust.spec index 83ee5a9..05ea3f7 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.43.0 +Version: 1.43.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -77,6 +77,9 @@ Patch3: rust-pr70591-ensure-llvm-is-in-the-link-path.patch # https://github.com/rust-lang/rust/pull/70163 Patch4: rust-pr70163-prepare-for-llvm-10-upgrade.patch +# https://github.com/rust-lang/rust/pull/71782 +Patch5: rust-pr71782-Use-a-non-existent-test-path.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -409,6 +412,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -714,6 +718,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index 2a8be05..fb9b958 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.43.0-src.tar.xz) = dbff18567f2971da4eb13c670c30b136757692df1bc5024cdc0406f3c30574d3485fd616724987bcc765bc5f64c8ed5026f0e96f11eacb035e00256ed190b4f3 +SHA512 (rustc-1.43.1-src.tar.xz) = 24bb01237b1f3f5412109290bb4406b9742cf8956162f4090a98ed3a59a6e2e8dda399452bec1c93c8afdcf5effd98e4825e7f218238e0e88735c1ff4a5b385f diff --git a/sources-bootstrap b/sources-bootstrap index 741fae5..f2aa62c 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.43.0-src.tar.xz) = dbff18567f2971da4eb13c670c30b136757692df1bc5024cdc0406f3c30574d3485fd616724987bcc765bc5f64c8ed5026f0e96f11eacb035e00256ed190b4f3 +SHA512 (rustc-1.43.1-src.tar.xz) = 24bb01237b1f3f5412109290bb4406b9742cf8956162f4090a98ed3a59a6e2e8dda399452bec1c93c8afdcf5effd98e4825e7f218238e0e88735c1ff4a5b385f SHA512 (rust-1.42.0-aarch64-unknown-linux-gnu.tar.xz) = 691a11e279efdcafa6bdafacb7fb48ccf653e180e0e85909b6031105a297d47538efb36d63216f6185427f818483a51aa827f351ca2123840d72caf60079fe13 SHA512 (rust-1.42.0-armv7-unknown-linux-gnueabihf.tar.xz) = 26768ec530506e20fed8f9ef2c1ca85eec155fc90949f2063836b6109b296a976c8430a698971a8b1c11e8f6ad043d854a36e9f0e849417178411dc5cbd30e59 SHA512 (rust-1.42.0-i686-unknown-linux-gnu.tar.xz) = 7376be5abed573bbf68f73ed5609fa8e22dfa3ead19a3f3d78d553347e3ae01604ab9906f5317f1687a8ab3f9ad9c38cde44ef6f56d7da65a788a74aee9df057 From d921e9b0a9460392526492a83cd25c0d76130524 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 4 Jun 2020 11:59:31 -0700 Subject: [PATCH 015/222] Update to 1.44.0. --- .gitignore | 8 + rust-pr57840-llvm7-debuginfo-variants.patch | 32 --- ...0123-ensure-llvm-is-in-the-link-path.patch | 210 ------------------ ...-pr70163-prepare-for-llvm-10-upgrade.patch | 175 --------------- ...0591-ensure-llvm-is-in-the-link-path.patch | 40 ---- ...pr71782-Use-a-non-existent-test-path.patch | 2 +- rust.spec | 49 ++-- sources | 2 +- sources-bootstrap | 16 +- 9 files changed, 35 insertions(+), 499 deletions(-) delete mode 100644 rust-pr57840-llvm7-debuginfo-variants.patch delete mode 100644 rust-pr70123-ensure-llvm-is-in-the-link-path.patch delete mode 100644 rust-pr70163-prepare-for-llvm-10-upgrade.patch delete mode 100644 rust-pr70591-ensure-llvm-is-in-the-link-path.patch diff --git a/.gitignore b/.gitignore index e06b217..5d48bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -270,3 +270,11 @@ /rust-1.42.0-s390x-unknown-linux-gnu.tar.xz /rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz /rustc-1.43.1-src.tar.xz +/rustc-1.44.0-src.tar.xz +/rust-1.43.1-aarch64-unknown-linux-gnu.tar.xz +/rust-1.43.1-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.43.1-i686-unknown-linux-gnu.tar.xz +/rust-1.43.1-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.43.1-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.43.1-s390x-unknown-linux-gnu.tar.xz +/rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust-pr57840-llvm7-debuginfo-variants.patch b/rust-pr57840-llvm7-debuginfo-variants.patch deleted file mode 100644 index b1fd427..0000000 --- a/rust-pr57840-llvm7-debuginfo-variants.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit ab998a2eeb2bcdc69ce70c814af97f0d1302a404 (from d17f62d857c70508efbf60be41135880bcd2e062) -Merge: d17f62d857c7 9452a8dfa3ba -Author: Mazdak Farrokhzad -Date: Thu Jan 24 00:20:00 2019 +0100 - - Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic - - Fix issue 57762 - - against a stock LLVM 7. LLVM 7 was released without a necessary fix - for a bug in the DWARF discriminant code. - - This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. - - Closes #57762 - -diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs -index 6deedd0b5ea3..9f63038c3623 100644 ---- a/src/librustc_codegen_llvm/debuginfo/metadata.rs -+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs -@@ -1164,7 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool { - // On MSVC we have to use the fallback mode, because LLVM doesn't - // lower variant parts to PDB. - return cx.sess().target.target.options.is_like_msvc -- || llvm_util::get_major_version() < 7; -+ // LLVM version 7 did not release with an important bug fix; -+ // but the required patch is in the LLVM 8. Rust LLVM reports -+ // 8 as well. -+ || llvm_util::get_major_version() < 8; - } - - // FIXME(eddyb) maybe precompute this? Right now it's computed once diff --git a/rust-pr70123-ensure-llvm-is-in-the-link-path.patch b/rust-pr70123-ensure-llvm-is-in-the-link-path.patch deleted file mode 100644 index d076d35..0000000 --- a/rust-pr70123-ensure-llvm-is-in-the-link-path.patch +++ /dev/null @@ -1,210 +0,0 @@ -commit 9423c4f0dda638ec2a925140850b85e8d3e6d455 (from bee074f032970fd1b59650c04a70e75eeee9c63b) -Merge: bee074f03297 3a2a4429a288 -Author: Mazdak Farrokhzad -Date: Mon Mar 23 10:29:13 2020 +0100 - - Rollup merge of #70123 - cuviper:library-path, r=Mark-Simulacrum - - Ensure LLVM is in the link path for rustc tools - - The build script for `rustc_llvm` outputs LLVM information in `cargo:rustc-link-lib` and `cargo:rustc-link-search` so the compiler can be linked correctly. However, while the lib is carried along in metadata, the search paths are not. So when cargo is invoked again later for rustc _tools_, they'll also try to link with LLVM, but the necessary paths may be left out. - - Rustbuild can use the environment to set the LLVM link path for tools -- `LIB` for MSVC toolchains and `LIBRARY_PATH` for everyone else. - - Fixes #68714. - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 602e4511ea58..dd519506d42a 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; - use std::process::Command; - use std::time::{Duration, Instant}; - --use build_helper::t; -+use build_helper::{output, t}; - - use crate::cache::{Cache, Interned, INTERNER}; - use crate::check; -@@ -23,7 +23,7 @@ use crate::install; - use crate::native; - use crate::test; - use crate::tool; --use crate::util::{self, add_lib_path, exe, libdir}; -+use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir}; - use crate::{Build, DocTests, GitRepo, Mode}; - - pub use crate::Compiler; -@@ -660,7 +660,7 @@ impl<'a> Builder<'a> { - return; - } - -- add_lib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); -+ add_dylib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); - } - - /// Gets a path to the compiler specified. -@@ -698,6 +698,20 @@ impl<'a> Builder<'a> { - cmd - } - -+ /// Return the path to `llvm-config` for the target, if it exists. -+ /// -+ /// Note that this returns `None` if LLVM is disabled, or if we're in a -+ /// check build or dry-run, where there's no need to build all of LLVM. -+ fn llvm_config(&self, target: Interned) -> Option { -+ if self.config.llvm_enabled() && self.kind != Kind::Check && !self.config.dry_run { -+ let llvm_config = self.ensure(native::Llvm { target }); -+ if llvm_config.is_file() { -+ return Some(llvm_config); -+ } -+ } -+ None -+ } -+ - /// Prepares an invocation of `cargo` to be run. - /// - /// This will create a `Command` that represents a pending execution of -@@ -1034,6 +1048,17 @@ impl<'a> Builder<'a> { - .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler)); - } - -+ // Tools that use compiler libraries may inherit the `-lLLVM` link -+ // requirement, but the `-L` library path is not propagated across -+ // separate Cargo projects. We can add LLVM's library path to the -+ // platform-specific environment variable as a workaround. -+ if mode == Mode::ToolRustc { -+ if let Some(llvm_config) = self.llvm_config(target) { -+ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); -+ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cargo); -+ } -+ } -+ - if self.config.incremental { - cargo.env("CARGO_INCREMENTAL", "1"); - } else { -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 65a00db33949..ad494b88b3af 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -451,44 +451,6 @@ impl Step for Rustc { - false, - ); - -- // We used to build librustc_codegen_llvm as a separate step, -- // which produced a dylib that the compiler would dlopen() at runtime. -- // This meant that we only needed to make sure that libLLVM.so was -- // installed by the time we went to run a tool using it - since -- // librustc_codegen_llvm was effectively a standalone artifact, -- // other crates were completely oblivious to its dependency -- // on `libLLVM.so` during build time. -- // -- // However, librustc_codegen_llvm is now built as an ordinary -- // crate during the same step as the rest of the compiler crates. -- // This means that any crates depending on it will see the fact -- // that it uses `libLLVM.so` as a native library, and will -- // cause us to pass `-llibLLVM.so` to the linker when we link -- // a binary. -- // -- // For `rustc` itself, this works out fine. -- // During the `Assemble` step, we call `dist::maybe_install_llvm_dylib` -- // to copy libLLVM.so into the `stage` directory. We then link -- // the compiler binary, which will find `libLLVM.so` in the correct place. -- // -- // However, this is insufficient for tools that are build against stage0 -- // (e.g. stage1 rustdoc). Since `Assemble` for stage0 doesn't actually do anything, -- // we won't have `libLLVM.so` in the stage0 sysroot. In the past, this wasn't -- // a problem - we would copy the tool binary into its correct stage directory -- // (e.g. stage1 for a stage1 rustdoc built against a stage0 compiler). -- // Since libLLVM.so wasn't resolved until runtime, it was fine for it to -- // not exist while we were building it. -- // -- // To ensure that we can still build stage1 tools against a stage0 compiler, -- // we explicitly copy libLLVM.so into the stage0 sysroot when building -- // the stage0 compiler. This ensures that tools built against stage0 -- // will see libLLVM.so at build time, making the linker happy. -- if compiler.stage == 0 { -- builder.info(&format!("Installing libLLVM.so to stage 0 ({})", compiler.host)); -- let sysroot = builder.sysroot(compiler); -- dist::maybe_install_llvm_dylib(builder, compiler.host, &sysroot); -- } -- - builder.ensure(RustcLink { - compiler: builder.compiler(compiler.stage, builder.config.build), - target_compiler: compiler, -diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs -index 67e0ed5c5802..c8ccba467e50 100644 ---- a/src/bootstrap/tool.rs -+++ b/src/bootstrap/tool.rs -@@ -12,7 +12,7 @@ use crate::channel; - use crate::channel::GitInfo; - use crate::compile; - use crate::toolstate::ToolState; --use crate::util::{add_lib_path, exe, CiEnv}; -+use crate::util::{add_dylib_path, exe, CiEnv}; - use crate::Compiler; - use crate::Mode; - -@@ -388,7 +388,7 @@ pub struct ErrorIndex { - impl ErrorIndex { - pub fn command(builder: &Builder<'_>, compiler: Compiler) -> Command { - let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); -- add_lib_path( -+ add_dylib_path( - vec![PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host))], - &mut cmd, - ); -@@ -689,7 +689,7 @@ impl<'a> Builder<'a> { - } - } - -- add_lib_path(lib_paths, &mut cmd); -+ add_dylib_path(lib_paths, &mut cmd); - cmd - } - } -diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs -index eac790fe504b..2bc6f1939d97 100644 ---- a/src/bootstrap/util.rs -+++ b/src/bootstrap/util.rs -@@ -40,7 +40,7 @@ pub fn libdir(target: &str) -> &'static str { - } - - /// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. --pub fn add_lib_path(path: Vec, cmd: &mut Command) { -+pub fn add_dylib_path(path: Vec, cmd: &mut Command) { - let mut list = dylib_path(); - for path in path { - list.insert(0, path); -@@ -72,6 +72,31 @@ pub fn dylib_path() -> Vec { - env::split_paths(&var).collect() - } - -+/// Adds a list of lookup paths to `cmd`'s link library lookup path. -+pub fn add_link_lib_path(path: Vec, cmd: &mut Command) { -+ let mut list = link_lib_path(); -+ for path in path { -+ list.insert(0, path); -+ } -+ cmd.env(link_lib_path_var(), t!(env::join_paths(list))); -+} -+ -+/// Returns the environment variable which the link library lookup path -+/// resides in for this platform. -+fn link_lib_path_var() -> &'static str { -+ if cfg!(target_env = "msvc") { "LIB" } else { "LIBRARY_PATH" } -+} -+ -+/// Parses the `link_lib_path_var()` environment variable, returning a list of -+/// paths that are members of this lookup path. -+fn link_lib_path() -> Vec { -+ let var = match env::var_os(link_lib_path_var()) { -+ Some(v) => v, -+ None => return vec![], -+ }; -+ env::split_paths(&var).collect() -+} -+ - /// `push` all components to `buf`. On windows, append `.exe` to the last component. - pub fn push_exe_path(mut buf: PathBuf, components: &[&str]) -> PathBuf { - let (&file, components) = components.split_last().expect("at least one component required"); diff --git a/rust-pr70163-prepare-for-llvm-10-upgrade.patch b/rust-pr70163-prepare-for-llvm-10-upgrade.patch deleted file mode 100644 index 765c2e9..0000000 --- a/rust-pr70163-prepare-for-llvm-10-upgrade.patch +++ /dev/null @@ -1,175 +0,0 @@ -commit 374ab25585f0a817fe7bd6986737f12347b12d0b (from 1add455ec6f81045e7651c6225902823f5d4fbfa) -Merge: 1add455ec6f8 497f879b1e24 -Author: bors -Date: Tue Mar 24 12:42:54 2020 +0000 - - Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper - - Prepare for LLVM 10 upgrade - - This is #67759 minus the submodule update. - - * Fix two compatibility issues in the rustllvm wrapper. - * Update data layout strings in tests. - * Fix LLVM version comparison (this become a problem because the major version has two digits now). - - r? @cuviper - -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index aa1d1b7c4241..b52fbe4666eb 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -1141,6 +1141,8 @@ impl Step for Compiletest { - let llvm_config = builder.ensure(native::Llvm { target: builder.config.build }); - if !builder.config.dry_run { - let llvm_version = output(Command::new(&llvm_config).arg("--version")); -+ // Remove trailing newline from llvm-config output. -+ let llvm_version = llvm_version.trim_end(); - cmd.arg("--llvm-version").arg(llvm_version); - } - if !builder.is_rust_llvm(target) { -diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp -index 90d24d20737d..9e8614e3b6d3 100644 ---- a/src/rustllvm/PassWrapper.cpp -+++ b/src/rustllvm/PassWrapper.cpp -@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() { - } - - extern "C" void LLVMTimeTraceProfilerInitialize() { --#if LLVM_VERSION_GE(9, 0) -+#if LLVM_VERSION_GE(10, 0) -+ timeTraceProfilerInitialize( -+ /* TimeTraceGranularity */ 0, -+ /* ProcName */ "rustc"); -+#elif LLVM_VERSION_GE(9, 0) - timeTraceProfilerInitialize(); - #endif - } -diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp -index 25cfee3373dc..799adb418822 100644 ---- a/src/rustllvm/RustWrapper.cpp -+++ b/src/rustllvm/RustWrapper.cpp -@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B, - LLVMValueRef Dst, unsigned DstAlign, - LLVMValueRef Val, - LLVMValueRef Size, bool IsVolatile) { -+#if LLVM_VERSION_GE(10, 0) -+ return wrap(unwrap(B)->CreateMemSet( -+ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile)); -+#else - return wrap(unwrap(B)->CreateMemSet( - unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile)); -+#endif - } - - extern "C" LLVMValueRef -diff --git a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json -index 8d028280a8da..00de3de05f07 100644 ---- a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json -+++ b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json -@@ -1,5 +1,5 @@ - { -- "data-layout": "e-m:e-p:32:32-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-f64:32:64-f80:32-n8:16:32-S128", - "linker-flavor": "gcc", - "llvm-target": "i686-unknown-linux-gnu", - "target-endian": "little", -diff --git a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json -index 48040ae3da0e..6d5e964ed4fe 100644 ---- a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json -+++ b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json -@@ -1,6 +1,6 @@ - { - "pre-link-args": {"gcc": ["-m64"]}, -- "data-layout": "e-m:e-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-f80:128-n8:16:32:64-S128", - "linker-flavor": "gcc", - "llvm-target": "x86_64-unknown-linux-gnu", - "target-endian": "little", -diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs -index 2a24a8c3c948..cb648db8830e 100644 ---- a/src/tools/compiletest/src/header.rs -+++ b/src/tools/compiletest/src/header.rs -@@ -191,6 +191,7 @@ impl EarlyProps { - return true; - } - if let Some(ref actual_version) = config.llvm_version { -+ let actual_version = version_to_int(actual_version); - if line.starts_with("min-llvm-version") { - let min_version = line - .trim_end() -@@ -199,7 +200,7 @@ impl EarlyProps { - .expect("Malformed llvm version directive"); - // Ignore if actual version is smaller the minimum required - // version -- &actual_version[..] < min_version -+ actual_version < version_to_int(min_version) - } else if line.starts_with("min-system-llvm-version") { - let min_version = line - .trim_end() -@@ -208,7 +209,7 @@ impl EarlyProps { - .expect("Malformed llvm version directive"); - // Ignore if using system LLVM and actual version - // is smaller the minimum required version -- config.system_llvm && &actual_version[..] < min_version -+ config.system_llvm && actual_version < version_to_int(min_version) - } else if line.starts_with("ignore-llvm-version") { - // Syntax is: "ignore-llvm-version [- ]" - let range_components = line -@@ -219,15 +220,15 @@ impl EarlyProps { - .take(3) // 3 or more = invalid, so take at most 3. - .collect::>(); - match range_components.len() { -- 1 => &actual_version[..] == range_components[0], -+ 1 => actual_version == version_to_int(range_components[0]), - 2 => { -- let v_min = range_components[0]; -- let v_max = range_components[1]; -+ let v_min = version_to_int(range_components[0]); -+ let v_max = version_to_int(range_components[1]); - if v_max < v_min { - panic!("Malformed LLVM version range: max < min") - } - // Ignore if version lies inside of range. -- &actual_version[..] >= v_min && &actual_version[..] <= v_max -+ actual_version >= v_min && actual_version <= v_max - } - _ => panic!("Malformed LLVM version directive"), - } -@@ -238,6 +239,20 @@ impl EarlyProps { - false - } - } -+ -+ fn version_to_int(version: &str) -> u32 { -+ let version_without_suffix = version.split('-').next().unwrap(); -+ let components: Vec = version_without_suffix -+ .split('.') -+ .map(|s| s.parse().expect("Malformed version component")) -+ .collect(); -+ match components.len() { -+ 1 => components[0] * 10000, -+ 2 => components[0] * 10000 + components[1] * 100, -+ 3 => components[0] * 10000 + components[1] * 100 + components[2], -+ _ => panic!("Malformed version"), -+ } -+ } - } - } - -diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs -index 6c478f7e29da..31d991e0c2f8 100644 ---- a/src/tools/compiletest/src/header/tests.rs -+++ b/src/tools/compiletest/src/header/tests.rs -@@ -122,9 +122,8 @@ fn llvm_version() { - config.llvm_version = Some("9.3.1-rust-1.43.0-dev".to_owned()); - assert!(!parse_rs(&config, "// min-llvm-version 9.2").ignore); - -- // FIXME. -- // config.llvm_version = Some("10.0.0-rust".to_owned()); -- // assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); -+ config.llvm_version = Some("10.0.0-rust".to_owned()); -+ assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); - } - - #[test] diff --git a/rust-pr70591-ensure-llvm-is-in-the-link-path.patch b/rust-pr70591-ensure-llvm-is-in-the-link-path.patch deleted file mode 100644 index 9f5722b..0000000 --- a/rust-pr70591-ensure-llvm-is-in-the-link-path.patch +++ /dev/null @@ -1,40 +0,0 @@ -commit 6067315d58ff3d49b305ae3c99810656856c8e21 -Author: Josh Stone -Date: Mon Mar 30 14:03:39 2020 -0700 - - Ensure LLVM is in the link path for "fulldeps" tests - - This is a follow-up to #70123, which added `llvm-config --libdir` to the - `LIBRARY_PATH` for rustc tools. We need the same for "run-make-fulldeps" - and "ui-fulldeps" tests which depend on compiler libraries, implicitly - needing to link to `-lLLVM` as well. - -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index 5b946b05735d..2499856235f1 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -21,7 +21,7 @@ use crate::flags::Subcommand; - use crate::native; - use crate::tool::{self, SourceType, Tool}; - use crate::toolstate::ToolState; --use crate::util::{self, dylib_path, dylib_path_var}; -+use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var}; - use crate::Crate as CargoCrate; - use crate::{envify, DocTests, GitRepo, Mode}; - -@@ -1178,6 +1178,15 @@ impl Step for Compiletest { - cmd.arg("--system-llvm"); - } - -+ // Tests that use compiler libraries may inherit the `-lLLVM` link -+ // requirement, but the `-L` library path is not propagated across -+ // separate compilations. We can add LLVM's library path to the -+ // platform-specific environment variable as a workaround. -+ if !builder.config.dry_run && suite.ends_with("fulldeps") { -+ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); -+ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd); -+ } -+ - // Only pass correct values for these flags for the `run-make` suite as it - // requires that a C++ compiler was configured which isn't always the case. - if !builder.config.dry_run && suite == "run-make-fulldeps" { diff --git a/rust-pr71782-Use-a-non-existent-test-path.patch b/rust-pr71782-Use-a-non-existent-test-path.patch index df02449..463cb61 100644 --- a/rust-pr71782-Use-a-non-existent-test-path.patch +++ b/rust-pr71782-Use-a-non-existent-test-path.patch @@ -49,7 +49,7 @@ index f732abc52b71..edadecf273a7 100644 -error: io error modifying /dev/ +error: io error modifying /does-not-exist/ - error: aborting due to previous error + error: aborting due to previous error; 1 warning emitted -- 2.26.2 diff --git a/rust.spec b/rust.spec index 05ea3f7..be67f20 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.42.0 -%global bootstrap_cargo 1.42.0 -%global bootstrap_channel 1.42.0 -%global bootstrap_date 2020-03-12 +%global bootstrap_rust 1.43.1 +%global bootstrap_cargo 1.43.1 +%global bootstrap_channel 1.43.1 +%global bootstrap_date 2020-05-07 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.43.1 +Version: 1.44.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -63,22 +63,8 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# Revert https://github.com/rust-lang/rust/pull/57840 -# We do have the necessary fix in our LLVM 7. -Patch1: rust-pr57840-llvm7-debuginfo-variants.patch - -# Ensure LLVM is in the link path for rustc tools and "fulldeps" tests -# https://github.com/rust-lang/rust/pull/70123 -# https://github.com/rust-lang/rust/pull/70591 -Patch2: rust-pr70123-ensure-llvm-is-in-the-link-path.patch -Patch3: rust-pr70591-ensure-llvm-is-in-the-link-path.patch - -# Prepare for LLVM 10 upgrade -# https://github.com/rust-lang/rust/pull/70163 -Patch4: rust-pr70163-prepare-for-llvm-10-upgrade.patch - # https://github.com/rust-lang/rust/pull/71782 -Patch5: rust-pr71782-Use-a-non-existent-test-path.patch +Patch1: rust-pr71782-Use-a-non-existent-test-path.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -143,7 +129,7 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %without bundled_libgit2 -BuildRequires: pkgconfig(libgit2) >= 0.27 +BuildRequires: pkgconfig(libgit2) >= 1.0.0 %endif %if %without bundled_libssh2 @@ -160,11 +146,11 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 9.0.0 +Provides: bundled(llvm) = 9.0.1 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} -%global llvm llvm7.0 +%global llvm llvm9.0 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -172,7 +158,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 7.0 +BuildRequires: %{llvm}-devel >= 8.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -186,7 +172,7 @@ BuildRequires: procps-ng BuildRequires: gdb # TODO: work on unbundling these! -Provides: bundled(libbacktrace) = 8.1.0 +Provides: bundled(libbacktrace) = 1.0.20200219 # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} @@ -297,7 +283,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.99.0 +Provides: bundled(libgit2) = 1.0.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -343,7 +329,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.99.0 +Provides: bundled(libgit2) = 1.0.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -408,11 +394,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -R -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 +%patch1 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -718,6 +700,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index fb9b958..f09abf1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.43.1-src.tar.xz) = 24bb01237b1f3f5412109290bb4406b9742cf8956162f4090a98ed3a59a6e2e8dda399452bec1c93c8afdcf5effd98e4825e7f218238e0e88735c1ff4a5b385f +SHA512 (rustc-1.44.0-src.tar.xz) = 03d6a2ec4c80eb436b278677080f360912c60aacffb98b79c91d5a79967ef988b2e62ccff9ab26993f852cebd62cdad48e149c4498f6dcdeb3699cbed19790e4 diff --git a/sources-bootstrap b/sources-bootstrap index f2aa62c..2f70374 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.43.1-src.tar.xz) = 24bb01237b1f3f5412109290bb4406b9742cf8956162f4090a98ed3a59a6e2e8dda399452bec1c93c8afdcf5effd98e4825e7f218238e0e88735c1ff4a5b385f -SHA512 (rust-1.42.0-aarch64-unknown-linux-gnu.tar.xz) = 691a11e279efdcafa6bdafacb7fb48ccf653e180e0e85909b6031105a297d47538efb36d63216f6185427f818483a51aa827f351ca2123840d72caf60079fe13 -SHA512 (rust-1.42.0-armv7-unknown-linux-gnueabihf.tar.xz) = 26768ec530506e20fed8f9ef2c1ca85eec155fc90949f2063836b6109b296a976c8430a698971a8b1c11e8f6ad043d854a36e9f0e849417178411dc5cbd30e59 -SHA512 (rust-1.42.0-i686-unknown-linux-gnu.tar.xz) = 7376be5abed573bbf68f73ed5609fa8e22dfa3ead19a3f3d78d553347e3ae01604ab9906f5317f1687a8ab3f9ad9c38cde44ef6f56d7da65a788a74aee9df057 -SHA512 (rust-1.42.0-powerpc64le-unknown-linux-gnu.tar.xz) = e1db9bbef45e88e7d1d5b905379c04786a015c90d0d9de6a6c16276a3e91c342a8231dda7a4d46ecc7adc969d07fd7dd8595975647b9ab69f8997fee74401219 -SHA512 (rust-1.42.0-powerpc64-unknown-linux-gnu.tar.xz) = 668d1d353bdaf676043ab7f4baad464b202e8ae1be7713e3481b8e9fb5fabd1020e10e178d69d099541cb1b23362b50b826790740156f1c96efa3d2a7457e404 -SHA512 (rust-1.42.0-s390x-unknown-linux-gnu.tar.xz) = 85b1331a9a71cc43a2fa628b8510590ff072e409c2c38ebfd9089ab7a245182e23b52f6221b25c63f6048e1bf4ada0f561dd8f3f810680c9727040bc8a0d8d46 -SHA512 (rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz) = 87c06d4503e7ba12bd3dfc8dd279a3bdf33a24d2c22eec1378b79b2c17ccdad9b4c8dbd0d4704eae1f3476aec5639d3ba143e8c74a296d631b17b57da7447e70 +SHA512 (rustc-1.44.0-src.tar.xz) = 03d6a2ec4c80eb436b278677080f360912c60aacffb98b79c91d5a79967ef988b2e62ccff9ab26993f852cebd62cdad48e149c4498f6dcdeb3699cbed19790e4 +SHA512 (rust-1.43.1-aarch64-unknown-linux-gnu.tar.xz) = b54fad5493344d2370bd77110f0ffb0231f41ab8aa9707e9303304957c5d9067dc83089432eb175605b78dc771dfcf7abfcce63d7fecdbb759dd224c17d12da0 +SHA512 (rust-1.43.1-armv7-unknown-linux-gnueabihf.tar.xz) = 0812b3229dd47f1b5cadb49020e68d28b4267ac0489d0c2e448f21e3b0b6519bbf216ac9b20b747e035033842a6eb3b13a98706f2eddca2c088d9396dcb2c21e +SHA512 (rust-1.43.1-i686-unknown-linux-gnu.tar.xz) = c7423bccfb15f3df6043ec1d81203c9db9b3229dedd347cab09d3cc3b183f53aa0707f59964efccd63418e1c6ad21e7ee7dcc1495eda8c4ecb55ee8e6b3ac034 +SHA512 (rust-1.43.1-powerpc64le-unknown-linux-gnu.tar.xz) = da447ec44ebf998290a73420437c8d434a6c196cfe1c3331a9adf40abf7acd97a231e352a8626bbfa961da8e0c4f450aa59d573254257f72cce4068eeb8112a1 +SHA512 (rust-1.43.1-powerpc64-unknown-linux-gnu.tar.xz) = 695591807892c8f08801cd145ebc6a91ee4222000210baaaa0d6c8acf1ac6a96f4bf2566871def04d15a9965b7e3ea4287e37d7851fb14010518694d8ede75e6 +SHA512 (rust-1.43.1-s390x-unknown-linux-gnu.tar.xz) = f087e50a91b1cc4a12bf15aea1cefbda9b89518febcecc0d56ea7d0a6a682be06cff7777d0a0b4812e96f3fb3295e7799bf200c1599c88cb7083a78d5002f14a +SHA512 (rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz) = 2fc573ca2826d9f03044f746ae4d7715b4e31b9ac933289607aa3449a538bb4dfd519540576a1d0d286c0d754a7ba6ce38beef6aded1090d3af3091b6ba2a9ee From 560777dfc7cdaaeab49b31414cefbbd9ace9b844 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 18 Jun 2020 09:47:06 -0700 Subject: [PATCH 016/222] Update to 1.44.1. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- sources-bootstrap | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5d48bd7..e840b80 100644 --- a/.gitignore +++ b/.gitignore @@ -278,3 +278,4 @@ /rust-1.43.1-powerpc64-unknown-linux-gnu.tar.xz /rust-1.43.1-s390x-unknown-linux-gnu.tar.xz /rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.44.1-src.tar.xz diff --git a/rust.spec b/rust.spec index be67f20..288b310 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.44.0 +Version: 1.44.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -700,6 +700,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index f09abf1..381d691 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.44.0-src.tar.xz) = 03d6a2ec4c80eb436b278677080f360912c60aacffb98b79c91d5a79967ef988b2e62ccff9ab26993f852cebd62cdad48e149c4498f6dcdeb3699cbed19790e4 +SHA512 (rustc-1.44.1-src.tar.xz) = 1c17002edae844a710db9b144c17171416330dc565343c65af8a6e112fb61555e2025bb4cf33cac1229d7df689e6ff8858b91ae00552400ccacafaf1de11849b diff --git a/sources-bootstrap b/sources-bootstrap index 2f70374..82332cc 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.44.0-src.tar.xz) = 03d6a2ec4c80eb436b278677080f360912c60aacffb98b79c91d5a79967ef988b2e62ccff9ab26993f852cebd62cdad48e149c4498f6dcdeb3699cbed19790e4 +SHA512 (rustc-1.44.1-src.tar.xz) = 1c17002edae844a710db9b144c17171416330dc565343c65af8a6e112fb61555e2025bb4cf33cac1229d7df689e6ff8858b91ae00552400ccacafaf1de11849b SHA512 (rust-1.43.1-aarch64-unknown-linux-gnu.tar.xz) = b54fad5493344d2370bd77110f0ffb0231f41ab8aa9707e9303304957c5d9067dc83089432eb175605b78dc771dfcf7abfcce63d7fecdbb759dd224c17d12da0 SHA512 (rust-1.43.1-armv7-unknown-linux-gnueabihf.tar.xz) = 0812b3229dd47f1b5cadb49020e68d28b4267ac0489d0c2e448f21e3b0b6519bbf216ac9b20b747e035033842a6eb3b13a98706f2eddca2c088d9396dcb2c21e SHA512 (rust-1.43.1-i686-unknown-linux-gnu.tar.xz) = c7423bccfb15f3df6043ec1d81203c9db9b3229dedd347cab09d3cc3b183f53aa0707f59964efccd63418e1c6ad21e7ee7dcc1495eda8c4ecb55ee8e6b3ac034 From bd38d989dcc7f2a05c8f54a14e55d161f151e0ee Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 1 Jul 2020 15:31:23 -0600 Subject: [PATCH 017/222] Disable LTO --- rust.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 288b310..df8f12e 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.44.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -450,6 +450,11 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %build +# This package fails to build with LTO due to undefined symbols. LTO +# was disabled in OpenSuSE as well, but with no real explanation why +# beyond the undefined symbols. It really should be investigated further. +# Disable LTO +%define _lto_cflags %{nil} %if %without bundled_libgit2 # convince libgit2-sys to use the distro libgit2 @@ -700,6 +705,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed Jul 01 2020 Josh Stone - 1.44.1-2 +- Disable LTO + * Thu Jun 18 2020 Josh Stone - 1.44.1-1 - Update to 1.44.1. From d62a20a4dedb7063ac3e43509847d5cbd84d5bca Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 Jul 2020 11:04:22 -0700 Subject: [PATCH 018/222] Update to 1.45.0. --- .gitignore | 8 +++ ...pr71782-Use-a-non-existent-test-path.patch | 56 ------------------- rust.spec | 28 +++++----- sources | 2 +- sources-bootstrap | 16 +++--- 5 files changed, 30 insertions(+), 80 deletions(-) delete mode 100644 rust-pr71782-Use-a-non-existent-test-path.patch diff --git a/.gitignore b/.gitignore index e840b80..35637e0 100644 --- a/.gitignore +++ b/.gitignore @@ -279,3 +279,11 @@ /rust-1.43.1-s390x-unknown-linux-gnu.tar.xz /rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz /rustc-1.44.1-src.tar.xz +/rustc-1.45.0-src.tar.xz +/rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz +/rust-1.44.0-i686-unknown-linux-gnu.tar.xz +/rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.44.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.44.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.44.0-s390x-unknown-linux-gnu.tar.xz diff --git a/rust-pr71782-Use-a-non-existent-test-path.patch b/rust-pr71782-Use-a-non-existent-test-path.patch deleted file mode 100644 index 463cb61..0000000 --- a/rust-pr71782-Use-a-non-existent-test-path.patch +++ /dev/null @@ -1,56 +0,0 @@ -From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 1 May 2020 16:50:10 -0700 -Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null - ---- - src/test/ui/non-ice-error-on-worker-io-fail.rs | 10 +++++++--- - src/test/ui/non-ice-error-on-worker-io-fail.stderr | 2 +- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.rs b/src/test/ui/non-ice-error-on-worker-io-fail.rs -index 8af17742850d..30779fc65c0f 100644 ---- a/src/test/ui/non-ice-error-on-worker-io-fail.rs -+++ b/src/test/ui/non-ice-error-on-worker-io-fail.rs -@@ -4,8 +4,12 @@ - // - // An attempt to `-o` into a directory we cannot write into should indeed - // be an error; but not an ICE. -+// -+// However, some folks run tests as root, which can write `/dev/` and end -+// up clobbering `/dev/null`. Instead we'll use a non-existent path, which -+// also used to ICE, but even root can't magically write there. - --// compile-flags: -o /dev/null -+// compile-flags: -o /does-not-exist/output - - // The error-pattern check occurs *before* normalization, and the error patterns - // are wildly different between build environments. So this is a cop-out (and we -@@ -15,10 +19,10 @@ - // error-pattern: error - - // On Mac OS X, we get an error like the below --// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/" -+// normalize-stderr-test "failed to write bytecode to /does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying /does-not-exist/" - - // On Linux, we get an error like the below --// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/" -+// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /does-not-exist/" - - // ignore-tidy-linelength - // ignore-windows - this is a unix-specific test -diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.stderr b/src/test/ui/non-ice-error-on-worker-io-fail.stderr -index f732abc52b71..edadecf273a7 100644 ---- a/src/test/ui/non-ice-error-on-worker-io-fail.stderr -+++ b/src/test/ui/non-ice-error-on-worker-io-fail.stderr -@@ -1,6 +1,6 @@ - warning: ignoring --out-dir flag due to -o flag - --error: io error modifying /dev/ -+error: io error modifying /does-not-exist/ - - error: aborting due to previous error; 1 warning emitted - --- -2.26.2 - diff --git a/rust.spec b/rust.spec index df8f12e..723e884 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.43.1 -%global bootstrap_cargo 1.43.1 -%global bootstrap_channel 1.43.1 -%global bootstrap_date 2020-05-07 +%global bootstrap_rust 1.44.0 +%global bootstrap_cargo 1.44.0 +%global bootstrap_channel 1.44.0 +%global bootstrap_date 2020-06-04 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -21,7 +21,7 @@ %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 7.0+. +# is insufficient. Rust currently requires LLVM 8.0+. %if 0%{?rhel} && !0%{?epel} %bcond_without bundled_llvm %else @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.44.1 -Release: 2%{?dist} +Version: 1.45.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -63,9 +63,6 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/71782 -Patch1: rust-pr71782-Use-a-non-existent-test-path.patch - # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -146,7 +143,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 9.0.1 +Provides: bundled(llvm) = 10.0.1 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} @@ -394,8 +391,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 - %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure %endif @@ -506,6 +501,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 --disable-rpath \ %{enable_debuginfo} \ --enable-extended \ + --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ %{?codegen_units_std} \ @@ -613,7 +609,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so -%exclude %{_bindir}/*miri %files std-static @@ -705,7 +700,10 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Wed Jul 01 2020 Josh Stone - 1.44.1-2 +* 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 diff --git a/sources b/sources index 381d691..fbfacd4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.44.1-src.tar.xz) = 1c17002edae844a710db9b144c17171416330dc565343c65af8a6e112fb61555e2025bb4cf33cac1229d7df689e6ff8858b91ae00552400ccacafaf1de11849b +SHA512 (rustc-1.45.0-src.tar.xz) = ff049eb65b36e6c64531d56251ebd446336a782f26504eccf375df1c22fa94b5f18e84660cef423edb815c1b31a1a7c9e57aea4aa0779576f3b0d7e81e19427b diff --git a/sources-bootstrap b/sources-bootstrap index 82332cc..09c180b 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.44.1-src.tar.xz) = 1c17002edae844a710db9b144c17171416330dc565343c65af8a6e112fb61555e2025bb4cf33cac1229d7df689e6ff8858b91ae00552400ccacafaf1de11849b -SHA512 (rust-1.43.1-aarch64-unknown-linux-gnu.tar.xz) = b54fad5493344d2370bd77110f0ffb0231f41ab8aa9707e9303304957c5d9067dc83089432eb175605b78dc771dfcf7abfcce63d7fecdbb759dd224c17d12da0 -SHA512 (rust-1.43.1-armv7-unknown-linux-gnueabihf.tar.xz) = 0812b3229dd47f1b5cadb49020e68d28b4267ac0489d0c2e448f21e3b0b6519bbf216ac9b20b747e035033842a6eb3b13a98706f2eddca2c088d9396dcb2c21e -SHA512 (rust-1.43.1-i686-unknown-linux-gnu.tar.xz) = c7423bccfb15f3df6043ec1d81203c9db9b3229dedd347cab09d3cc3b183f53aa0707f59964efccd63418e1c6ad21e7ee7dcc1495eda8c4ecb55ee8e6b3ac034 -SHA512 (rust-1.43.1-powerpc64le-unknown-linux-gnu.tar.xz) = da447ec44ebf998290a73420437c8d434a6c196cfe1c3331a9adf40abf7acd97a231e352a8626bbfa961da8e0c4f450aa59d573254257f72cce4068eeb8112a1 -SHA512 (rust-1.43.1-powerpc64-unknown-linux-gnu.tar.xz) = 695591807892c8f08801cd145ebc6a91ee4222000210baaaa0d6c8acf1ac6a96f4bf2566871def04d15a9965b7e3ea4287e37d7851fb14010518694d8ede75e6 -SHA512 (rust-1.43.1-s390x-unknown-linux-gnu.tar.xz) = f087e50a91b1cc4a12bf15aea1cefbda9b89518febcecc0d56ea7d0a6a682be06cff7777d0a0b4812e96f3fb3295e7799bf200c1599c88cb7083a78d5002f14a -SHA512 (rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz) = 2fc573ca2826d9f03044f746ae4d7715b4e31b9ac933289607aa3449a538bb4dfd519540576a1d0d286c0d754a7ba6ce38beef6aded1090d3af3091b6ba2a9ee +SHA512 (rustc-1.45.0-src.tar.xz) = ff049eb65b36e6c64531d56251ebd446336a782f26504eccf375df1c22fa94b5f18e84660cef423edb815c1b31a1a7c9e57aea4aa0779576f3b0d7e81e19427b +SHA512 (rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz) = 25c762e07e178ffc1b96b4a113e437541d6dc18bd81fb9933af676e99ca391c6cdd8d420caabcfca1b3ddb987a84ff9eb1d0bdb3cca486e71925555f51ecaa4c +SHA512 (rust-1.44.0-i686-unknown-linux-gnu.tar.xz) = 85ee1d7cd4581d9cdc18f0cfe89b0c78c32039f658b85c5f6a60ac8047864234bdff955e02d6e15ae40dd98e8e27cb3d83fab978dba6373f9e487cfd2ba0b594 +SHA512 (rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz) = 59fd1f0dc058118a838c4c3c66dd5a5c2acb1b05ebf4525188846577cb22c4b46a57605d6a9cede5fbd34c0b5c638434a186d1ce3693ace6be8105c265b59b7b +SHA512 (rust-1.44.0-aarch64-unknown-linux-gnu.tar.xz) = c853a585bd76730a9ed1e95c12baf2939928fd3c5ba7cc0f95c03ec472c0012f01d0b7d7c37e21dfdcc1d1eca4c7e392709a2585e42bc759b636e95b4ab870d0 +SHA512 (rust-1.44.0-powerpc64-unknown-linux-gnu.tar.xz) = dff9aa248cd0efd1b28c6254c040cd30356ce973a3ed525530db783d6f7ebcdd32568bfa5c68c2aba0bb312ee74f03d1c91361e69830fe79ddd4d31e73fc2865 +SHA512 (rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz) = d74802fc29641d08b5e5d526e91258c71d914daf0f33abea71ad7d300da4ae39d457b9d4e95b0b0811ec8ed5e60e7d0292e8e928f3079189e07887ce115bd466 +SHA512 (rust-1.44.0-s390x-unknown-linux-gnu.tar.xz) = 39fac45e0c1e8786275ba30ed13d13334c7f0fc03d653a3e0a3e174d18e244d9e4bb99614ed1465e7a21befb2542ed4d3a54d4ea2702da449b1e6a7770a43970 From 2023d1f6b78598235ca43644a16b996fa09d22c0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 07:19:49 +0000 Subject: [PATCH 019/222] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 723e884..ff08fa4 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.45.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -700,6 +700,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. From d2688a551805dbb0916cf1741397e57694612b6d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 30 Jul 2020 11:41:32 -0700 Subject: [PATCH 020/222] Update to 1.45.1. --- .gitignore | 1 + rust.spec | 7 +++++-- sources | 2 +- sources-bootstrap | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 35637e0..6c921e2 100644 --- a/.gitignore +++ b/.gitignore @@ -287,3 +287,4 @@ /rust-1.44.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.44.0-s390x-unknown-linux-gnu.tar.xz +/rustc-1.45.1-src.tar.xz diff --git a/rust.spec b/rust.spec index ff08fa4..1489ff2 100644 --- a/rust.spec +++ b/rust.spec @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.45.0 -Release: 2%{?dist} +Version: 1.45.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -700,6 +700,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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 diff --git a/sources b/sources index fbfacd4..fe11332 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.45.0-src.tar.xz) = ff049eb65b36e6c64531d56251ebd446336a782f26504eccf375df1c22fa94b5f18e84660cef423edb815c1b31a1a7c9e57aea4aa0779576f3b0d7e81e19427b +SHA512 (rustc-1.45.1-src.tar.xz) = ef71a1706c84fa8557f481d310033285a41ecd9b8d537bacb846d01ed9954b679b915272db57cd96d5ee097cc0134899e584d517c467a9d2949496312e5995df diff --git a/sources-bootstrap b/sources-bootstrap index 09c180b..ffb5848 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.45.0-src.tar.xz) = ff049eb65b36e6c64531d56251ebd446336a782f26504eccf375df1c22fa94b5f18e84660cef423edb815c1b31a1a7c9e57aea4aa0779576f3b0d7e81e19427b +SHA512 (rustc-1.45.1-src.tar.xz) = ef71a1706c84fa8557f481d310033285a41ecd9b8d537bacb846d01ed9954b679b915272db57cd96d5ee097cc0134899e584d517c467a9d2949496312e5995df SHA512 (rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz) = 25c762e07e178ffc1b96b4a113e437541d6dc18bd81fb9933af676e99ca391c6cdd8d420caabcfca1b3ddb987a84ff9eb1d0bdb3cca486e71925555f51ecaa4c SHA512 (rust-1.44.0-i686-unknown-linux-gnu.tar.xz) = 85ee1d7cd4581d9cdc18f0cfe89b0c78c32039f658b85c5f6a60ac8047864234bdff955e02d6e15ae40dd98e8e27cb3d83fab978dba6373f9e487cfd2ba0b594 SHA512 (rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz) = 59fd1f0dc058118a838c4c3c66dd5a5c2acb1b05ebf4525188846577cb22c4b46a57605d6a9cede5fbd34c0b5c638434a186d1ce3693ace6be8105c265b59b7b From 99cf40c754dcb1fb951a4f84db983262571c2a17 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 3 Aug 2020 10:33:21 -0700 Subject: [PATCH 021/222] Update to 1.45.2. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- sources-bootstrap | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6c921e2..6cde7da 100644 --- a/.gitignore +++ b/.gitignore @@ -288,3 +288,4 @@ /rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.44.0-s390x-unknown-linux-gnu.tar.xz /rustc-1.45.1-src.tar.xz +/rustc-1.45.2-src.tar.xz diff --git a/rust.spec b/rust.spec index 1489ff2..4680a96 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ %endif Name: rust -Version: 1.45.1 +Version: 1.45.2 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -700,6 +700,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/sources b/sources index fe11332..9c4067f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.45.1-src.tar.xz) = ef71a1706c84fa8557f481d310033285a41ecd9b8d537bacb846d01ed9954b679b915272db57cd96d5ee097cc0134899e584d517c467a9d2949496312e5995df +SHA512 (rustc-1.45.2-src.tar.xz) = cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25 diff --git a/sources-bootstrap b/sources-bootstrap index ffb5848..cd3a489 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.45.1-src.tar.xz) = ef71a1706c84fa8557f481d310033285a41ecd9b8d537bacb846d01ed9954b679b915272db57cd96d5ee097cc0134899e584d517c467a9d2949496312e5995df +SHA512 (rustc-1.45.2-src.tar.xz) = cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25 SHA512 (rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz) = 25c762e07e178ffc1b96b4a113e437541d6dc18bd81fb9933af676e99ca391c6cdd8d420caabcfca1b3ddb987a84ff9eb1d0bdb3cca486e71925555f51ecaa4c SHA512 (rust-1.44.0-i686-unknown-linux-gnu.tar.xz) = 85ee1d7cd4581d9cdc18f0cfe89b0c78c32039f658b85c5f6a60ac8047864234bdff955e02d6e15ae40dd98e8e27cb3d83fab978dba6373f9e487cfd2ba0b594 SHA512 (rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz) = 59fd1f0dc058118a838c4c3c66dd5a5c2acb1b05ebf4525188846577cb22c4b46a57605d6a9cede5fbd34c0b5c638434a186d1ce3693ace6be8105c265b59b7b From 105a7c00129f8f526fb3e15bce8c481874c2b88c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 27 Aug 2020 10:49:15 -0700 Subject: [PATCH 022/222] Update to 1.46.0. I've unbundled libgit2 for fedora >= 32, where we have libgit2-1.0.1. I've also pulled in some RHEL config and patches I had in other branches, but these should end up as no-ops for Fedora. --- .gitignore | 8 + ...er_exists-test-on-single-cpu-systems.patch | 29 ++++ rust.spec | 137 ++++++++++++------ rustc-1.42.0-disable-libssh2.patch | 42 ++++++ rustc-1.45.0-disable-http2.patch | 66 +++++++++ rustc-1.45.0-no-default-pie.patch | 20 +++ sources | 2 +- sources-bootstrap | 16 +- 8 files changed, 266 insertions(+), 54 deletions(-) create mode 100644 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch create mode 100644 rustc-1.42.0-disable-libssh2.patch create mode 100644 rustc-1.45.0-disable-http2.patch create mode 100644 rustc-1.45.0-no-default-pie.patch diff --git a/.gitignore b/.gitignore index 6cde7da..25c173a 100644 --- a/.gitignore +++ b/.gitignore @@ -289,3 +289,11 @@ /rust-1.44.0-s390x-unknown-linux-gnu.tar.xz /rustc-1.45.1-src.tar.xz /rustc-1.45.2-src.tar.xz +/rustc-1.46.0-src.tar.xz +/rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz +/rust-1.45.2-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.45.2-i686-unknown-linux-gnu.tar.xz +/rust-1.45.2-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.45.2-s390x-unknown-linux-gnu.tar.xz +/rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch b/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch new file mode 100644 index 0000000..1650679 --- /dev/null +++ b/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch @@ -0,0 +1,29 @@ +From 02fc16aece46abcd23d2ade2d969497f07fe26ab Mon Sep 17 00:00:00 2001 +From: Alex Crichton +Date: Fri, 7 Aug 2020 12:50:25 -0700 +Subject: [PATCH] Fix jobserver_exists test on single-cpu systems + +Closes #8595 +--- + tests/testsuite/jobserver.rs | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/testsuite/jobserver.rs b/tests/testsuite/jobserver.rs +index 9e91c956cd75..16518ee2c614 100644 +--- a/tests/testsuite/jobserver.rs ++++ b/tests/testsuite/jobserver.rs +@@ -51,7 +51,10 @@ fn jobserver_exists() { + .file("src/lib.rs", "") + .build(); + +- p.cargo("build").run(); ++ // Explicitly use `-j2` to ensure that there's eventually going to be a ++ // token to read from `valdiate` above, since running the build script ++ // itself consumes a token. ++ p.cargo("build -j2").run(); + } + + #[cargo_test] +-- +2.26.2 + diff --git a/rust.spec b/rust.spec index 4680a96..ed134fb 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.44.0 -%global bootstrap_cargo 1.44.0 -%global bootstrap_channel 1.44.0 -%global bootstrap_date 2020-06-04 +%global bootstrap_rust 1.45.2 +%global bootstrap_cargo 1.45.2 +%global bootstrap_channel 1.45.2 +%global bootstrap_date 2020-08-03 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -22,33 +22,37 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 8.0+. -%if 0%{?rhel} && !0%{?epel} -%bcond_without bundled_llvm -%else %bcond_with bundled_llvm + +# Requires stable libgit2 1.0 +%if 0%{?fedora} >= 32 +%bcond_with bundled_libgit2 +%else +%bcond_without bundled_libgit2 %endif -# libgit2-sys expects to use its bundled library, which is sometimes just a -# snapshot of libgit2's master branch. This can mean the FFI declarations -# won't match our released libgit2.so, e.g. having changed struct fields. -# So, tread carefully if you toggle this... -%bcond_without bundled_libgit2 - %if 0%{?rhel} -%bcond_without bundled_libssh2 +# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) +%bcond_without disabled_libssh2 %else -%bcond_with bundled_libssh2 +%bcond_with disabled_libssh2 +%endif + +%if 0%{?rhel} && 0%{?rhel} < 8 +%bcond_with curl_http2 +%else +%bcond_without curl_http2 %endif # LLDB isn't available everywhere... -%if !0%{?rhel} -%bcond_without lldb -%else +%if 0%{?rhel} && 0%{?rhel} < 8 %bcond_with lldb +%else +%bcond_without lldb %endif Name: rust -Version: 1.45.2 +Version: 1.46.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -63,6 +67,23 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# https://github.com/rust-lang/cargo/pull/8598 +Patch1: 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch + +### RHEL-specific patches below ### + +# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) +Patch100: rustc-1.42.0-disable-libssh2.patch + +# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys +# will try to build it statically -- instead we turn off the feature. +Patch101: rustc-1.45.0-disable-http2.patch + +# kernel rh1410097 causes too-small stacks for PIE. +# (affects RHEL6 kernels when building for RHEL7) +Patch102: rustc-1.45.0-no-default-pie.patch + + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -73,6 +94,8 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz arch = "powerpc64" elseif arch == "ppc64le" then arch = "powerpc64le" + elseif arch == "riscv64" then + arch = "riscv64gc" end return arch.."-unknown-linux-"..abi end} @@ -106,11 +129,11 @@ end} Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else BuildRequires: cargo >= %{bootstrap_cargo} -%if 0%{?fedora} >= 27 -BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) -%else +%if 0%{?rhel} && 0%{?rhel} < 8 BuildRequires: %{name} >= %{bootstrap_rust} BuildConflicts: %{name} > %{version} +%else +BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) %endif %global local_rust_root %{_prefix} %endif @@ -120,6 +143,8 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: ncurses-devel BuildRequires: curl +# explicit curl-devel to avoid httpd24-curl (rhbz1540167) +BuildRequires: curl-devel BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(openssl) @@ -129,16 +154,12 @@ BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(libgit2) >= 1.0.0 %endif -%if %without bundled_libssh2 +%if %{without disabled_libssh2} && %{without bundled_libssh2} # needs libssh2_userauth_publickey_frommemory BuildRequires: pkgconfig(libssh2) >= 1.6.0 %endif -%if 0%{?rhel} && 0%{?rhel} <= 7 -%global python python2 -%else %global python python3 -%endif BuildRequires: %{python} %if %with bundled_llvm @@ -146,7 +167,7 @@ BuildRequires: cmake3 >= 3.4.3 Provides: bundled(llvm) = 10.0.1 %else BuildRequires: cmake >= 2.8.11 -%if 0%{?epel} +%if 0%{?epel} == 7 %global llvm llvm9.0 %endif %if %defined llvm @@ -192,14 +213,14 @@ Requires: /usr/bin/cc # While we don't want to encourage dynamic linking to Rust shared libraries, as # there's no stable ABI, we still need the unallocated metadata (.rustc) to -# support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is -# very eager by default, so we have to limit it to -g, only debugging symbols. -%if 0%{?fedora} >= 27 -# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 -%global _find_debuginfo_opts --keep-section .rustc -%else +# support custom-derive plugins like #[proc_macro_derive(Foo)]. +%if 0%{?rhel} && 0%{?rhel} < 8 +# eu-strip is very eager by default, so we have to limit it to -g, only debugging symbols. %global _find_debuginfo_opts -g %undefine _include_minidebuginfo +%else +# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 +%global _find_debuginfo_opts --keep-section .rustc %endif # Use hardening ldflags. @@ -251,11 +272,7 @@ programs. Summary: LLDB pretty printers for Rust BuildArch: noarch Requires: lldb -%if 0%{?fedora} >= 31 -Requires: python3-lldb -%else -Requires: python2-lldb -%endif +Requires: %{python}-lldb Requires: %{name}-debugger-common = %{version}-%{release} %description lldb @@ -391,8 +408,24 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%if "%{python}" == "python3" -sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure +%patch1 -p1 -d src/tools/cargo + +%if %with disabled_libssh2 +%patch100 -p1 +%endif + +%if %without curl_http2 +%patch101 -p1 +rm -rf vendor/libnghttp2-sys/ +%endif + +%if 0%{?rhel} && 0%{?rhel} < 8 +%patch102 -p1 -b .no-pie +%endif + +%if "%{python}" != "python3" +# Use our preferred python first +sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %endif %if %without bundled_llvm @@ -413,6 +446,9 @@ rm -rf vendor/libgit2-sys/libgit2/ %if %without bundled_libssh2 rm -rf vendor/libssh2-sys/libssh2/ %endif +%if %with disabled_libssh2 +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 @@ -420,7 +456,7 @@ sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs # rename bundled license for packaging cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} -%if %{with bundled_llvm} && 0%{?epel} +%if %{with bundled_llvm} && 0%{?epel} == 7 mkdir -p cmake-bin ln -s /usr/bin/cmake3 cmake-bin/cmake %global cmake_path $PWD/cmake-bin @@ -472,7 +508,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %ifarch %{arm} %{ix86} s390x # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 -%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7) +%if 0%{?rhel} && 0%{?rhel} < 8 # Older rpmbuild didn't work with partial debuginfo coverage. %global debug_package %{nil} %define enable_debuginfo --debuginfo-level=0 @@ -490,6 +526,14 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %define codegen_units_std --set rust.codegen-units-std=1 %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) +max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 )) +if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then + ncpus="$max_cpus" +fi + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -507,7 +551,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %{?codegen_units_std} \ --release-channel=%{channel} -%{python} ./x.py build +%{python} ./x.py build -j "$ncpus" --stage 2 %{python} ./x.py doc @@ -621,7 +665,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files debugger-common %dir %{rustlibdir} %dir %{rustlibdir}/etc -%{rustlibdir}/etc/debugger_*.py* +%{rustlibdir}/etc/rust_*.py* %files gdb @@ -700,6 +744,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. diff --git a/rustc-1.42.0-disable-libssh2.patch b/rustc-1.42.0-disable-libssh2.patch new file mode 100644 index 0000000..770ad34 --- /dev/null +++ b/rustc-1.42.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- rustc-1.42.0-src/Cargo.lock.orig 2020-03-09 15:11:17.000000000 -0700 ++++ rustc-1.42.0-src/Cargo.lock 2020-04-02 16:39:22.268896227 -0700 +@@ -1796,7 +1796,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1813,20 +1812,6 @@ + ] + + [[package]] +-name = "libssh2-sys" +-version = "0.2.14" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] +- +-[[package]] + name = "libz-sys" + version = "1.0.25" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-1.42.0-src/vendor/git2/Cargo.toml.orig 2020-03-09 17:00:19.000000000 -0700 ++++ rustc-1.42.0-src/vendor/git2/Cargo.toml 2020-04-02 16:38:46.163664007 -0700 +@@ -55,7 +55,7 @@ + version = "0.1.39" + + [features] +-default = ["ssh", "https", "ssh_key_from_memory"] ++default = ["https"] + https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] + ssh = ["libgit2-sys/ssh"] + ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/rustc-1.45.0-disable-http2.patch b/rustc-1.45.0-disable-http2.patch new file mode 100644 index 0000000..875b22a --- /dev/null +++ b/rustc-1.45.0-disable-http2.patch @@ -0,0 +1,66 @@ +--- rustc-1.45.0-src/Cargo.lock.orig 2020-07-13 09:27:24.000000000 -0700 ++++ rustc-1.45.0-src/Cargo.lock 2020-07-16 12:12:32.253903599 -0700 +@@ -896,7 +896,6 @@ + dependencies = [ + "cc", + "libc", +- "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1875,16 +1874,6 @@ + ] + + [[package]] +-name = "libnghttp2-sys" +-version = "0.1.2" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463" +-dependencies = [ +- "cc", +- "libc", +-] +- +-[[package]] + name = "libz-sys" + version = "1.0.25" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-1.45.0-src/src/tools/cargo/Cargo.toml.orig 2020-07-13 09:27:49.000000000 -0700 ++++ rustc-1.45.0-src/src/tools/cargo/Cargo.toml 2020-07-16 12:12:32.253903599 -0700 +@@ -25,7 +25,7 @@ + crates-io = { path = "crates/crates-io", version = "0.31.1" } + crossbeam-utils = "0.7" + crypto-hash = "0.3.1" +-curl = { version = "0.4.23", features = ["http2"] } ++curl = { version = "0.4.23", features = [] } + curl-sys = "0.4.22" + env_logger = "0.7.0" + pretty_env_logger = { version = "0.4", optional = true } +--- rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-07-13 09:27:49.000000000 -0700 ++++ rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-07-16 12:12:32.253903599 -0700 +@@ -393,14 +393,8 @@ + // Also note that pipelining is disabled as curl authors have indicated + // that it's buggy, and we've empirically seen that it's buggy with HTTP + // proxies. +- let mut multi = Multi::new(); +- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); +- multi +- .pipelining(false, multiplexing) +- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?; +- +- // let's not flood crates.io with connections +- multi.set_max_host_connections(2)?; ++ let multi = Multi::new(); ++ let multiplexing = false; + + Ok(PackageSet { + packages: package_ids +@@ -563,7 +557,7 @@ + macro_rules! try_old_curl { + ($e:expr, $msg:expr) => { + let result = $e; +- if cfg!(target_os = "macos") { ++ if cfg!(any(target_os = "linux", target_os = "macos")) { + if let Err(e) = result { + warn!("ignoring libcurl {} error: {}", $msg, e); + } diff --git a/rustc-1.45.0-no-default-pie.patch b/rustc-1.45.0-no-default-pie.patch new file mode 100644 index 0000000..726df24 --- /dev/null +++ b/rustc-1.45.0-no-default-pie.patch @@ -0,0 +1,20 @@ +diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs +index dcce1d45298c..5c11f7276f26 100644 +--- a/src/librustc_codegen_ssa/back/link.rs ++++ b/src/librustc_codegen_ssa/back/link.rs +@@ -1184,10 +1184,12 @@ fn exec_linker( + } + + fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { +- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { +- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, ++ // Only use PIE if explicity specified. ++ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); ++ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { ++ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, +- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, ++ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, + (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, + (_, true, _) => LinkOutputKind::StaticDylib, + (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/sources b/sources index 9c4067f..11a9b85 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.45.2-src.tar.xz) = cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25 +SHA512 (rustc-1.46.0-src.tar.xz) = 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4 diff --git a/sources-bootstrap b/sources-bootstrap index cd3a489..422747e 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.45.2-src.tar.xz) = cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25 -SHA512 (rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz) = 25c762e07e178ffc1b96b4a113e437541d6dc18bd81fb9933af676e99ca391c6cdd8d420caabcfca1b3ddb987a84ff9eb1d0bdb3cca486e71925555f51ecaa4c -SHA512 (rust-1.44.0-i686-unknown-linux-gnu.tar.xz) = 85ee1d7cd4581d9cdc18f0cfe89b0c78c32039f658b85c5f6a60ac8047864234bdff955e02d6e15ae40dd98e8e27cb3d83fab978dba6373f9e487cfd2ba0b594 -SHA512 (rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz) = 59fd1f0dc058118a838c4c3c66dd5a5c2acb1b05ebf4525188846577cb22c4b46a57605d6a9cede5fbd34c0b5c638434a186d1ce3693ace6be8105c265b59b7b -SHA512 (rust-1.44.0-aarch64-unknown-linux-gnu.tar.xz) = c853a585bd76730a9ed1e95c12baf2939928fd3c5ba7cc0f95c03ec472c0012f01d0b7d7c37e21dfdcc1d1eca4c7e392709a2585e42bc759b636e95b4ab870d0 -SHA512 (rust-1.44.0-powerpc64-unknown-linux-gnu.tar.xz) = dff9aa248cd0efd1b28c6254c040cd30356ce973a3ed525530db783d6f7ebcdd32568bfa5c68c2aba0bb312ee74f03d1c91361e69830fe79ddd4d31e73fc2865 -SHA512 (rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz) = d74802fc29641d08b5e5d526e91258c71d914daf0f33abea71ad7d300da4ae39d457b9d4e95b0b0811ec8ed5e60e7d0292e8e928f3079189e07887ce115bd466 -SHA512 (rust-1.44.0-s390x-unknown-linux-gnu.tar.xz) = 39fac45e0c1e8786275ba30ed13d13334c7f0fc03d653a3e0a3e174d18e244d9e4bb99614ed1465e7a21befb2542ed4d3a54d4ea2702da449b1e6a7770a43970 +SHA512 (rustc-1.46.0-src.tar.xz) = 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4 +SHA512 (rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz) = b4b3fb198bf85192563fb8b6017cf07f92b9c26d6e590efa9476aa878871839315db935e3353c664e635a229f17b0979bcfd31488e29e02ce0dc266d252b9e41 +SHA512 (rust-1.45.2-armv7-unknown-linux-gnueabihf.tar.xz) = dbf36643e87fc31cda5c0d5fc8b1589ce80531a94379060106ce81d525cd77c36ac6f89d5ae05d8872020baf31e5391422ed58c01ec6f801428d67e2e10896fb +SHA512 (rust-1.45.2-i686-unknown-linux-gnu.tar.xz) = afe81d38d8692e5792e111c3b2c83da4dffa99c9a8a89b5f1e10a6e449e49d4dd19d68c96d7b2f5013054d141bf4b1a08da1c2b877c7bbe87f81c19232020ecb +SHA512 (rust-1.45.2-powerpc64le-unknown-linux-gnu.tar.xz) = 6cb169efae4c847ba204fa24c1f40b4320e53928ab8966727971a5bc7a565eaa6142f40904cec93927543b25450db23d816c20653f53d3aa36ac616fe85ee6ba +SHA512 (rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz) = fbf909e5f9135d5216dbbc1be0d1e3159000c58b83bcdeb9839a12f5a9ff56261a61edfab93cd21800a90ff56bb9eff8a1ad83c60fa54bf0cf4b149219dbe914 +SHA512 (rust-1.45.2-s390x-unknown-linux-gnu.tar.xz) = 7727cfbeed29e8a1e79398392332b25b5498900f593f3d08414c70b44da0cd06dca0791a361956c47c3367e6572d59d885085d3cd99fd4a9c28c431a158ddbfd +SHA512 (rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz) = dfd3ce0cc42ae82a2d13866c5c94c304b031e253a1485ccc1d6ecd62cc05018b01ac7b2183297bc45ada286b5e91d1344aa3d8417694ab834f8265c7838b4fd2 From aacb4980d2c7ccc07fd9105c8bb31468c5ccbec7 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Fri, 28 Aug 2020 23:03:37 +0200 Subject: [PATCH 023/222] fix LTO with doctests (backported cargo PR#8657) --- 0002-Fix-LTO-with-doctests.patch | 133 +++++++++++++++++++++++++++++++ rust.spec | 8 +- 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 0002-Fix-LTO-with-doctests.patch diff --git a/0002-Fix-LTO-with-doctests.patch b/0002-Fix-LTO-with-doctests.patch new file mode 100644 index 0000000..e251c11 --- /dev/null +++ b/0002-Fix-LTO-with-doctests.patch @@ -0,0 +1,133 @@ +From 2c9deaabf99dab9998f6ddbbe496d19ff7ce31f0 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Fri, 28 Aug 2020 21:56:45 +0200 +Subject: [PATCH 2/2] Fix LTO with doctests + +--- + .../src/cargo/core/compiler/context/mod.rs | 3 +- + .../cargo/src/cargo/core/compiler/mod.rs | 59 +++++---------- + src/tools/cargo/src/cargo/core/profiles.rs | 7 +- + src/tools/cargo/tests/testsuite/lto.rs | 71 ++++++++++++++++--- + 4 files changed, 85 insertions(+), 55 deletions(-) + +diff --git a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs +index 52b954dd1..82831f423 100644 +--- a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs ++++ b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs +@@ -210,7 +210,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> { + // Collect information for `rustdoc --test`. + if unit.mode.is_doc_test() { + let mut unstable_opts = false; +- let args = compiler::extern_args(&self, unit, &mut unstable_opts)?; ++ let mut args = compiler::extern_args(&self, unit, &mut unstable_opts)?; ++ args.extend(compiler::lto_args(&self, unit)); + self.compilation.to_doc_test.push(compilation::Doctest { + unit: unit.clone(), + args, +diff --git a/src/tools/cargo/src/cargo/core/compiler/mod.rs b/src/tools/cargo/src/cargo/core/compiler/mod.rs +index 9399c5042..47d2b9bb4 100644 +--- a/src/tools/cargo/src/cargo/core/compiler/mod.rs ++++ b/src/tools/cargo/src/cargo/core/compiler/mod.rs +@@ -783,49 +783,9 @@ fn build_base_args( + cmd.arg("-C").arg(format!("panic={}", panic)); + } + +- match cx.lto[unit] { +- lto::Lto::Run(None) => { +- cmd.arg("-C").arg("lto"); +- } +- lto::Lto::Run(Some(s)) => { +- cmd.arg("-C").arg(format!("lto={}", s)); +- } +- lto::Lto::Off => { +- cmd.arg("-C").arg("lto=off"); +- } +- lto::Lto::ObjectAndBitcode => {} // this is rustc's default +- lto::Lto::OnlyBitcode => { +- // Note that this compiler flag, like the one below, is just an +- // optimization in terms of build time. If we don't pass it then +- // both object code and bitcode will show up. This is lagely just +- // compat until the feature lands on stable and we can remove the +- // conditional branch. +- if cx +- .bcx +- .target_data +- .info(CompileKind::Host) +- .supports_embed_bitcode +- .unwrap() +- { +- cmd.arg("-Clinker-plugin-lto"); +- } +- } +- lto::Lto::OnlyObject => { +- if cx +- .bcx +- .target_data +- .info(CompileKind::Host) +- .supports_embed_bitcode +- .unwrap() +- { +- cmd.arg("-Cembed-bitcode=no"); +- } +- } +- } ++ cmd.args(<o_args(cx, unit)); + + if let Some(n) = codegen_units { +- // There are some restrictions with LTO and codegen-units, so we +- // only add codegen units when LTO is not used. + cmd.arg("-C").arg(&format!("codegen-units={}", n)); + } + +@@ -952,6 +912,23 @@ fn build_base_args( + Ok(()) + } + ++fn lto_args(cx: &Context<'_, '_>, unit: &Unit) -> Vec { ++ let mut result = Vec::new(); ++ let mut push = |arg: &str| { ++ result.push(OsString::from("-C")); ++ result.push(OsString::from(arg)); ++ }; ++ match cx.lto[unit] { ++ lto::Lto::Run(None) => push("lto"), ++ lto::Lto::Run(Some(s)) => push(&format!("lto={}", s)), ++ lto::Lto::Off => push("lto=off"), ++ lto::Lto::ObjectAndBitcode => {} // this is rustc's default ++ lto::Lto::OnlyBitcode => push("linker-plugin-lto"), ++ lto::Lto::OnlyObject => push("embed-bitcode=no"), ++ } ++ result ++} ++ + fn build_deps_args( + cmd: &mut ProcessBuilder, + cx: &mut Context<'_, '_>, +diff --git a/src/tools/cargo/src/cargo/core/profiles.rs b/src/tools/cargo/src/cargo/core/profiles.rs +index 6a28bd261..ca0c2e417 100644 +--- a/src/tools/cargo/src/cargo/core/profiles.rs ++++ b/src/tools/cargo/src/cargo/core/profiles.rs +@@ -302,7 +302,7 @@ impl Profiles { + }; + + match mode { +- CompileMode::Test | CompileMode::Bench => { ++ CompileMode::Test | CompileMode::Bench | CompileMode::Doctest => { + if release { + ( + InternedString::new("bench"), +@@ -315,10 +315,7 @@ impl Profiles { + ) + } + } +- CompileMode::Build +- | CompileMode::Check { .. } +- | CompileMode::Doctest +- | CompileMode::RunCustomBuild => { ++ CompileMode::Build | CompileMode::Check { .. } | CompileMode::RunCustomBuild => { + // Note: `RunCustomBuild` doesn't normally use this code path. + // `build_unit_profiles` normally ensures that it selects the + // ancestor's profile. However, `cargo clean -p` can hit this +-- +2.26.2 + diff --git a/rust.spec b/rust.spec index ed134fb..d5f9032 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.46.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -69,6 +69,8 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/cargo/pull/8598 Patch1: 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch +# https://github.com/rust-lang/cargo/pull/8657 (backported) +Patch2: 0002-Fix-LTO-with-doctests.patch ### RHEL-specific patches below ### @@ -409,6 +411,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -d src/tools/cargo +%patch2 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -744,6 +747,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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. From aac4471f406d3a0eae526133ff140062cd0374ea Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 9 Oct 2020 16:13:53 -0700 Subject: [PATCH 024/222] Update to 1.47.0. --- .gitignore | 8 ++ ...er_exists-test-on-single-cpu-systems.patch | 29 ---- ...iveEndian-in-symbolize-gimli-Context.patch | 28 ++++ 0002-Fix-LTO-with-doctests.patch | 133 ------------------ rust.spec | 78 +++++----- ....patch => rustc-1.47.0-disable-http2.patch | 26 ++-- ...atch => rustc-1.47.0-disable-libssh2.patch | 20 +-- sources | 2 +- sources-bootstrap | 16 +-- 9 files changed, 104 insertions(+), 236 deletions(-) delete mode 100644 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch create mode 100644 0001-use-NativeEndian-in-symbolize-gimli-Context.patch delete mode 100644 0002-Fix-LTO-with-doctests.patch rename rustc-1.45.0-disable-http2.patch => rustc-1.47.0-disable-http2.patch (69%) rename rustc-1.42.0-disable-libssh2.patch => rustc-1.47.0-disable-libssh2.patch (58%) diff --git a/.gitignore b/.gitignore index 25c173a..a9378d6 100644 --- a/.gitignore +++ b/.gitignore @@ -297,3 +297,11 @@ /rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz /rust-1.45.2-s390x-unknown-linux-gnu.tar.xz /rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.47.0-src.tar.xz +/rust-1.46.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.46.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.46.0-i686-unknown-linux-gnu.tar.xz +/rust-1.46.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.46.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.46.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch b/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch deleted file mode 100644 index 1650679..0000000 --- a/0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 02fc16aece46abcd23d2ade2d969497f07fe26ab Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Fri, 7 Aug 2020 12:50:25 -0700 -Subject: [PATCH] Fix jobserver_exists test on single-cpu systems - -Closes #8595 ---- - tests/testsuite/jobserver.rs | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/tests/testsuite/jobserver.rs b/tests/testsuite/jobserver.rs -index 9e91c956cd75..16518ee2c614 100644 ---- a/tests/testsuite/jobserver.rs -+++ b/tests/testsuite/jobserver.rs -@@ -51,7 +51,10 @@ fn jobserver_exists() { - .file("src/lib.rs", "") - .build(); - -- p.cargo("build").run(); -+ // Explicitly use `-j2` to ensure that there's eventually going to be a -+ // token to read from `valdiate` above, since running the build script -+ // itself consumes a token. -+ p.cargo("build -j2").run(); - } - - #[cargo_test] --- -2.26.2 - diff --git a/0001-use-NativeEndian-in-symbolize-gimli-Context.patch b/0001-use-NativeEndian-in-symbolize-gimli-Context.patch new file mode 100644 index 0000000..81b7a63 --- /dev/null +++ b/0001-use-NativeEndian-in-symbolize-gimli-Context.patch @@ -0,0 +1,28 @@ +From 6f8efee8c936de65bc31610eea30abd5461a5dd1 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 8 Oct 2020 15:53:49 -0700 +Subject: [PATCH] use NativeEndian in symbolize::gimli::Context + +`Object` uses `NativeEndian`, so the `Context` should too. + +Cc: https://github.com/rust-lang/rust/issues/77410 +--- + src/symbolize/gimli.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/symbolize/gimli.rs b/src/symbolize/gimli.rs +index 58ed8bafca3d..273ff43f1c8c 100644 +--- a/src/symbolize/gimli.rs ++++ b/src/symbolize/gimli.rs +@@ -5,7 +5,7 @@ + //! intended to wholesale replace the `libbacktrace.rs` implementation. + + use self::gimli::read::EndianSlice; +-use self::gimli::LittleEndian as Endian; ++use self::gimli::NativeEndian as Endian; + use self::mmap::Mmap; + use self::stash::Stash; + use super::BytesOrWideString; +-- +2.26.2 + diff --git a/0002-Fix-LTO-with-doctests.patch b/0002-Fix-LTO-with-doctests.patch deleted file mode 100644 index e251c11..0000000 --- a/0002-Fix-LTO-with-doctests.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 2c9deaabf99dab9998f6ddbbe496d19ff7ce31f0 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Fri, 28 Aug 2020 21:56:45 +0200 -Subject: [PATCH 2/2] Fix LTO with doctests - ---- - .../src/cargo/core/compiler/context/mod.rs | 3 +- - .../cargo/src/cargo/core/compiler/mod.rs | 59 +++++---------- - src/tools/cargo/src/cargo/core/profiles.rs | 7 +- - src/tools/cargo/tests/testsuite/lto.rs | 71 ++++++++++++++++--- - 4 files changed, 85 insertions(+), 55 deletions(-) - -diff --git a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs -index 52b954dd1..82831f423 100644 ---- a/src/tools/cargo/src/cargo/core/compiler/context/mod.rs -+++ b/src/tools/cargo/src/cargo/core/compiler/context/mod.rs -@@ -210,7 +210,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> { - // Collect information for `rustdoc --test`. - if unit.mode.is_doc_test() { - let mut unstable_opts = false; -- let args = compiler::extern_args(&self, unit, &mut unstable_opts)?; -+ let mut args = compiler::extern_args(&self, unit, &mut unstable_opts)?; -+ args.extend(compiler::lto_args(&self, unit)); - self.compilation.to_doc_test.push(compilation::Doctest { - unit: unit.clone(), - args, -diff --git a/src/tools/cargo/src/cargo/core/compiler/mod.rs b/src/tools/cargo/src/cargo/core/compiler/mod.rs -index 9399c5042..47d2b9bb4 100644 ---- a/src/tools/cargo/src/cargo/core/compiler/mod.rs -+++ b/src/tools/cargo/src/cargo/core/compiler/mod.rs -@@ -783,49 +783,9 @@ fn build_base_args( - cmd.arg("-C").arg(format!("panic={}", panic)); - } - -- match cx.lto[unit] { -- lto::Lto::Run(None) => { -- cmd.arg("-C").arg("lto"); -- } -- lto::Lto::Run(Some(s)) => { -- cmd.arg("-C").arg(format!("lto={}", s)); -- } -- lto::Lto::Off => { -- cmd.arg("-C").arg("lto=off"); -- } -- lto::Lto::ObjectAndBitcode => {} // this is rustc's default -- lto::Lto::OnlyBitcode => { -- // Note that this compiler flag, like the one below, is just an -- // optimization in terms of build time. If we don't pass it then -- // both object code and bitcode will show up. This is lagely just -- // compat until the feature lands on stable and we can remove the -- // conditional branch. -- if cx -- .bcx -- .target_data -- .info(CompileKind::Host) -- .supports_embed_bitcode -- .unwrap() -- { -- cmd.arg("-Clinker-plugin-lto"); -- } -- } -- lto::Lto::OnlyObject => { -- if cx -- .bcx -- .target_data -- .info(CompileKind::Host) -- .supports_embed_bitcode -- .unwrap() -- { -- cmd.arg("-Cembed-bitcode=no"); -- } -- } -- } -+ cmd.args(<o_args(cx, unit)); - - if let Some(n) = codegen_units { -- // There are some restrictions with LTO and codegen-units, so we -- // only add codegen units when LTO is not used. - cmd.arg("-C").arg(&format!("codegen-units={}", n)); - } - -@@ -952,6 +912,23 @@ fn build_base_args( - Ok(()) - } - -+fn lto_args(cx: &Context<'_, '_>, unit: &Unit) -> Vec { -+ let mut result = Vec::new(); -+ let mut push = |arg: &str| { -+ result.push(OsString::from("-C")); -+ result.push(OsString::from(arg)); -+ }; -+ match cx.lto[unit] { -+ lto::Lto::Run(None) => push("lto"), -+ lto::Lto::Run(Some(s)) => push(&format!("lto={}", s)), -+ lto::Lto::Off => push("lto=off"), -+ lto::Lto::ObjectAndBitcode => {} // this is rustc's default -+ lto::Lto::OnlyBitcode => push("linker-plugin-lto"), -+ lto::Lto::OnlyObject => push("embed-bitcode=no"), -+ } -+ result -+} -+ - fn build_deps_args( - cmd: &mut ProcessBuilder, - cx: &mut Context<'_, '_>, -diff --git a/src/tools/cargo/src/cargo/core/profiles.rs b/src/tools/cargo/src/cargo/core/profiles.rs -index 6a28bd261..ca0c2e417 100644 ---- a/src/tools/cargo/src/cargo/core/profiles.rs -+++ b/src/tools/cargo/src/cargo/core/profiles.rs -@@ -302,7 +302,7 @@ impl Profiles { - }; - - match mode { -- CompileMode::Test | CompileMode::Bench => { -+ CompileMode::Test | CompileMode::Bench | CompileMode::Doctest => { - if release { - ( - InternedString::new("bench"), -@@ -315,10 +315,7 @@ impl Profiles { - ) - } - } -- CompileMode::Build -- | CompileMode::Check { .. } -- | CompileMode::Doctest -- | CompileMode::RunCustomBuild => { -+ CompileMode::Build | CompileMode::Check { .. } | CompileMode::RunCustomBuild => { - // Note: `RunCustomBuild` doesn't normally use this code path. - // `build_unit_profiles` normally ensures that it selects the - // ancestor's profile. However, `cargo clean -p` can hit this --- -2.26.2 - diff --git a/rust.spec b/rust.spec index d5f9032..29b1481 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.45.2 -%global bootstrap_cargo 1.45.2 -%global bootstrap_channel 1.45.2 -%global bootstrap_date 2020-08-03 +%global bootstrap_rust 1.46.0 +%global bootstrap_cargo 1.46.0 +%global bootstrap_channel 1.46.0 +%global bootstrap_date 2020-08-27 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -52,8 +52,8 @@ %endif Name: rust -Version: 1.46.0 -Release: 2%{?dist} +Version: 1.47.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,19 +67,17 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/cargo/pull/8598 -Patch1: 0001-Fix-jobserver_exists-test-on-single-cpu-systems.patch -# https://github.com/rust-lang/cargo/pull/8657 (backported) -Patch2: 0002-Fix-LTO-with-doctests.patch +# https://github.com/rust-lang/backtrace-rs/pull/373 +Patch1: 0001-use-NativeEndian-in-symbolize-gimli-Context.patch ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.42.0-disable-libssh2.patch +Patch100: rustc-1.47.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.45.0-disable-http2.patch +Patch101: rustc-1.47.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -166,7 +164,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 10.0.1 +Provides: bundled(llvm) = 11.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 @@ -191,9 +189,6 @@ BuildRequires: procps-ng # debuginfo-gdb tests need gdb BuildRequires: gdb -# TODO: work on unbundling these! -Provides: bundled(libbacktrace) = 1.0.20200219 - # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} Provides: rustc%{?_isa} = %{version}-%{release} @@ -410,8 +405,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -d src/tools/cargo -%patch2 -p1 +%patch1 -p1 -d library/backtrace %if %with disabled_libssh2 %patch100 -p1 @@ -456,9 +450,6 @@ rm -rf vendor/libssh2-sys/ # 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 -# rename bundled license for packaging -cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} - %if %{with bundled_llvm} && 0%{?epel} == 7 mkdir -p cmake-bin ln -s /usr/bin/cmake3 cmake-bin/cmake @@ -482,6 +473,20 @@ find vendor -name .cargo-checksum.json \ # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' +# Set up shared environment variables for build/install/check +%global rust_env RUSTFLAGS="%{rustflags}" +%if 0%{?cmake_path:1} +%global rust_env %{rust_env} PATH="%{cmake_path}:$PATH" +%endif +%if %without bundled_libgit2 +# convince libgit2-sys to use the distro libgit2 +%global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1 +%endif +%if %without bundled_libssh2 +# convince libssh2-sys to use the distro libssh2 +%global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 +%endif + %build # This package fails to build with LTO due to undefined symbols. LTO @@ -490,18 +495,7 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' # Disable LTO %define _lto_cflags %{nil} -%if %without bundled_libgit2 -# convince libgit2-sys to use the distro libgit2 -export LIBGIT2_SYS_USE_PKG_CONFIG=1 -%endif - -%if %without bundled_libssh2 -# convince libssh2-sys to use the distro libssh2 -export LIBSSH2_SYS_USE_PKG_CONFIG=1 -%endif - -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. @@ -555,12 +549,11 @@ fi --release-channel=%{channel} %{python} ./x.py build -j "$ncpus" --stage 2 -%{python} ./x.py doc +%{python} ./x.py doc --stage 2 %install -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} DESTDIR=%{buildroot} %{python} ./x.py install @@ -624,13 +617,12 @@ ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html %if %without lldb rm -f %{buildroot}%{_bindir}/rust-lldb -rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* +rm -f %{buildroot}%{rustlibdir}/etc/lldb_* %endif %check -%{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?rustflags:export RUSTFLAGS="%{rustflags}"} +export %{rust_env} # The results are not stable on koji, so mask errors and just log it. %{python} ./x.py test --no-fail-fast || : @@ -645,7 +637,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT -%license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc @@ -673,14 +664,14 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files gdb %{_bindir}/rust-gdb -%{rustlibdir}/etc/gdb_*.py* +%{rustlibdir}/etc/gdb_* %exclude %{_bindir}/rust-gdbgui %if %with lldb %files lldb %{_bindir}/rust-lldb -%{rustlibdir}/etc/lldb_*.py* +%{rustlibdir}/etc/lldb_* %endif @@ -747,6 +738,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* 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). diff --git a/rustc-1.45.0-disable-http2.patch b/rustc-1.47.0-disable-http2.patch similarity index 69% rename from rustc-1.45.0-disable-http2.patch rename to rustc-1.47.0-disable-http2.patch index 875b22a..e59c892 100644 --- a/rustc-1.45.0-disable-http2.patch +++ b/rustc-1.47.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.45.0-src/Cargo.lock.orig 2020-07-13 09:27:24.000000000 -0700 -+++ rustc-1.45.0-src/Cargo.lock 2020-07-16 12:12:32.253903599 -0700 -@@ -896,7 +896,6 @@ +--- rustc-1.47.0-src/Cargo.lock.orig 2020-10-08 12:21:40.516837553 -0700 ++++ rustc-1.47.0-src/Cargo.lock 2020-10-08 12:23:25.327581933 -0700 +@@ -837,7 +837,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1875,16 +1874,6 @@ +@@ -1642,16 +1641,6 @@ ] [[package]] -name = "libnghttp2-sys" --version = "0.1.2" +-version = "0.1.4+1.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463" +-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" -dependencies = [ - "cc", - "libc", @@ -23,10 +23,10 @@ - -[[package]] name = "libz-sys" - version = "1.0.25" + version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.45.0-src/src/tools/cargo/Cargo.toml.orig 2020-07-13 09:27:49.000000000 -0700 -+++ rustc-1.45.0-src/src/tools/cargo/Cargo.toml 2020-07-16 12:12:32.253903599 -0700 +--- rustc-1.47.0-src/src/tools/cargo/Cargo.toml.orig 2020-10-07 01:04:03.000000000 -0700 ++++ rustc-1.47.0-src/src/tools/cargo/Cargo.toml 2020-10-08 12:22:17.830034534 -0700 @@ -25,7 +25,7 @@ crates-io = { path = "crates/crates-io", version = "0.31.1" } crossbeam-utils = "0.7" @@ -36,9 +36,9 @@ curl-sys = "0.4.22" env_logger = "0.7.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-07-13 09:27:49.000000000 -0700 -+++ rustc-1.45.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-07-16 12:12:32.253903599 -0700 -@@ -393,14 +393,8 @@ +--- rustc-1.47.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-10-07 01:04:03.000000000 -0700 ++++ rustc-1.47.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-10-08 12:23:11.246884961 -0700 +@@ -396,14 +396,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -563,7 +557,7 @@ +@@ -566,7 +560,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.42.0-disable-libssh2.patch b/rustc-1.47.0-disable-libssh2.patch similarity index 58% rename from rustc-1.42.0-disable-libssh2.patch rename to rustc-1.47.0-disable-libssh2.patch index 770ad34..5a03b13 100644 --- a/rustc-1.42.0-disable-libssh2.patch +++ b/rustc-1.47.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-1.42.0-src/Cargo.lock.orig 2020-03-09 15:11:17.000000000 -0700 -+++ rustc-1.42.0-src/Cargo.lock 2020-04-02 16:39:22.268896227 -0700 -@@ -1796,7 +1796,6 @@ +--- rustc-1.47.0-src/Cargo.lock.orig 2020-10-07 00:53:22.000000000 -0700 ++++ rustc-1.47.0-src/Cargo.lock 2020-10-08 12:15:07.361298619 -0700 +@@ -1636,7 +1636,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1813,20 +1812,6 @@ +@@ -1653,20 +1652,6 @@ ] [[package]] -name = "libssh2-sys" --version = "0.2.14" +-version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10" +-checksum = "eafa907407504b0e683786d4aba47acf250f114d37357d56608333fd167dd0fc" -dependencies = [ - "cc", - "libc", @@ -27,11 +27,11 @@ - -[[package]] name = "libz-sys" - version = "1.0.25" + version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.42.0-src/vendor/git2/Cargo.toml.orig 2020-03-09 17:00:19.000000000 -0700 -+++ rustc-1.42.0-src/vendor/git2/Cargo.toml 2020-04-02 16:38:46.163664007 -0700 -@@ -55,7 +55,7 @@ +--- rustc-1.47.0-src/vendor/git2/Cargo.toml.orig 2020-10-07 02:33:31.000000000 -0700 ++++ rustc-1.47.0-src/vendor/git2/Cargo.toml 2020-10-08 12:13:37.697228272 -0700 +@@ -49,7 +49,7 @@ version = "0.1.39" [features] diff --git a/sources b/sources index 11a9b85..748da43 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.46.0-src.tar.xz) = 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4 +SHA512 (rustc-1.47.0-src.tar.xz) = 6ba83c0158f8130ddeae7e070417a2121d8a548c8fe97e28bce116d84048636c75aaee78e0c92cd43a50f5679a1223fc226cc8c5ba9bbd1465e84c5c6034d5c9 diff --git a/sources-bootstrap b/sources-bootstrap index 422747e..2e17a5a 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.46.0-src.tar.xz) = 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4 -SHA512 (rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz) = b4b3fb198bf85192563fb8b6017cf07f92b9c26d6e590efa9476aa878871839315db935e3353c664e635a229f17b0979bcfd31488e29e02ce0dc266d252b9e41 -SHA512 (rust-1.45.2-armv7-unknown-linux-gnueabihf.tar.xz) = dbf36643e87fc31cda5c0d5fc8b1589ce80531a94379060106ce81d525cd77c36ac6f89d5ae05d8872020baf31e5391422ed58c01ec6f801428d67e2e10896fb -SHA512 (rust-1.45.2-i686-unknown-linux-gnu.tar.xz) = afe81d38d8692e5792e111c3b2c83da4dffa99c9a8a89b5f1e10a6e449e49d4dd19d68c96d7b2f5013054d141bf4b1a08da1c2b877c7bbe87f81c19232020ecb -SHA512 (rust-1.45.2-powerpc64le-unknown-linux-gnu.tar.xz) = 6cb169efae4c847ba204fa24c1f40b4320e53928ab8966727971a5bc7a565eaa6142f40904cec93927543b25450db23d816c20653f53d3aa36ac616fe85ee6ba -SHA512 (rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz) = fbf909e5f9135d5216dbbc1be0d1e3159000c58b83bcdeb9839a12f5a9ff56261a61edfab93cd21800a90ff56bb9eff8a1ad83c60fa54bf0cf4b149219dbe914 -SHA512 (rust-1.45.2-s390x-unknown-linux-gnu.tar.xz) = 7727cfbeed29e8a1e79398392332b25b5498900f593f3d08414c70b44da0cd06dca0791a361956c47c3367e6572d59d885085d3cd99fd4a9c28c431a158ddbfd -SHA512 (rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz) = dfd3ce0cc42ae82a2d13866c5c94c304b031e253a1485ccc1d6ecd62cc05018b01ac7b2183297bc45ada286b5e91d1344aa3d8417694ab834f8265c7838b4fd2 +SHA512 (rustc-1.47.0-src.tar.xz) = 6ba83c0158f8130ddeae7e070417a2121d8a548c8fe97e28bce116d84048636c75aaee78e0c92cd43a50f5679a1223fc226cc8c5ba9bbd1465e84c5c6034d5c9 +SHA512 (rust-1.46.0-aarch64-unknown-linux-gnu.tar.xz) = 53e5d8afadaa9505286dce4acbb911126d17bc7bf45ea4685070ff07be7f6c7860e543a7686eeac695e7e3e127ca38ba2f09b73467fbf5f92d0b2195467c51f2 +SHA512 (rust-1.46.0-armv7-unknown-linux-gnueabihf.tar.xz) = c7e320fd5169c99bf8a12fb5bf1c5fb19a05d14f75ce655e4b64cad3456594ef09be1da7ac34a09b5d84da0c857d1a6e5a0695b5ff04cda491ea92fea15d28dc +SHA512 (rust-1.46.0-i686-unknown-linux-gnu.tar.xz) = b01e9b06c9de50e43bc6b5e1a5e6cc49dab1cf28b9cf0a8b974d2630c7ed4c6a5df6f321c872e11eb622c42f1d8cfaec77c1b67254a84365464fe3415acfa07f +SHA512 (rust-1.46.0-powerpc64le-unknown-linux-gnu.tar.xz) = 986f0bf7995f35836b73fb7045cf43ae5efe0c2543c75c66cdcc0f8c1dd3513def3c291e021241e328142deaca690ce113526ffc870c4412a7841f244258a43e +SHA512 (rust-1.46.0-powerpc64-unknown-linux-gnu.tar.xz) = 40f9423d838cab74b9920372e728c4ca7057005d83af587387dd2b164a0bf93de65cebc035320bce25f80914c63ce65b84218b9a776b0b905428e4cba0821b8b +SHA512 (rust-1.46.0-s390x-unknown-linux-gnu.tar.xz) = b6146695225ff6d0516e7bb6bc4620599356bb89b14f429a09d9d7f8715a94e8e218402346d5c9a10eeb54c0bdc40fb179289216b0cb4edd5bdf886f6b69aab4 +SHA512 (rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz) = 95f5adc2d2137010c7e5ac8a0fc70485250b4f9a909cb8b164b35fffff76ab88e9b09d305bfac37324ed080c5fc7643001d2abec5454ca911dc3513f1af52c88 From 51a2a836f97e1d4343186ba9982e2fa0f46de0fb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 9 Oct 2020 20:31:11 -0700 Subject: [PATCH 025/222] Fix the doc link to raw::stat on s390x --- ...uate-stat-in-MetadataExt-as_raw_stat.patch | 46 +++++++++++++++++++ rust.spec | 4 ++ 2 files changed, 50 insertions(+) create mode 100644 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch diff --git a/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch b/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch new file mode 100644 index 0000000..bf6ef9c --- /dev/null +++ b/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch @@ -0,0 +1,46 @@ +From f200c1e7afdd04b42c01c0108735e5b14ca07d93 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 9 Oct 2020 20:12:26 -0700 +Subject: [PATCH] doc: disambiguate stat in MetadataExt::as_raw_stat + +A few architectures in `os::linux::raw` import `libc::stat`, rather than +defining that type directly. However, that also imports the _function_ +called `stat`, which makes this doc link ambiguous: + + error: `crate::os::linux::raw::stat` is both a struct and a function + --> library/std/src/os/linux/fs.rs:21:19 + | + 21 | /// [`stat`]: crate::os::linux::raw::stat + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link + | + = note: `-D broken-intra-doc-links` implied by `-D warnings` + help: to link to the struct, prefix with the item type + | + 21 | /// [`stat`]: struct@crate::os::linux::raw::stat + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + help: to link to the function, add parentheses + | + 21 | /// [`stat`]: crate::os::linux::raw::stat() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We want the `struct`, so it's now prefixed accordingly. +--- + library/std/src/os/linux/fs.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs +index ff23c3d67e3b..9b7af97616c9 100644 +--- a/library/std/src/os/linux/fs.rs ++++ b/library/std/src/os/linux/fs.rs +@@ -20,7 +20,7 @@ pub trait MetadataExt { + /// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the + /// cross-Unix abstractions contained within the raw stat. + /// +- /// [`stat`]: crate::os::linux::raw::stat ++ /// [`stat`]: struct@crate::os::linux::raw::stat + /// + /// # Examples + /// +-- +2.26.2 + diff --git a/rust.spec b/rust.spec index 29b1481..e45436e 100644 --- a/rust.spec +++ b/rust.spec @@ -70,6 +70,9 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/backtrace-rs/pull/373 Patch1: 0001-use-NativeEndian-in-symbolize-gimli-Context.patch +# https://github.com/rust-lang/rust/pull/77777 +Patch2: 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -406,6 +409,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -d library/backtrace +%patch2 -p1 %if %with disabled_libssh2 %patch100 -p1 From 8efa6f4d091c3bdb230bda0701cd22ec6721d67a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 10 Oct 2020 10:00:19 -0700 Subject: [PATCH 026/222] Make tests explicitly use stage 2 --- rust.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rust.spec b/rust.spec index e45436e..57aa187 100644 --- a/rust.spec +++ b/rust.spec @@ -629,11 +629,11 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_* export %{rust_env} # The results are not stable on koji, so mask errors and just log it. -%{python} ./x.py test --no-fail-fast || : -%{python} ./x.py test --no-fail-fast cargo || : -%{python} ./x.py test --no-fail-fast clippy || : -%{python} ./x.py test --no-fail-fast rls || : -%{python} ./x.py test --no-fail-fast rustfmt || : +%{python} ./x.py test --no-fail-fast --stage 2 || : +%{python} ./x.py test --no-fail-fast --stage 2 cargo || : +%{python} ./x.py test --no-fail-fast --stage 2 clippy || : +%{python} ./x.py test --no-fail-fast --stage 2 rls || : +%{python} ./x.py test --no-fail-fast --stage 2 rustfmt || : %ldconfig_scriptlets From f92bb2f31c47e0d730cc375bb1e431dbd4ed8522 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sat, 10 Oct 2020 20:06:02 -0600 Subject: [PATCH 027/222] Re-enable LTO --- rust.spec | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/rust.spec b/rust.spec index 57aa187..6ab2407 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.47.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -493,12 +493,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %build -# This package fails to build with LTO due to undefined symbols. LTO -# was disabled in OpenSuSE as well, but with no real explanation why -# beyond the undefined symbols. It really should be investigated further. -# Disable LTO -%define _lto_cflags %{nil} - export %{rust_env} # We're going to override --libdir when configuring to get rustlib into a @@ -742,6 +736,9 @@ export %{rust_env} %changelog +* 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. From 457f56dd2523f370c359cf1144a0828a09a055e4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Nov 2020 10:47:24 -0800 Subject: [PATCH 028/222] Update to 1.48.0. --- .gitignore | 8 +++++ rust.spec | 32 +++++++++++-------- ....patch => rustc-1.48.0-disable-http2.patch | 18 +++++------ ...atch => rustc-1.48.0-disable-libssh2.patch | 18 +++++------ ...patch => rustc-1.48.0-no-default-pie.patch | 8 ++--- sources | 2 +- sources-bootstrap | 16 +++++----- 7 files changed, 56 insertions(+), 46 deletions(-) rename rustc-1.47.0-disable-http2.patch => rustc-1.48.0-disable-http2.patch (75%) rename rustc-1.47.0-disable-libssh2.patch => rustc-1.48.0-disable-libssh2.patch (58%) rename rustc-1.45.0-no-default-pie.patch => rustc-1.48.0-no-default-pie.patch (79%) diff --git a/.gitignore b/.gitignore index a9378d6..e66acbf 100644 --- a/.gitignore +++ b/.gitignore @@ -305,3 +305,11 @@ /rust-1.46.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.46.0-s390x-unknown-linux-gnu.tar.xz /rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.48.0-src.tar.xz +/rust-1.47.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.47.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.47.0-i686-unknown-linux-gnu.tar.xz +/rust-1.47.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.47.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index 6ab2407..3d078a2 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ # Only x86_64 and i686 are Tier 1 platforms at this time. -# https://forge.rust-lang.org/platform-support.html +# https://doc.rust-lang.org/nightly/rustc/platform-support.html %global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x # The channel can be stable, beta, or nightly @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.46.0 -%global bootstrap_cargo 1.46.0 -%global bootstrap_channel 1.46.0 -%global bootstrap_date 2020-08-27 +%global bootstrap_rust 1.47.0 +%global bootstrap_cargo 1.47.0 +%global bootstrap_channel 1.47.0 +%global bootstrap_date 2020-10-08 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -52,8 +52,8 @@ %endif Name: rust -Version: 1.47.0 -Release: 2%{?dist} +Version: 1.48.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -76,15 +76,15 @@ Patch2: 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.47.0-disable-libssh2.patch +Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.47.0-disable-http2.patch +Patch101: rustc-1.48.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.45.0-no-default-pie.patch +Patch102: rustc-1.48.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -297,7 +297,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.0.0 +Provides: bundled(libgit2) = 1.1.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -343,7 +343,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.0.0 +Provides: bundled(libgit2) = 1.1.0 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.9.0~dev @@ -421,7 +421,7 @@ rm -rf vendor/libnghttp2-sys/ %endif %if 0%{?rhel} && 0%{?rhel} < 8 -%patch102 -p1 -b .no-pie +%patch102 -p1 %endif %if "%{python}" != "python3" @@ -431,12 +431,14 @@ sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %if %without bundled_llvm rm -rf src/llvm-project/ +mkdir -p src/llvm-project/libunwind/ %endif # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ rm -rf vendor/libz-sys/src/zlib/ +rm -rf vendor/libz-sys/src/zlib-ng/ rm -rf vendor/lzma-sys/xz-*/ rm -rf vendor/openssl-src/openssl/ @@ -680,7 +682,6 @@ export %{rust_env} %{_docdir}/%{name}/html/*/ %{_docdir}/%{name}/html/*.html %{_docdir}/%{name}/html/*.css -%{_docdir}/%{name}/html/*.ico %{_docdir}/%{name}/html/*.js %{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg @@ -736,6 +737,9 @@ export %{rust_env} %changelog +* 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 diff --git a/rustc-1.47.0-disable-http2.patch b/rustc-1.48.0-disable-http2.patch similarity index 75% rename from rustc-1.47.0-disable-http2.patch rename to rustc-1.48.0-disable-http2.patch index e59c892..a162fd0 100644 --- a/rustc-1.47.0-disable-http2.patch +++ b/rustc-1.48.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.47.0-src/Cargo.lock.orig 2020-10-08 12:21:40.516837553 -0700 -+++ rustc-1.47.0-src/Cargo.lock 2020-10-08 12:23:25.327581933 -0700 -@@ -837,7 +837,6 @@ +--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 09:36:19.889728111 -0800 ++++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:36:19.890728089 -0800 +@@ -849,7 +849,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1642,16 +1641,6 @@ +@@ -1682,16 +1681,6 @@ ] [[package]] @@ -23,10 +23,10 @@ - -[[package]] name = "libz-sys" - version = "1.0.27" + version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.47.0-src/src/tools/cargo/Cargo.toml.orig 2020-10-07 01:04:03.000000000 -0700 -+++ rustc-1.47.0-src/src/tools/cargo/Cargo.toml 2020-10-08 12:22:17.830034534 -0700 +--- rustc-1.48.0-src/src/tools/cargo/Cargo.toml.orig 2020-11-16 06:02:09.000000000 -0800 ++++ rustc-1.48.0-src/src/tools/cargo/Cargo.toml 2020-11-16 09:36:19.890728089 -0800 @@ -25,7 +25,7 @@ crates-io = { path = "crates/crates-io", version = "0.31.1" } crossbeam-utils = "0.7" @@ -36,8 +36,8 @@ curl-sys = "0.4.22" env_logger = "0.7.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.47.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-10-07 01:04:03.000000000 -0700 -+++ rustc-1.47.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-10-08 12:23:11.246884961 -0700 +--- rustc-1.48.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-11-16 06:02:09.000000000 -0800 ++++ rustc-1.48.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-11-16 09:36:19.890728089 -0800 @@ -396,14 +396,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP diff --git a/rustc-1.47.0-disable-libssh2.patch b/rustc-1.48.0-disable-libssh2.patch similarity index 58% rename from rustc-1.47.0-disable-libssh2.patch rename to rustc-1.48.0-disable-libssh2.patch index 5a03b13..6916e74 100644 --- a/rustc-1.47.0-disable-libssh2.patch +++ b/rustc-1.48.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-1.47.0-src/Cargo.lock.orig 2020-10-07 00:53:22.000000000 -0700 -+++ rustc-1.47.0-src/Cargo.lock 2020-10-08 12:15:07.361298619 -0700 -@@ -1636,7 +1636,6 @@ +--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 06:01:53.000000000 -0800 ++++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:27:44.425104404 -0800 +@@ -1676,7 +1676,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1653,20 +1652,6 @@ +@@ -1693,20 +1692,6 @@ ] [[package]] -name = "libssh2-sys" --version = "0.2.18" +-version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "eafa907407504b0e683786d4aba47acf250f114d37357d56608333fd167dd0fc" +-checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" -dependencies = [ - "cc", - "libc", @@ -27,10 +27,10 @@ - -[[package]] name = "libz-sys" - version = "1.0.27" + version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.47.0-src/vendor/git2/Cargo.toml.orig 2020-10-07 02:33:31.000000000 -0700 -+++ rustc-1.47.0-src/vendor/git2/Cargo.toml 2020-10-08 12:13:37.697228272 -0700 +--- rustc-1.48.0-src/vendor/git2/Cargo.toml.orig 2020-11-16 06:27:49.000000000 -0800 ++++ rustc-1.48.0-src/vendor/git2/Cargo.toml 2020-11-16 09:27:44.425104404 -0800 @@ -49,7 +49,7 @@ version = "0.1.39" diff --git a/rustc-1.45.0-no-default-pie.patch b/rustc-1.48.0-no-default-pie.patch similarity index 79% rename from rustc-1.45.0-no-default-pie.patch rename to rustc-1.48.0-no-default-pie.patch index 726df24..bb6b3d1 100644 --- a/rustc-1.45.0-no-default-pie.patch +++ b/rustc-1.48.0-no-default-pie.patch @@ -1,8 +1,6 @@ -diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs -index dcce1d45298c..5c11f7276f26 100644 ---- a/src/librustc_codegen_ssa/back/link.rs -+++ b/src/librustc_codegen_ssa/back/link.rs -@@ -1184,10 +1184,12 @@ fn exec_linker( +--- rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2020-11-16 06:01:53.000000000 -0800 ++++ rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs 2020-11-16 09:37:15.779516797 -0800 +@@ -1185,10 +1185,12 @@ } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { diff --git a/sources b/sources index 748da43..eb048bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.47.0-src.tar.xz) = 6ba83c0158f8130ddeae7e070417a2121d8a548c8fe97e28bce116d84048636c75aaee78e0c92cd43a50f5679a1223fc226cc8c5ba9bbd1465e84c5c6034d5c9 +SHA512 (rustc-1.48.0-src.tar.xz) = 4e12baa6893238a8d336ec9ebe891477d18676f271b32763474fa7a6a8b58fb3187dd4e2aa95bce482989b692cc2e1360221669d6811eec71b326f22a1756c23 diff --git a/sources-bootstrap b/sources-bootstrap index 2e17a5a..bdfa9f7 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.47.0-src.tar.xz) = 6ba83c0158f8130ddeae7e070417a2121d8a548c8fe97e28bce116d84048636c75aaee78e0c92cd43a50f5679a1223fc226cc8c5ba9bbd1465e84c5c6034d5c9 -SHA512 (rust-1.46.0-aarch64-unknown-linux-gnu.tar.xz) = 53e5d8afadaa9505286dce4acbb911126d17bc7bf45ea4685070ff07be7f6c7860e543a7686eeac695e7e3e127ca38ba2f09b73467fbf5f92d0b2195467c51f2 -SHA512 (rust-1.46.0-armv7-unknown-linux-gnueabihf.tar.xz) = c7e320fd5169c99bf8a12fb5bf1c5fb19a05d14f75ce655e4b64cad3456594ef09be1da7ac34a09b5d84da0c857d1a6e5a0695b5ff04cda491ea92fea15d28dc -SHA512 (rust-1.46.0-i686-unknown-linux-gnu.tar.xz) = b01e9b06c9de50e43bc6b5e1a5e6cc49dab1cf28b9cf0a8b974d2630c7ed4c6a5df6f321c872e11eb622c42f1d8cfaec77c1b67254a84365464fe3415acfa07f -SHA512 (rust-1.46.0-powerpc64le-unknown-linux-gnu.tar.xz) = 986f0bf7995f35836b73fb7045cf43ae5efe0c2543c75c66cdcc0f8c1dd3513def3c291e021241e328142deaca690ce113526ffc870c4412a7841f244258a43e -SHA512 (rust-1.46.0-powerpc64-unknown-linux-gnu.tar.xz) = 40f9423d838cab74b9920372e728c4ca7057005d83af587387dd2b164a0bf93de65cebc035320bce25f80914c63ce65b84218b9a776b0b905428e4cba0821b8b -SHA512 (rust-1.46.0-s390x-unknown-linux-gnu.tar.xz) = b6146695225ff6d0516e7bb6bc4620599356bb89b14f429a09d9d7f8715a94e8e218402346d5c9a10eeb54c0bdc40fb179289216b0cb4edd5bdf886f6b69aab4 -SHA512 (rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz) = 95f5adc2d2137010c7e5ac8a0fc70485250b4f9a909cb8b164b35fffff76ab88e9b09d305bfac37324ed080c5fc7643001d2abec5454ca911dc3513f1af52c88 +SHA512 (rustc-1.48.0-src.tar.xz) = 4e12baa6893238a8d336ec9ebe891477d18676f271b32763474fa7a6a8b58fb3187dd4e2aa95bce482989b692cc2e1360221669d6811eec71b326f22a1756c23 +SHA512 (rust-1.47.0-aarch64-unknown-linux-gnu.tar.xz) = 7df7045df341f03508f1ad795a9117b39c1f4c4cc778c7fd9d78c42e7da662ce244d018084ac9e80d9409cf8b3b5d1ccc25ef4cb71a2b8727398d30a4e962e19 +SHA512 (rust-1.47.0-armv7-unknown-linux-gnueabihf.tar.xz) = b207ab7c478dce6db4018527888f539938c8e77b5ceccb460b9d52ffee13a2329d225d03a605b60729cae6254129245bdd69730aebb6ec91dd0c83005cf25253 +SHA512 (rust-1.47.0-i686-unknown-linux-gnu.tar.xz) = 551204b4edfc1500aa83108c88b845997bb6befba0dd3401e9ae5294ab27960421f1b3130159946b996171c1d46f7532afa0c3ae767a9318985db0bb7c88dba0 +SHA512 (rust-1.47.0-powerpc64le-unknown-linux-gnu.tar.xz) = d5c6580861786545f0540cc9591884fb9f2036061bdd451d17cf8bfb427008d365cacd14e5054028c72b83d1d5eb347ab74478a882cbbd7fcc75a7421657561c +SHA512 (rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz) = 46fa1c042aebb06db4185fed6ef3bc7772f2a13f2290a20f5499757aae2a05dc984026315be7b5813aac172f52f50565e56aa074d32f6271858590a9ceb9e1c7 +SHA512 (rust-1.47.0-s390x-unknown-linux-gnu.tar.xz) = dd5877b6ff5c310ca6aa23c1cc621e6b0675d4c46f5a06b2a0b107641b604a1a2101109ba8e286267bab1158768c601d5d9a922a8da72486c91755ef465720c0 +SHA512 (rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz) = f695986ab8e67636b0e92ca7ea223984121e3c22788434a6f1062690e7932f6b30c0c302160fef96831f821acedaf8a909bd3d00a9aa873c7200d2b8fa39013f From 6c5b7257595233d29b226987f0c8f16bd3de4325 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 1 Dec 2020 17:28:02 -0800 Subject: [PATCH 029/222] Never bundle libssh2 --- rust.spec | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/rust.spec b/rust.spec index 3d078a2..10ea348 100644 --- a/rust.spec +++ b/rust.spec @@ -157,7 +157,7 @@ BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(libgit2) >= 1.0.0 %endif -%if %{without disabled_libssh2} && %{without bundled_libssh2} +%if %{without disabled_libssh2} # needs libssh2_userauth_publickey_frommemory BuildRequires: pkgconfig(libssh2) >= 1.6.0 %endif @@ -299,9 +299,6 @@ Summary: Rust's package manager and build tool %if %with bundled_libgit2 Provides: bundled(libgit2) = 1.1.0 %endif -%if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.9.0~dev -%endif # For tests: BuildRequires: git # Cargo is not much use without Rust @@ -345,9 +342,6 @@ Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 Provides: bundled(libgit2) = 1.1.0 %endif -%if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.9.0~dev -%endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs Requires: %{name}%{?_isa} = %{version}-%{release} @@ -437,6 +431,7 @@ mkdir -p src/llvm-project/libunwind/ # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ +rm -rf vendor/libssh2-sys/libssh2/ rm -rf vendor/libz-sys/src/zlib/ rm -rf vendor/libz-sys/src/zlib-ng/ rm -rf vendor/lzma-sys/xz-*/ @@ -446,9 +441,6 @@ rm -rf vendor/openssl-src/openssl/ rm -rf vendor/libgit2-sys/libgit2/ %endif -%if %without bundled_libssh2 -rm -rf vendor/libssh2-sys/libssh2/ -%endif %if %with disabled_libssh2 rm -rf vendor/libssh2-sys/ %endif @@ -488,7 +480,7 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' # convince libgit2-sys to use the distro libgit2 %global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1 %endif -%if %without bundled_libssh2 +%if %without disabled_libssh2 # convince libssh2-sys to use the distro libssh2 %global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif From e3b256c65fc8ea4e154eed8f43727b2239c07412 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 28 Dec 2020 19:00:26 +0100 Subject: [PATCH 030/222] Rebuild for libgit2 1.1.x Signed-off-by: Igor Raits --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 10ea348..85d735e 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.48.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -729,6 +729,9 @@ export %{rust_env} %changelog +* Mon Dec 28 19:00:26 CET 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. From 8d20a2058af8e531b14a80784bab58dae53b14c1 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 28 Dec 2020 19:37:47 +0100 Subject: [PATCH 031/222] Build with bundled libgit2 (to avoid re-bootstrap) Signed-off-by: Igor Raits --- rust.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/rust.spec b/rust.spec index 85d735e..db3d0b8 100644 --- a/rust.spec +++ b/rust.spec @@ -24,6 +24,7 @@ # is insufficient. Rust currently requires LLVM 8.0+. %bcond_with bundled_llvm +%global _with_bundled_libgit2 # Requires stable libgit2 1.0 %if 0%{?fedora} >= 32 %bcond_with bundled_libgit2 From 28e90c2b9d45ba5caf4f6f908e3fda9a2a1230b7 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 28 Dec 2020 19:38:13 +0100 Subject: [PATCH 032/222] fixup! Build with bundled libgit2 (to avoid re-bootstrap) Signed-off-by: Igor Raits --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index db3d0b8..8a0000a 100644 --- a/rust.spec +++ b/rust.spec @@ -24,7 +24,7 @@ # is insufficient. Rust currently requires LLVM 8.0+. %bcond_with bundled_llvm -%global _with_bundled_libgit2 +%global _with_bundled_libgit2 1 # Requires stable libgit2 1.0 %if 0%{?fedora} >= 32 %bcond_with bundled_libgit2 From f6db939d0c8300c0f133a9c96bd82346b2b2ad2a Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 28 Dec 2020 19:53:09 +0100 Subject: [PATCH 033/222] Bootstrap Signed-off-by: Igor Raits --- rust.spec | 3 +-- sources | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 8a0000a..094c244 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2020-10-08 # Only the specified arches will use bootstrap binaries. -#global bootstrap_arches %%{rust_arches} +%global bootstrap_arches %%{rust_arches} # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static @@ -24,7 +24,6 @@ # is insufficient. Rust currently requires LLVM 8.0+. %bcond_with bundled_llvm -%global _with_bundled_libgit2 1 # Requires stable libgit2 1.0 %if 0%{?fedora} >= 32 %bcond_with bundled_libgit2 diff --git a/sources b/sources index eb048bc..bdfa9f7 100644 --- a/sources +++ b/sources @@ -1 +1,8 @@ SHA512 (rustc-1.48.0-src.tar.xz) = 4e12baa6893238a8d336ec9ebe891477d18676f271b32763474fa7a6a8b58fb3187dd4e2aa95bce482989b692cc2e1360221669d6811eec71b326f22a1756c23 +SHA512 (rust-1.47.0-aarch64-unknown-linux-gnu.tar.xz) = 7df7045df341f03508f1ad795a9117b39c1f4c4cc778c7fd9d78c42e7da662ce244d018084ac9e80d9409cf8b3b5d1ccc25ef4cb71a2b8727398d30a4e962e19 +SHA512 (rust-1.47.0-armv7-unknown-linux-gnueabihf.tar.xz) = b207ab7c478dce6db4018527888f539938c8e77b5ceccb460b9d52ffee13a2329d225d03a605b60729cae6254129245bdd69730aebb6ec91dd0c83005cf25253 +SHA512 (rust-1.47.0-i686-unknown-linux-gnu.tar.xz) = 551204b4edfc1500aa83108c88b845997bb6befba0dd3401e9ae5294ab27960421f1b3130159946b996171c1d46f7532afa0c3ae767a9318985db0bb7c88dba0 +SHA512 (rust-1.47.0-powerpc64le-unknown-linux-gnu.tar.xz) = d5c6580861786545f0540cc9591884fb9f2036061bdd451d17cf8bfb427008d365cacd14e5054028c72b83d1d5eb347ab74478a882cbbd7fcc75a7421657561c +SHA512 (rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz) = 46fa1c042aebb06db4185fed6ef3bc7772f2a13f2290a20f5499757aae2a05dc984026315be7b5813aac172f52f50565e56aa074d32f6271858590a9ceb9e1c7 +SHA512 (rust-1.47.0-s390x-unknown-linux-gnu.tar.xz) = dd5877b6ff5c310ca6aa23c1cc621e6b0675d4c46f5a06b2a0b107641b604a1a2101109ba8e286267bab1158768c601d5d9a922a8da72486c91755ef465720c0 +SHA512 (rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz) = f695986ab8e67636b0e92ca7ea223984121e3c22788434a6f1062690e7932f6b30c0c302160fef96831f821acedaf8a909bd3d00a9aa873c7200d2b8fa39013f From 35653afd8f61bbb66e6dc14ca866179c4c336e82 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Tue, 29 Dec 2020 08:42:45 +0100 Subject: [PATCH 034/222] Revert "Bootstrap" This reverts commit f6db939d0c8300c0f133a9c96bd82346b2b2ad2a. --- rust.spec | 7 +++++-- sources | 7 ------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/rust.spec b/rust.spec index 094c244..176a75f 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2020-10-08 # Only the specified arches will use bootstrap binaries. -%global bootstrap_arches %%{rust_arches} +#global bootstrap_arches %%{rust_arches} # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static @@ -53,7 +53,7 @@ Name: rust Version: 1.48.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -729,6 +729,9 @@ export %{rust_env} %changelog +* Tue Dec 29 2020 Igor Raits - 1.48.0-3 +- De-bootstrap + * Mon Dec 28 19:00:26 CET 2020 Igor Raits - 1.48.0-2 - Rebuild for libgit2 1.1.x diff --git a/sources b/sources index bdfa9f7..eb048bc 100644 --- a/sources +++ b/sources @@ -1,8 +1 @@ SHA512 (rustc-1.48.0-src.tar.xz) = 4e12baa6893238a8d336ec9ebe891477d18676f271b32763474fa7a6a8b58fb3187dd4e2aa95bce482989b692cc2e1360221669d6811eec71b326f22a1756c23 -SHA512 (rust-1.47.0-aarch64-unknown-linux-gnu.tar.xz) = 7df7045df341f03508f1ad795a9117b39c1f4c4cc778c7fd9d78c42e7da662ce244d018084ac9e80d9409cf8b3b5d1ccc25ef4cb71a2b8727398d30a4e962e19 -SHA512 (rust-1.47.0-armv7-unknown-linux-gnueabihf.tar.xz) = b207ab7c478dce6db4018527888f539938c8e77b5ceccb460b9d52ffee13a2329d225d03a605b60729cae6254129245bdd69730aebb6ec91dd0c83005cf25253 -SHA512 (rust-1.47.0-i686-unknown-linux-gnu.tar.xz) = 551204b4edfc1500aa83108c88b845997bb6befba0dd3401e9ae5294ab27960421f1b3130159946b996171c1d46f7532afa0c3ae767a9318985db0bb7c88dba0 -SHA512 (rust-1.47.0-powerpc64le-unknown-linux-gnu.tar.xz) = d5c6580861786545f0540cc9591884fb9f2036061bdd451d17cf8bfb427008d365cacd14e5054028c72b83d1d5eb347ab74478a882cbbd7fcc75a7421657561c -SHA512 (rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz) = 46fa1c042aebb06db4185fed6ef3bc7772f2a13f2290a20f5499757aae2a05dc984026315be7b5813aac172f52f50565e56aa074d32f6271858590a9ceb9e1c7 -SHA512 (rust-1.47.0-s390x-unknown-linux-gnu.tar.xz) = dd5877b6ff5c310ca6aa23c1cc621e6b0675d4c46f5a06b2a0b107641b604a1a2101109ba8e286267bab1158768c601d5d9a922a8da72486c91755ef465720c0 -SHA512 (rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz) = f695986ab8e67636b0e92ca7ea223984121e3c22788434a6f1062690e7932f6b30c0c302160fef96831f821acedaf8a909bd3d00a9aa873c7200d2b8fa39013f From 3aadadbd4b2429a45fd1ae02261c8d37bff90eae Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 5 Jan 2021 16:07:24 -0800 Subject: [PATCH 035/222] Update to 1.49.0. --- .gitignore | 8 ++++ ...uate-stat-in-MetadataExt-as_raw_stat.patch | 46 ------------------- ...iveEndian-in-symbolize-gimli-Context.patch | 28 ----------- rust.spec | 30 +++++------- ....patch => rustc-1.49.0-disable-http2.patch | 24 +++++----- sources | 2 +- sources-bootstrap | 16 +++---- 7 files changed, 41 insertions(+), 113 deletions(-) delete mode 100644 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch delete mode 100644 0001-use-NativeEndian-in-symbolize-gimli-Context.patch rename rustc-1.48.0-disable-http2.patch => rustc-1.49.0-disable-http2.patch (73%) diff --git a/.gitignore b/.gitignore index e66acbf..becac4e 100644 --- a/.gitignore +++ b/.gitignore @@ -313,3 +313,11 @@ /rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.47.0-s390x-unknown-linux-gnu.tar.xz /rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.49.0-src.tar.xz +/rust-1.48.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.48.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.48.0-i686-unknown-linux-gnu.tar.xz +/rust-1.48.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.48.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.48.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.48.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch b/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch deleted file mode 100644 index bf6ef9c..0000000 --- a/0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f200c1e7afdd04b42c01c0108735e5b14ca07d93 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 9 Oct 2020 20:12:26 -0700 -Subject: [PATCH] doc: disambiguate stat in MetadataExt::as_raw_stat - -A few architectures in `os::linux::raw` import `libc::stat`, rather than -defining that type directly. However, that also imports the _function_ -called `stat`, which makes this doc link ambiguous: - - error: `crate::os::linux::raw::stat` is both a struct and a function - --> library/std/src/os/linux/fs.rs:21:19 - | - 21 | /// [`stat`]: crate::os::linux::raw::stat - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link - | - = note: `-D broken-intra-doc-links` implied by `-D warnings` - help: to link to the struct, prefix with the item type - | - 21 | /// [`stat`]: struct@crate::os::linux::raw::stat - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - help: to link to the function, add parentheses - | - 21 | /// [`stat`]: crate::os::linux::raw::stat() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -We want the `struct`, so it's now prefixed accordingly. ---- - library/std/src/os/linux/fs.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs -index ff23c3d67e3b..9b7af97616c9 100644 ---- a/library/std/src/os/linux/fs.rs -+++ b/library/std/src/os/linux/fs.rs -@@ -20,7 +20,7 @@ pub trait MetadataExt { - /// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the - /// cross-Unix abstractions contained within the raw stat. - /// -- /// [`stat`]: crate::os::linux::raw::stat -+ /// [`stat`]: struct@crate::os::linux::raw::stat - /// - /// # Examples - /// --- -2.26.2 - diff --git a/0001-use-NativeEndian-in-symbolize-gimli-Context.patch b/0001-use-NativeEndian-in-symbolize-gimli-Context.patch deleted file mode 100644 index 81b7a63..0000000 --- a/0001-use-NativeEndian-in-symbolize-gimli-Context.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 6f8efee8c936de65bc31610eea30abd5461a5dd1 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 8 Oct 2020 15:53:49 -0700 -Subject: [PATCH] use NativeEndian in symbolize::gimli::Context - -`Object` uses `NativeEndian`, so the `Context` should too. - -Cc: https://github.com/rust-lang/rust/issues/77410 ---- - src/symbolize/gimli.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/symbolize/gimli.rs b/src/symbolize/gimli.rs -index 58ed8bafca3d..273ff43f1c8c 100644 ---- a/src/symbolize/gimli.rs -+++ b/src/symbolize/gimli.rs -@@ -5,7 +5,7 @@ - //! intended to wholesale replace the `libbacktrace.rs` implementation. - - use self::gimli::read::EndianSlice; --use self::gimli::LittleEndian as Endian; -+use self::gimli::NativeEndian as Endian; - use self::mmap::Mmap; - use self::stash::Stash; - use super::BytesOrWideString; --- -2.26.2 - diff --git a/rust.spec b/rust.spec index 176a75f..88c3909 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.47.0 -%global bootstrap_cargo 1.47.0 -%global bootstrap_channel 1.47.0 -%global bootstrap_date 2020-10-08 +%global bootstrap_rust 1.48.0 +%global bootstrap_cargo 1.48.0 +%global bootstrap_channel 1.48.0 +%global bootstrap_date 2020-11-19 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -52,8 +52,8 @@ %endif Name: rust -Version: 1.48.0 -Release: 3%{?dist} +Version: 1.49.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,12 +67,6 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/backtrace-rs/pull/373 -Patch1: 0001-use-NativeEndian-in-symbolize-gimli-Context.patch - -# https://github.com/rust-lang/rust/pull/77777 -Patch2: 0001-doc-disambiguate-stat-in-MetadataExt-as_raw_stat.patch - ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -80,7 +74,7 @@ Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.48.0-disable-http2.patch +Patch101: rustc-1.49.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -179,7 +173,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 8.0 +BuildRequires: %{llvm}-devel >= 9.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -402,9 +396,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -d library/backtrace -%patch2 -p1 - %if %with disabled_libssh2 %patch100 -p1 %endif @@ -729,10 +720,13 @@ export %{rust_env} %changelog +* 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 19:00:26 CET 2020 Igor Raits - 1.48.0-2 +* 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 diff --git a/rustc-1.48.0-disable-http2.patch b/rustc-1.49.0-disable-http2.patch similarity index 73% rename from rustc-1.48.0-disable-http2.patch rename to rustc-1.49.0-disable-http2.patch index a162fd0..d6c6aa7 100644 --- a/rustc-1.48.0-disable-http2.patch +++ b/rustc-1.49.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 09:36:19.889728111 -0800 -+++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:36:19.890728089 -0800 -@@ -849,7 +849,6 @@ +--- rustc-1.49.0-src/Cargo.lock.orig 2021-01-05 12:45:10.456414612 -0800 ++++ rustc-1.49.0-src/Cargo.lock 2021-01-05 12:45:10.458414575 -0800 +@@ -882,7 +882,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1682,16 +1681,6 @@ +@@ -1728,16 +1727,6 @@ ] [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.48.0-src/src/tools/cargo/Cargo.toml.orig 2020-11-16 06:02:09.000000000 -0800 -+++ rustc-1.48.0-src/src/tools/cargo/Cargo.toml 2020-11-16 09:36:19.890728089 -0800 +--- rustc-1.49.0-src/src/tools/cargo/Cargo.toml.orig 2021-01-05 12:45:10.458414575 -0800 ++++ rustc-1.49.0-src/src/tools/cargo/Cargo.toml 2021-01-05 12:47:25.966928554 -0800 @@ -25,7 +25,7 @@ crates-io = { path = "crates/crates-io", version = "0.31.1" } - crossbeam-utils = "0.7" + crossbeam-utils = "0.8" crypto-hash = "0.3.1" -curl = { version = "0.4.23", features = ["http2"] } +curl = { version = "0.4.23", features = [] } curl-sys = "0.4.22" - env_logger = "0.7.0" + env_logger = "0.8.1" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.48.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-11-16 06:02:09.000000000 -0800 -+++ rustc-1.48.0-src/src/tools/cargo/src/cargo/core/package.rs 2020-11-16 09:36:19.890728089 -0800 -@@ -396,14 +396,8 @@ +--- rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-12-28 19:03:25.000000000 -0800 ++++ rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-01-05 12:45:10.458414575 -0800 +@@ -408,14 +408,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -566,7 +560,7 @@ +@@ -584,7 +578,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/sources b/sources index eb048bc..9a88293 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.48.0-src.tar.xz) = 4e12baa6893238a8d336ec9ebe891477d18676f271b32763474fa7a6a8b58fb3187dd4e2aa95bce482989b692cc2e1360221669d6811eec71b326f22a1756c23 +SHA512 (rustc-1.49.0-src.tar.xz) = fd8bc67ec0a73d3b6bf9c1fabb7ea981ef817644b4e6ced982fa90b12eae9b55de074634a670bdfb38bfee6588603e818ddcbcc2f2a05f83057c061b4194b4b7 diff --git a/sources-bootstrap b/sources-bootstrap index bdfa9f7..21fb440 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.48.0-src.tar.xz) = 4e12baa6893238a8d336ec9ebe891477d18676f271b32763474fa7a6a8b58fb3187dd4e2aa95bce482989b692cc2e1360221669d6811eec71b326f22a1756c23 -SHA512 (rust-1.47.0-aarch64-unknown-linux-gnu.tar.xz) = 7df7045df341f03508f1ad795a9117b39c1f4c4cc778c7fd9d78c42e7da662ce244d018084ac9e80d9409cf8b3b5d1ccc25ef4cb71a2b8727398d30a4e962e19 -SHA512 (rust-1.47.0-armv7-unknown-linux-gnueabihf.tar.xz) = b207ab7c478dce6db4018527888f539938c8e77b5ceccb460b9d52ffee13a2329d225d03a605b60729cae6254129245bdd69730aebb6ec91dd0c83005cf25253 -SHA512 (rust-1.47.0-i686-unknown-linux-gnu.tar.xz) = 551204b4edfc1500aa83108c88b845997bb6befba0dd3401e9ae5294ab27960421f1b3130159946b996171c1d46f7532afa0c3ae767a9318985db0bb7c88dba0 -SHA512 (rust-1.47.0-powerpc64le-unknown-linux-gnu.tar.xz) = d5c6580861786545f0540cc9591884fb9f2036061bdd451d17cf8bfb427008d365cacd14e5054028c72b83d1d5eb347ab74478a882cbbd7fcc75a7421657561c -SHA512 (rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz) = 46fa1c042aebb06db4185fed6ef3bc7772f2a13f2290a20f5499757aae2a05dc984026315be7b5813aac172f52f50565e56aa074d32f6271858590a9ceb9e1c7 -SHA512 (rust-1.47.0-s390x-unknown-linux-gnu.tar.xz) = dd5877b6ff5c310ca6aa23c1cc621e6b0675d4c46f5a06b2a0b107641b604a1a2101109ba8e286267bab1158768c601d5d9a922a8da72486c91755ef465720c0 -SHA512 (rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz) = f695986ab8e67636b0e92ca7ea223984121e3c22788434a6f1062690e7932f6b30c0c302160fef96831f821acedaf8a909bd3d00a9aa873c7200d2b8fa39013f +SHA512 (rustc-1.49.0-src.tar.xz) = fd8bc67ec0a73d3b6bf9c1fabb7ea981ef817644b4e6ced982fa90b12eae9b55de074634a670bdfb38bfee6588603e818ddcbcc2f2a05f83057c061b4194b4b7 +SHA512 (rust-1.48.0-aarch64-unknown-linux-gnu.tar.xz) = 6ebbd936b1bc2ccf30b62dbbbc6f3986fb57738d89e33a23d58bab09be57a445c17df7912866add91cc108ef7547d229a08c6206db2d2fb00d72887ff6a0894d +SHA512 (rust-1.48.0-armv7-unknown-linux-gnueabihf.tar.xz) = 9763b0c5bc5dc7b265b86636ed32947aab98bd9b5732c4b298ade93e9a09bab82ad37fc7ca2d7c97dfd87634756b3c55015d47696c0a6ed2cb44be03659bcf55 +SHA512 (rust-1.48.0-i686-unknown-linux-gnu.tar.xz) = b8b3c5407304a333fc6c10ad70363589a88673640dda7b5fde8971097e679f56a8c733da31b2183044ae2ce30700db923cc3c3cb8c590d785df680b60b199451 +SHA512 (rust-1.48.0-powerpc64le-unknown-linux-gnu.tar.xz) = 7ddd2b0599872012f8613ccab456622cb05a0a43587b7d389e8b7fdf9381f0387763726d892da931233c89e8e3ce45c2b303ed00b1cce1f91c88d8f88d6b148d +SHA512 (rust-1.48.0-powerpc64-unknown-linux-gnu.tar.xz) = f79e1f984cc3c4dce08599418be2885666e0b6f73e639b10e97ffff4b900606d880c0596b6c2ab7c5f999cfc364d22b2ca6ab88db6ba38b8b227670b222fe23b +SHA512 (rust-1.48.0-s390x-unknown-linux-gnu.tar.xz) = b2b1565f3b1cc0c3bf4aa06aba1da7df775c6e29c892ca7727d0e549f175b632080433be2586e799c5636231de6c678f0228dedee8358fbf167016a1f7d25389 +SHA512 (rust-1.48.0-x86_64-unknown-linux-gnu.tar.xz) = 0784e156e70c47386abfa88ecfeb62b1109364459b1fee225de0749c30379c4eb443ff3ff7faa7dc1a6ff373bc6eb43997007f937889cb35daf940a74641753b From 259615dcc04989c859f998513ae5b0ca4dc0c1a4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 16:44:01 +0000 Subject: [PATCH 036/222] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 88c3909..89c6e76 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.49.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -720,6 +720,9 @@ export %{rust_env} %changelog +* 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. From 8148cbf67890e233c779daeddd4a4dfd5557fdf2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 19 Feb 2021 10:25:21 -0800 Subject: [PATCH 037/222] Update to 1.50.0. --- .gitignore | 7 ++ 0001-Revert-Auto-merge-of-79547.patch | 102 ++++++++++++++++++++++++++ rust.spec | 36 ++++++--- sources | 2 +- sources-bootstrap | 15 ++-- 5 files changed, 142 insertions(+), 20 deletions(-) create mode 100644 0001-Revert-Auto-merge-of-79547.patch diff --git a/.gitignore b/.gitignore index becac4e..c43d28a 100644 --- a/.gitignore +++ b/.gitignore @@ -321,3 +321,10 @@ /rust-1.48.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.48.0-s390x-unknown-linux-gnu.tar.xz /rust-1.48.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.50.0-src.tar.xz +/rust-1.49.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.49.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.49.0-i686-unknown-linux-gnu.tar.xz +/rust-1.49.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.49.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.49.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Revert-Auto-merge-of-79547.patch b/0001-Revert-Auto-merge-of-79547.patch new file mode 100644 index 0000000..b2e58a1 --- /dev/null +++ b/0001-Revert-Auto-merge-of-79547.patch @@ -0,0 +1,102 @@ +From eaf7ea1fc339e1ff348ed941ed2e8c4d66f3e458 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 18 Feb 2021 19:14:58 -0800 +Subject: [PATCH] Revert "Auto merge of #79547 - erikdesjardins:byval, + r=nagisa" + +This reverts commit a094ff9590b83c8f94d898f92c2964a5803ded06, reversing +changes made to d37afad0cc87bf709ad10c85319296ac53030f03. +--- + compiler/rustc_middle/src/ty/layout.rs | 12 ++++++------ + ...return-value-in-reg.rs => return-value-in-reg.rs} | 4 ++-- + src/test/codegen/union-abi.rs | 11 +++-------- + 3 files changed, 11 insertions(+), 16 deletions(-) + rename src/test/codegen/{arg-return-value-in-reg.rs => return-value-in-reg.rs} (74%) + +diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs +index b545b92c9252..545f6aee1a21 100644 +--- a/compiler/rustc_middle/src/ty/layout.rs ++++ b/compiler/rustc_middle/src/ty/layout.rs +@@ -2849,7 +2849,7 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { + || abi == SpecAbi::RustIntrinsic + || abi == SpecAbi::PlatformIntrinsic + { +- let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| { ++ let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| { + if arg.is_ignore() { + return; + } +@@ -2887,9 +2887,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { + _ => return, + } + +- // Pass and return structures up to 2 pointers in size by value, matching `ScalarPair`. +- // LLVM will usually pass these in 2 registers, which is more efficient than by-ref. +- let max_by_val_size = Pointer.size(cx) * 2; ++ // Return structures up to 2 pointers in size by value, matching `ScalarPair`. LLVM ++ // will usually return these in 2 registers, which is more efficient than by-ref. ++ let max_by_val_size = if is_ret { Pointer.size(cx) * 2 } else { Pointer.size(cx) }; + let size = arg.layout.size; + + if arg.layout.is_unsized() || size > max_by_val_size { +@@ -2901,9 +2901,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { + arg.cast_to(Reg { kind: RegKind::Integer, size }); + } + }; +- fixup(&mut self.ret); ++ fixup(&mut self.ret, true); + for arg in &mut self.args { +- fixup(arg); ++ fixup(arg, false); + } + return; + } +diff --git a/src/test/codegen/arg-return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs +similarity index 74% +rename from src/test/codegen/arg-return-value-in-reg.rs +rename to src/test/codegen/return-value-in-reg.rs +index a69291d47821..4bc0136c5e32 100644 +--- a/src/test/codegen/arg-return-value-in-reg.rs ++++ b/src/test/codegen/return-value-in-reg.rs +@@ -1,4 +1,4 @@ +-//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer. ++//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer. + + // compile-flags: -C no-prepopulate-passes -O + // only-x86_64 +@@ -11,7 +11,7 @@ pub struct S { + c: u32, + } + +-// CHECK: define i128 @modify(i128{{( %0)?}}) ++// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s) + #[no_mangle] + pub fn modify(s: S) -> S { + S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c } +diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs +index f282fd237054..afea01e9a2d0 100644 +--- a/src/test/codegen/union-abi.rs ++++ b/src/test/codegen/union-abi.rs +@@ -63,16 +63,11 @@ pub union UnionU128{a:u128} + #[no_mangle] + pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} } + +-pub union UnionU128x2{a:(u128, u128)} +-// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1) +-#[no_mangle] +-pub fn test_UnionU128x2(_: UnionU128x2) { loop {} } +- + #[repr(C)] +-pub union CUnionU128x2{a:(u128, u128)} +-// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1) ++pub union CUnionU128{a:u128} ++// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1) + #[no_mangle] +-pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} } ++pub fn test_CUnionU128(_: CUnionU128) { loop {} } + + pub union UnionBool { b:bool } + // CHECK: define zeroext i1 @test_UnionBool(i8 %b) +-- +2.29.2 + diff --git a/rust.spec b/rust.spec index 89c6e76..fbba9fa 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.48.0 -%global bootstrap_cargo 1.48.0 -%global bootstrap_channel 1.48.0 -%global bootstrap_date 2020-11-19 +%global bootstrap_rust 1.49.0 +%global bootstrap_cargo 1.49.0 +%global bootstrap_channel 1.49.0 +%global bootstrap_date 2020-12-31 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -21,11 +21,11 @@ %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 8.0+. +# is insufficient. Rust currently requires LLVM 9.0+. %bcond_with bundled_llvm -# Requires stable libgit2 1.0 -%if 0%{?fedora} >= 32 +# Requires stable libgit2 1.1 +%if 0%{?fedora} >= 34 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -52,8 +52,8 @@ %endif Name: rust -Version: 1.49.0 -Release: 2%{?dist} +Version: 1.50.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,6 +67,10 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# This internal rust-abi change broke s390x -- revert for now. +# https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 +Patch1: 0001-Revert-Auto-merge-of-79547.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -148,7 +152,7 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %without bundled_libgit2 -BuildRequires: pkgconfig(libgit2) >= 1.0.0 +BuildRequires: pkgconfig(libgit2) >= 1.1.0 %endif %if %{without disabled_libssh2} @@ -396,6 +400,8 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} +%patch1 -p1 + %if %with disabled_libssh2 %patch100 -p1 %endif @@ -529,7 +535,8 @@ fi --enable-vendor \ --enable-verbose-tests \ %{?codegen_units_std} \ - --release-channel=%{channel} + --release-channel=%{channel} \ + --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" %{python} ./x.py build -j "$ncpus" --stage 2 %{python} ./x.py doc --stage 2 @@ -603,6 +610,9 @@ rm -f %{buildroot}%{_bindir}/rust-lldb rm -f %{buildroot}%{rustlibdir}/etc/lldb_* %endif +# We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp) +rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* + %check export %{rust_env} @@ -677,6 +687,7 @@ export %{rust_env} %license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY %doc src/tools/cargo/README.md %{_bindir}/cargo +%{_libexecdir}/cargo* %{_mandir}/man1/cargo*.1* %{_sysconfdir}/bash_completion.d/cargo %{_datadir}/zsh/site-functions/_cargo @@ -720,6 +731,9 @@ export %{rust_env} %changelog +* 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 diff --git a/sources b/sources index 9a88293..a9788dc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.49.0-src.tar.xz) = fd8bc67ec0a73d3b6bf9c1fabb7ea981ef817644b4e6ced982fa90b12eae9b55de074634a670bdfb38bfee6588603e818ddcbcc2f2a05f83057c061b4194b4b7 +SHA512 (rustc-1.50.0-src.tar.xz) = df3c83c0fdc9ebce6fdccddda781dea0cdbd88d2b2a8220cac40cc3a8fa957923ae834d1fa45283d4ad227b334bd9e220e37a4a1ad7a1c7aeb806ed9ed387245 diff --git a/sources-bootstrap b/sources-bootstrap index 21fb440..78e4cd5 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,7 @@ -SHA512 (rustc-1.49.0-src.tar.xz) = fd8bc67ec0a73d3b6bf9c1fabb7ea981ef817644b4e6ced982fa90b12eae9b55de074634a670bdfb38bfee6588603e818ddcbcc2f2a05f83057c061b4194b4b7 -SHA512 (rust-1.48.0-aarch64-unknown-linux-gnu.tar.xz) = 6ebbd936b1bc2ccf30b62dbbbc6f3986fb57738d89e33a23d58bab09be57a445c17df7912866add91cc108ef7547d229a08c6206db2d2fb00d72887ff6a0894d -SHA512 (rust-1.48.0-armv7-unknown-linux-gnueabihf.tar.xz) = 9763b0c5bc5dc7b265b86636ed32947aab98bd9b5732c4b298ade93e9a09bab82ad37fc7ca2d7c97dfd87634756b3c55015d47696c0a6ed2cb44be03659bcf55 -SHA512 (rust-1.48.0-i686-unknown-linux-gnu.tar.xz) = b8b3c5407304a333fc6c10ad70363589a88673640dda7b5fde8971097e679f56a8c733da31b2183044ae2ce30700db923cc3c3cb8c590d785df680b60b199451 -SHA512 (rust-1.48.0-powerpc64le-unknown-linux-gnu.tar.xz) = 7ddd2b0599872012f8613ccab456622cb05a0a43587b7d389e8b7fdf9381f0387763726d892da931233c89e8e3ce45c2b303ed00b1cce1f91c88d8f88d6b148d -SHA512 (rust-1.48.0-powerpc64-unknown-linux-gnu.tar.xz) = f79e1f984cc3c4dce08599418be2885666e0b6f73e639b10e97ffff4b900606d880c0596b6c2ab7c5f999cfc364d22b2ca6ab88db6ba38b8b227670b222fe23b -SHA512 (rust-1.48.0-s390x-unknown-linux-gnu.tar.xz) = b2b1565f3b1cc0c3bf4aa06aba1da7df775c6e29c892ca7727d0e549f175b632080433be2586e799c5636231de6c678f0228dedee8358fbf167016a1f7d25389 -SHA512 (rust-1.48.0-x86_64-unknown-linux-gnu.tar.xz) = 0784e156e70c47386abfa88ecfeb62b1109364459b1fee225de0749c30379c4eb443ff3ff7faa7dc1a6ff373bc6eb43997007f937889cb35daf940a74641753b +SHA512 (rustc-1.50.0-src.tar.xz) = df3c83c0fdc9ebce6fdccddda781dea0cdbd88d2b2a8220cac40cc3a8fa957923ae834d1fa45283d4ad227b334bd9e220e37a4a1ad7a1c7aeb806ed9ed387245 +SHA512 (rust-1.49.0-aarch64-unknown-linux-gnu.tar.xz) = fa81b618359c2952de941e094eabfe2966e3c1a39a1b20452a77f1a68a54dde9cc5cade18db911cf448ffe947d934461ce752112bd9b5b5430e1fcdabbd8b56a +SHA512 (rust-1.49.0-armv7-unknown-linux-gnueabihf.tar.xz) = 1cba85fc958371aeb1d521e8842ad576e65d244147e2c75c34eaa776552ed025434d10284fa976d901d6cede69f6db3e5fdd770005ca0b93bb5e3202b9f9392a +SHA512 (rust-1.49.0-i686-unknown-linux-gnu.tar.xz) = b4d39cb234314f013969b5db3d365d21719d7a01f2dc0816e4f221c5e6d4abecd7f9e83f54b8640173d00d3e701cb3cbb61cef32f00db9356139005a1ce3bd19 +SHA512 (rust-1.49.0-powerpc64le-unknown-linux-gnu.tar.xz) = c17eb27ec4dbcc56da3edffbc57e0edda99744d6a0d38369fa08af066894aeb13dd78c7b8055f2246fc3bf13c654842675ea4df44b7bc8852e0f9952acdf7e7c +SHA512 (rust-1.49.0-s390x-unknown-linux-gnu.tar.xz) = 25259ea2e499c89459b14571e2c54f230d642af9cfe539dc2b8be15eff0e23b8c6e60af4c567bcbb6c6c185b4537eaab19c3395fce48b1f6e5ef1234efc31e3a +SHA512 (rust-1.49.0-x86_64-unknown-linux-gnu.tar.xz) = c008aa50e17db6a0134fb85235a958258d345410f5063bc77175f7c28b2e35895427b9e68cd1ac9acb769769c83313cd59fe6465b453e891cf415a2514b7722d From 85a5f3ae28e4dc7dd4874572026139cfde7ad10b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 25 Mar 2021 11:38:09 -0700 Subject: [PATCH 038/222] Update to 1.51.0. --- .gitignore | 7 ++++++ rust.spec | 23 ++++++++++++------- ....patch => rustc-1.51.0-disable-http2.patch | 22 +++++++++--------- ...patch => rustc-1.51.0-no-default-pie.patch | 9 ++++---- sources | 2 +- sources-bootstrap | 14 +++++------ 6 files changed, 46 insertions(+), 31 deletions(-) rename rustc-1.49.0-disable-http2.patch => rustc-1.51.0-disable-http2.patch (72%) rename rustc-1.48.0-no-default-pie.patch => rustc-1.51.0-no-default-pie.patch (75%) diff --git a/.gitignore b/.gitignore index c43d28a..d00b69d 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,10 @@ /rust-1.49.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.49.0-s390x-unknown-linux-gnu.tar.xz /rust-1.49.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.51.0-src.tar.xz +/rust-1.50.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.50.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.50.0-i686-unknown-linux-gnu.tar.xz +/rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.50.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index fbba9fa..28efbfc 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.49.0 -%global bootstrap_cargo 1.49.0 -%global bootstrap_channel 1.49.0 -%global bootstrap_date 2020-12-31 +%global bootstrap_rust 1.50.0 +%global bootstrap_cargo 1.50.0 +%global bootstrap_channel 1.50.0 +%global bootstrap_date 2021-02-11 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -52,7 +52,7 @@ %endif Name: rust -Version: 1.50.0 +Version: 1.51.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -78,11 +78,11 @@ Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.49.0-disable-http2.patch +Patch101: rustc-1.51.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.48.0-no-default-pie.patch +Patch102: rustc-1.51.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -165,12 +165,16 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 11.0.0 +Provides: bundled(llvm) = 11.0.1 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm9.0 %endif +%if 0%{?fedora} >= 34 +# we're not ready for llvm-12 yet +%global llvm llvm11 +%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -731,6 +735,9 @@ export %{rust_env} %changelog +* 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. diff --git a/rustc-1.49.0-disable-http2.patch b/rustc-1.51.0-disable-http2.patch similarity index 72% rename from rustc-1.49.0-disable-http2.patch rename to rustc-1.51.0-disable-http2.patch index d6c6aa7..2517a34 100644 --- a/rustc-1.49.0-disable-http2.patch +++ b/rustc-1.51.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.49.0-src/Cargo.lock.orig 2021-01-05 12:45:10.456414612 -0800 -+++ rustc-1.49.0-src/Cargo.lock 2021-01-05 12:45:10.458414575 -0800 -@@ -882,7 +882,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2021-03-09 10:30:08.626424998 -0800 ++++ rustc-beta-src/Cargo.lock 2021-03-09 10:32:38.096207704 -0800 +@@ -899,7 +899,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1728,16 +1727,6 @@ +@@ -1860,16 +1859,6 @@ ] [[package]] @@ -25,10 +25,10 @@ name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.49.0-src/src/tools/cargo/Cargo.toml.orig 2021-01-05 12:45:10.458414575 -0800 -+++ rustc-1.49.0-src/src/tools/cargo/Cargo.toml 2021-01-05 12:47:25.966928554 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-03-05 08:34:15.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-03-09 10:32:38.096207704 -0800 @@ -25,7 +25,7 @@ - crates-io = { path = "crates/crates-io", version = "0.31.1" } + crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" crypto-hash = "0.3.1" -curl = { version = "0.4.23", features = ["http2"] } @@ -36,9 +36,9 @@ curl-sys = "0.4.22" env_logger = "0.8.1" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-12-28 19:03:25.000000000 -0800 -+++ rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-01-05 12:45:10.458414575 -0800 -@@ -408,14 +408,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-03-05 08:34:15.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-03-09 10:32:38.096207704 -0800 +@@ -412,14 +412,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -584,7 +578,7 @@ +@@ -592,7 +586,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.48.0-no-default-pie.patch b/rustc-1.51.0-no-default-pie.patch similarity index 75% rename from rustc-1.48.0-no-default-pie.patch rename to rustc-1.51.0-no-default-pie.patch index bb6b3d1..d24cc75 100644 --- a/rustc-1.48.0-no-default-pie.patch +++ b/rustc-1.51.0-no-default-pie.patch @@ -1,14 +1,15 @@ ---- rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2020-11-16 06:01:53.000000000 -0800 -+++ rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs 2020-11-16 09:37:15.779516797 -0800 -@@ -1185,10 +1185,12 @@ +--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800 ++++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800 +@@ -1279,11 +1279,13 @@ } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { -- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, + // Only use PIE if explicity specified. + let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { + (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, +- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, - (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, diff --git a/sources b/sources index a9788dc..9834690 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.50.0-src.tar.xz) = df3c83c0fdc9ebce6fdccddda781dea0cdbd88d2b2a8220cac40cc3a8fa957923ae834d1fa45283d4ad227b334bd9e220e37a4a1ad7a1c7aeb806ed9ed387245 +SHA512 (rustc-1.51.0-src.tar.xz) = ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df diff --git a/sources-bootstrap b/sources-bootstrap index 78e4cd5..2ad0ad0 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,7 +1,7 @@ -SHA512 (rustc-1.50.0-src.tar.xz) = df3c83c0fdc9ebce6fdccddda781dea0cdbd88d2b2a8220cac40cc3a8fa957923ae834d1fa45283d4ad227b334bd9e220e37a4a1ad7a1c7aeb806ed9ed387245 -SHA512 (rust-1.49.0-aarch64-unknown-linux-gnu.tar.xz) = fa81b618359c2952de941e094eabfe2966e3c1a39a1b20452a77f1a68a54dde9cc5cade18db911cf448ffe947d934461ce752112bd9b5b5430e1fcdabbd8b56a -SHA512 (rust-1.49.0-armv7-unknown-linux-gnueabihf.tar.xz) = 1cba85fc958371aeb1d521e8842ad576e65d244147e2c75c34eaa776552ed025434d10284fa976d901d6cede69f6db3e5fdd770005ca0b93bb5e3202b9f9392a -SHA512 (rust-1.49.0-i686-unknown-linux-gnu.tar.xz) = b4d39cb234314f013969b5db3d365d21719d7a01f2dc0816e4f221c5e6d4abecd7f9e83f54b8640173d00d3e701cb3cbb61cef32f00db9356139005a1ce3bd19 -SHA512 (rust-1.49.0-powerpc64le-unknown-linux-gnu.tar.xz) = c17eb27ec4dbcc56da3edffbc57e0edda99744d6a0d38369fa08af066894aeb13dd78c7b8055f2246fc3bf13c654842675ea4df44b7bc8852e0f9952acdf7e7c -SHA512 (rust-1.49.0-s390x-unknown-linux-gnu.tar.xz) = 25259ea2e499c89459b14571e2c54f230d642af9cfe539dc2b8be15eff0e23b8c6e60af4c567bcbb6c6c185b4537eaab19c3395fce48b1f6e5ef1234efc31e3a -SHA512 (rust-1.49.0-x86_64-unknown-linux-gnu.tar.xz) = c008aa50e17db6a0134fb85235a958258d345410f5063bc77175f7c28b2e35895427b9e68cd1ac9acb769769c83313cd59fe6465b453e891cf415a2514b7722d +SHA512 (rustc-1.51.0-src.tar.xz) = ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df +SHA512 (rust-1.50.0-aarch64-unknown-linux-gnu.tar.xz) = e6b409afc8e85a88ecb9ff439a6eb9dcb93d5553e81549fb4f332b9e2d946dce0424319c5092e60aab9435944af70d0117d15c12d54d2059ef73c1fdf36d8273 +SHA512 (rust-1.50.0-armv7-unknown-linux-gnueabihf.tar.xz) = c3314436afc4ebed697bf6828b9eacbc12f96838b156241331a3b71e99e1438f8ad82e701615ea302ebfc459464479442fe653232bd319cf824027362438970d +SHA512 (rust-1.50.0-i686-unknown-linux-gnu.tar.xz) = bff117733d11731f56e8659265d0b47327e2af3f7c46aca494747a92b4f634dd35fa9731a1be59dd69821042f88bded253e1d7b5693ca237c9a167408ca7f898 +SHA512 (rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz) = e3dc75ba7dff3a358042542afa398ec8771a23f5f699454a876ddc1f3583d399fe5350696a5da62d71ca97ea882c9ae1fcb60dc2e9fdf76bc7a9af892096371e +SHA512 (rust-1.50.0-s390x-unknown-linux-gnu.tar.xz) = 733513af2a7ef7a782a5ebfbd080071194ac47084022b54b4830de84facef9986d65525f8666a4c226e9878e43b00ebced26d6077e5fb1b7f775ac8f290fba97 +SHA512 (rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz) = ab49e3ecb14e4af8e48548845184e9ab3d564ab2341c1e5462b7847347c79d13324211b860988d219ccb646143bf142fb14c3ab03663b06cfe9ca275128d9fa0 From 546915fc9cc15b6656a1bdfecf8583fc0e55ab47 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 14 Apr 2021 17:28:06 -0700 Subject: [PATCH 039/222] Security fixes for CVE-2021-28876, CVE-2021-28878, CVE-2021-28879 --- rust.spec | 20 ++++- rustc-1.51.0-backport-pr81741.patch | 44 ++++++++++ rustc-1.51.0-backport-pr82289.patch | 96 ++++++++++++++++++++++ rustc-1.51.0-backport-pr82292.patch | 120 ++++++++++++++++++++++++++++ 4 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 rustc-1.51.0-backport-pr81741.patch create mode 100644 rustc-1.51.0-backport-pr82289.patch create mode 100644 rustc-1.51.0-backport-pr82292.patch diff --git a/rust.spec b/rust.spec index 28efbfc..10ea78b 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.51.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -71,6 +71,18 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 Patch1: 0001-Revert-Auto-merge-of-79547.patch +# CVE-2021-28876 rust: panic safety issue in Zip implementation +# https://github.com/rust-lang/rust/pull/81741 +Patch2: rustc-1.51.0-backport-pr81741.patch + +# CVE-2021-28879 rust: integer overflow in the Zip implementation can lead to a buffer overflow +# https://github.com/rust-lang/rust/pull/82289 +Patch3: rustc-1.51.0-backport-pr82289.patch + +# CVE-2021-28878 rust: memory safety violation in Zip implementation when next_back() and next() are used together +# https://github.com/rust-lang/rust/pull/82292 +Patch4: rustc-1.51.0-backport-pr82292.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -405,6 +417,9 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -735,6 +750,9 @@ export %{rust_env} %changelog +* Wed Apr 14 2021 Josh Stone - 1.51.0-2 +- Security fixes for CVE-2021-28876, CVE-2021-28878, CVE-2021-28879 + * Thu Mar 25 2021 Josh Stone - 1.51.0-1 - Update to 1.51.0. diff --git a/rustc-1.51.0-backport-pr81741.patch b/rustc-1.51.0-backport-pr81741.patch new file mode 100644 index 0000000..8ef22ee --- /dev/null +++ b/rustc-1.51.0-backport-pr81741.patch @@ -0,0 +1,44 @@ +From 40d3f2d7ef5835317fe9df9ecc01f4c363def4fd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Thu, 4 Feb 2021 10:23:01 +0200 +Subject: [PATCH] Increment `self.index` before calling + `Iterator::self.a.__iterator_get_unchecked` in `Zip` `TrustedRandomAccess` + specialization + +Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the +index would not have been incremented yet and another call to +`Iterator::next` would read from the same index again, which is not +allowed according to the API contract of `TrustedRandomAccess` for +`!Clone`. + +Fixes https://github.com/rust-lang/rust/issues/81740 + +(cherry picked from commit 86a4b27475aab52b998c15f5758540697cc9cff0) +--- + library/core/src/iter/adapters/zip.rs | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs +index 98b8dca96140..9f9835345200 100644 +--- a/library/core/src/iter/adapters/zip.rs ++++ b/library/core/src/iter/adapters/zip.rs +@@ -198,12 +198,13 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { + Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) + } + } else if A::may_have_side_effect() && self.index < self.a.size() { ++ let i = self.index; ++ self.index += 1; + // match the base implementation's potential side effects +- // SAFETY: we just checked that `self.index` < `self.a.len()` ++ // SAFETY: we just checked that `i` < `self.a.len()` + unsafe { +- self.a.__iterator_get_unchecked(self.index); ++ self.a.__iterator_get_unchecked(i); + } +- self.index += 1; + None + } else { + None +-- +2.31.1 + diff --git a/rustc-1.51.0-backport-pr82289.patch b/rustc-1.51.0-backport-pr82289.patch new file mode 100644 index 0000000..5cf5433 --- /dev/null +++ b/rustc-1.51.0-backport-pr82289.patch @@ -0,0 +1,96 @@ +From 5222e2ba2d97cd716a379b4ae6bc62c5f7c2dd36 Mon Sep 17 00:00:00 2001 +From: Giacomo Stevanato +Date: Fri, 19 Feb 2021 12:15:37 +0100 +Subject: [PATCH 1/3] Increment self.len in specialized ZipImpl to avoid + underflow in size_hint + +(cherry picked from commit 66a260617a88ed1ad55a46f03c5a90d5ad3004d3) +--- + library/core/src/iter/adapters/zip.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs +index 9f9835345200..f08bfac837fe 100644 +--- a/library/core/src/iter/adapters/zip.rs ++++ b/library/core/src/iter/adapters/zip.rs +@@ -200,6 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { + } else if A::may_have_side_effect() && self.index < self.a.size() { + let i = self.index; + self.index += 1; ++ self.len += 1; + // match the base implementation's potential side effects + // SAFETY: we just checked that `i` < `self.a.len()` + unsafe { +-- +2.31.1 + + +From d39669fc8282830a374d19d204f7b4ee8eb1e381 Mon Sep 17 00:00:00 2001 +From: Giacomo Stevanato +Date: Fri, 19 Feb 2021 12:16:12 +0100 +Subject: [PATCH 2/3] Add test for underflow in specialized Zip's size_hint + +(cherry picked from commit 8b9ac4d4155c74db5b317046033ab9c05a09e351) +--- + library/core/tests/iter/adapters/zip.rs | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs +index 1fce0951e365..a59771039295 100644 +--- a/library/core/tests/iter/adapters/zip.rs ++++ b/library/core/tests/iter/adapters/zip.rs +@@ -245,3 +245,23 @@ fn test_double_ended_zip() { + assert_eq!(it.next_back(), Some((3, 3))); + assert_eq!(it.next(), None); + } ++ ++#[test] ++fn test_issue_82282() { ++ fn overflowed_zip(arr: &[i32]) -> impl Iterator { ++ static UNIT_EMPTY_ARR: [(); 0] = []; ++ ++ let mapped = arr.into_iter().map(|i| *i); ++ let mut zipped = mapped.zip(UNIT_EMPTY_ARR.iter()); ++ zipped.next(); ++ zipped ++ } ++ ++ let arr = [1, 2, 3]; ++ let zip = overflowed_zip(&arr).zip(overflowed_zip(&arr)); ++ ++ assert_eq!(zip.size_hint(), (0, Some(0))); ++ for _ in zip { ++ panic!(); ++ } ++} +-- +2.31.1 + + +From 4b382167dd5ed5a6eac0cf314bfb86e3704b6e76 Mon Sep 17 00:00:00 2001 +From: Giacomo Stevanato +Date: Fri, 19 Feb 2021 12:17:48 +0100 +Subject: [PATCH 3/3] Remove useless comparison since now self.index <= + self.len is an invariant + +(cherry picked from commit aeb4ea739efb70e0002a4a9c4c7b8027dd0620b3) +--- + library/core/src/iter/adapters/zip.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs +index f08bfac837fe..dcbcb1ce7200 100644 +--- a/library/core/src/iter/adapters/zip.rs ++++ b/library/core/src/iter/adapters/zip.rs +@@ -261,7 +261,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> + if sz_a != sz_b { + let sz_a = self.a.size(); + if a_side_effect && sz_a > self.len { +- for _ in 0..sz_a - cmp::max(self.len, self.index) { ++ for _ in 0..sz_a - self.len { + self.a.next_back(); + } + } +-- +2.31.1 + diff --git a/rustc-1.51.0-backport-pr82292.patch b/rustc-1.51.0-backport-pr82292.patch new file mode 100644 index 0000000..4baf72a --- /dev/null +++ b/rustc-1.51.0-backport-pr82292.patch @@ -0,0 +1,120 @@ +From 0babb88efc4d36f3defafc3c3c0343793fa05d52 Mon Sep 17 00:00:00 2001 +From: Giacomo Stevanato +Date: Wed, 3 Mar 2021 21:09:01 +0100 +Subject: [PATCH 1/2] Prevent Zip specialization from calling + __iterator_get_unchecked twice with the same index after calling next_back + +(cherry picked from commit 2371914a05f8f2763dffe6e2511d0870bcd6b461) +--- + library/core/src/iter/adapters/zip.rs | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs +index dcbcb1ce7200..7dac0c63ca2d 100644 +--- a/library/core/src/iter/adapters/zip.rs ++++ b/library/core/src/iter/adapters/zip.rs +@@ -13,9 +13,10 @@ + pub struct Zip { + a: A, + b: B, +- // index and len are only used by the specialized version of zip ++ // index, len and a_len are only used by the specialized version of zip + index: usize, + len: usize, ++ a_len: usize, + } + impl Zip { + pub(in crate::iter) fn new(a: A, b: B) -> Zip { +@@ -110,6 +111,7 @@ impl ZipImpl for Zip + b, + index: 0, // unused + len: 0, // unused ++ a_len: 0, // unused + } + } + +@@ -184,8 +186,9 @@ impl ZipImpl for Zip + B: TrustedRandomAccess + Iterator, + { + fn new(a: A, b: B) -> Self { +- let len = cmp::min(a.size(), b.size()); +- Zip { a, b, index: 0, len } ++ let a_len = a.size(); ++ let len = cmp::min(a_len, b.size()); ++ Zip { a, b, index: 0, len, a_len } + } + + #[inline] +@@ -197,7 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { + unsafe { + Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) + } +- } else if A::may_have_side_effect() && self.index < self.a.size() { ++ } else if A::may_have_side_effect() && self.index < self.a_len { + let i = self.index; + self.index += 1; + self.len += 1; +@@ -264,6 +267,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> + for _ in 0..sz_a - self.len { + self.a.next_back(); + } ++ self.a_len = self.len; + } + let sz_b = self.b.size(); + if b_side_effect && sz_b > self.len { +@@ -275,6 +279,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> + } + if self.index < self.len { + self.len -= 1; ++ self.a_len -= 1; + let i = self.len; + // SAFETY: `i` is smaller than the previous value of `self.len`, + // which is also smaller than or equal to `self.a.len()` and `self.b.len()` +-- +2.31.1 + + +From 19af66a6f3e2bbb4780bb9eae7eb53bd13e3dd0f Mon Sep 17 00:00:00 2001 +From: Giacomo Stevanato +Date: Fri, 19 Feb 2021 15:25:09 +0100 +Subject: [PATCH 2/2] Add relevant test + +(cherry picked from commit c1bfb9a78db6d481be1d03355672712c766e20b0) +--- + library/core/tests/iter/adapters/zip.rs | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs +index a59771039295..000c15f72c88 100644 +--- a/library/core/tests/iter/adapters/zip.rs ++++ b/library/core/tests/iter/adapters/zip.rs +@@ -265,3 +265,26 @@ fn overflowed_zip(arr: &[i32]) -> impl Iterator { + panic!(); + } + } ++ ++#[test] ++fn test_issue_82291() { ++ use std::cell::Cell; ++ ++ let mut v1 = [()]; ++ let v2 = [()]; ++ ++ let called = Cell::new(0); ++ ++ let mut zip = v1 ++ .iter_mut() ++ .map(|r| { ++ called.set(called.get() + 1); ++ r ++ }) ++ .zip(&v2); ++ ++ zip.next_back(); ++ assert_eq!(called.get(), 1); ++ zip.next(); ++ assert_eq!(called.get(), 1); ++} +-- +2.31.1 + From 5789d99323deb0d60b7da9866fbb5d33544a0547 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 14 Apr 2021 18:43:41 -0700 Subject: [PATCH 040/222] Fix bootstrap for stage0 rust 1.51 --- rust.spec | 6 ++++ rustc-1.51.0-backport-pr81910.patch | 48 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 rustc-1.51.0-backport-pr81910.patch diff --git a/rust.spec b/rust.spec index 10ea78b..ff6e95f 100644 --- a/rust.spec +++ b/rust.spec @@ -83,6 +83,10 @@ Patch3: rustc-1.51.0-backport-pr82289.patch # https://github.com/rust-lang/rust/pull/82292 Patch4: rustc-1.51.0-backport-pr82292.patch +# Fix bootstrap for stage0 rust 1.51 +# https://github.com/rust-lang/rust/pull/81910 +Patch5: rustc-1.51.0-backport-pr81910.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -420,6 +424,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -752,6 +757,7 @@ export %{rust_env} %changelog * 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. diff --git a/rustc-1.51.0-backport-pr81910.patch b/rustc-1.51.0-backport-pr81910.patch new file mode 100644 index 0000000..e2f91b6 --- /dev/null +++ b/rustc-1.51.0-backport-pr81910.patch @@ -0,0 +1,48 @@ +From 852684d306cee955ed751f1e8d8eec6adaecff3b Mon Sep 17 00:00:00 2001 +From: Joshua Nelson +Date: Mon, 8 Feb 2021 22:51:21 -0500 +Subject: [PATCH] Use format string in bootstrap panic instead of a string + directly + +This fixes the following warning when compiling with nightly: + +``` +warning: panic message is not a string literal + --> src/bootstrap/builder.rs:1515:24 + | +1515 | panic!(out); + | ^^^ + | + = note: `#[warn(non_fmt_panic)]` on by default + = note: this is no longer accepted in Rust 2021 +help: add a "{}" format string to Display the message + | +1515 | panic!("{}", out); + | ^^^^^ +help: or use std::panic::panic_any instead + | +1515 | std::panic::panic_any(out); + | ^^^^^^^^^^^^^^^^^^^^^^ +``` + +(cherry picked from commit 31c93397bde772764cda3058e16f9cef61895090) +--- + src/bootstrap/builder.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index f1a160250dbe..0f5fcb4af400 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -1490,7 +1490,7 @@ pub fn ensure(&'a self, step: S) -> S::Output { + for el in stack.iter().rev() { + out += &format!("\t{:?}\n", el); + } +- panic!(out); ++ panic!("{}", out); + } + if let Some(out) = self.cache.get(&step) { + self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step)); +-- +2.31.1 + From 1cb0a34c53c337586c1947dada9417739c30fa75 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 16 Apr 2021 13:45:09 -0700 Subject: [PATCH 041/222] Security fixes for CVE-2020-36323, CVE-2021-31162 --- rust.spec | 15 ++- rustc-1.51.0-backport-pr81728.patch | 181 ++++++++++++++++++++++++++++ rustc-1.51.0-backport-pr83629.patch | 142 ++++++++++++++++++++++ 3 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 rustc-1.51.0-backport-pr81728.patch create mode 100644 rustc-1.51.0-backport-pr83629.patch diff --git a/rust.spec b/rust.spec index ff6e95f..a0973b1 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.51.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -87,6 +87,14 @@ Patch4: rustc-1.51.0-backport-pr82292.patch # https://github.com/rust-lang/rust/pull/81910 Patch5: rustc-1.51.0-backport-pr81910.patch +# CVE-2020-36323 rust: optimization for joining strings can cause uninitialized bytes to be exposed +# https://github.com/rust-lang/rust/pull/81728 +Patch6: rustc-1.51.0-backport-pr81728.patch + +# CVE-2021-31162 rust: double free in Vec::from_iter function if freeing the element panics +# https://github.com/rust-lang/rust/pull/83629 +Patch7: rustc-1.51.0-backport-pr83629.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -425,6 +433,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 +%patch7 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -755,6 +765,9 @@ export %{rust_env} %changelog +* 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 diff --git a/rustc-1.51.0-backport-pr81728.patch b/rustc-1.51.0-backport-pr81728.patch new file mode 100644 index 0000000..20373f4 --- /dev/null +++ b/rustc-1.51.0-backport-pr81728.patch @@ -0,0 +1,181 @@ +From 70f17ca715d3d7e2fd79cc909b95fd3a6357c13e Mon Sep 17 00:00:00 2001 +From: Yechan Bae +Date: Wed, 3 Feb 2021 16:36:33 -0500 +Subject: [PATCH 1/2] Fixes #80335 + +--- + library/alloc/src/str.rs | 42 ++++++++++++++++++++++---------------- + library/alloc/tests/str.rs | 30 +++++++++++++++++++++++++++ + 2 files changed, 54 insertions(+), 18 deletions(-) + +diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs +index 70e0c7dba5ea..a7584c6b6510 100644 +--- a/library/alloc/src/str.rs ++++ b/library/alloc/src/str.rs +@@ -90,8 +90,8 @@ fn join(slice: &Self, sep: &str) -> String { + } + } + +-macro_rules! spezialize_for_lengths { +- ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => { ++macro_rules! specialize_for_lengths { ++ ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => {{ + let mut target = $target; + let iter = $iter; + let sep_bytes = $separator; +@@ -102,7 +102,8 @@ macro_rules! spezialize_for_lengths { + $num => { + for s in iter { + copy_slice_and_advance!(target, sep_bytes); +- copy_slice_and_advance!(target, s.borrow().as_ref()); ++ let content_bytes = s.borrow().as_ref(); ++ copy_slice_and_advance!(target, content_bytes); + } + }, + )* +@@ -110,11 +111,13 @@ macro_rules! spezialize_for_lengths { + // arbitrary non-zero size fallback + for s in iter { + copy_slice_and_advance!(target, sep_bytes); +- copy_slice_and_advance!(target, s.borrow().as_ref()); ++ let content_bytes = s.borrow().as_ref(); ++ copy_slice_and_advance!(target, content_bytes); + } + } + } +- }; ++ target ++ }} + } + + macro_rules! copy_slice_and_advance { +@@ -153,7 +156,7 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec + // if the `len` calculation overflows, we'll panic + // we would have run out of memory anyway and the rest of the function requires + // the entire Vec pre-allocated for safety +- let len = sep_len ++ let reserved_len = sep_len + .checked_mul(iter.len()) + .and_then(|n| { + slice.iter().map(|s| s.borrow().as_ref().len()).try_fold(n, usize::checked_add) +@@ -161,22 +164,25 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec + .expect("attempt to join into collection with len > usize::MAX"); + + // crucial for safety +- let mut result = Vec::with_capacity(len); +- assert!(result.capacity() >= len); ++ let mut result = Vec::with_capacity(reserved_len); ++ debug_assert!(result.capacity() >= reserved_len); + + result.extend_from_slice(first.borrow().as_ref()); + + unsafe { +- { +- let pos = result.len(); +- let target = result.get_unchecked_mut(pos..len); +- +- // copy separator and slices over without bounds checks +- // generate loops with hardcoded offsets for small separators +- // massive improvements possible (~ x2) +- spezialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); +- } +- result.set_len(len); ++ let pos = result.len(); ++ let target = result.get_unchecked_mut(pos..reserved_len); ++ ++ // copy separator and slices over without bounds checks ++ // generate loops with hardcoded offsets for small separators ++ // massive improvements possible (~ x2) ++ let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); ++ ++ // issue #80335: A weird borrow implementation can return different ++ // slices for the length calculation and the actual copy, so ++ // `remain.len()` might be non-zero. ++ let result_len = reserved_len - remain.len(); ++ result.set_len(result_len); + } + result + } +diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs +index 604835e6cc4a..6df8d8c2f354 100644 +--- a/library/alloc/tests/str.rs ++++ b/library/alloc/tests/str.rs +@@ -160,6 +160,36 @@ fn test_join_for_different_lengths_with_long_separator() { + test_join!("~~~~~a~~~~~bc", ["", "a", "bc"], "~~~~~"); + } + ++#[test] ++fn test_join_isue_80335() { ++ use core::{borrow::Borrow, cell::Cell}; ++ ++ struct WeirdBorrow { ++ state: Cell, ++ } ++ ++ impl Default for WeirdBorrow { ++ fn default() -> Self { ++ WeirdBorrow { state: Cell::new(false) } ++ } ++ } ++ ++ impl Borrow for WeirdBorrow { ++ fn borrow(&self) -> &str { ++ let state = self.state.get(); ++ if state { ++ "0" ++ } else { ++ self.state.set(true); ++ "123456" ++ } ++ } ++ } ++ ++ let arr: [WeirdBorrow; 3] = Default::default(); ++ test_join!("0-0-0", arr, "-"); ++} ++ + #[test] + #[cfg_attr(miri, ignore)] // Miri is too slow + fn test_unsafe_slice() { +-- +2.31.1 + + +From 10020817d2e6756be1ff2ac3c182af97cf7fe904 Mon Sep 17 00:00:00 2001 +From: Yechan Bae +Date: Sat, 20 Mar 2021 13:42:54 -0400 +Subject: [PATCH 2/2] Update the comment + +--- + library/alloc/src/str.rs | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs +index a7584c6b6510..4d1e876457b8 100644 +--- a/library/alloc/src/str.rs ++++ b/library/alloc/src/str.rs +@@ -163,7 +163,7 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec + }) + .expect("attempt to join into collection with len > usize::MAX"); + +- // crucial for safety ++ // prepare an uninitialized buffer + let mut result = Vec::with_capacity(reserved_len); + debug_assert!(result.capacity() >= reserved_len); + +@@ -178,9 +178,9 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec + // massive improvements possible (~ x2) + let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); + +- // issue #80335: A weird borrow implementation can return different +- // slices for the length calculation and the actual copy, so +- // `remain.len()` might be non-zero. ++ // A weird borrow implementation may return different ++ // slices for the length calculation and the actual copy. ++ // Make sure we don't expose uninitialized bytes to the caller. + let result_len = reserved_len - remain.len(); + result.set_len(result_len); + } +-- +2.31.1 + diff --git a/rustc-1.51.0-backport-pr83629.patch b/rustc-1.51.0-backport-pr83629.patch new file mode 100644 index 0000000..7f68d95 --- /dev/null +++ b/rustc-1.51.0-backport-pr83629.patch @@ -0,0 +1,142 @@ +From 3834e7b7393bf1a0d7df02ccd1d2e896c1465769 Mon Sep 17 00:00:00 2001 +From: The8472 +Date: Mon, 29 Mar 2021 04:22:34 +0200 +Subject: [PATCH 1/2] add testcase for double-drop during Vec in-place + collection + +--- + library/alloc/tests/vec.rs | 38 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs +index 5c7ff67bc621..4cdb7eefcdf1 100644 +--- a/library/alloc/tests/vec.rs ++++ b/library/alloc/tests/vec.rs +@@ -954,7 +954,7 @@ fn test_from_iter_specialization_head_tail_drop() { + } + + #[test] +-fn test_from_iter_specialization_panic_drop() { ++fn test_from_iter_specialization_panic_during_iteration_drops() { + let drop_count: Vec<_> = (0..=2).map(|_| Rc::new(())).collect(); + let src: Vec<_> = drop_count.iter().cloned().collect(); + let iter = src.into_iter(); +@@ -977,6 +977,42 @@ fn test_from_iter_specialization_panic_drop() { + ); + } + ++#[test] ++fn test_from_iter_specialization_panic_during_drop_leaks() { ++ static mut DROP_COUNTER: usize = 0; ++ ++ #[derive(Debug)] ++ enum Droppable { ++ DroppedTwice(Box), ++ PanicOnDrop, ++ } ++ ++ impl Drop for Droppable { ++ fn drop(&mut self) { ++ match self { ++ Droppable::DroppedTwice(_) => { ++ unsafe { ++ DROP_COUNTER += 1; ++ } ++ println!("Dropping!") ++ } ++ Droppable::PanicOnDrop => { ++ if !std::thread::panicking() { ++ panic!(); ++ } ++ } ++ } ++ } ++ } ++ ++ let _ = std::panic::catch_unwind(AssertUnwindSafe(|| { ++ let v = vec![Droppable::DroppedTwice(Box::new(123)), Droppable::PanicOnDrop]; ++ let _ = v.into_iter().take(0).collect::>(); ++ })); ++ ++ assert_eq!(unsafe { DROP_COUNTER }, 1); ++} ++ + #[test] + fn test_cow_from() { + let borrowed: &[_] = &["borrowed", "(slice)"]; +-- +2.31.1 + + +From 8e2706343e1ce1c5a2d3a2ceaaaa010aaeb21d93 Mon Sep 17 00:00:00 2001 +From: The8472 +Date: Mon, 29 Mar 2021 04:22:48 +0200 +Subject: [PATCH 2/2] fix double-drop in in-place collect specialization + +--- + library/alloc/src/vec/into_iter.rs | 27 ++++++++++++++------- + library/alloc/src/vec/source_iter_marker.rs | 4 +-- + 2 files changed, 20 insertions(+), 11 deletions(-) + +diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs +index f131d06bb18f..74adced53f6d 100644 +--- a/library/alloc/src/vec/into_iter.rs ++++ b/library/alloc/src/vec/into_iter.rs +@@ -85,20 +85,29 @@ fn as_raw_mut_slice(&mut self) -> *mut [T] { + ptr::slice_from_raw_parts_mut(self.ptr as *mut T, self.len()) + } + +- pub(super) fn drop_remaining(&mut self) { +- unsafe { +- ptr::drop_in_place(self.as_mut_slice()); +- } +- self.ptr = self.end; +- } ++ /// Drops remaining elements and relinquishes the backing allocation. ++ /// ++ /// This is roughly equivalent to the following, but more efficient ++ /// ++ /// ``` ++ /// # let mut into_iter = Vec::::with_capacity(10).into_iter(); ++ /// (&mut into_iter).for_each(core::mem::drop); ++ /// unsafe { core::ptr::write(&mut into_iter, Vec::new().into_iter()); } ++ /// ``` ++ pub(super) fn forget_allocation_drop_remaining(&mut self) { ++ let remaining = self.as_raw_mut_slice(); + +- /// Relinquishes the backing allocation, equivalent to +- /// `ptr::write(&mut self, Vec::new().into_iter())` +- pub(super) fn forget_allocation(&mut self) { ++ // overwrite the individual fields instead of creating a new ++ // struct and then overwriting &mut self. ++ // this creates less assembly + self.cap = 0; + self.buf = unsafe { NonNull::new_unchecked(RawVec::NEW.ptr()) }; + self.ptr = self.buf.as_ptr(); + self.end = self.buf.as_ptr(); ++ ++ unsafe { ++ ptr::drop_in_place(remaining); ++ } + } + } + +diff --git a/library/alloc/src/vec/source_iter_marker.rs b/library/alloc/src/vec/source_iter_marker.rs +index 8c0e95559fa1..9301f7a5184e 100644 +--- a/library/alloc/src/vec/source_iter_marker.rs ++++ b/library/alloc/src/vec/source_iter_marker.rs +@@ -78,9 +78,9 @@ impl SpecFromIter for Vec + } + + // drop any remaining values at the tail of the source +- src.drop_remaining(); + // but prevent drop of the allocation itself once IntoIter goes out of scope +- src.forget_allocation(); ++ // if the drop panics then we also leak any elements collected into dst_buf ++ src.forget_allocation_drop_remaining(); + + let vec = unsafe { + let len = dst.offset_from(dst_buf) as usize; +-- +2.31.1 + From 34582956829af6aa9a9d6c5208ed5cff15ef0424 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 6 May 2021 09:24:31 -0700 Subject: [PATCH 042/222] Update to 1.52.0. --- .gitignore | 7 ++ rust.spec | 54 ++------- rustc-1.51.0-backport-pr81728.patch | 181 ---------------------------- rustc-1.51.0-backport-pr81741.patch | 44 ------- rustc-1.51.0-backport-pr81910.patch | 48 -------- rustc-1.51.0-backport-pr82289.patch | 96 --------------- rustc-1.51.0-backport-pr82292.patch | 120 ------------------ rustc-1.51.0-backport-pr83629.patch | 142 ---------------------- sources | 2 +- sources-bootstrap | 14 +-- 10 files changed, 27 insertions(+), 681 deletions(-) delete mode 100644 rustc-1.51.0-backport-pr81728.patch delete mode 100644 rustc-1.51.0-backport-pr81741.patch delete mode 100644 rustc-1.51.0-backport-pr81910.patch delete mode 100644 rustc-1.51.0-backport-pr82289.patch delete mode 100644 rustc-1.51.0-backport-pr82292.patch delete mode 100644 rustc-1.51.0-backport-pr83629.patch diff --git a/.gitignore b/.gitignore index d00b69d..87b82f1 100644 --- a/.gitignore +++ b/.gitignore @@ -335,3 +335,10 @@ /rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.50.0-s390x-unknown-linux-gnu.tar.xz /rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.52.0-src.tar.xz +/rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.51.0-i686-unknown-linux-gnu.tar.xz +/rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.51.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index a0973b1..a0d1851 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.50.0 -%global bootstrap_cargo 1.50.0 -%global bootstrap_channel 1.50.0 -%global bootstrap_date 2021-02-11 +%global bootstrap_rust 1.51.0 +%global bootstrap_cargo 1.51.0 +%global bootstrap_channel 1.51.0 +%global bootstrap_date 2021-03-25 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -52,8 +52,8 @@ %endif Name: rust -Version: 1.51.0 -Release: 3%{?dist} +Version: 1.52.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -71,30 +71,6 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 Patch1: 0001-Revert-Auto-merge-of-79547.patch -# CVE-2021-28876 rust: panic safety issue in Zip implementation -# https://github.com/rust-lang/rust/pull/81741 -Patch2: rustc-1.51.0-backport-pr81741.patch - -# CVE-2021-28879 rust: integer overflow in the Zip implementation can lead to a buffer overflow -# https://github.com/rust-lang/rust/pull/82289 -Patch3: rustc-1.51.0-backport-pr82289.patch - -# CVE-2021-28878 rust: memory safety violation in Zip implementation when next_back() and next() are used together -# https://github.com/rust-lang/rust/pull/82292 -Patch4: rustc-1.51.0-backport-pr82292.patch - -# Fix bootstrap for stage0 rust 1.51 -# https://github.com/rust-lang/rust/pull/81910 -Patch5: rustc-1.51.0-backport-pr81910.patch - -# CVE-2020-36323 rust: optimization for joining strings can cause uninitialized bytes to be exposed -# https://github.com/rust-lang/rust/pull/81728 -Patch6: rustc-1.51.0-backport-pr81728.patch - -# CVE-2021-31162 rust: double free in Vec::from_iter function if freeing the element panics -# https://github.com/rust-lang/rust/pull/83629 -Patch7: rustc-1.51.0-backport-pr83629.patch - ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -188,17 +164,13 @@ BuildRequires: pkgconfig(libssh2) >= 1.6.0 BuildRequires: %{python} %if %with bundled_llvm -BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 11.0.1 +BuildRequires: cmake3 >= 3.13.4 +Provides: bundled(llvm) = 12.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm9.0 %endif -%if 0%{?fedora} >= 34 -# we're not ready for llvm-12 yet -%global llvm llvm11 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -429,12 +401,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -713,6 +679,7 @@ export %{rust_env} %{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg %{_docdir}/%{name}/html/*.woff +%{_docdir}/%{name}/html/*.woff2 %license %{_docdir}/%{name}/html/*.txt %license %{_docdir}/%{name}/html/*.md @@ -765,6 +732,9 @@ export %{rust_env} %changelog +* 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 diff --git a/rustc-1.51.0-backport-pr81728.patch b/rustc-1.51.0-backport-pr81728.patch deleted file mode 100644 index 20373f4..0000000 --- a/rustc-1.51.0-backport-pr81728.patch +++ /dev/null @@ -1,181 +0,0 @@ -From 70f17ca715d3d7e2fd79cc909b95fd3a6357c13e Mon Sep 17 00:00:00 2001 -From: Yechan Bae -Date: Wed, 3 Feb 2021 16:36:33 -0500 -Subject: [PATCH 1/2] Fixes #80335 - ---- - library/alloc/src/str.rs | 42 ++++++++++++++++++++++---------------- - library/alloc/tests/str.rs | 30 +++++++++++++++++++++++++++ - 2 files changed, 54 insertions(+), 18 deletions(-) - -diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs -index 70e0c7dba5ea..a7584c6b6510 100644 ---- a/library/alloc/src/str.rs -+++ b/library/alloc/src/str.rs -@@ -90,8 +90,8 @@ fn join(slice: &Self, sep: &str) -> String { - } - } - --macro_rules! spezialize_for_lengths { -- ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => { -+macro_rules! specialize_for_lengths { -+ ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => {{ - let mut target = $target; - let iter = $iter; - let sep_bytes = $separator; -@@ -102,7 +102,8 @@ macro_rules! spezialize_for_lengths { - $num => { - for s in iter { - copy_slice_and_advance!(target, sep_bytes); -- copy_slice_and_advance!(target, s.borrow().as_ref()); -+ let content_bytes = s.borrow().as_ref(); -+ copy_slice_and_advance!(target, content_bytes); - } - }, - )* -@@ -110,11 +111,13 @@ macro_rules! spezialize_for_lengths { - // arbitrary non-zero size fallback - for s in iter { - copy_slice_and_advance!(target, sep_bytes); -- copy_slice_and_advance!(target, s.borrow().as_ref()); -+ let content_bytes = s.borrow().as_ref(); -+ copy_slice_and_advance!(target, content_bytes); - } - } - } -- }; -+ target -+ }} - } - - macro_rules! copy_slice_and_advance { -@@ -153,7 +156,7 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec - // if the `len` calculation overflows, we'll panic - // we would have run out of memory anyway and the rest of the function requires - // the entire Vec pre-allocated for safety -- let len = sep_len -+ let reserved_len = sep_len - .checked_mul(iter.len()) - .and_then(|n| { - slice.iter().map(|s| s.borrow().as_ref().len()).try_fold(n, usize::checked_add) -@@ -161,22 +164,25 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec - .expect("attempt to join into collection with len > usize::MAX"); - - // crucial for safety -- let mut result = Vec::with_capacity(len); -- assert!(result.capacity() >= len); -+ let mut result = Vec::with_capacity(reserved_len); -+ debug_assert!(result.capacity() >= reserved_len); - - result.extend_from_slice(first.borrow().as_ref()); - - unsafe { -- { -- let pos = result.len(); -- let target = result.get_unchecked_mut(pos..len); -- -- // copy separator and slices over without bounds checks -- // generate loops with hardcoded offsets for small separators -- // massive improvements possible (~ x2) -- spezialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); -- } -- result.set_len(len); -+ let pos = result.len(); -+ let target = result.get_unchecked_mut(pos..reserved_len); -+ -+ // copy separator and slices over without bounds checks -+ // generate loops with hardcoded offsets for small separators -+ // massive improvements possible (~ x2) -+ let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); -+ -+ // issue #80335: A weird borrow implementation can return different -+ // slices for the length calculation and the actual copy, so -+ // `remain.len()` might be non-zero. -+ let result_len = reserved_len - remain.len(); -+ result.set_len(result_len); - } - result - } -diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs -index 604835e6cc4a..6df8d8c2f354 100644 ---- a/library/alloc/tests/str.rs -+++ b/library/alloc/tests/str.rs -@@ -160,6 +160,36 @@ fn test_join_for_different_lengths_with_long_separator() { - test_join!("~~~~~a~~~~~bc", ["", "a", "bc"], "~~~~~"); - } - -+#[test] -+fn test_join_isue_80335() { -+ use core::{borrow::Borrow, cell::Cell}; -+ -+ struct WeirdBorrow { -+ state: Cell, -+ } -+ -+ impl Default for WeirdBorrow { -+ fn default() -> Self { -+ WeirdBorrow { state: Cell::new(false) } -+ } -+ } -+ -+ impl Borrow for WeirdBorrow { -+ fn borrow(&self) -> &str { -+ let state = self.state.get(); -+ if state { -+ "0" -+ } else { -+ self.state.set(true); -+ "123456" -+ } -+ } -+ } -+ -+ let arr: [WeirdBorrow; 3] = Default::default(); -+ test_join!("0-0-0", arr, "-"); -+} -+ - #[test] - #[cfg_attr(miri, ignore)] // Miri is too slow - fn test_unsafe_slice() { --- -2.31.1 - - -From 10020817d2e6756be1ff2ac3c182af97cf7fe904 Mon Sep 17 00:00:00 2001 -From: Yechan Bae -Date: Sat, 20 Mar 2021 13:42:54 -0400 -Subject: [PATCH 2/2] Update the comment - ---- - library/alloc/src/str.rs | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs -index a7584c6b6510..4d1e876457b8 100644 ---- a/library/alloc/src/str.rs -+++ b/library/alloc/src/str.rs -@@ -163,7 +163,7 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec - }) - .expect("attempt to join into collection with len > usize::MAX"); - -- // crucial for safety -+ // prepare an uninitialized buffer - let mut result = Vec::with_capacity(reserved_len); - debug_assert!(result.capacity() >= reserved_len); - -@@ -178,9 +178,9 @@ fn join_generic_copy(slice: &[S], sep: &[T]) -> Vec - // massive improvements possible (~ x2) - let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); - -- // issue #80335: A weird borrow implementation can return different -- // slices for the length calculation and the actual copy, so -- // `remain.len()` might be non-zero. -+ // A weird borrow implementation may return different -+ // slices for the length calculation and the actual copy. -+ // Make sure we don't expose uninitialized bytes to the caller. - let result_len = reserved_len - remain.len(); - result.set_len(result_len); - } --- -2.31.1 - diff --git a/rustc-1.51.0-backport-pr81741.patch b/rustc-1.51.0-backport-pr81741.patch deleted file mode 100644 index 8ef22ee..0000000 --- a/rustc-1.51.0-backport-pr81741.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 40d3f2d7ef5835317fe9df9ecc01f4c363def4fd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= -Date: Thu, 4 Feb 2021 10:23:01 +0200 -Subject: [PATCH] Increment `self.index` before calling - `Iterator::self.a.__iterator_get_unchecked` in `Zip` `TrustedRandomAccess` - specialization - -Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the -index would not have been incremented yet and another call to -`Iterator::next` would read from the same index again, which is not -allowed according to the API contract of `TrustedRandomAccess` for -`!Clone`. - -Fixes https://github.com/rust-lang/rust/issues/81740 - -(cherry picked from commit 86a4b27475aab52b998c15f5758540697cc9cff0) ---- - library/core/src/iter/adapters/zip.rs | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index 98b8dca96140..9f9835345200 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -198,12 +198,13 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { - Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) - } - } else if A::may_have_side_effect() && self.index < self.a.size() { -+ let i = self.index; -+ self.index += 1; - // match the base implementation's potential side effects -- // SAFETY: we just checked that `self.index` < `self.a.len()` -+ // SAFETY: we just checked that `i` < `self.a.len()` - unsafe { -- self.a.__iterator_get_unchecked(self.index); -+ self.a.__iterator_get_unchecked(i); - } -- self.index += 1; - None - } else { - None --- -2.31.1 - diff --git a/rustc-1.51.0-backport-pr81910.patch b/rustc-1.51.0-backport-pr81910.patch deleted file mode 100644 index e2f91b6..0000000 --- a/rustc-1.51.0-backport-pr81910.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 852684d306cee955ed751f1e8d8eec6adaecff3b Mon Sep 17 00:00:00 2001 -From: Joshua Nelson -Date: Mon, 8 Feb 2021 22:51:21 -0500 -Subject: [PATCH] Use format string in bootstrap panic instead of a string - directly - -This fixes the following warning when compiling with nightly: - -``` -warning: panic message is not a string literal - --> src/bootstrap/builder.rs:1515:24 - | -1515 | panic!(out); - | ^^^ - | - = note: `#[warn(non_fmt_panic)]` on by default - = note: this is no longer accepted in Rust 2021 -help: add a "{}" format string to Display the message - | -1515 | panic!("{}", out); - | ^^^^^ -help: or use std::panic::panic_any instead - | -1515 | std::panic::panic_any(out); - | ^^^^^^^^^^^^^^^^^^^^^^ -``` - -(cherry picked from commit 31c93397bde772764cda3058e16f9cef61895090) ---- - src/bootstrap/builder.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index f1a160250dbe..0f5fcb4af400 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -1490,7 +1490,7 @@ pub fn ensure(&'a self, step: S) -> S::Output { - for el in stack.iter().rev() { - out += &format!("\t{:?}\n", el); - } -- panic!(out); -+ panic!("{}", out); - } - if let Some(out) = self.cache.get(&step) { - self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step)); --- -2.31.1 - diff --git a/rustc-1.51.0-backport-pr82289.patch b/rustc-1.51.0-backport-pr82289.patch deleted file mode 100644 index 5cf5433..0000000 --- a/rustc-1.51.0-backport-pr82289.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 5222e2ba2d97cd716a379b4ae6bc62c5f7c2dd36 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato -Date: Fri, 19 Feb 2021 12:15:37 +0100 -Subject: [PATCH 1/3] Increment self.len in specialized ZipImpl to avoid - underflow in size_hint - -(cherry picked from commit 66a260617a88ed1ad55a46f03c5a90d5ad3004d3) ---- - library/core/src/iter/adapters/zip.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index 9f9835345200..f08bfac837fe 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -200,6 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { - } else if A::may_have_side_effect() && self.index < self.a.size() { - let i = self.index; - self.index += 1; -+ self.len += 1; - // match the base implementation's potential side effects - // SAFETY: we just checked that `i` < `self.a.len()` - unsafe { --- -2.31.1 - - -From d39669fc8282830a374d19d204f7b4ee8eb1e381 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato -Date: Fri, 19 Feb 2021 12:16:12 +0100 -Subject: [PATCH 2/3] Add test for underflow in specialized Zip's size_hint - -(cherry picked from commit 8b9ac4d4155c74db5b317046033ab9c05a09e351) ---- - library/core/tests/iter/adapters/zip.rs | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs -index 1fce0951e365..a59771039295 100644 ---- a/library/core/tests/iter/adapters/zip.rs -+++ b/library/core/tests/iter/adapters/zip.rs -@@ -245,3 +245,23 @@ fn test_double_ended_zip() { - assert_eq!(it.next_back(), Some((3, 3))); - assert_eq!(it.next(), None); - } -+ -+#[test] -+fn test_issue_82282() { -+ fn overflowed_zip(arr: &[i32]) -> impl Iterator { -+ static UNIT_EMPTY_ARR: [(); 0] = []; -+ -+ let mapped = arr.into_iter().map(|i| *i); -+ let mut zipped = mapped.zip(UNIT_EMPTY_ARR.iter()); -+ zipped.next(); -+ zipped -+ } -+ -+ let arr = [1, 2, 3]; -+ let zip = overflowed_zip(&arr).zip(overflowed_zip(&arr)); -+ -+ assert_eq!(zip.size_hint(), (0, Some(0))); -+ for _ in zip { -+ panic!(); -+ } -+} --- -2.31.1 - - -From 4b382167dd5ed5a6eac0cf314bfb86e3704b6e76 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato -Date: Fri, 19 Feb 2021 12:17:48 +0100 -Subject: [PATCH 3/3] Remove useless comparison since now self.index <= - self.len is an invariant - -(cherry picked from commit aeb4ea739efb70e0002a4a9c4c7b8027dd0620b3) ---- - library/core/src/iter/adapters/zip.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index f08bfac837fe..dcbcb1ce7200 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -261,7 +261,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> - if sz_a != sz_b { - let sz_a = self.a.size(); - if a_side_effect && sz_a > self.len { -- for _ in 0..sz_a - cmp::max(self.len, self.index) { -+ for _ in 0..sz_a - self.len { - self.a.next_back(); - } - } --- -2.31.1 - diff --git a/rustc-1.51.0-backport-pr82292.patch b/rustc-1.51.0-backport-pr82292.patch deleted file mode 100644 index 4baf72a..0000000 --- a/rustc-1.51.0-backport-pr82292.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 0babb88efc4d36f3defafc3c3c0343793fa05d52 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato -Date: Wed, 3 Mar 2021 21:09:01 +0100 -Subject: [PATCH 1/2] Prevent Zip specialization from calling - __iterator_get_unchecked twice with the same index after calling next_back - -(cherry picked from commit 2371914a05f8f2763dffe6e2511d0870bcd6b461) ---- - library/core/src/iter/adapters/zip.rs | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index dcbcb1ce7200..7dac0c63ca2d 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -13,9 +13,10 @@ - pub struct Zip { - a: A, - b: B, -- // index and len are only used by the specialized version of zip -+ // index, len and a_len are only used by the specialized version of zip - index: usize, - len: usize, -+ a_len: usize, - } - impl Zip { - pub(in crate::iter) fn new(a: A, b: B) -> Zip { -@@ -110,6 +111,7 @@ impl ZipImpl for Zip - b, - index: 0, // unused - len: 0, // unused -+ a_len: 0, // unused - } - } - -@@ -184,8 +186,9 @@ impl ZipImpl for Zip - B: TrustedRandomAccess + Iterator, - { - fn new(a: A, b: B) -> Self { -- let len = cmp::min(a.size(), b.size()); -- Zip { a, b, index: 0, len } -+ let a_len = a.size(); -+ let len = cmp::min(a_len, b.size()); -+ Zip { a, b, index: 0, len, a_len } - } - - #[inline] -@@ -197,7 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { - unsafe { - Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) - } -- } else if A::may_have_side_effect() && self.index < self.a.size() { -+ } else if A::may_have_side_effect() && self.index < self.a_len { - let i = self.index; - self.index += 1; - self.len += 1; -@@ -264,6 +267,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> - for _ in 0..sz_a - self.len { - self.a.next_back(); - } -+ self.a_len = self.len; - } - let sz_b = self.b.size(); - if b_side_effect && sz_b > self.len { -@@ -275,6 +279,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> - } - if self.index < self.len { - self.len -= 1; -+ self.a_len -= 1; - let i = self.len; - // SAFETY: `i` is smaller than the previous value of `self.len`, - // which is also smaller than or equal to `self.a.len()` and `self.b.len()` --- -2.31.1 - - -From 19af66a6f3e2bbb4780bb9eae7eb53bd13e3dd0f Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato -Date: Fri, 19 Feb 2021 15:25:09 +0100 -Subject: [PATCH 2/2] Add relevant test - -(cherry picked from commit c1bfb9a78db6d481be1d03355672712c766e20b0) ---- - library/core/tests/iter/adapters/zip.rs | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs -index a59771039295..000c15f72c88 100644 ---- a/library/core/tests/iter/adapters/zip.rs -+++ b/library/core/tests/iter/adapters/zip.rs -@@ -265,3 +265,26 @@ fn overflowed_zip(arr: &[i32]) -> impl Iterator { - panic!(); - } - } -+ -+#[test] -+fn test_issue_82291() { -+ use std::cell::Cell; -+ -+ let mut v1 = [()]; -+ let v2 = [()]; -+ -+ let called = Cell::new(0); -+ -+ let mut zip = v1 -+ .iter_mut() -+ .map(|r| { -+ called.set(called.get() + 1); -+ r -+ }) -+ .zip(&v2); -+ -+ zip.next_back(); -+ assert_eq!(called.get(), 1); -+ zip.next(); -+ assert_eq!(called.get(), 1); -+} --- -2.31.1 - diff --git a/rustc-1.51.0-backport-pr83629.patch b/rustc-1.51.0-backport-pr83629.patch deleted file mode 100644 index 7f68d95..0000000 --- a/rustc-1.51.0-backport-pr83629.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 3834e7b7393bf1a0d7df02ccd1d2e896c1465769 Mon Sep 17 00:00:00 2001 -From: The8472 -Date: Mon, 29 Mar 2021 04:22:34 +0200 -Subject: [PATCH 1/2] add testcase for double-drop during Vec in-place - collection - ---- - library/alloc/tests/vec.rs | 38 +++++++++++++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs -index 5c7ff67bc621..4cdb7eefcdf1 100644 ---- a/library/alloc/tests/vec.rs -+++ b/library/alloc/tests/vec.rs -@@ -954,7 +954,7 @@ fn test_from_iter_specialization_head_tail_drop() { - } - - #[test] --fn test_from_iter_specialization_panic_drop() { -+fn test_from_iter_specialization_panic_during_iteration_drops() { - let drop_count: Vec<_> = (0..=2).map(|_| Rc::new(())).collect(); - let src: Vec<_> = drop_count.iter().cloned().collect(); - let iter = src.into_iter(); -@@ -977,6 +977,42 @@ fn test_from_iter_specialization_panic_drop() { - ); - } - -+#[test] -+fn test_from_iter_specialization_panic_during_drop_leaks() { -+ static mut DROP_COUNTER: usize = 0; -+ -+ #[derive(Debug)] -+ enum Droppable { -+ DroppedTwice(Box), -+ PanicOnDrop, -+ } -+ -+ impl Drop for Droppable { -+ fn drop(&mut self) { -+ match self { -+ Droppable::DroppedTwice(_) => { -+ unsafe { -+ DROP_COUNTER += 1; -+ } -+ println!("Dropping!") -+ } -+ Droppable::PanicOnDrop => { -+ if !std::thread::panicking() { -+ panic!(); -+ } -+ } -+ } -+ } -+ } -+ -+ let _ = std::panic::catch_unwind(AssertUnwindSafe(|| { -+ let v = vec![Droppable::DroppedTwice(Box::new(123)), Droppable::PanicOnDrop]; -+ let _ = v.into_iter().take(0).collect::>(); -+ })); -+ -+ assert_eq!(unsafe { DROP_COUNTER }, 1); -+} -+ - #[test] - fn test_cow_from() { - let borrowed: &[_] = &["borrowed", "(slice)"]; --- -2.31.1 - - -From 8e2706343e1ce1c5a2d3a2ceaaaa010aaeb21d93 Mon Sep 17 00:00:00 2001 -From: The8472 -Date: Mon, 29 Mar 2021 04:22:48 +0200 -Subject: [PATCH 2/2] fix double-drop in in-place collect specialization - ---- - library/alloc/src/vec/into_iter.rs | 27 ++++++++++++++------- - library/alloc/src/vec/source_iter_marker.rs | 4 +-- - 2 files changed, 20 insertions(+), 11 deletions(-) - -diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs -index f131d06bb18f..74adced53f6d 100644 ---- a/library/alloc/src/vec/into_iter.rs -+++ b/library/alloc/src/vec/into_iter.rs -@@ -85,20 +85,29 @@ fn as_raw_mut_slice(&mut self) -> *mut [T] { - ptr::slice_from_raw_parts_mut(self.ptr as *mut T, self.len()) - } - -- pub(super) fn drop_remaining(&mut self) { -- unsafe { -- ptr::drop_in_place(self.as_mut_slice()); -- } -- self.ptr = self.end; -- } -+ /// Drops remaining elements and relinquishes the backing allocation. -+ /// -+ /// This is roughly equivalent to the following, but more efficient -+ /// -+ /// ``` -+ /// # let mut into_iter = Vec::::with_capacity(10).into_iter(); -+ /// (&mut into_iter).for_each(core::mem::drop); -+ /// unsafe { core::ptr::write(&mut into_iter, Vec::new().into_iter()); } -+ /// ``` -+ pub(super) fn forget_allocation_drop_remaining(&mut self) { -+ let remaining = self.as_raw_mut_slice(); - -- /// Relinquishes the backing allocation, equivalent to -- /// `ptr::write(&mut self, Vec::new().into_iter())` -- pub(super) fn forget_allocation(&mut self) { -+ // overwrite the individual fields instead of creating a new -+ // struct and then overwriting &mut self. -+ // this creates less assembly - self.cap = 0; - self.buf = unsafe { NonNull::new_unchecked(RawVec::NEW.ptr()) }; - self.ptr = self.buf.as_ptr(); - self.end = self.buf.as_ptr(); -+ -+ unsafe { -+ ptr::drop_in_place(remaining); -+ } - } - } - -diff --git a/library/alloc/src/vec/source_iter_marker.rs b/library/alloc/src/vec/source_iter_marker.rs -index 8c0e95559fa1..9301f7a5184e 100644 ---- a/library/alloc/src/vec/source_iter_marker.rs -+++ b/library/alloc/src/vec/source_iter_marker.rs -@@ -78,9 +78,9 @@ impl SpecFromIter for Vec - } - - // drop any remaining values at the tail of the source -- src.drop_remaining(); - // but prevent drop of the allocation itself once IntoIter goes out of scope -- src.forget_allocation(); -+ // if the drop panics then we also leak any elements collected into dst_buf -+ src.forget_allocation_drop_remaining(); - - let vec = unsafe { - let len = dst.offset_from(dst_buf) as usize; --- -2.31.1 - diff --git a/sources b/sources index 9834690..b2cbcac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.51.0-src.tar.xz) = ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df +SHA512 (rustc-1.52.0-src.tar.xz) = 27e18e5f33b67b85eeda1a747846b4839e3891265b4a9356861a1ed628e84ff723be0df470a6f21e7a1e893f348c38a4df5d1c541640a2699e015bdb622cae83 diff --git a/sources-bootstrap b/sources-bootstrap index 2ad0ad0..fb17cbc 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,7 +1,7 @@ -SHA512 (rustc-1.51.0-src.tar.xz) = ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df -SHA512 (rust-1.50.0-aarch64-unknown-linux-gnu.tar.xz) = e6b409afc8e85a88ecb9ff439a6eb9dcb93d5553e81549fb4f332b9e2d946dce0424319c5092e60aab9435944af70d0117d15c12d54d2059ef73c1fdf36d8273 -SHA512 (rust-1.50.0-armv7-unknown-linux-gnueabihf.tar.xz) = c3314436afc4ebed697bf6828b9eacbc12f96838b156241331a3b71e99e1438f8ad82e701615ea302ebfc459464479442fe653232bd319cf824027362438970d -SHA512 (rust-1.50.0-i686-unknown-linux-gnu.tar.xz) = bff117733d11731f56e8659265d0b47327e2af3f7c46aca494747a92b4f634dd35fa9731a1be59dd69821042f88bded253e1d7b5693ca237c9a167408ca7f898 -SHA512 (rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz) = e3dc75ba7dff3a358042542afa398ec8771a23f5f699454a876ddc1f3583d399fe5350696a5da62d71ca97ea882c9ae1fcb60dc2e9fdf76bc7a9af892096371e -SHA512 (rust-1.50.0-s390x-unknown-linux-gnu.tar.xz) = 733513af2a7ef7a782a5ebfbd080071194ac47084022b54b4830de84facef9986d65525f8666a4c226e9878e43b00ebced26d6077e5fb1b7f775ac8f290fba97 -SHA512 (rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz) = ab49e3ecb14e4af8e48548845184e9ab3d564ab2341c1e5462b7847347c79d13324211b860988d219ccb646143bf142fb14c3ab03663b06cfe9ca275128d9fa0 +SHA512 (rustc-1.52.0-src.tar.xz) = 27e18e5f33b67b85eeda1a747846b4839e3891265b4a9356861a1ed628e84ff723be0df470a6f21e7a1e893f348c38a4df5d1c541640a2699e015bdb622cae83 +SHA512 (rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz) = 2af31290e1065a4611f34e6cc8c62ee494c222becfb21ec6707059c119069b0adf0eec23e56bad4a3cc8690b2556309ec58cbd9003a959983689cc46c7c63361 +SHA512 (rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz) = c602dcc7fd1343b310f5e3074bf63f2428ca7c15cdce8999fa4655de5a4bda5a13255fc12bee3d0632f6cb93220a883fb36d24061dca6795d23afa9f8fdae57f +SHA512 (rust-1.51.0-i686-unknown-linux-gnu.tar.xz) = 05d08e44827dcba8197667deb9a7f3584465085ce1b79a38deb138849a07c716646a70f1cc2cee02b41c45ec7c3a3b7800a3fae62ebe04d6f72f017a5d722bab +SHA512 (rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz) = b53a741d1d75637fb31ddb0364e1f91427c3818ca145f819b906d13c32c638ae77fbaa567a6220b6bf69f38cc00d2b95615778a86f4acadd63efe2e62b1b01ef +SHA512 (rust-1.51.0-s390x-unknown-linux-gnu.tar.xz) = a72ad31c6306f939c4f963133ddc0b3fabc9e506bdff5e318f5275658b7271a675a51d208d306d94fb01739cbcf0f62f018fc7490ca6db54b301852202749d16 +SHA512 (rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz) = 9f95045119bcd5ef7be54f5b5bdc9ebc6bd6c48437d90762a1cfbc03281882f81087e1877eecae9573ba5e7cd7c11ef5fed979034c57f45b6547cbfeb11eef6d From 6231b0ba09849b395657b860bbd6e92ac8457766 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 7 May 2021 11:20:45 -0700 Subject: [PATCH 043/222] Fall back to LLVM 11 on f34 for now... --- rust.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust.spec b/rust.spec index a0d1851..e5b933f 100644 --- a/rust.spec +++ b/rust.spec @@ -171,6 +171,11 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm9.0 %endif +%if 0%{?fedora} == 34 +# aarch64 is hanging with LLVM 12-rc1, but it's fine with 12-final on rawhide. +# Fall back to LLVM 11 on f34 for now... +%global llvm llvm11 +%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else From a8550e8fec7ce6fb82f6cd34082a628bfba6614c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 10 May 2021 10:39:06 -0700 Subject: [PATCH 044/222] Update to 1.52.1. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- sources-bootstrap | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 87b82f1..98a8066 100644 --- a/.gitignore +++ b/.gitignore @@ -342,3 +342,4 @@ /rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.51.0-s390x-unknown-linux-gnu.tar.xz /rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.52.1-src.tar.xz diff --git a/rust.spec b/rust.spec index e5b933f..2886605 100644 --- a/rust.spec +++ b/rust.spec @@ -52,7 +52,7 @@ %endif Name: rust -Version: 1.52.0 +Version: 1.52.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -737,6 +737,9 @@ export %{rust_env} %changelog +* 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. diff --git a/sources b/sources index b2cbcac..0ec5511 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.52.0-src.tar.xz) = 27e18e5f33b67b85eeda1a747846b4839e3891265b4a9356861a1ed628e84ff723be0df470a6f21e7a1e893f348c38a4df5d1c541640a2699e015bdb622cae83 +SHA512 (rustc-1.52.1-src.tar.xz) = 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c diff --git a/sources-bootstrap b/sources-bootstrap index fb17cbc..cc52865 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.52.0-src.tar.xz) = 27e18e5f33b67b85eeda1a747846b4839e3891265b4a9356861a1ed628e84ff723be0df470a6f21e7a1e893f348c38a4df5d1c541640a2699e015bdb622cae83 +SHA512 (rustc-1.52.1-src.tar.xz) = 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c SHA512 (rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz) = 2af31290e1065a4611f34e6cc8c62ee494c222becfb21ec6707059c119069b0adf0eec23e56bad4a3cc8690b2556309ec58cbd9003a959983689cc46c7c63361 SHA512 (rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz) = c602dcc7fd1343b310f5e3074bf63f2428ca7c15cdce8999fa4655de5a4bda5a13255fc12bee3d0632f6cb93220a883fb36d24061dca6795d23afa9f8fdae57f SHA512 (rust-1.51.0-i686-unknown-linux-gnu.tar.xz) = 05d08e44827dcba8197667deb9a7f3584465085ce1b79a38deb138849a07c716646a70f1cc2cee02b41c45ec7c3a3b7800a3fae62ebe04d6f72f017a5d722bab From 078a6925f5f5a7c9e916c41c33e8457e8ac257af Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 14 May 2021 12:49:12 -0700 Subject: [PATCH 045/222] Rebuild f34 with LLVM 12. --- rust.spec | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rust.spec b/rust.spec index 2886605..2f4f48a 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.52.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -171,11 +171,6 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm9.0 %endif -%if 0%{?fedora} == 34 -# aarch64 is hanging with LLVM 12-rc1, but it's fine with 12-final on rawhide. -# Fall back to LLVM 11 on f34 for now... -%global llvm llvm11 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -737,6 +732,9 @@ export %{rust_env} %changelog +* Fri May 14 2021 Josh Stone - 1.52.1-2 +- Rebuild f34 with LLVM 12. + * Mon May 10 2021 Josh Stone - 1.52.1-1 - Update to 1.52.1. From fa5bf8c5987d08539e2d8b27ab7f1ebda798ab0b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 2 Jun 2021 15:27:05 -0700 Subject: [PATCH 046/222] Set rust.codegen-units-std=1 for all targets again. --- rust.spec | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rust.spec b/rust.spec index 2886605..a084245 100644 --- a/rust.spec +++ b/rust.spec @@ -53,7 +53,7 @@ Name: rust Version: 1.52.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -510,13 +510,6 @@ export %{rust_env} %define enable_debuginfo --debuginfo-level=2 %endif -# We want the best optimization for std, but it caused problems for rpm-ostree -# on ppc64le to have all of the compiler_builtins in a single object: -# https://bugzilla.redhat.com/show_bug.cgi?id=1713090 -%ifnarch %{power64} -%define codegen_units_std --set rust.codegen-units-std=1 -%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) @@ -535,6 +528,7 @@ fi %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-rpath \ %{enable_debuginfo} \ + --set rust.codegen-units-std=1 \ --enable-extended \ --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ @@ -737,6 +731,9 @@ export %{rust_env} %changelog +* Wed Jun 02 2021 Josh Stone - 1.52.1-2 +- Set rust.codegen-units-std=1 for all targets again. + * Mon May 10 2021 Josh Stone - 1.52.1-1 - Update to 1.52.1. From ebd24b39176265e2d001250dc279293a23b6a79c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 2 Jun 2021 15:27:34 -0700 Subject: [PATCH 047/222] Add rust-std-static-wasm32-unknown-unknown. This change is partly based on an older pull request: https://src.fedoraproject.org/rpms/rust/pull-request/6 Co-authored-by: Ivan Mironov --- ...-Use-lld-provided-by-system-for-wasm.patch | 26 ++++++ rust.spec | 89 +++++++++++++++++-- 2 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 0001-Use-lld-provided-by-system-for-wasm.patch diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch new file mode 100644 index 0000000..ff126cc --- /dev/null +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -0,0 +1,26 @@ +From 1a6307bbf7972aa2ce89a213bad6f26b6325a59c Mon Sep 17 00:00:00 2001 +From: Ivan Mironov +Date: Sun, 8 Dec 2019 17:23:08 +0500 +Subject: [PATCH] Use lld provided by system for wasm + +--- + compiler/rustc_target/src/spec/wasm32_base.rs | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/compiler/rustc_target/src/spec/wasm32_base.rs b/compiler/rustc_target/src/spec/wasm32_base.rs +index bfef3d37228f..0ecb29248fe2 100644 +--- a/compiler/rustc_target/src/spec/wasm32_base.rs ++++ b/compiler/rustc_target/src/spec/wasm32_base.rs +@@ -97,8 +97,7 @@ pub fn options() -> TargetOptions { + // arguments just yet + limit_rdylib_exports: false, + +- // we use the LLD shipped with the Rust toolchain by default +- linker: Some("rust-lld".to_owned()), ++ linker: Some("lld".to_owned()), + lld_flavor: LldFlavor::Wasm, + + // No need for indirection here, simd types can always be passed by +-- +2.31.1 + diff --git a/rust.spec b/rust.spec index a084245..b508e36 100644 --- a/rust.spec +++ b/rust.spec @@ -17,6 +17,15 @@ # Only the specified arches will use bootstrap binaries. #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 cross_targets wasm32-unknown-unknown +%endif +%endif + # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static @@ -71,6 +80,9 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 Patch1: 0001-Revert-Auto-merge-of-79547.patch +# By default, rust tries to use "rust-lld" as a linker for WebAssembly. +Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -235,6 +247,19 @@ Requires: /usr/bin/cc %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 +%global rustlibdir %{common_libdir}/rustlib + +%if %defined cross_targets +# brp-strip-static-archive breaks the archive index for wasm +%global __os_install_post \ +%__os_install_post \ +find %{buildroot}%{rustlibdir} -type f -path '*/wasm*/lib/*.rlib' -exec ranlib '{}' ';' \ +%{nil} +%endif + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -249,6 +274,32 @@ Summary: Standard library for Rust This package includes the standard libraries for building applications written in Rust. +%if %defined cross_targets +%{lua: do + for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + local requires = rpm.expand("Requires: rust = %{version}-%{release}") + if string.sub(triple, 1, 4) == "wasm" then + requires = requires .. "\nRequires: lld >= 8.0" + end + local subs = { + triple = triple, + requires = requires, + } + local s = string.gsub([[ +%package std-static-{{triple}} +Summary: Standard library for Rust +BuildArch: noarch +{{requires}} + +%description std-static-{{triple}} +This package includes the standard libraries for building applications +written in Rust for the {{triple}} target. +]], "{{(%w+)}}", subs) + print(s) + end +end} +%endif + %package debugger-common Summary: Common debugger pretty printers for Rust @@ -406,6 +457,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 +%patch2 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -491,11 +543,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %build export %{rust_env} -# 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 -%global rustlibdir %{common_libdir}/rustlib - %ifarch %{arm} %{ix86} s390x # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 @@ -540,12 +587,23 @@ fi %{python} ./x.py build -j "$ncpus" --stage 2 %{python} ./x.py doc --stage 2 +%if %defined cross_targets +for triple in %{cross_targets}; do + %{python} ./x.py build --stage 2 --target=$triple std +done +%endif %install export %{rust_env} DESTDIR=%{buildroot} %{python} ./x.py install +%if %defined cross_targets +for triple in %{cross_targets}; do + DESTDIR=%{buildroot} %{python} ./x.py install --target=$triple std +done +%endif + # Make sure the shared libraries are in the proper libdir %if "%{_libdir}" != "%{common_libdir}" mkdir -p %{buildroot}%{_libdir} @@ -648,6 +706,26 @@ export %{rust_env} %{rustlibdir}/%{rust_triple}/lib/*.rlib +%if %defined cross_targets +%{lua: do + for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + local subs = { + triple = triple, + rustlibdir = rpm.expand("%{rustlibdir}"), + } + local s = string.gsub([[ +%files std-static-{{triple}} +%dir {{rustlibdir}} +%dir {{rustlibdir}}/{{triple}} +%dir {{rustlibdir}}/{{triple}}/lib +{{rustlibdir}}/{{triple}}/lib/*.rlib +]], "{{(%w+)}}", subs) + print(s) + end +end} +%endif + + %files debugger-common %dir %{rustlibdir} %dir %{rustlibdir}/etc @@ -733,6 +811,7 @@ export %{rust_env} %changelog * 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. * Mon May 10 2021 Josh Stone - 1.52.1-1 - Update to 1.52.1. From d498bc15d8366cb20ef33c6a8ad2fb797bc6ecd0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 17 Jun 2021 10:45:34 -0700 Subject: [PATCH 048/222] Update to 1.53.0. --- .gitignore | 7 +++++ ...-Use-lld-provided-by-system-for-wasm.patch | 14 +++++----- rust.spec | 23 +++++++++------- ....patch => rustc-1.53.0-disable-http2.patch | 26 +++++++++---------- sources | 2 +- sources-bootstrap | 14 +++++----- 6 files changed, 48 insertions(+), 38 deletions(-) rename rustc-1.51.0-disable-http2.patch => rustc-1.53.0-disable-http2.patch (72%) diff --git a/.gitignore b/.gitignore index 98a8066..dec69a4 100644 --- a/.gitignore +++ b/.gitignore @@ -343,3 +343,10 @@ /rust-1.51.0-s390x-unknown-linux-gnu.tar.xz /rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz /rustc-1.52.1-src.tar.xz +/rustc-1.53.0-src.tar.xz +/rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.52.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.52.0-i686-unknown-linux-gnu.tar.xz +/rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.52.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch index ff126cc..4dcb322 100644 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -1,17 +1,17 @@ -From 1a6307bbf7972aa2ce89a213bad6f26b6325a59c Mon Sep 17 00:00:00 2001 +From 3582a262d27fd5a2f8705bad6018241eaca8aadd Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sun, 8 Dec 2019 17:23:08 +0500 Subject: [PATCH] Use lld provided by system for wasm --- - compiler/rustc_target/src/spec/wasm32_base.rs | 3 +-- + compiler/rustc_target/src/spec/wasm_base.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -diff --git a/compiler/rustc_target/src/spec/wasm32_base.rs b/compiler/rustc_target/src/spec/wasm32_base.rs -index bfef3d37228f..0ecb29248fe2 100644 ---- a/compiler/rustc_target/src/spec/wasm32_base.rs -+++ b/compiler/rustc_target/src/spec/wasm32_base.rs -@@ -97,8 +97,7 @@ pub fn options() -> TargetOptions { +diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs +index b208eb92f8ff..94a701a11c8b 100644 +--- a/compiler/rustc_target/src/spec/wasm_base.rs ++++ b/compiler/rustc_target/src/spec/wasm_base.rs +@@ -98,8 +98,7 @@ pub fn options() -> TargetOptions { // arguments just yet limit_rdylib_exports: false, diff --git a/rust.spec b/rust.spec index b508e36..c2eaf66 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.51.0 -%global bootstrap_cargo 1.51.0 -%global bootstrap_channel 1.51.0 -%global bootstrap_date 2021-03-25 +%global bootstrap_rust 1.52.0 +%global bootstrap_cargo 1.52.0 +%global bootstrap_channel 1.52.0 +%global bootstrap_date 2021-05-06 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -30,7 +30,7 @@ %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 9.0+. +# is insufficient. Rust currently requires LLVM 10.0+. %bcond_with bundled_llvm # Requires stable libgit2 1.1 @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.52.1 -Release: 2%{?dist} +Version: 1.53.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -90,7 +90,7 @@ Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.51.0-disable-http2.patch +Patch101: rustc-1.53.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -181,7 +181,7 @@ Provides: bundled(llvm) = 12.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 -%global llvm llvm9.0 +%global llvm llvm11.0 %endif %if 0%{?fedora} == 34 # aarch64 is hanging with LLVM 12-rc1, but it's fine with 12-final on rawhide. @@ -194,7 +194,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 9.0 +BuildRequires: %{llvm}-devel >= 10.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -809,6 +809,9 @@ end} %changelog +* 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. diff --git a/rustc-1.51.0-disable-http2.patch b/rustc-1.53.0-disable-http2.patch similarity index 72% rename from rustc-1.51.0-disable-http2.patch rename to rustc-1.53.0-disable-http2.patch index 2517a34..94040b3 100644 --- a/rustc-1.51.0-disable-http2.patch +++ b/rustc-1.53.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2021-03-09 10:30:08.626424998 -0800 -+++ rustc-beta-src/Cargo.lock 2021-03-09 10:32:38.096207704 -0800 -@@ -899,7 +899,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2021-06-04 15:56:04.141227630 -0700 ++++ rustc-beta-src/Cargo.lock 2021-06-04 16:03:04.461396826 -0700 +@@ -885,7 +885,6 @@ dependencies = [ "cc", "libc", @@ -8,8 +8,8 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1860,16 +1859,6 @@ - ] +@@ -1904,16 +1903,6 @@ + checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] -name = "libnghttp2-sys" @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-03-05 08:34:15.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-03-09 10:32:38.096207704 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-06-04 15:56:04.143227587 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-06-04 15:57:56.931857927 -0700 @@ -25,7 +25,7 @@ + cargo-util = { path = "crates/cargo-util", version = "0.1.0" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" - crypto-hash = "0.3.1" -curl = { version = "0.4.23", features = ["http2"] } +curl = { version = "0.4.23", features = [] } curl-sys = "0.4.22" env_logger = "0.8.1" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-03-05 08:34:15.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-03-09 10:32:38.096207704 -0800 -@@ -412,14 +412,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-05-22 15:22:31.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-06-04 16:00:03.903190293 -0700 +@@ -416,14 +416,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -46,7 +46,7 @@ - let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); - multi - .pipelining(false, multiplexing) -- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?; +- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; - - // let's not flood crates.io with connections - multi.set_max_host_connections(2)?; @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -592,7 +586,7 @@ +@@ -596,7 +590,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/sources b/sources index 0ec5511..0df131d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.52.1-src.tar.xz) = 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c +SHA512 (rustc-1.53.0-src.tar.xz) = 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24 diff --git a/sources-bootstrap b/sources-bootstrap index cc52865..0f64443 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,7 +1,7 @@ -SHA512 (rustc-1.52.1-src.tar.xz) = 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c -SHA512 (rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz) = 2af31290e1065a4611f34e6cc8c62ee494c222becfb21ec6707059c119069b0adf0eec23e56bad4a3cc8690b2556309ec58cbd9003a959983689cc46c7c63361 -SHA512 (rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz) = c602dcc7fd1343b310f5e3074bf63f2428ca7c15cdce8999fa4655de5a4bda5a13255fc12bee3d0632f6cb93220a883fb36d24061dca6795d23afa9f8fdae57f -SHA512 (rust-1.51.0-i686-unknown-linux-gnu.tar.xz) = 05d08e44827dcba8197667deb9a7f3584465085ce1b79a38deb138849a07c716646a70f1cc2cee02b41c45ec7c3a3b7800a3fae62ebe04d6f72f017a5d722bab -SHA512 (rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz) = b53a741d1d75637fb31ddb0364e1f91427c3818ca145f819b906d13c32c638ae77fbaa567a6220b6bf69f38cc00d2b95615778a86f4acadd63efe2e62b1b01ef -SHA512 (rust-1.51.0-s390x-unknown-linux-gnu.tar.xz) = a72ad31c6306f939c4f963133ddc0b3fabc9e506bdff5e318f5275658b7271a675a51d208d306d94fb01739cbcf0f62f018fc7490ca6db54b301852202749d16 -SHA512 (rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz) = 9f95045119bcd5ef7be54f5b5bdc9ebc6bd6c48437d90762a1cfbc03281882f81087e1877eecae9573ba5e7cd7c11ef5fed979034c57f45b6547cbfeb11eef6d +SHA512 (rustc-1.53.0-src.tar.xz) = 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24 +SHA512 (rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz) = 7a26e14be6b27c7084c7c85b312341ab991c2df91ea53128f14707a4c725dd03ba7df30b9e9fcef39a509ab4f5d5feb028b99d6d9ffcc059996ed29b83eb90b9 +SHA512 (rust-1.52.0-armv7-unknown-linux-gnueabihf.tar.xz) = 100b9abdc3dc7852f880eea205056a7a6b78af39fc3b7019ebcac712d5eee3c053f0508a6dc1f9da13074ca476e9fb33514bb83098d3b41964e878c0fc6498d4 +SHA512 (rust-1.52.0-i686-unknown-linux-gnu.tar.xz) = 10fcf9e891ae8bc6e83b5e71c83b34773c18b024c9e9b580cfae714b4e135d313ba5434fc28c2dffa3db2e50669b3acd07e6874de0cfab89b343db92bfbdff80 +SHA512 (rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz) = 916a3338c850cf804535e25aebc0fdcf6cea8fe9e5df9fed11fbf03ae81fb8220321dc41edd7133f287dfee0dbf19730ff8b020f32322850329865db76bab95e +SHA512 (rust-1.52.0-s390x-unknown-linux-gnu.tar.xz) = 6a91adf7c1947b63db0bf02b4aa4a36fbbfcc5b40d9c18175e4c5efe785b8a17ff21a887476cf76f7e3d3854f2cc362b5d2dc8243493291a4d19a705276e6355 +SHA512 (rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz) = 27a8db421ae62af92e2c34dcc1fdd617bf7e8de2c68205773a3037be496ccbf21f5549dd18377a9730102e7915519824231218fef9a09abe9d116441d6ce28d2 From 2104887fc0902967b6ac3e6eb27cfe059385dee1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 18 Jun 2021 09:41:37 -0700 Subject: [PATCH 049/222] Use llvm11 and devtoolset-9 for epel7 --- rust.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 2ef33e0..a31979b 100644 --- a/rust.spec +++ b/rust.spec @@ -181,7 +181,7 @@ Provides: bundled(llvm) = 12.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 -%global llvm llvm11.0 +%global llvm llvm11 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -214,6 +214,14 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release} # https://github.com/rust-lang/rust/issues/11937 Requires: /usr/bin/cc +%if 0%{?epel} == 7 +%global devtoolset_name devtoolset-9 +BuildRequires: %{devtoolset_name}-gcc +BuildRequires: %{devtoolset_name}-gcc-c++ +%global __cc /opt/rh/%{devtoolset_name}/root/usr/bin/gcc +%global __cxx /opt/rh/%{devtoolset_name}/root/usr/bin/g++ +%endif + # ALL Rust libraries are private, because they don't keep an ABI. %global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.* %global __provides_exclude ^(%{_privatelibs})$ @@ -563,6 +571,9 @@ fi %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ + --set target.%{rust_triple}.linker=%{__cc} \ + --set target.%{rust_triple}.cc=%{__cc} \ + --set target.%{rust_triple}.cxx=%{__cxx} \ --python=%{python} \ --local-rust-root=%{local_rust_root} \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ From e9feea05d7f5672e0e7d730ff3a8040001d3ade2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 8 Jul 2021 17:13:17 -0700 Subject: [PATCH 050/222] Exclude wasm on s390x for lack of lld --- rust.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index a31979b..cf441c8 100644 --- a/rust.spec +++ b/rust.spec @@ -62,7 +62,7 @@ Name: rust Version: 1.53.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -282,7 +282,7 @@ written in Rust. for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do local requires = rpm.expand("Requires: rust = %{version}-%{release}") if string.sub(triple, 1, 4) == "wasm" then - requires = requires .. "\nRequires: lld >= 8.0" + requires = requires .. "\nRequires: lld >= 8.0\nExcludeArch: s390x" end local subs = { triple = triple, @@ -815,6 +815,9 @@ end} %changelog +* 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. From bb1cdb7330f4d2568bbe261ae2c51020f9ea5c6b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 15 Jul 2021 13:52:24 -0700 Subject: [PATCH 051/222] noarch+ExcludeArch doesn't work on subpackages --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index cf441c8..808d073 100644 --- a/rust.spec +++ b/rust.spec @@ -282,7 +282,7 @@ written in Rust. for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do local requires = rpm.expand("Requires: rust = %{version}-%{release}") if string.sub(triple, 1, 4) == "wasm" then - requires = requires .. "\nRequires: lld >= 8.0\nExcludeArch: s390x" + requires = requires .. "\nRequires: lld >= 8.0" end local subs = { triple = triple, From 9e0cdcfa93c9b25cb07e36148667a7c4cb64802f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 21 Jul 2021 09:44:42 -0700 Subject: [PATCH 052/222] Clean some temporary files to reduce total disk space --- rust.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust.spec b/rust.spec index 808d073..bd97f32 100644 --- a/rust.spec +++ b/rust.spec @@ -610,6 +610,9 @@ for triple in %{cross_targets}; do done %endif +# These are transient files used by x.py dist and install +rm -rf ./build/dist/ ./build/tmp/ + # Make sure the shared libraries are in the proper libdir %if "%{_libdir}" != "%{common_libdir}" mkdir -p %{buildroot}%{_libdir} @@ -681,8 +684,13 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* export %{rust_env} # 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. %{python} ./x.py test --no-fail-fast --stage 2 || : +rm -rf "./build/%{rust_triple}/test/" + %{python} ./x.py test --no-fail-fast --stage 2 cargo || : +rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" + %{python} ./x.py test --no-fail-fast --stage 2 clippy || : %{python} ./x.py test --no-fail-fast --stage 2 rls || : %{python} ./x.py test --no-fail-fast --stage 2 rustfmt || : From c2603b2286c86e397fcc6be63c517f5b5bcb5589 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 12:57:15 +0000 Subject: [PATCH 053/222] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index bd97f32..9339b1d 100644 --- a/rust.spec +++ b/rust.spec @@ -62,7 +62,7 @@ Name: rust Version: 1.53.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -823,6 +823,9 @@ end} %changelog +* 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 From 9e24510b777bf387d189f223e4857c8a0298f9f6 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 29 Jul 2021 09:14:40 -0700 Subject: [PATCH 054/222] Update to 1.54.0. --- .gitignore | 8 ++++++++ 0001-Use-lld-provided-by-system-for-wasm.patch | 8 ++++---- rust.spec | 15 +++++++++------ sources | 2 +- sources-bootstrap | 15 ++++++++------- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index dec69a4..01998f1 100644 --- a/.gitignore +++ b/.gitignore @@ -350,3 +350,11 @@ /rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.52.0-s390x-unknown-linux-gnu.tar.xz /rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.54.0-src.tar.xz +/rust-1.53.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.53.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.53.0-i686-unknown-linux-gnu.tar.xz +/rust-1.53.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.53.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.53.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.53.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch index 4dcb322..681b21a 100644 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -1,4 +1,4 @@ -From 3582a262d27fd5a2f8705bad6018241eaca8aadd Mon Sep 17 00:00:00 2001 +From 9ac837c237568a6c1c5f0e979fcce208cd9c926a Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sun, 8 Dec 2019 17:23:08 +0500 Subject: [PATCH] Use lld provided by system for wasm @@ -8,10 +8,10 @@ Subject: [PATCH] Use lld provided by system for wasm 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index b208eb92f8ff..94a701a11c8b 100644 +index 4c954a1e567c..15c4f1bda5eb 100644 --- a/compiler/rustc_target/src/spec/wasm_base.rs +++ b/compiler/rustc_target/src/spec/wasm_base.rs -@@ -98,8 +98,7 @@ pub fn options() -> TargetOptions { +@@ -99,8 +99,7 @@ pub fn options() -> TargetOptions { // arguments just yet limit_rdylib_exports: false, @@ -19,8 +19,8 @@ index b208eb92f8ff..94a701a11c8b 100644 - linker: Some("rust-lld".to_owned()), + linker: Some("lld".to_owned()), lld_flavor: LldFlavor::Wasm, + linker_is_gnu: false, - // No need for indirection here, simd types can always be passed by -- 2.31.1 diff --git a/rust.spec b/rust.spec index 9339b1d..3e67e18 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.52.0 -%global bootstrap_cargo 1.52.0 -%global bootstrap_channel 1.52.0 -%global bootstrap_date 2021-05-06 +%global bootstrap_rust 1.53.0 +%global bootstrap_cargo 1.53.0 +%global bootstrap_channel 1.53.0 +%global bootstrap_date 2021-06-17 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.53.0 -Release: 3%{?dist} +Version: 1.54.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -823,6 +823,9 @@ end} %changelog +* 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 diff --git a/sources b/sources index 0df131d..47411b8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.53.0-src.tar.xz) = 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24 +SHA512 (rustc-1.54.0-src.tar.xz) = 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa diff --git a/sources-bootstrap b/sources-bootstrap index 0f64443..85a5f81 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,7 +1,8 @@ -SHA512 (rustc-1.53.0-src.tar.xz) = 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24 -SHA512 (rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz) = 7a26e14be6b27c7084c7c85b312341ab991c2df91ea53128f14707a4c725dd03ba7df30b9e9fcef39a509ab4f5d5feb028b99d6d9ffcc059996ed29b83eb90b9 -SHA512 (rust-1.52.0-armv7-unknown-linux-gnueabihf.tar.xz) = 100b9abdc3dc7852f880eea205056a7a6b78af39fc3b7019ebcac712d5eee3c053f0508a6dc1f9da13074ca476e9fb33514bb83098d3b41964e878c0fc6498d4 -SHA512 (rust-1.52.0-i686-unknown-linux-gnu.tar.xz) = 10fcf9e891ae8bc6e83b5e71c83b34773c18b024c9e9b580cfae714b4e135d313ba5434fc28c2dffa3db2e50669b3acd07e6874de0cfab89b343db92bfbdff80 -SHA512 (rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz) = 916a3338c850cf804535e25aebc0fdcf6cea8fe9e5df9fed11fbf03ae81fb8220321dc41edd7133f287dfee0dbf19730ff8b020f32322850329865db76bab95e -SHA512 (rust-1.52.0-s390x-unknown-linux-gnu.tar.xz) = 6a91adf7c1947b63db0bf02b4aa4a36fbbfcc5b40d9c18175e4c5efe785b8a17ff21a887476cf76f7e3d3854f2cc362b5d2dc8243493291a4d19a705276e6355 -SHA512 (rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz) = 27a8db421ae62af92e2c34dcc1fdd617bf7e8de2c68205773a3037be496ccbf21f5549dd18377a9730102e7915519824231218fef9a09abe9d116441d6ce28d2 +SHA512 (rustc-1.54.0-src.tar.xz) = 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa +SHA512 (rust-1.53.0-aarch64-unknown-linux-gnu.tar.xz) = aed515e60e5eb22478b864f7e9aa74b99b9843afe6d1fcc9d0ad78bfd48a39b0d9c8ee7b785f273c3bf5d3a173c169fd6dcd5c64fa67c49285803ff4598d9f59 +SHA512 (rust-1.53.0-armv7-unknown-linux-gnueabihf.tar.xz) = a3c5f4f0d19a55e51b3a0fbc7dc9f168cc6eb0b9ccbca34e4e5a83f70e4e22149cfc4fa51bf878ec39e5b2988e198630fed32620bf151ad9359c70db2f9af28a +SHA512 (rust-1.53.0-i686-unknown-linux-gnu.tar.xz) = 404969329b88ce3f3078837e7bd33de28babf0834e366f5663abab79bf810f2c0ddfeea304bb6289415862afc50289d897cb92fc3f0c0ee8a40bcfc8c23b567c +SHA512 (rust-1.53.0-powerpc64le-unknown-linux-gnu.tar.xz) = f418272864889635494553cd1f6216b0487c016c31603532920e45435da85154f6ec275bee6d2a32ef6755fb12f57151ce2d3c7c5d6d97c2eb3d81f7c2842c48 +SHA512 (rust-1.53.0-powerpc64-unknown-linux-gnu.tar.xz) = 573815b4b93e2484108990814c8c63cc8c783b1909c24ff9c856b3920ec3553016aed66309e459bae5d16319ae925f470c6449aeae653791af4a90384ccb9be8 +SHA512 (rust-1.53.0-s390x-unknown-linux-gnu.tar.xz) = ca142b436b1396ad978ba1d1a0993a4bba105d9e99bf89a9aea731b7406399a2132a531664fa6fec17af20f99ebd5c0a7ad329d2b143565fb878f4e7290aeb4c +SHA512 (rust-1.53.0-x86_64-unknown-linux-gnu.tar.xz) = 3b1ee4a549917fc514de7dfb99392cfa058cb06fb93266e4864d4df3ff86372eeef9a9d2a459f93462eaab8f223d3eaff1e824d42be7b983c44d18ec1579c6fa From 8df8326f7ef20d9f3fc91a88a66ea0a6faa0972b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 24 Aug 2021 11:33:19 -0700 Subject: [PATCH 055/222] Build with LLVM 12 on Fedora 35+ --- rust.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 3e67e18..61848f4 100644 --- a/rust.spec +++ b/rust.spec @@ -62,7 +62,7 @@ Name: rust Version: 1.54.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -183,6 +183,10 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm11 %endif +# Rust isn't ready for LLVM 13 yet +%if 0%{?fedora} >= 35 +%global llvm llvm12 +%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -587,6 +591,7 @@ fi --enable-vendor \ --enable-verbose-tests \ %{?codegen_units_std} \ + --dist-compression-formats=gz \ --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" @@ -692,7 +697,10 @@ rm -rf "./build/%{rust_triple}/test/" rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{python} ./x.py test --no-fail-fast --stage 2 clippy || : + +env RLS_TEST_WAIT_FOR_AGES=1 \ %{python} ./x.py test --no-fail-fast --stage 2 rls || : + %{python} ./x.py test --no-fail-fast --stage 2 rustfmt || : @@ -823,6 +831,9 @@ end} %changelog +* 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. From ffcb56b1e55f6311198dbc256a2b18e92186c634 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Tue, 7 Sep 2021 17:38:53 +0200 Subject: [PATCH 056/222] Added basic CI gating tests --- gating.yaml | 19 +++++++++ plans/ci.fmf | 6 +++ 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 +++++++++++++++++++++++++ 6 files changed, 159 insertions(+) create mode 100644 gating.yaml create mode 100644 plans/ci.fmf create mode 100644 tests/Sanity/basic-smoke/Makefile create mode 100644 tests/Sanity/basic-smoke/PURPOSE create mode 100644 tests/Sanity/basic-smoke/main.fmf create mode 100755 tests/Sanity/basic-smoke/runtest.sh diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..ce3cdc1 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,19 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..1ad2c12 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: beakerlib diff --git a/tests/Sanity/basic-smoke/Makefile b/tests/Sanity/basic-smoke/Makefile new file mode 100644 index 0000000..3293c52 --- /dev/null +++ b/tests/Sanity/basic-smoke/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 new file mode 100644 index 0000000..a7455dc --- /dev/null +++ b/tests/Sanity/basic-smoke/PURPOSE @@ -0,0 +1,3 @@ +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 new file mode 100644 index 0000000..c414d05 --- /dev/null +++ b/tests/Sanity/basic-smoke/main.fmf @@ -0,0 +1,13 @@ +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 new file mode 100755 index 0000000..ed25e86 --- /dev/null +++ b/tests/Sanity/basic-smoke/runtest.sh @@ -0,0 +1,55 @@ +#!/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 From e675755a182e191cd0fd9b2524877bc16e861dda Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Sep 2021 16:30:41 -0700 Subject: [PATCH 057/222] Update to 1.55.0. Use llvm-ranlib for wasm rlibs; Fixes rhbz#2002612 --- .gitignore | 8 +++++ rust.spec | 24 ++++++++------- ....patch => rustc-1.55.0-disable-http2.patch | 30 +++++++++---------- sources | 2 +- sources-bootstrap | 16 +++++----- 5 files changed, 46 insertions(+), 34 deletions(-) rename rustc-1.53.0-disable-http2.patch => rustc-1.55.0-disable-http2.patch (67%) diff --git a/.gitignore b/.gitignore index 01998f1..e1c5205 100644 --- a/.gitignore +++ b/.gitignore @@ -358,3 +358,11 @@ /rust-1.53.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.53.0-s390x-unknown-linux-gnu.tar.xz /rust-1.53.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.55.0-src.tar.xz +/rust-1.54.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.54.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.54.0-i686-unknown-linux-gnu.tar.xz +/rust-1.54.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.54.0-powerpc64-unknown-linux-gnu.tar.xz +/rust-1.54.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.54.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index 61848f4..d02db39 100644 --- a/rust.spec +++ b/rust.spec @@ -9,13 +9,13 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.53.0 -%global bootstrap_cargo 1.53.0 -%global bootstrap_channel 1.53.0 -%global bootstrap_date 2021-06-17 +%global bootstrap_rust 1.54.0 +%global bootstrap_cargo 1.54.0 +%global bootstrap_channel 1.54.0 +%global bootstrap_date 2021-07-29 # Only the specified arches will use bootstrap binaries. -#global bootstrap_arches %%{rust_arches} +%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 @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.54.0 -Release: 2%{?dist} +Version: 1.55.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -90,7 +90,7 @@ Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.53.0-disable-http2.patch +Patch101: rustc-1.55.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -177,7 +177,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.13.4 -Provides: bundled(llvm) = 12.0.0 +Provides: bundled(llvm) = 12.0.1 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 @@ -263,7 +263,7 @@ BuildRequires: %{devtoolset_name}-gcc-c++ # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ %__os_install_post \ -find %{buildroot}%{rustlibdir} -type f -path '*/wasm*/lib/*.rlib' -exec ranlib '{}' ';' \ +find '%{buildroot}%{rustlibdir}' -type f -path '*/wasm*/lib/*.rlib' -print -exec '%{llvm_root}/bin/llvm-ranlib' '{}' ';' \ %{nil} %endif @@ -831,6 +831,10 @@ end} %changelog +* 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+ diff --git a/rustc-1.53.0-disable-http2.patch b/rustc-1.55.0-disable-http2.patch similarity index 67% rename from rustc-1.53.0-disable-http2.patch rename to rustc-1.55.0-disable-http2.patch index 94040b3..33c6fee 100644 --- a/rustc-1.53.0-disable-http2.patch +++ b/rustc-1.55.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2021-06-04 15:56:04.141227630 -0700 -+++ rustc-beta-src/Cargo.lock 2021-06-04 16:03:04.461396826 -0700 -@@ -885,7 +885,6 @@ +--- rustc-1.55.0-src/Cargo.lock.orig 2021-09-07 16:33:21.672163689 -0700 ++++ rustc-1.55.0-src/Cargo.lock 2021-09-07 16:33:21.673163668 -0700 +@@ -877,7 +877,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1904,16 +1903,6 @@ +@@ -1907,16 +1906,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-06-04 15:56:04.143227587 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-06-04 15:57:56.931857927 -0700 +--- rustc-1.55.0-src/src/tools/cargo/Cargo.toml.orig 2021-09-07 16:33:21.673163668 -0700 ++++ rustc-1.55.0-src/src/tools/cargo/Cargo.toml 2021-09-07 16:34:59.637068004 -0700 @@ -25,7 +25,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.1.0" } + cargo-util = { path = "crates/cargo-util", version = "0.1.1" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" --curl = { version = "0.4.23", features = ["http2"] } -+curl = { version = "0.4.23", features = [] } - curl-sys = "0.4.22" - env_logger = "0.8.1" +-curl = { version = "0.4.38", features = ["http2"] } ++curl = { version = "0.4.38", features = [] } + curl-sys = "0.4.45" + env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-05-22 15:22:31.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-06-04 16:00:03.903190293 -0700 -@@ -416,14 +416,8 @@ +--- rustc-1.55.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-09-06 11:42:51.000000000 -0700 ++++ rustc-1.55.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-09-07 16:33:21.674163646 -0700 +@@ -417,14 +417,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -596,7 +590,7 @@ +@@ -597,7 +591,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/sources b/sources index 47411b8..5a05016 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.54.0-src.tar.xz) = 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa +SHA512 (rustc-1.55.0-src.tar.xz) = 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da diff --git a/sources-bootstrap b/sources-bootstrap index 85a5f81..5068ed4 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.54.0-src.tar.xz) = 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa -SHA512 (rust-1.53.0-aarch64-unknown-linux-gnu.tar.xz) = aed515e60e5eb22478b864f7e9aa74b99b9843afe6d1fcc9d0ad78bfd48a39b0d9c8ee7b785f273c3bf5d3a173c169fd6dcd5c64fa67c49285803ff4598d9f59 -SHA512 (rust-1.53.0-armv7-unknown-linux-gnueabihf.tar.xz) = a3c5f4f0d19a55e51b3a0fbc7dc9f168cc6eb0b9ccbca34e4e5a83f70e4e22149cfc4fa51bf878ec39e5b2988e198630fed32620bf151ad9359c70db2f9af28a -SHA512 (rust-1.53.0-i686-unknown-linux-gnu.tar.xz) = 404969329b88ce3f3078837e7bd33de28babf0834e366f5663abab79bf810f2c0ddfeea304bb6289415862afc50289d897cb92fc3f0c0ee8a40bcfc8c23b567c -SHA512 (rust-1.53.0-powerpc64le-unknown-linux-gnu.tar.xz) = f418272864889635494553cd1f6216b0487c016c31603532920e45435da85154f6ec275bee6d2a32ef6755fb12f57151ce2d3c7c5d6d97c2eb3d81f7c2842c48 -SHA512 (rust-1.53.0-powerpc64-unknown-linux-gnu.tar.xz) = 573815b4b93e2484108990814c8c63cc8c783b1909c24ff9c856b3920ec3553016aed66309e459bae5d16319ae925f470c6449aeae653791af4a90384ccb9be8 -SHA512 (rust-1.53.0-s390x-unknown-linux-gnu.tar.xz) = ca142b436b1396ad978ba1d1a0993a4bba105d9e99bf89a9aea731b7406399a2132a531664fa6fec17af20f99ebd5c0a7ad329d2b143565fb878f4e7290aeb4c -SHA512 (rust-1.53.0-x86_64-unknown-linux-gnu.tar.xz) = 3b1ee4a549917fc514de7dfb99392cfa058cb06fb93266e4864d4df3ff86372eeef9a9d2a459f93462eaab8f223d3eaff1e824d42be7b983c44d18ec1579c6fa +SHA512 (rustc-1.55.0-src.tar.xz) = 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da +SHA512 (rust-1.54.0-aarch64-unknown-linux-gnu.tar.xz) = 3e6f638a35ed391f5393be7c92ef2560ed6bb26af1ea6ebf784bfadd3e153d1effd88fe49128eb98f5ec2ced7a65f3f4a596db71b9c4eca90429e50a8f168d11 +SHA512 (rust-1.54.0-armv7-unknown-linux-gnueabihf.tar.xz) = 0f4f4e075299cd369b4b53a425e9b290cd9cedca6a88878c6a4ae0487fe976b15bea0c8b92e7e376f77dc370552d95d738e99b7fa184a8e2c0e5ab94d65e7595 +SHA512 (rust-1.54.0-i686-unknown-linux-gnu.tar.xz) = 15bc0c31a306aa1e2b16fec7f97963ca291b2632664c49add4281d3244054b2e2f51b0ade86a9d63db87124071fa25bd7d5e662acf4c30cf3267eb56da4a1f1f +SHA512 (rust-1.54.0-powerpc64le-unknown-linux-gnu.tar.xz) = 9d13d53a1ef106b190161096122da1bc9090dc495604c8ddbb9d6b02323e6b7c9b8bec82dfe33ae6cf1820e986811a701f7a4d4c3eb7c297c777fe3563b8e9ee +SHA512 (rust-1.54.0-powerpc64-unknown-linux-gnu.tar.xz) = 543dcaf3bab3343e796b3535a3b4e12d77227006e64e91b885f599fd94ffc9c1cc8d8c5ce3b788df0399c79dc785ff7c8dc375ae20d3b4156d1b16a7dec5a371 +SHA512 (rust-1.54.0-s390x-unknown-linux-gnu.tar.xz) = 5033e3f61af7de144c3ed441f9fdf9f0c00a837d018ec3c0d4ef67f032e7f808d2dcc586e7b85b733ff9bc2196c2e05fcd104b3daa85698cc0e4e9ab69b870bd +SHA512 (rust-1.54.0-x86_64-unknown-linux-gnu.tar.xz) = d2aad46556b164dac54be76a2459789fc686781b157f0c7d647464db3b03cbb902c8c4de5c6ef2e0811a94bdbba2973c93698c4f3a7c6ba294c0e652994e3fdc From 8107b9011e693b3e8e74bad070c49c043e239bcd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Sep 2021 16:51:23 -0700 Subject: [PATCH 058/222] unset bootstrap_arches --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index d02db39..1f17237 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2021-07-29 # Only the specified arches will use bootstrap binaries. -%global bootstrap_arches %%{rust_arches} +#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 From 02dbc18c83ee9e03e151b6405db382025bc151a3 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Thu, 9 Sep 2021 09:44:06 +0200 Subject: [PATCH 059/222] Add missing .fmf directory for CI tests --- .fmf/version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .fmf/version diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 From 2513da263ab323d49e2531969c2ef4c2cf32d720 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Thu, 9 Sep 2021 10:10:08 +0200 Subject: [PATCH 060/222] Add wasm target smoke test --- 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 +++++++++ 6 files changed, 175 insertions(+) create mode 100644 tests/Sanity/rust-wasm-smoke-test/Makefile create mode 100644 tests/Sanity/rust-wasm-smoke-test/PURPOSE create mode 100644 tests/Sanity/rust-wasm-smoke-test/lib.rs create mode 100644 tests/Sanity/rust-wasm-smoke-test/main.fmf create mode 100755 tests/Sanity/rust-wasm-smoke-test/runtest.sh create mode 100644 tests/Sanity/rust-wasm-smoke-test/test.js diff --git a/tests/Sanity/rust-wasm-smoke-test/Makefile b/tests/Sanity/rust-wasm-smoke-test/Makefile new file mode 100644 index 0000000..437da6b --- /dev/null +++ b/tests/Sanity/rust-wasm-smoke-test/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 new file mode 100644 index 0000000..e21d668 --- /dev/null +++ b/tests/Sanity/rust-wasm-smoke-test/PURPOSE @@ -0,0 +1,3 @@ +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 new file mode 100644 index 0000000..36e7457 --- /dev/null +++ b/tests/Sanity/rust-wasm-smoke-test/lib.rs @@ -0,0 +1,12 @@ +#[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 new file mode 100644 index 0000000..0fe807c --- /dev/null +++ b/tests/Sanity/rust-wasm-smoke-test/main.fmf @@ -0,0 +1,15 @@ +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 new file mode 100755 index 0000000..bee4890 --- /dev/null +++ b/tests/Sanity/rust-wasm-smoke-test/runtest.sh @@ -0,0 +1,53 @@ +#!/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 new file mode 100644 index 0000000..921df38 --- /dev/null +++ b/tests/Sanity/rust-wasm-smoke-test/test.js @@ -0,0 +1,28 @@ +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 59cd56ee3773249f48090414f3db64744166164e Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Tue, 14 Sep 2021 19:14:06 +0200 Subject: [PATCH 061/222] Rebuilt with OpenSSL 3.0.0 --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 1f17237..cb83c2b 100644 --- a/rust.spec +++ b/rust.spec @@ -62,7 +62,7 @@ Name: rust Version: 1.55.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -831,6 +831,9 @@ end} %changelog +* 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 From d0d893f8a27cc81249e7326d4d8a9f06db80a3e4 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Tue, 19 Oct 2021 10:15:25 +0200 Subject: [PATCH 062/222] Ensure that rust don't break other packages Added two tests that build stratisd and librsvg2. Rust is listed as BuildRequires in those packages, so the aim of these tests is to detect upfront if rust breaks depending packages builds. --- 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/rpmbuild-librsvg2/Makefile | 65 +++++++++++++++++++++++ tests/Sanity/rpmbuild-librsvg2/PURPOSE | 3 ++ tests/Sanity/rpmbuild-librsvg2/main.fmf | 18 +++++++ tests/Sanity/rpmbuild-librsvg2/runtest.sh | 65 +++++++++++++++++++++++ 8 files changed, 299 insertions(+) create mode 100644 tests/Sanity/build-stratisd/Makefile create mode 100644 tests/Sanity/build-stratisd/PURPOSE create mode 100644 tests/Sanity/build-stratisd/main.fmf create mode 100755 tests/Sanity/build-stratisd/runtest.sh create mode 100644 tests/Sanity/rpmbuild-librsvg2/Makefile create mode 100644 tests/Sanity/rpmbuild-librsvg2/PURPOSE create mode 100644 tests/Sanity/rpmbuild-librsvg2/main.fmf create mode 100755 tests/Sanity/rpmbuild-librsvg2/runtest.sh diff --git a/tests/Sanity/build-stratisd/Makefile b/tests/Sanity/build-stratisd/Makefile new file mode 100644 index 0000000..a085527 --- /dev/null +++ b/tests/Sanity/build-stratisd/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 new file mode 100644 index 0000000..c790991 --- /dev/null +++ b/tests/Sanity/build-stratisd/PURPOSE @@ -0,0 +1,3 @@ +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 new file mode 100644 index 0000000..0617757 --- /dev/null +++ b/tests/Sanity/build-stratisd/main.fmf @@ -0,0 +1,17 @@ +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 new file mode 100755 index 0000000..693a72f --- /dev/null +++ b/tests/Sanity/build-stratisd/runtest.sh @@ -0,0 +1,65 @@ +#!/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/rpmbuild-librsvg2/Makefile b/tests/Sanity/rpmbuild-librsvg2/Makefile new file mode 100644 index 0000000..bd22601 --- /dev/null +++ b/tests/Sanity/rpmbuild-librsvg2/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 new file mode 100644 index 0000000..d3a05af --- /dev/null +++ b/tests/Sanity/rpmbuild-librsvg2/PURPOSE @@ -0,0 +1,3 @@ +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 new file mode 100644 index 0000000..decb64d --- /dev/null +++ b/tests/Sanity/rpmbuild-librsvg2/main.fmf @@ -0,0 +1,18 @@ +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 new file mode 100755 index 0000000..8965c9e --- /dev/null +++ b/tests/Sanity/rpmbuild-librsvg2/runtest.sh @@ -0,0 +1,65 @@ +#!/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}')" + + rlRun "yum-builddep -y ${SPECDIR}/${PKG_TO_BUILD}.spec ${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 917b223b5e8906148581d38ac450a446cc7624b1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 21 Oct 2021 12:29:34 -0700 Subject: [PATCH 063/222] Update to 1.56.0. --- .gitignore | 7 ++++ rust.spec | 33 ++++++++++++------- ....patch => rustc-1.56.0-disable-http2.patch | 18 +++++----- ...atch => rustc-1.56.0-disable-libssh2.patch | 16 ++++----- sources | 2 +- sources-bootstrap | 15 ++++----- 6 files changed, 53 insertions(+), 38 deletions(-) rename rustc-1.55.0-disable-http2.patch => rustc-1.56.0-disable-http2.patch (77%) rename rustc-1.48.0-disable-libssh2.patch => rustc-1.56.0-disable-libssh2.patch (66%) diff --git a/.gitignore b/.gitignore index e1c5205..6cbd9ff 100644 --- a/.gitignore +++ b/.gitignore @@ -366,3 +366,10 @@ /rust-1.54.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.54.0-s390x-unknown-linux-gnu.tar.xz /rust-1.54.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.56.0-src.tar.xz +/rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.55.0-i686-unknown-linux-gnu.tar.xz +/rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.55.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index cb83c2b..0b87ed0 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.54.0 -%global bootstrap_cargo 1.54.0 -%global bootstrap_channel 1.54.0 -%global bootstrap_date 2021-07-29 +%global bootstrap_rust 1.55.0 +%global bootstrap_cargo 1.55.0 +%global bootstrap_channel 1.55.0 +%global bootstrap_date 2021-09-09 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.55.0 -Release: 2%{?dist} +Version: 1.56.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -76,7 +76,8 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# This internal rust-abi change broke s390x -- revert for now. +# An internal rust-abi change broke s390x, but it's fixed in LLVM 12.0.1. +# We'll revert the change on Fedora 33 that has an unpatched LLVM 11. # https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 Patch1: 0001-Revert-Auto-merge-of-79547.patch @@ -86,11 +87,11 @@ Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.48.0-disable-libssh2.patch +Patch100: rustc-1.56.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.55.0-disable-http2.patch +Patch101: rustc-1.56.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -177,14 +178,15 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.13.4 -Provides: bundled(llvm) = 12.0.1 +BuildRequires: ninja-build +Provides: bundled(llvm) = 13.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm11 %endif -# Rust isn't ready for LLVM 13 yet -%if 0%{?fedora} >= 35 +%if 0%{?fedora} == 35 +# f35 still only has 13.0.0~rc1 %global llvm llvm12 %endif %if %defined llvm @@ -463,7 +465,11 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} +%if 0%{?fedora} == 33 +# revert only for LLVM 11 %patch1 -p1 +%endif + %patch2 -p1 %if %with disabled_libssh2 @@ -831,6 +837,9 @@ end} %changelog +* 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 diff --git a/rustc-1.55.0-disable-http2.patch b/rustc-1.56.0-disable-http2.patch similarity index 77% rename from rustc-1.55.0-disable-http2.patch rename to rustc-1.56.0-disable-http2.patch index 33c6fee..3b3d0c8 100644 --- a/rustc-1.55.0-disable-http2.patch +++ b/rustc-1.56.0-disable-http2.patch @@ -1,5 +1,5 @@ ---- rustc-1.55.0-src/Cargo.lock.orig 2021-09-07 16:33:21.672163689 -0700 -+++ rustc-1.55.0-src/Cargo.lock 2021-09-07 16:33:21.673163668 -0700 +--- rustc-1.56.0-src/Cargo.lock.orig 2021-10-19 18:03:53.928187581 -0700 ++++ rustc-1.56.0-src/Cargo.lock 2021-10-19 18:05:41.443522980 -0700 @@ -877,7 +877,6 @@ dependencies = [ "cc", @@ -23,21 +23,21 @@ - -[[package]] name = "libz-sys" - version = "1.1.2" + version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.55.0-src/src/tools/cargo/Cargo.toml.orig 2021-09-07 16:33:21.673163668 -0700 -+++ rustc-1.55.0-src/src/tools/cargo/Cargo.toml 2021-09-07 16:34:59.637068004 -0700 +--- rustc-1.56.0-src/src/tools/cargo/Cargo.toml.orig 2021-10-19 18:03:53.930187532 -0700 ++++ rustc-1.56.0-src/src/tools/cargo/Cargo.toml 2021-10-19 18:05:13.663211469 -0700 @@ -25,7 +25,7 @@ cargo-util = { path = "crates/cargo-util", version = "0.1.1" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" -curl = { version = "0.4.38", features = ["http2"] } +curl = { version = "0.4.38", features = [] } - curl-sys = "0.4.45" + curl-sys = "0.4.48" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.55.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-09-06 11:42:51.000000000 -0700 -+++ rustc-1.55.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-09-07 16:33:21.674163646 -0700 +--- rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-10-18 02:52:56.000000000 -0700 ++++ rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-10-19 18:03:53.931187507 -0700 @@ -417,14 +417,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -597,7 +591,7 @@ +@@ -653,7 +647,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.48.0-disable-libssh2.patch b/rustc-1.56.0-disable-libssh2.patch similarity index 66% rename from rustc-1.48.0-disable-libssh2.patch rename to rustc-1.56.0-disable-libssh2.patch index 6916e74..4d9331b 100644 --- a/rustc-1.48.0-disable-libssh2.patch +++ b/rustc-1.56.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 06:01:53.000000000 -0800 -+++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:27:44.425104404 -0800 -@@ -1676,7 +1676,6 @@ +--- rustc-1.56.0-src/Cargo.lock.orig 2021-10-18 02:52:36.000000000 -0700 ++++ rustc-1.56.0-src/Cargo.lock 2021-10-19 18:00:47.999793566 -0700 +@@ -1895,7 +1895,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1693,20 +1692,6 @@ +@@ -1918,20 +1917,6 @@ ] [[package]] @@ -27,11 +27,11 @@ - -[[package]] name = "libz-sys" - version = "1.1.2" + version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.48.0-src/vendor/git2/Cargo.toml.orig 2020-11-16 06:27:49.000000000 -0800 -+++ rustc-1.48.0-src/vendor/git2/Cargo.toml 2020-11-16 09:27:44.425104404 -0800 -@@ -49,7 +49,7 @@ +--- rustc-1.56.0-src/vendor/git2/Cargo.toml.orig 2021-10-18 04:05:54.000000000 -0700 ++++ rustc-1.56.0-src/vendor/git2/Cargo.toml 2021-10-19 17:57:37.960500359 -0700 +@@ -52,7 +52,7 @@ version = "0.1.39" [features] diff --git a/sources b/sources index 5a05016..d87c7bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.55.0-src.tar.xz) = 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da +SHA512 (rustc-1.56.0-src.tar.xz) = 2daa365524b47dcc48e49a0e9c8c45988af44c0845e2695dc5053f18e768e49acf3dbdd77f808dbf260546ef608eb47c593544012dd05675cb7e6b6223900315 diff --git a/sources-bootstrap b/sources-bootstrap index 5068ed4..539ecec 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,7 @@ -SHA512 (rustc-1.55.0-src.tar.xz) = 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da -SHA512 (rust-1.54.0-aarch64-unknown-linux-gnu.tar.xz) = 3e6f638a35ed391f5393be7c92ef2560ed6bb26af1ea6ebf784bfadd3e153d1effd88fe49128eb98f5ec2ced7a65f3f4a596db71b9c4eca90429e50a8f168d11 -SHA512 (rust-1.54.0-armv7-unknown-linux-gnueabihf.tar.xz) = 0f4f4e075299cd369b4b53a425e9b290cd9cedca6a88878c6a4ae0487fe976b15bea0c8b92e7e376f77dc370552d95d738e99b7fa184a8e2c0e5ab94d65e7595 -SHA512 (rust-1.54.0-i686-unknown-linux-gnu.tar.xz) = 15bc0c31a306aa1e2b16fec7f97963ca291b2632664c49add4281d3244054b2e2f51b0ade86a9d63db87124071fa25bd7d5e662acf4c30cf3267eb56da4a1f1f -SHA512 (rust-1.54.0-powerpc64le-unknown-linux-gnu.tar.xz) = 9d13d53a1ef106b190161096122da1bc9090dc495604c8ddbb9d6b02323e6b7c9b8bec82dfe33ae6cf1820e986811a701f7a4d4c3eb7c297c777fe3563b8e9ee -SHA512 (rust-1.54.0-powerpc64-unknown-linux-gnu.tar.xz) = 543dcaf3bab3343e796b3535a3b4e12d77227006e64e91b885f599fd94ffc9c1cc8d8c5ce3b788df0399c79dc785ff7c8dc375ae20d3b4156d1b16a7dec5a371 -SHA512 (rust-1.54.0-s390x-unknown-linux-gnu.tar.xz) = 5033e3f61af7de144c3ed441f9fdf9f0c00a837d018ec3c0d4ef67f032e7f808d2dcc586e7b85b733ff9bc2196c2e05fcd104b3daa85698cc0e4e9ab69b870bd -SHA512 (rust-1.54.0-x86_64-unknown-linux-gnu.tar.xz) = d2aad46556b164dac54be76a2459789fc686781b157f0c7d647464db3b03cbb902c8c4de5c6ef2e0811a94bdbba2973c93698c4f3a7c6ba294c0e652994e3fdc +SHA512 (rustc-1.56.0-src.tar.xz) = 2daa365524b47dcc48e49a0e9c8c45988af44c0845e2695dc5053f18e768e49acf3dbdd77f808dbf260546ef608eb47c593544012dd05675cb7e6b6223900315 +SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 +SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e +SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 +SHA512 (rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz) = 67c98c7cc44482082daa5daa3926dc92782b373b3173181413e68d59ea07f6eee61d46f3832a3fce18bdc44dd563e2e1f85709435e04c599b299981ecd932a9f +SHA512 (rust-1.55.0-s390x-unknown-linux-gnu.tar.xz) = 7fc83c8723493864a470f32a05db9e16ecba0ff621080d8a3a257e6f42a37bfcc8d364d71aff696991dd85635f6596ffa72efdefee1620c308984536b48d212a +SHA512 (rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz) = 4bc304727b1e9459194a9a9ad5c8e1fe63501f01047d479585de6708365b3f59e09aade64c7f4969df204f8bbcf9de9508745d2b96bc25cb74ed093f8053a4d6 From a30f744cc0fa323952d0a56fd1145ee03230f85a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 1 Nov 2021 10:13:10 -0700 Subject: [PATCH 064/222] Update to 1.56.1. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- sources-bootstrap | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6cbd9ff..580cbc0 100644 --- a/.gitignore +++ b/.gitignore @@ -373,3 +373,4 @@ /rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.55.0-s390x-unknown-linux-gnu.tar.xz /rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.56.1-src.tar.xz diff --git a/rust.spec b/rust.spec index 0b87ed0..6548873 100644 --- a/rust.spec +++ b/rust.spec @@ -61,7 +61,7 @@ %endif Name: rust -Version: 1.56.0 +Version: 1.56.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -837,6 +837,9 @@ end} %changelog +* 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. diff --git a/sources b/sources index d87c7bc..8c268fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.56.0-src.tar.xz) = 2daa365524b47dcc48e49a0e9c8c45988af44c0845e2695dc5053f18e768e49acf3dbdd77f808dbf260546ef608eb47c593544012dd05675cb7e6b6223900315 +SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f diff --git a/sources-bootstrap b/sources-bootstrap index 539ecec..0c5ba1c 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.56.0-src.tar.xz) = 2daa365524b47dcc48e49a0e9c8c45988af44c0845e2695dc5053f18e768e49acf3dbdd77f808dbf260546ef608eb47c593544012dd05675cb7e6b6223900315 +SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 From 87168d10f5727f636462e36f03f4470be56fac0b Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sun, 28 Nov 2021 15:36:21 +0100 Subject: [PATCH 065/222] Rebuild for libgit2 1.3.x Signed-off-by: Igor Raits --- rust.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 6548873..1bbc075 100644 --- a/rust.spec +++ b/rust.spec @@ -62,7 +62,7 @@ Name: rust Version: 1.56.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -164,7 +164,7 @@ BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) -%if %without bundled_libgit2 +%if %{without bundled_libgit2} BuildRequires: pkgconfig(libgit2) >= 1.1.0 %endif @@ -837,6 +837,9 @@ end} %changelog +* 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. From 7ece76136b6a1c9fd3fcbe0cad52d93ddfc1585e Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sun, 28 Nov 2021 15:38:29 +0100 Subject: [PATCH 066/222] Bootstrap Signed-off-by: Igor Raits --- rust.spec | 2 +- sources | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 1bbc075..6c13cab 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2021-09-09 # Only the specified arches will use bootstrap binaries. -#global bootstrap_arches %%{rust_arches} +%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 diff --git a/sources b/sources index 8c268fb..0c5ba1c 100644 --- a/sources +++ b/sources @@ -1 +1,7 @@ SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f +SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 +SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e +SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 +SHA512 (rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz) = 67c98c7cc44482082daa5daa3926dc92782b373b3173181413e68d59ea07f6eee61d46f3832a3fce18bdc44dd563e2e1f85709435e04c599b299981ecd932a9f +SHA512 (rust-1.55.0-s390x-unknown-linux-gnu.tar.xz) = 7fc83c8723493864a470f32a05db9e16ecba0ff621080d8a3a257e6f42a37bfcc8d364d71aff696991dd85635f6596ffa72efdefee1620c308984536b48d212a +SHA512 (rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz) = 4bc304727b1e9459194a9a9ad5c8e1fe63501f01047d479585de6708365b3f59e09aade64c7f4969df204f8bbcf9de9508745d2b96bc25cb74ed093f8053a4d6 From b71ab25d584860b51387a97f601e5f58f582f03b Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sun, 28 Nov 2021 16:01:12 +0100 Subject: [PATCH 067/222] fixup! Bootstrap Signed-off-by: Igor Raits --- .gitignore | 1 + sources | 1 + sources-bootstrap | 1 + 3 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 580cbc0..f8f9fde 100644 --- a/.gitignore +++ b/.gitignore @@ -370,6 +370,7 @@ /rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz /rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz /rust-1.55.0-i686-unknown-linux-gnu.tar.xz +/rust-1.55.0-powerpc64-unknown-linux-gnu.tar.xz /rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.55.0-s390x-unknown-linux-gnu.tar.xz /rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/sources b/sources index 0c5ba1c..abb7a12 100644 --- a/sources +++ b/sources @@ -2,6 +2,7 @@ SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd4 SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 +SHA512 (rust-1.55.0-powerpc64-unknown-linux-gnu.tar.xz) = 367ddaee0131ae05945b0a81efb73fde479140cb8078d10ec166c0da68afc1fa2aff40a8e6246c2b4861a876b8672a8d8d126bf15d23830c6e170aa27c1d6a7b SHA512 (rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz) = 67c98c7cc44482082daa5daa3926dc92782b373b3173181413e68d59ea07f6eee61d46f3832a3fce18bdc44dd563e2e1f85709435e04c599b299981ecd932a9f SHA512 (rust-1.55.0-s390x-unknown-linux-gnu.tar.xz) = 7fc83c8723493864a470f32a05db9e16ecba0ff621080d8a3a257e6f42a37bfcc8d364d71aff696991dd85635f6596ffa72efdefee1620c308984536b48d212a SHA512 (rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz) = 4bc304727b1e9459194a9a9ad5c8e1fe63501f01047d479585de6708365b3f59e09aade64c7f4969df204f8bbcf9de9508745d2b96bc25cb74ed093f8053a4d6 diff --git a/sources-bootstrap b/sources-bootstrap index 0c5ba1c..abb7a12 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -2,6 +2,7 @@ SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd4 SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 +SHA512 (rust-1.55.0-powerpc64-unknown-linux-gnu.tar.xz) = 367ddaee0131ae05945b0a81efb73fde479140cb8078d10ec166c0da68afc1fa2aff40a8e6246c2b4861a876b8672a8d8d126bf15d23830c6e170aa27c1d6a7b SHA512 (rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz) = 67c98c7cc44482082daa5daa3926dc92782b373b3173181413e68d59ea07f6eee61d46f3832a3fce18bdc44dd563e2e1f85709435e04c599b299981ecd932a9f SHA512 (rust-1.55.0-s390x-unknown-linux-gnu.tar.xz) = 7fc83c8723493864a470f32a05db9e16ecba0ff621080d8a3a257e6f42a37bfcc8d364d71aff696991dd85635f6596ffa72efdefee1620c308984536b48d212a SHA512 (rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz) = 4bc304727b1e9459194a9a9ad5c8e1fe63501f01047d479585de6708365b3f59e09aade64c7f4969df204f8bbcf9de9508745d2b96bc25cb74ed093f8053a4d6 From 7b8811c5dfc4a17f324413afdde7bc57907cfc3a Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sun, 28 Nov 2021 22:24:16 +0100 Subject: [PATCH 068/222] De-bootstrap Signed-off-by: Igor Raits --- rust.spec | 7 +++++-- sources | 7 ------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/rust.spec b/rust.spec index 6c13cab..833e698 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2021-09-09 # Only the specified arches will use bootstrap binaries. -%global bootstrap_arches %%{rust_arches} +#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 @@ -62,7 +62,7 @@ Name: rust Version: 1.56.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -837,6 +837,9 @@ end} %changelog +* 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 diff --git a/sources b/sources index abb7a12..8c268fb 100644 --- a/sources +++ b/sources @@ -1,8 +1 @@ SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f -SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 -SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e -SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 -SHA512 (rust-1.55.0-powerpc64-unknown-linux-gnu.tar.xz) = 367ddaee0131ae05945b0a81efb73fde479140cb8078d10ec166c0da68afc1fa2aff40a8e6246c2b4861a876b8672a8d8d126bf15d23830c6e170aa27c1d6a7b -SHA512 (rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz) = 67c98c7cc44482082daa5daa3926dc92782b373b3173181413e68d59ea07f6eee61d46f3832a3fce18bdc44dd563e2e1f85709435e04c599b299981ecd932a9f -SHA512 (rust-1.55.0-s390x-unknown-linux-gnu.tar.xz) = 7fc83c8723493864a470f32a05db9e16ecba0ff621080d8a3a257e6f42a37bfcc8d364d71aff696991dd85635f6596ffa72efdefee1620c308984536b48d212a -SHA512 (rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz) = 4bc304727b1e9459194a9a9ad5c8e1fe63501f01047d479585de6708365b3f59e09aade64c7f4969df204f8bbcf9de9508745d2b96bc25cb74ed093f8053a4d6 From b4ce4e3b0964d1bf0feb5a7691c7a2651da14997 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 2 Dec 2021 15:05:01 -0800 Subject: [PATCH 069/222] Update to 1.57.0, fixes rhbz#2028675. Backport rust#91070, fixes rhbz#1990657 Add rust-std-static-wasm32-wasi --- .gitignore | 8 ++ 0001-Revert-Auto-merge-of-79547.patch | 102 --------------- rust-pr91070.patch | 94 ++++++++++++++ rust.spec | 122 ++++++++++++------ ....patch => rustc-1.57.0-disable-http2.patch | 20 +-- ...patch => rustc-1.57.0-no-default-pie.patch | 17 ++- sources | 3 +- sources-bootstrap | 16 +-- 8 files changed, 216 insertions(+), 166 deletions(-) delete mode 100644 0001-Revert-Auto-merge-of-79547.patch create mode 100644 rust-pr91070.patch rename rustc-1.56.0-disable-http2.patch => rustc-1.57.0-disable-http2.patch (73%) rename rustc-1.51.0-no-default-pie.patch => rustc-1.57.0-no-default-pie.patch (66%) diff --git a/.gitignore b/.gitignore index f8f9fde..c7432cc 100644 --- a/.gitignore +++ b/.gitignore @@ -375,3 +375,11 @@ /rust-1.55.0-s390x-unknown-linux-gnu.tar.xz /rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz /rustc-1.56.1-src.tar.xz +/rustc-1.57.0-src.tar.xz +/wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz +/rust-1.56.1-aarch64-unknown-linux-gnu.tar.xz +/rust-1.56.1-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.56.1-i686-unknown-linux-gnu.tar.xz +/rust-1.56.1-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.56.1-s390x-unknown-linux-gnu.tar.xz +/rust-1.56.1-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-Revert-Auto-merge-of-79547.patch b/0001-Revert-Auto-merge-of-79547.patch deleted file mode 100644 index b2e58a1..0000000 --- a/0001-Revert-Auto-merge-of-79547.patch +++ /dev/null @@ -1,102 +0,0 @@ -From eaf7ea1fc339e1ff348ed941ed2e8c4d66f3e458 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 18 Feb 2021 19:14:58 -0800 -Subject: [PATCH] Revert "Auto merge of #79547 - erikdesjardins:byval, - r=nagisa" - -This reverts commit a094ff9590b83c8f94d898f92c2964a5803ded06, reversing -changes made to d37afad0cc87bf709ad10c85319296ac53030f03. ---- - compiler/rustc_middle/src/ty/layout.rs | 12 ++++++------ - ...return-value-in-reg.rs => return-value-in-reg.rs} | 4 ++-- - src/test/codegen/union-abi.rs | 11 +++-------- - 3 files changed, 11 insertions(+), 16 deletions(-) - rename src/test/codegen/{arg-return-value-in-reg.rs => return-value-in-reg.rs} (74%) - -diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs -index b545b92c9252..545f6aee1a21 100644 ---- a/compiler/rustc_middle/src/ty/layout.rs -+++ b/compiler/rustc_middle/src/ty/layout.rs -@@ -2849,7 +2849,7 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { - || abi == SpecAbi::RustIntrinsic - || abi == SpecAbi::PlatformIntrinsic - { -- let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| { -+ let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| { - if arg.is_ignore() { - return; - } -@@ -2887,9 +2887,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { - _ => return, - } - -- // Pass and return structures up to 2 pointers in size by value, matching `ScalarPair`. -- // LLVM will usually pass these in 2 registers, which is more efficient than by-ref. -- let max_by_val_size = Pointer.size(cx) * 2; -+ // Return structures up to 2 pointers in size by value, matching `ScalarPair`. LLVM -+ // will usually return these in 2 registers, which is more efficient than by-ref. -+ let max_by_val_size = if is_ret { Pointer.size(cx) * 2 } else { Pointer.size(cx) }; - let size = arg.layout.size; - - if arg.layout.is_unsized() || size > max_by_val_size { -@@ -2901,9 +2901,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { - arg.cast_to(Reg { kind: RegKind::Integer, size }); - } - }; -- fixup(&mut self.ret); -+ fixup(&mut self.ret, true); - for arg in &mut self.args { -- fixup(arg); -+ fixup(arg, false); - } - return; - } -diff --git a/src/test/codegen/arg-return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs -similarity index 74% -rename from src/test/codegen/arg-return-value-in-reg.rs -rename to src/test/codegen/return-value-in-reg.rs -index a69291d47821..4bc0136c5e32 100644 ---- a/src/test/codegen/arg-return-value-in-reg.rs -+++ b/src/test/codegen/return-value-in-reg.rs -@@ -1,4 +1,4 @@ --//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer. -+//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer. - - // compile-flags: -C no-prepopulate-passes -O - // only-x86_64 -@@ -11,7 +11,7 @@ pub struct S { - c: u32, - } - --// CHECK: define i128 @modify(i128{{( %0)?}}) -+// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s) - #[no_mangle] - pub fn modify(s: S) -> S { - S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c } -diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs -index f282fd237054..afea01e9a2d0 100644 ---- a/src/test/codegen/union-abi.rs -+++ b/src/test/codegen/union-abi.rs -@@ -63,16 +63,11 @@ pub union UnionU128{a:u128} - #[no_mangle] - pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} } - --pub union UnionU128x2{a:(u128, u128)} --// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1) --#[no_mangle] --pub fn test_UnionU128x2(_: UnionU128x2) { loop {} } -- - #[repr(C)] --pub union CUnionU128x2{a:(u128, u128)} --// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1) -+pub union CUnionU128{a:u128} -+// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1) - #[no_mangle] --pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} } -+pub fn test_CUnionU128(_: CUnionU128) { loop {} } - - pub union UnionBool { b:bool } - // CHECK: define zeroext i1 @test_UnionBool(i8 %b) --- -2.29.2 - diff --git a/rust-pr91070.patch b/rust-pr91070.patch new file mode 100644 index 0000000..1b4f052 --- /dev/null +++ b/rust-pr91070.patch @@ -0,0 +1,94 @@ +diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +index e77d29bed712..f3d8eb2602a3 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +@@ -124,8 +124,18 @@ extern "C" LLVMValueRef LLVMRustGetOrInsertFunction(LLVMModuleRef M, + + extern "C" LLVMValueRef + LLVMRustGetOrInsertGlobal(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef Ty) { ++ Module *Mod = unwrap(M); + StringRef NameRef(Name, NameLen); +- return wrap(unwrap(M)->getOrInsertGlobal(NameRef, unwrap(Ty))); ++ ++ // We don't use Module::getOrInsertGlobal because that returns a Constant*, ++ // which may either be the real GlobalVariable*, or a constant bitcast of it ++ // if our type doesn't match the original declaration. We always want the ++ // GlobalVariable* so we can access linkage, visibility, etc. ++ GlobalVariable *GV = Mod->getGlobalVariable(NameRef, true); ++ if (!GV) ++ GV = new GlobalVariable(*Mod, unwrap(Ty), false, ++ GlobalValue::ExternalLinkage, nullptr, NameRef); ++ return wrap(GV); + } + + extern "C" LLVMValueRef +diff --git a/src/test/ui/statics/issue-91050-1.rs b/src/test/ui/statics/issue-91050-1.rs +new file mode 100644 +index 000000000000..403a41462ef1 +--- /dev/null ++++ b/src/test/ui/statics/issue-91050-1.rs +@@ -0,0 +1,34 @@ ++// build-pass ++// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes ++ ++// This test declares globals by the same name with different types, which ++// caused problems because Module::getOrInsertGlobal would return a Constant* ++// bitcast instead of a GlobalVariable* that could access linkage/visibility. ++// In alt builds with LLVM assertions this would fail: ++// ++// rustc: /checkout/src/llvm-project/llvm/include/llvm/Support/Casting.h:269: ++// typename cast_retty::ret_type llvm::cast(Y *) [X = llvm::GlobalValue, Y = llvm::Value]: ++// Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. ++// ++// In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!" ++ ++pub mod before { ++ #[no_mangle] ++ pub static GLOBAL1: [u8; 1] = [1]; ++} ++ ++pub mod inner { ++ extern "C" { ++ pub static GLOBAL1: u8; ++ pub static GLOBAL2: u8; ++ } ++ ++ pub fn call() { ++ drop(unsafe { (GLOBAL1, GLOBAL2) }); ++ } ++} ++ ++pub mod after { ++ #[no_mangle] ++ pub static GLOBAL2: [u8; 1] = [2]; ++} +diff --git a/src/test/ui/statics/issue-91050-2.rs b/src/test/ui/statics/issue-91050-2.rs +new file mode 100644 +index 000000000000..2ff954d15cab +--- /dev/null ++++ b/src/test/ui/statics/issue-91050-2.rs +@@ -0,0 +1,24 @@ ++// build-pass ++// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes ++ ++// This is a variant of issue-91050-1.rs -- see there for an explanation. ++ ++pub mod before { ++ extern "C" { ++ pub static GLOBAL1: [u8; 1]; ++ } ++ ++ pub unsafe fn do_something_with_array() -> u8 { ++ GLOBAL1[0] ++ } ++} ++ ++pub mod inner { ++ extern "C" { ++ pub static GLOBAL1: u8; ++ } ++ ++ pub unsafe fn call() -> u8 { ++ GLOBAL1 + 42 ++ } ++} diff --git a/rust.spec b/rust.spec index 833e698..c73a9c9 100644 --- a/rust.spec +++ b/rust.spec @@ -1,6 +1,6 @@ # Only x86_64 and i686 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html -%global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x +%global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x # The channel can be stable, beta, or nightly %{!?channel: %global channel stable} @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.55.0 -%global bootstrap_cargo 1.55.0 -%global bootstrap_channel 1.55.0 -%global bootstrap_date 2021-09-09 +%global bootstrap_rust 1.56.1 +%global bootstrap_cargo 1.56.1 +%global bootstrap_channel 1.56.1 +%global bootstrap_date 2021-11-01 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -22,10 +22,19 @@ # reproducible between hosts, so only x86_64 actually builds it. %ifarch x86_64 %if 0%{?fedora} -%global cross_targets wasm32-unknown-unknown +%global cross_targets wasm32-unknown-unknown wasm32-wasi %endif %endif +# 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 forgeurl1 https://github.com/WebAssembly/wasi-libc +%global commit1 ad5133410f66b93a2381db5b542aad5e0964db96 +%forgemeta -z 1 +%undefine distprefix1 +%global wasi_libc_source %{forgesource1} +%global wasi_libc_dir %{_builddir}/%{extractdir1} + # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static @@ -33,8 +42,8 @@ # is insufficient. Rust currently requires LLVM 10.0+. %bcond_with bundled_llvm -# Requires stable libgit2 1.1 -%if 0%{?fedora} >= 34 +# Requires stable libgit2 1.3 +%if 0%{?fedora} >= 36 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -61,8 +70,8 @@ %endif Name: rust -Version: 1.56.1 -Release: 3%{?dist} +Version: 1.57.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -75,11 +84,12 @@ ExclusiveArch: %{rust_arches} %global rustc_package rustc-%{channel}-src %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +Source1: %{wasi_libc_source} +# Sources for bootstrap_arches are inserted by lua below -# An internal rust-abi change broke s390x, but it's fixed in LLVM 12.0.1. -# We'll revert the change on Fedora 33 that has an unpatched LLVM 11. -# https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 -Patch1: 0001-Revert-Auto-merge-of-79547.patch +# Fix a bad typecast for LLVM globals, rhbz#1990657 +# https://github.com/rust-lang/rust/pull/91070 +Patch1: rust-pr91070.patch # By default, rust tries to use "rust-lld" as a linker for WebAssembly. Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch @@ -91,11 +101,11 @@ Patch100: rustc-1.56.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.56.0-disable-http2.patch +Patch101: rustc-1.57.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.51.0-no-default-pie.patch +Patch102: rustc-1.57.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -128,6 +138,7 @@ end} .."/rust-%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do + i = 100 + i print(string.format("Source%d: %s-%s.tar.xz\n", i, base, rust_triple(arch))) if arch == target_arch then @@ -165,7 +176,7 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %{without bundled_libgit2} -BuildRequires: pkgconfig(libgit2) >= 1.1.0 +BuildRequires: pkgconfig(libgit2) >= 1.3.0 %endif %if %{without disabled_libssh2} @@ -185,10 +196,6 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm11 %endif -%if 0%{?fedora} == 35 -# f35 still only has 13.0.0~rc1 -%global llvm llvm12 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -262,6 +269,7 @@ BuildRequires: %{devtoolset_name}-gcc-c++ %global rustlibdir %{common_libdir}/rustlib %if %defined cross_targets +BuildRequires: clang # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ %__os_install_post \ @@ -286,23 +294,29 @@ written in Rust. %if %defined cross_targets %{lua: do for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do - local requires = rpm.expand("Requires: rust = %{version}-%{release}") - if string.sub(triple, 1, 4) == "wasm" then - requires = requires .. "\nRequires: lld >= 8.0" - end local subs = { triple = triple, - requires = requires, + verrel = rpm.expand("%{version}-%{release}"), + wasm = string.sub(triple, 1, 4) == "wasm" and 1 or 0, + wasi = string.find(triple, "-wasi") and 1 or 0, } local s = string.gsub([[ + %package std-static-{{triple}} Summary: Standard library for Rust BuildArch: noarch -{{requires}} +Requires: rust = {{verrel}} +%if {{wasm}} +Requires: lld >= 8.0 +%endif +%if {{wasi}} +Provides: bundled(wasi-libc) +%endif %description std-static-{{triple}} This package includes the standard libraries for building applications written in Rust for the {{triple}} target. + ]], "{{(%w+)}}", subs) print(s) end @@ -360,7 +374,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.1.0 +Provides: bundled(libgit2) = 1.3.0 %endif # For tests: BuildRequires: git @@ -403,7 +417,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.1.0 +Provides: bundled(libgit2) = 1.3.0 %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs @@ -463,13 +477,13 @@ test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif -%setup -q -n %{rustc_package} - -%if 0%{?fedora} == 33 -# revert only for LLVM 11 -%patch1 -p1 +%if %defined cross_targets +%forgesetup -z 1 %endif +%setup -q -n %{rustc_package} + +%patch1 -p1 %patch2 -p1 %if %with disabled_libssh2 @@ -543,10 +557,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %if 0%{?cmake_path:1} %global rust_env %{rust_env} PATH="%{cmake_path}:$PATH" %endif -%if %without bundled_libgit2 -# convince libgit2-sys to use the distro libgit2 -%global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1 -%endif %if %without disabled_libssh2 # convince libssh2-sys to use the distro libssh2 %global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 @@ -578,6 +588,22 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then ncpus="$max_cpus" fi +%if %defined cross_targets +%make_build -C %{wasi_libc_dir} +%{lua: do + local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot" + local set_wasi_root = "" + for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + if string.find(triple, "-wasi") then + set_wasi_root = set_wasi_root .. " --set target." .. triple .. ".wasi-root=" .. wasi_root + end + end + if wasi_root ~= "" then + rpm.define("set_wasi_root "..set_wasi_root) + end +end} +%endif + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -596,7 +622,7 @@ fi --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ - %{?codegen_units_std} \ + %{?set_wasi_root} \ --dist-compression-formats=gz \ --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" @@ -694,6 +720,12 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %check export %{rust_env} +# Sanity-check the installed binaries, debuginfo-stripped and all. +%{buildroot}%{_bindir}/cargo new build/hello-world +env RUSTC=%{buildroot}%{_bindir}/rustc \ + LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ + %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml + # 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. %{python} ./x.py test --no-fail-fast --stage 2 || : @@ -740,13 +772,20 @@ env RLS_TEST_WAIT_FOR_AGES=1 \ local subs = { triple = triple, rustlibdir = rpm.expand("%{rustlibdir}"), + wasi = string.find(triple, "-wasi") and 1 or 0, } local s = string.gsub([[ + %files std-static-{{triple}} %dir {{rustlibdir}} %dir {{rustlibdir}}/{{triple}} %dir {{rustlibdir}}/{{triple}}/lib {{rustlibdir}}/{{triple}}/lib/*.rlib +%if {{wasi}} +%dir {{rustlibdir}}/{{triple}}/lib/self-contained +{{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o +%endif + ]], "{{(%w+)}}", subs) print(s) end @@ -837,6 +876,11 @@ end} %changelog +* 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) diff --git a/rustc-1.56.0-disable-http2.patch b/rustc-1.57.0-disable-http2.patch similarity index 73% rename from rustc-1.56.0-disable-http2.patch rename to rustc-1.57.0-disable-http2.patch index 3b3d0c8..6723dc6 100644 --- a/rustc-1.56.0-disable-http2.patch +++ b/rustc-1.57.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.56.0-src/Cargo.lock.orig 2021-10-19 18:03:53.928187581 -0700 -+++ rustc-1.56.0-src/Cargo.lock 2021-10-19 18:05:41.443522980 -0700 -@@ -877,7 +877,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2021-11-29 10:37:40.665228216 -0800 ++++ rustc-beta-src/Cargo.lock 2021-11-29 10:37:40.667228175 -0800 +@@ -889,7 +889,6 @@ dependencies = [ "cc", "libc", @@ -25,19 +25,19 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.56.0-src/src/tools/cargo/Cargo.toml.orig 2021-10-19 18:03:53.930187532 -0700 -+++ rustc-1.56.0-src/src/tools/cargo/Cargo.toml 2021-10-19 18:05:13.663211469 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-11-29 10:37:40.667228175 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-11-29 10:38:41.291987733 -0800 @@ -25,7 +25,7 @@ cargo-util = { path = "crates/cargo-util", version = "0.1.1" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" --curl = { version = "0.4.38", features = ["http2"] } -+curl = { version = "0.4.38", features = [] } - curl-sys = "0.4.48" +-curl = { version = "0.4.39", features = ["http2"] } ++curl = { version = "0.4.39", features = [] } + curl-sys = "0.4.49" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-10-18 02:52:56.000000000 -0700 -+++ rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-10-19 18:03:53.931187507 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-11-27 09:38:17.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-11-29 10:37:40.667228175 -0800 @@ -417,14 +417,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP diff --git a/rustc-1.51.0-no-default-pie.patch b/rustc-1.57.0-no-default-pie.patch similarity index 66% rename from rustc-1.51.0-no-default-pie.patch rename to rustc-1.57.0-no-default-pie.patch index d24cc75..c9c8693 100644 --- a/rustc-1.51.0-no-default-pie.patch +++ b/rustc-1.57.0-no-default-pie.patch @@ -1,18 +1,23 @@ ---- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800 -+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800 -@@ -1279,11 +1279,13 @@ +--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-11-29 10:41:02.380100917 -0800 ++++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-11-29 10:53:31.014783112 -0800 +@@ -1485,15 +1485,14 @@ } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { + // Only use PIE if explicity specified. -+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); ++ let explicit_pic = ++ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, -- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, +- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { +- LinkOutputKind::DynamicPicExe +- } + (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, -- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, +- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { +- LinkOutputKind::StaticPicExe +- } + (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, (_, true, _) => LinkOutputKind::StaticDylib, diff --git a/sources b/sources index 8c268fb..d326606 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f +SHA512 (rustc-1.57.0-src.tar.xz) = 7903bcfc7c1db208da5d5991bd5b7f55dbe5917d4814274a8badf0d3b767211e81f8626c355ea93142f236abf116d5921c0b542ef309fbe84ece1ce84e5af30f +SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 diff --git a/sources-bootstrap b/sources-bootstrap index abb7a12..60923aa 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.56.1-src.tar.xz) = 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f -SHA512 (rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz) = 223a024701762675adb5c7c59fc54717d23f2ae4ea5984cd1cc0568d39c5207aa07a104ddad68da057f6434eecf23415ae13be2235797897d8d0f7cb5f2fc4b5 -SHA512 (rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz) = b06b3c36b5ca35391030f3c9d2f64725263ac987002923d9263c4c27877d91453db3191e01d40c78f439a48f83da220926a2841337d815dd333591d453f2fc0e -SHA512 (rust-1.55.0-i686-unknown-linux-gnu.tar.xz) = a0222c68c63ddd67afee552dd9ed636ea02fd3f26000deb7a1dc47806a1ec0b2fafaed903d4dabb0fddeb9e4026bf0da8bb2161c14db24d2883c084932e306b6 -SHA512 (rust-1.55.0-powerpc64-unknown-linux-gnu.tar.xz) = 367ddaee0131ae05945b0a81efb73fde479140cb8078d10ec166c0da68afc1fa2aff40a8e6246c2b4861a876b8672a8d8d126bf15d23830c6e170aa27c1d6a7b -SHA512 (rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz) = 67c98c7cc44482082daa5daa3926dc92782b373b3173181413e68d59ea07f6eee61d46f3832a3fce18bdc44dd563e2e1f85709435e04c599b299981ecd932a9f -SHA512 (rust-1.55.0-s390x-unknown-linux-gnu.tar.xz) = 7fc83c8723493864a470f32a05db9e16ecba0ff621080d8a3a257e6f42a37bfcc8d364d71aff696991dd85635f6596ffa72efdefee1620c308984536b48d212a -SHA512 (rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz) = 4bc304727b1e9459194a9a9ad5c8e1fe63501f01047d479585de6708365b3f59e09aade64c7f4969df204f8bbcf9de9508745d2b96bc25cb74ed093f8053a4d6 +SHA512 (rustc-1.57.0-src.tar.xz) = 7903bcfc7c1db208da5d5991bd5b7f55dbe5917d4814274a8badf0d3b767211e81f8626c355ea93142f236abf116d5921c0b542ef309fbe84ece1ce84e5af30f +SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 +SHA512 (rust-1.56.1-aarch64-unknown-linux-gnu.tar.xz) = 1e612617206f0cb49ddc24352b8c8d344ac4613a71c59532e8df78189fd2ff13d71e4b1fa433e06e4af9b50292558b00f2118ffb8efff31359c28ac2fd5f5044 +SHA512 (rust-1.56.1-armv7-unknown-linux-gnueabihf.tar.xz) = fd890ad58a346896a282b78b5138523c0ac06d177f9ec7c6df5262f24e9226be0e0f7a5d67d93d989e73c9380c0292fb7b3c977627cb5b57f48c8621a9b1444a +SHA512 (rust-1.56.1-i686-unknown-linux-gnu.tar.xz) = 56e9fa266c0cb668695c202c80b768aba9443b8e594530a3fbdef9ddaff6a37251eca5de584423b51fbee9f0b7712e5de59f6cd0892da4ed036fef5b9e74f27c +SHA512 (rust-1.56.1-powerpc64le-unknown-linux-gnu.tar.xz) = 603e9232879e5b9f79f91807f64e088cf657449bd8884c37218585d78c8b6e1919ac8f0aa7b6d38cbe844a89f837170a1bb8e0b4062c8b4aa9cca457eff89bdf +SHA512 (rust-1.56.1-s390x-unknown-linux-gnu.tar.xz) = aa0231187d3f096bfb223707e08262ff79f1b6fb9969814fc2385d3a134efc456bb43030723e614163ff27e6d6a779d27b77ad7ed05c80ab24b22fd10f9bc183 +SHA512 (rust-1.56.1-x86_64-unknown-linux-gnu.tar.xz) = 129c619c3a27b6be903b953efa033731b29436cf83c5229ad1137d2d26571379e5d6e2b3a5704e3002547560e47ae1fa7b6c98990bd2ea482299ad94099bb4b0 From 36c3018948085cbf8a05d7c86b2cb15b63a9c43d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 5 Jan 2022 19:00:19 -0800 Subject: [PATCH 070/222] Add MinGW targets - Add `rust-std-static-i686-pc-windows-gnu`, which also provides `mingw32-rust`. - Add `rust-std-static-x86_64-pc-windows-gnu`, which also provides `mingw64-rust`. --- 0001-remove-field-is-never-read-warning.patch | 59 ++++++ rust.spec | 185 ++++++++++++++---- 2 files changed, 201 insertions(+), 43 deletions(-) create mode 100644 0001-remove-field-is-never-read-warning.patch diff --git a/0001-remove-field-is-never-read-warning.patch b/0001-remove-field-is-never-read-warning.patch new file mode 100644 index 0000000..d0f0ee9 --- /dev/null +++ b/0001-remove-field-is-never-read-warning.patch @@ -0,0 +1,59 @@ +From aca8bcb48feca8c87b9af4e440835992d3f6d470 Mon Sep 17 00:00:00 2001 +From: Pietro Albini +Date: Tue, 19 Oct 2021 09:29:19 +0200 +Subject: [PATCH] remove "field is never read" warning + +--- + src/bootstrap/lib.rs | 1 - + src/bootstrap/metadata.rs | 3 +-- + src/tools/bump-stage0/src/main.rs | 1 - + 3 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 2d4e15278972..3b3c8a9227d9 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -277,7 +277,6 @@ pub struct Build { + struct Crate { + name: Interned, + deps: HashSet>, +- id: String, + path: PathBuf, + } + +diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs +index a38391c7b88f..65e229697dc8 100644 +--- a/src/bootstrap/metadata.rs ++++ b/src/bootstrap/metadata.rs +@@ -14,7 +14,6 @@ struct Output { + + #[derive(Deserialize)] + struct Package { +- id: String, + name: String, + source: Option, + manifest_path: String, +@@ -50,7 +49,7 @@ pub fn build(build: &mut Build) { + .filter(|dep| dep.source.is_none()) + .map(|dep| INTERNER.intern_string(dep.name)) + .collect(); +- build.crates.insert(name, Crate { name, id: package.id, deps, path }); ++ build.crates.insert(name, Crate { name, deps, path }); + } + } + } +diff --git a/src/tools/bump-stage0/src/main.rs b/src/tools/bump-stage0/src/main.rs +index 96d3c8738433..d6364e28fef9 100644 +--- a/src/tools/bump-stage0/src/main.rs ++++ b/src/tools/bump-stage0/src/main.rs +@@ -196,7 +196,6 @@ struct ManifestPackage { + + #[derive(Debug, serde::Deserialize)] + struct ManifestTargetPackage { +- available: bool, + url: Option, + hash: Option, + xz_url: Option, +-- +2.33.1 + diff --git a/rust.spec b/rust.spec index c73a9c9..75d4111 100644 --- a/rust.spec +++ b/rust.spec @@ -22,7 +22,8 @@ # reproducible between hosts, so only x86_64 actually builds it. %ifarch x86_64 %if 0%{?fedora} -%global cross_targets wasm32-unknown-unknown wasm32-wasi +%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu +%global wasm_targets wasm32-unknown-unknown wasm32-wasi %endif %endif @@ -71,7 +72,7 @@ Name: rust Version: 1.57.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -94,6 +95,10 @@ Patch1: rust-pr91070.patch # By default, rust tries to use "rust-lld" as a linker for WebAssembly. Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch +# Fix a bootstrap warning with stage0 1.57 +# https://github.com/rust-lang/rust/pull/90042 +Patch3: 0001-remove-field-is-never-read-warning.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -231,8 +236,14 @@ Requires: /usr/bin/cc %global devtoolset_name devtoolset-9 BuildRequires: %{devtoolset_name}-gcc BuildRequires: %{devtoolset_name}-gcc-c++ -%global __cc /opt/rh/%{devtoolset_name}/root/usr/bin/gcc -%global __cxx /opt/rh/%{devtoolset_name}/root/usr/bin/g++ +%global devtoolset_bindir /opt/rh/%{devtoolset_name}/root/usr/bin +%global __cc %{devtoolset_bindir}/gcc +%global __cxx %{devtoolset_bindir}/g++ +%global __ar %{devtoolset_bindir}/ar +%global __ranlib %{devtoolset_bindir}/ranlib +%global __strip %{devtoolset_bindir}/strip +%else +%global __ranlib %{_bindir}/ranlib %endif # ALL Rust libraries are private, because they don't keep an ABI. @@ -254,9 +265,6 @@ BuildRequires: %{devtoolset_name}-gcc-c++ %global _find_debuginfo_opts --keep-section .rustc %endif -# Use hardening ldflags. -%global rustflags -Clink-arg=-Wl,-z,relro,-z,now - %if %{without bundled_llvm} %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} %global llvm_has_filecheck 1 @@ -268,7 +276,14 @@ BuildRequires: %{devtoolset_name}-gcc-c++ %global common_libdir %{_prefix}/lib %global rustlibdir %{common_libdir}/rustlib -%if %defined cross_targets +%if %defined mingw_targets +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw32-gcc +BuildRequires: mingw64-gcc +%endif + +%if %defined wasm_targets BuildRequires: clang # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ @@ -286,36 +301,67 @@ This package includes the Rust compiler and documentation generator. %package std-static Summary: Standard library for Rust +Requires: %{name} = %{version}-%{release} +Requires: glibc-devel%{?_isa} >= 2.11 %description std-static This package includes the standard libraries for building applications written in Rust. -%if %defined cross_targets +%if %defined mingw_targets %{lua: do - for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do local subs = { triple = triple, + name = rpm.expand("%{name}"), + verrel = rpm.expand("%{version}-%{release}"), + mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", + } + local s = string.gsub([[ + +%package std-static-{{triple}} +Summary: Standard library for Rust {{triple}} +BuildArch: noarch +Provides: {{mingw}}-rust = {{verrel}} +Provides: {{mingw}}-rustc = {{verrel}} +Requires: {{mingw}}-crt +Requires: {{mingw}}-gcc +Requires: {{mingw}}-winpthreads-static +Requires: {{name}} = {{verrel}} + +%description std-static-{{triple}} +This package includes the standard libraries for building applications +written in Rust for the MinGW target {{triple}}. + +]], "{{(%w+)}}", subs) + print(s) + end +end} +%endif + +%if %defined wasm_targets +%{lua: do + for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do + local subs = { + triple = triple, + name = rpm.expand("%{name}"), verrel = rpm.expand("%{version}-%{release}"), - wasm = string.sub(triple, 1, 4) == "wasm" and 1 or 0, wasi = string.find(triple, "-wasi") and 1 or 0, } local s = string.gsub([[ %package std-static-{{triple}} -Summary: Standard library for Rust +Summary: Standard library for Rust {{triple}} BuildArch: noarch -Requires: rust = {{verrel}} -%if {{wasm}} +Requires: {{name}} = {{verrel}} Requires: lld >= 8.0 -%endif %if {{wasi}} Provides: bundled(wasi-libc) %endif %description std-static-{{triple}} This package includes the standard libraries for building applications -written in Rust for the {{triple}} target. +written in Rust for the WebAssembly target {{triple}}. ]], "{{(%w+)}}", subs) print(s) @@ -477,7 +523,7 @@ test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif -%if %defined cross_targets +%if %defined wasm_targets %forgesetup -z 1 %endif @@ -485,6 +531,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -553,18 +600,19 @@ find vendor -name .cargo-checksum.json \ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' # Set up shared environment variables for build/install/check -%global rust_env RUSTFLAGS="%{rustflags}" +%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %if 0%{?cmake_path:1} -%global rust_env %{rust_env} PATH="%{cmake_path}:$PATH" +%global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" %endif %if %without disabled_libssh2 # convince libssh2-sys to use the distro libssh2 -%global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 +%global rust_env %{?rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif +%global export_rust_env %{?rust_env:export %{rust_env}} %build -export %{rust_env} +%{export_rust_env} %ifarch %{arm} %{ix86} s390x # full debuginfo is exhausting memory; just do libstd for now @@ -588,28 +636,54 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then ncpus="$max_cpus" fi -%if %defined cross_targets -%make_build -C %{wasi_libc_dir} +%define target_config %{shrink: + --set target.%{rust_triple}.linker=%{__cc} + --set target.%{rust_triple}.cc=%{__cc} + --set target.%{rust_triple}.cxx=%{__cxx} + --set target.%{rust_triple}.ar=%{__ar} + --set target.%{rust_triple}.ranlib=/usr/bin/ranlib +} + +%if %defined mingw_targets +%{lua: do + local cfg = "" + for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do + local subs = { + triple = triple, + mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", + } + local s = string.gsub([[%{shrink: + --set target.{{triple}}.linker=%{{{mingw}}_cc} + --set target.{{triple}}.cc=%{{{mingw}}_cc} + --set target.{{triple}}.ar=%{{{mingw}}_ar} + --set target.{{triple}}.ranlib=%{{{mingw}}_ranlib} + }]], "{{(%w+)}}", subs) + cfg = cfg .. " " .. s + end + rpm.define("mingw_target_config " .. cfg) +end} +%endif + +%if %defined wasm_targets +%make_build --quiet -C %{wasi_libc_dir} %{lua: do local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot" - local set_wasi_root = "" - for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + local cfg = "" + for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do if string.find(triple, "-wasi") then - set_wasi_root = set_wasi_root .. " --set target." .. triple .. ".wasi-root=" .. wasi_root + cfg = cfg .. " --set target." .. triple .. ".wasi-root=" .. wasi_root end end - if wasi_root ~= "" then - rpm.define("set_wasi_root "..set_wasi_root) - end + rpm.define("wasm_target_config "..cfg) end} %endif %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ - --set target.%{rust_triple}.linker=%{__cc} \ - --set target.%{rust_triple}.cc=%{__cc} \ - --set target.%{rust_triple}.cxx=%{__cxx} \ + %{target_config} \ + %{?mingw_target_config} \ + %{?wasm_target_config} \ --python=%{python} \ --local-rust-root=%{local_rust_root} \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ @@ -622,7 +696,6 @@ end} --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ - %{?set_wasi_root} \ --dist-compression-formats=gz \ --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" @@ -630,22 +703,18 @@ end} %{python} ./x.py build -j "$ncpus" --stage 2 %{python} ./x.py doc --stage 2 -%if %defined cross_targets -for triple in %{cross_targets}; do +for triple in %{?mingw_targets} %{?wasm_targets}; do %{python} ./x.py build --stage 2 --target=$triple std done -%endif %install -export %{rust_env} +%{export_rust_env} DESTDIR=%{buildroot} %{python} ./x.py install -%if %defined cross_targets -for triple in %{cross_targets}; do +for triple in %{?mingw_targets} %{?wasm_targets}; do DESTDIR=%{buildroot} %{python} ./x.py install --target=$triple std done -%endif # These are transient files used by x.py dist and install rm -rf ./build/dist/ ./build/tmp/ @@ -718,7 +787,7 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %check -export %{rust_env} +%{export_rust_env} # Sanity-check the installed binaries, debuginfo-stripped and all. %{buildroot}%{_bindir}/cargo new build/hello-world @@ -766,9 +835,35 @@ env RLS_TEST_WAIT_FOR_AGES=1 \ %{rustlibdir}/%{rust_triple}/lib/*.rlib -%if %defined cross_targets +%if %defined mingw_targets %{lua: do - for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do + local subs = { + triple = triple, + rustlibdir = rpm.expand("%{rustlibdir}"), + } + local s = string.gsub([[ + +%files std-static-{{triple}} +%dir {{rustlibdir}} +%dir {{rustlibdir}}/{{triple}} +%dir {{rustlibdir}}/{{triple}}/lib +{{rustlibdir}}/{{triple}}/lib/*.rlib +{{rustlibdir}}/{{triple}}/lib/rs*.o +%exclude {{rustlibdir}}/{{triple}}/lib/*.dll +%exclude {{rustlibdir}}/{{triple}}/lib/*.dll.a +%exclude {{rustlibdir}}/{{triple}}/lib/self-contained + +]], "{{(%w+)}}", subs) + print(s) + end +end} +%endif + + +%if %defined wasm_targets +%{lua: do + for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do local subs = { triple = triple, rustlibdir = rpm.expand("%{rustlibdir}"), @@ -876,6 +971,10 @@ end} %changelog +* 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 From 26168805e881dddad336e7f42cb76e8bcd6469b5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 13 Jan 2022 11:41:45 -0800 Subject: [PATCH 071/222] Update to 1.58.0. --- .gitignore | 7 + 0001-remove-field-is-never-read-warning.patch | 59 --------- rust-pr91070.patch | 94 -------------- rust.spec | 120 +++++++++--------- ....patch => rustc-1.58.0-disable-http2.patch | 28 ++-- sources | 2 +- sources-bootstrap | 14 +- 7 files changed, 90 insertions(+), 234 deletions(-) delete mode 100644 0001-remove-field-is-never-read-warning.patch delete mode 100644 rust-pr91070.patch rename rustc-1.57.0-disable-http2.patch => rustc-1.58.0-disable-http2.patch (70%) diff --git a/.gitignore b/.gitignore index c7432cc..4c3cd4e 100644 --- a/.gitignore +++ b/.gitignore @@ -383,3 +383,10 @@ /rust-1.56.1-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.56.1-s390x-unknown-linux-gnu.tar.xz /rust-1.56.1-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.58.0-src.tar.xz +/rust-1.57.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.57.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.57.0-i686-unknown-linux-gnu.tar.xz +/rust-1.57.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.57.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/0001-remove-field-is-never-read-warning.patch b/0001-remove-field-is-never-read-warning.patch deleted file mode 100644 index d0f0ee9..0000000 --- a/0001-remove-field-is-never-read-warning.patch +++ /dev/null @@ -1,59 +0,0 @@ -From aca8bcb48feca8c87b9af4e440835992d3f6d470 Mon Sep 17 00:00:00 2001 -From: Pietro Albini -Date: Tue, 19 Oct 2021 09:29:19 +0200 -Subject: [PATCH] remove "field is never read" warning - ---- - src/bootstrap/lib.rs | 1 - - src/bootstrap/metadata.rs | 3 +-- - src/tools/bump-stage0/src/main.rs | 1 - - 3 files changed, 1 insertion(+), 4 deletions(-) - -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 2d4e15278972..3b3c8a9227d9 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -277,7 +277,6 @@ pub struct Build { - struct Crate { - name: Interned, - deps: HashSet>, -- id: String, - path: PathBuf, - } - -diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs -index a38391c7b88f..65e229697dc8 100644 ---- a/src/bootstrap/metadata.rs -+++ b/src/bootstrap/metadata.rs -@@ -14,7 +14,6 @@ struct Output { - - #[derive(Deserialize)] - struct Package { -- id: String, - name: String, - source: Option, - manifest_path: String, -@@ -50,7 +49,7 @@ pub fn build(build: &mut Build) { - .filter(|dep| dep.source.is_none()) - .map(|dep| INTERNER.intern_string(dep.name)) - .collect(); -- build.crates.insert(name, Crate { name, id: package.id, deps, path }); -+ build.crates.insert(name, Crate { name, deps, path }); - } - } - } -diff --git a/src/tools/bump-stage0/src/main.rs b/src/tools/bump-stage0/src/main.rs -index 96d3c8738433..d6364e28fef9 100644 ---- a/src/tools/bump-stage0/src/main.rs -+++ b/src/tools/bump-stage0/src/main.rs -@@ -196,7 +196,6 @@ struct ManifestPackage { - - #[derive(Debug, serde::Deserialize)] - struct ManifestTargetPackage { -- available: bool, - url: Option, - hash: Option, - xz_url: Option, --- -2.33.1 - diff --git a/rust-pr91070.patch b/rust-pr91070.patch deleted file mode 100644 index 1b4f052..0000000 --- a/rust-pr91070.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -index e77d29bed712..f3d8eb2602a3 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -@@ -124,8 +124,18 @@ extern "C" LLVMValueRef LLVMRustGetOrInsertFunction(LLVMModuleRef M, - - extern "C" LLVMValueRef - LLVMRustGetOrInsertGlobal(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef Ty) { -+ Module *Mod = unwrap(M); - StringRef NameRef(Name, NameLen); -- return wrap(unwrap(M)->getOrInsertGlobal(NameRef, unwrap(Ty))); -+ -+ // We don't use Module::getOrInsertGlobal because that returns a Constant*, -+ // which may either be the real GlobalVariable*, or a constant bitcast of it -+ // if our type doesn't match the original declaration. We always want the -+ // GlobalVariable* so we can access linkage, visibility, etc. -+ GlobalVariable *GV = Mod->getGlobalVariable(NameRef, true); -+ if (!GV) -+ GV = new GlobalVariable(*Mod, unwrap(Ty), false, -+ GlobalValue::ExternalLinkage, nullptr, NameRef); -+ return wrap(GV); - } - - extern "C" LLVMValueRef -diff --git a/src/test/ui/statics/issue-91050-1.rs b/src/test/ui/statics/issue-91050-1.rs -new file mode 100644 -index 000000000000..403a41462ef1 ---- /dev/null -+++ b/src/test/ui/statics/issue-91050-1.rs -@@ -0,0 +1,34 @@ -+// build-pass -+// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes -+ -+// This test declares globals by the same name with different types, which -+// caused problems because Module::getOrInsertGlobal would return a Constant* -+// bitcast instead of a GlobalVariable* that could access linkage/visibility. -+// In alt builds with LLVM assertions this would fail: -+// -+// rustc: /checkout/src/llvm-project/llvm/include/llvm/Support/Casting.h:269: -+// typename cast_retty::ret_type llvm::cast(Y *) [X = llvm::GlobalValue, Y = llvm::Value]: -+// Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. -+// -+// In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!" -+ -+pub mod before { -+ #[no_mangle] -+ pub static GLOBAL1: [u8; 1] = [1]; -+} -+ -+pub mod inner { -+ extern "C" { -+ pub static GLOBAL1: u8; -+ pub static GLOBAL2: u8; -+ } -+ -+ pub fn call() { -+ drop(unsafe { (GLOBAL1, GLOBAL2) }); -+ } -+} -+ -+pub mod after { -+ #[no_mangle] -+ pub static GLOBAL2: [u8; 1] = [2]; -+} -diff --git a/src/test/ui/statics/issue-91050-2.rs b/src/test/ui/statics/issue-91050-2.rs -new file mode 100644 -index 000000000000..2ff954d15cab ---- /dev/null -+++ b/src/test/ui/statics/issue-91050-2.rs -@@ -0,0 +1,24 @@ -+// build-pass -+// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes -+ -+// This is a variant of issue-91050-1.rs -- see there for an explanation. -+ -+pub mod before { -+ extern "C" { -+ pub static GLOBAL1: [u8; 1]; -+ } -+ -+ pub unsafe fn do_something_with_array() -> u8 { -+ GLOBAL1[0] -+ } -+} -+ -+pub mod inner { -+ extern "C" { -+ pub static GLOBAL1: u8; -+ } -+ -+ pub unsafe fn call() -> u8 { -+ GLOBAL1 + 42 -+ } -+} diff --git a/rust.spec b/rust.spec index 75d4111..a2289e8 100644 --- a/rust.spec +++ b/rust.spec @@ -5,14 +5,14 @@ # The channel can be stable, beta, or nightly %{!?channel: %global channel stable} -# To bootstrap from scratch, set the channel and date from src/stage0.txt +# To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.56.1 -%global bootstrap_cargo 1.56.1 -%global bootstrap_channel 1.56.1 -%global bootstrap_date 2021-11-01 +%global bootstrap_rust 1.57.0 +%global bootstrap_cargo 1.57.0 +%global bootstrap_channel 1.57.0 +%global bootstrap_date 2021-12-02 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -23,33 +23,40 @@ %ifarch x86_64 %if 0%{?fedora} %global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu +%endif +%if 0%{?fedora} || 0%{?rhel} >= 8 %global wasm_targets wasm32-unknown-unknown wasm32-wasi %endif %endif # 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 forgeurl1 https://github.com/WebAssembly/wasi-libc -%global commit1 ad5133410f66b93a2381db5b542aad5e0964db96 -%forgemeta -z 1 -%undefine distprefix1 -%global wasi_libc_source %{forgesource1} -%global wasi_libc_dir %{_builddir}/%{extractdir1} +%global wasi_libc_url https://github.com/WebAssembly/wasi-libc +%global wasi_libc_commit ad5133410f66b93a2381db5b542aad5e0964db96 +%global wasi_libc_name wasi-libc-%{wasi_libc_commit} +%global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_commit}/%{wasi_libc_name}.tar.gz +%global wasi_libc_dir %{_builddir}/%{wasi_libc_name} # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %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 10.0+. +# is insufficient. Rust currently requires LLVM 12.0+. +%global min_llvm_version 12.0.0 +%global bundled_llvm_version 13.0.0 %bcond_with bundled_llvm # Requires stable libgit2 1.3 +%global min_libgit2_version 1.3.0 +%global bundled_libgit2_version 1.3.0 %if 0%{?fedora} >= 36 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 %endif +# needs libssh2_userauth_publickey_frommemory +%global min_libssh2_version 1.6.0 %if 0%{?rhel} # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) %bcond_without disabled_libssh2 @@ -71,8 +78,8 @@ %endif Name: rust -Version: 1.57.0 -Release: 2%{?dist} +Version: 1.58.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -88,16 +95,8 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz Source1: %{wasi_libc_source} # Sources for bootstrap_arches are inserted by lua below -# Fix a bad typecast for LLVM globals, rhbz#1990657 -# https://github.com/rust-lang/rust/pull/91070 -Patch1: rust-pr91070.patch - # By default, rust tries to use "rust-lld" as a linker for WebAssembly. -Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch - -# Fix a bootstrap warning with stage0 1.57 -# https://github.com/rust-lang/rust/pull/90042 -Patch3: 0001-remove-field-is-never-read-warning.patch +Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch ### RHEL-specific patches below ### @@ -106,7 +105,7 @@ Patch100: rustc-1.56.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.57.0-disable-http2.patch +Patch101: rustc-1.58.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -172,7 +171,6 @@ BuildRequires: make BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: ncurses-devel -BuildRequires: curl # explicit curl-devel to avoid httpd24-curl (rhbz1540167) BuildRequires: curl-devel BuildRequires: pkgconfig(libcurl) @@ -181,25 +179,28 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %{without bundled_libgit2} -BuildRequires: pkgconfig(libgit2) >= 1.3.0 +BuildRequires: pkgconfig(libgit2) >= %{min_libgit2_version} %endif %if %{without disabled_libssh2} -# needs libssh2_userauth_publickey_frommemory -BuildRequires: pkgconfig(libssh2) >= 1.6.0 +BuildRequires: pkgconfig(libssh2) >= %{min_libssh2_version} %endif -%global python python3 -BuildRequires: %{python} +%if 0%{?rhel} == 8 +BuildRequires: platform-python +%else +BuildRequires: python3 +%endif +BuildRequires: python3-rpm-macros %if %with bundled_llvm BuildRequires: cmake3 >= 3.13.4 BuildRequires: ninja-build -Provides: bundled(llvm) = 13.0.0 +Provides: bundled(llvm) = %{bundled_llvm_version} %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 -%global llvm llvm11 +%global llvm llvm13 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -207,14 +208,14 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 10.0 +BuildRequires: %{llvm}-devel >= %{min_llvm_version} %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel %endif %endif -# make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs +# make check needs "ps" for src/test/ui/wait-forked-but-failed-child.rs BuildRequires: procps-ng # debuginfo-gdb tests need gdb @@ -234,6 +235,7 @@ Requires: /usr/bin/cc %if 0%{?epel} == 7 %global devtoolset_name devtoolset-9 +BuildRequires: %{devtoolset_name}-binutils BuildRequires: %{devtoolset_name}-gcc BuildRequires: %{devtoolset_name}-gcc-c++ %global devtoolset_bindir /opt/rh/%{devtoolset_name}/root/usr/bin @@ -395,7 +397,7 @@ programs. Summary: LLDB pretty printers for Rust BuildArch: noarch Requires: lldb -Requires: %{python}-lldb +Requires: python3-lldb Requires: %{name}-debugger-common = %{version}-%{release} %description lldb @@ -420,12 +422,12 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.3.0 +Provides: bundled(libgit2) = %{bundled_libgit2_version} %endif # For tests: -BuildRequires: git +BuildRequires: git-core # Cargo is not much use without Rust -Requires: rust +Requires: %{name} # "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 @@ -442,7 +444,7 @@ Summary: Documentation for Cargo BuildArch: noarch # Cargo no longer builds its own documentation # https://github.com/rust-lang/cargo/pull/4904 -Requires: rust-doc = %{version}-%{release} +Requires: %{name}-doc = %{version}-%{release} %description -n cargo-doc This package includes HTML documentation for Cargo. @@ -463,9 +465,9 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.3.0 +Provides: bundled(libgit2) = %{bundled_libgit2_version} %endif -Requires: rust-analysis +Requires: %{name}-analysis # /usr/bin/rls is dynamically linked against internal rustc libs Requires: %{name}%{?_isa} = %{version}-%{release} @@ -524,14 +526,12 @@ test -f '%{local_rust_root}/bin/rustc' %endif %if %defined wasm_targets -%forgesetup -z 1 +%setup -q -n %{wasi_libc_name} -T -b 1 %endif %setup -q -n %{rustc_package} %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -546,10 +546,8 @@ rm -rf vendor/libnghttp2-sys/ %patch102 -p1 %endif -%if "%{python}" != "python3" -# Use our preferred python first -sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure -%endif +# Use our explicit python3 first +sed -i.try-python -e '/^try python3 /i try "%{__python3}" "$@"' ./configure %if %without bundled_llvm rm -rf src/llvm-project/ @@ -684,7 +682,7 @@ end} %{target_config} \ %{?mingw_target_config} \ %{?wasm_target_config} \ - --python=%{python} \ + --python=%{__python3} \ --local-rust-root=%{local_rust_root} \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ %{!?llvm_has_filecheck: --disable-codegen-tests} \ @@ -700,20 +698,20 @@ end} --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" -%{python} ./x.py build -j "$ncpus" --stage 2 -%{python} ./x.py doc --stage 2 +%{__python3} ./x.py build -j "$ncpus" --stage 2 +%{__python3} ./x.py doc --stage 2 for triple in %{?mingw_targets} %{?wasm_targets}; do - %{python} ./x.py build --stage 2 --target=$triple std + %{__python3} ./x.py build --stage 2 --target=$triple std done %install %{export_rust_env} -DESTDIR=%{buildroot} %{python} ./x.py install +DESTDIR=%{buildroot} %{__python3} ./x.py install for triple in %{?mingw_targets} %{?wasm_targets}; do - DESTDIR=%{buildroot} %{python} ./x.py install --target=$triple std + DESTDIR=%{buildroot} %{__python3} ./x.py install --target=$triple std done # These are transient files used by x.py dist and install @@ -797,18 +795,18 @@ env RUSTC=%{buildroot}%{_bindir}/rustc \ # 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. -%{python} ./x.py test --no-fail-fast --stage 2 || : +%{__python3} ./x.py test --no-fail-fast --stage 2 || : rm -rf "./build/%{rust_triple}/test/" -%{python} ./x.py test --no-fail-fast --stage 2 cargo || : +%{__python3} ./x.py test --no-fail-fast --stage 2 cargo || : rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" -%{python} ./x.py test --no-fail-fast --stage 2 clippy || : +%{__python3} ./x.py test --no-fail-fast --stage 2 clippy || : env RLS_TEST_WAIT_FOR_AGES=1 \ -%{python} ./x.py test --no-fail-fast --stage 2 rls || : +%{__python3} ./x.py test --no-fail-fast --stage 2 rls || : -%{python} ./x.py test --no-fail-fast --stage 2 rustfmt || : +%{__python3} ./x.py test --no-fail-fast --stage 2 rustfmt || : %ldconfig_scriptlets @@ -879,6 +877,7 @@ end} %if {{wasi}} %dir {{rustlibdir}}/{{triple}}/lib/self-contained {{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o +{{rustlibdir}}/{{triple}}/lib/self-contained/libc.a %endif ]], "{{(%w+)}}", subs) @@ -971,6 +970,9 @@ end} %changelog +* 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 diff --git a/rustc-1.57.0-disable-http2.patch b/rustc-1.58.0-disable-http2.patch similarity index 70% rename from rustc-1.57.0-disable-http2.patch rename to rustc-1.58.0-disable-http2.patch index 6723dc6..215e0c7 100644 --- a/rustc-1.57.0-disable-http2.patch +++ b/rustc-1.58.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2021-11-29 10:37:40.665228216 -0800 -+++ rustc-beta-src/Cargo.lock 2021-11-29 10:37:40.667228175 -0800 -@@ -889,7 +889,6 @@ +--- rustc-1.58.0-src/Cargo.lock.orig 2022-01-11 16:13:10.125323813 -0800 ++++ rustc-1.58.0-src/Cargo.lock 2022-01-11 16:22:54.313011908 -0800 +@@ -909,7 +909,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1907,16 +1906,6 @@ +@@ -1927,16 +1926,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-11-29 10:37:40.667228175 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-11-29 10:38:41.291987733 -0800 -@@ -25,7 +25,7 @@ +--- rustc-1.58.0-src/src/tools/cargo/Cargo.toml.orig 2022-01-11 16:13:10.127323771 -0800 ++++ rustc-1.58.0-src/src/tools/cargo/Cargo.toml 2022-01-11 16:14:50.721203730 -0800 +@@ -22,7 +22,7 @@ cargo-util = { path = "crates/cargo-util", version = "0.1.1" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" --curl = { version = "0.4.39", features = ["http2"] } -+curl = { version = "0.4.39", features = [] } - curl-sys = "0.4.49" +-curl = { version = "0.4.41", features = ["http2"] } ++curl = { version = "0.4.41", features = [] } + curl-sys = "0.4.50" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-11-27 09:38:17.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-11-29 10:37:40.667228175 -0800 -@@ -417,14 +417,8 @@ +--- rustc-1.58.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-01-11 03:18:44.000000000 -0800 ++++ rustc-1.58.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-01-11 16:13:10.127323771 -0800 +@@ -419,14 +419,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -653,7 +647,7 @@ +@@ -655,7 +649,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/sources b/sources index d326606..0775c6e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.57.0-src.tar.xz) = 7903bcfc7c1db208da5d5991bd5b7f55dbe5917d4814274a8badf0d3b767211e81f8626c355ea93142f236abf116d5921c0b542ef309fbe84ece1ce84e5af30f +SHA512 (rustc-1.58.0-src.tar.xz) = 70104f4d3b474dcb9935200ef0503f29cb15f10d38ba8630e1dadbb384924dd9137fced647794699efe83ac88083e4ae5f45712f0e1c8bc0a6f8c23eecdb0aeb SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 diff --git a/sources-bootstrap b/sources-bootstrap index 60923aa..4b8ab4b 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.57.0-src.tar.xz) = 7903bcfc7c1db208da5d5991bd5b7f55dbe5917d4814274a8badf0d3b767211e81f8626c355ea93142f236abf116d5921c0b542ef309fbe84ece1ce84e5af30f +SHA512 (rustc-1.58.0-src.tar.xz) = 70104f4d3b474dcb9935200ef0503f29cb15f10d38ba8630e1dadbb384924dd9137fced647794699efe83ac88083e4ae5f45712f0e1c8bc0a6f8c23eecdb0aeb SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 -SHA512 (rust-1.56.1-aarch64-unknown-linux-gnu.tar.xz) = 1e612617206f0cb49ddc24352b8c8d344ac4613a71c59532e8df78189fd2ff13d71e4b1fa433e06e4af9b50292558b00f2118ffb8efff31359c28ac2fd5f5044 -SHA512 (rust-1.56.1-armv7-unknown-linux-gnueabihf.tar.xz) = fd890ad58a346896a282b78b5138523c0ac06d177f9ec7c6df5262f24e9226be0e0f7a5d67d93d989e73c9380c0292fb7b3c977627cb5b57f48c8621a9b1444a -SHA512 (rust-1.56.1-i686-unknown-linux-gnu.tar.xz) = 56e9fa266c0cb668695c202c80b768aba9443b8e594530a3fbdef9ddaff6a37251eca5de584423b51fbee9f0b7712e5de59f6cd0892da4ed036fef5b9e74f27c -SHA512 (rust-1.56.1-powerpc64le-unknown-linux-gnu.tar.xz) = 603e9232879e5b9f79f91807f64e088cf657449bd8884c37218585d78c8b6e1919ac8f0aa7b6d38cbe844a89f837170a1bb8e0b4062c8b4aa9cca457eff89bdf -SHA512 (rust-1.56.1-s390x-unknown-linux-gnu.tar.xz) = aa0231187d3f096bfb223707e08262ff79f1b6fb9969814fc2385d3a134efc456bb43030723e614163ff27e6d6a779d27b77ad7ed05c80ab24b22fd10f9bc183 -SHA512 (rust-1.56.1-x86_64-unknown-linux-gnu.tar.xz) = 129c619c3a27b6be903b953efa033731b29436cf83c5229ad1137d2d26571379e5d6e2b3a5704e3002547560e47ae1fa7b6c98990bd2ea482299ad94099bb4b0 +SHA512 (rust-1.57.0-aarch64-unknown-linux-gnu.tar.xz) = 71d32e1ed3fc4a2eaf3594112b3b43ab82bd28b35e547542f6c1ed006175d7cf805be373a4da8b962762962dd32fe951c8ca7c0a424addad5d4e828441d5386c +SHA512 (rust-1.57.0-armv7-unknown-linux-gnueabihf.tar.xz) = 667d8f6fb56408782c7a9e0c5086013d0350d6161d52ca4cd948ea39a02ebdf657dd45cb0a135ade8bc1e856c0962040969416fa1762e3bb55a03574fff3b1d1 +SHA512 (rust-1.57.0-i686-unknown-linux-gnu.tar.xz) = 9dc7d650bbe35d3967a883e91bfd2a3dcad633c41c00a41d9ca78bc336b1e3262bbb4100a76d42169700dc3b15d4066fa065e785aed1c0a46df4736dfd00d7c6 +SHA512 (rust-1.57.0-powerpc64le-unknown-linux-gnu.tar.xz) = 7e0809b66086f1c9dde14df5bd9f08757e32bb58041b74150415f798d81cb4ca01a6d69d529efe8a93026f251aa8f1711520defa8d86de64f20d9055ee1568e5 +SHA512 (rust-1.57.0-s390x-unknown-linux-gnu.tar.xz) = 4cc63e93bbafcbba2122a862200bf1dd241fe84f526778e1877c14237984fdeccdd3d2b3dfe73428b1b97bd253c1ddf98f4302f40709abbdd52ec721d5ccdb6e +SHA512 (rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz) = 54016b58fe85208c0d98e61cb52f2549bbb9731d7d631b4964663c91c91b7ea0ff4c224c3d29a770de433e6a0bcd92d2fe757563bf68e224a20c1cec6d031a7e From 820e900bd031ccf3d01cdd8c2407c16729828d09 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 20 Jan 2022 15:59:07 -0800 Subject: [PATCH 072/222] Update to 1.58.1. --- .gitignore | 1 + rust.spec | 11 +++++--- rustc-1.57.0-no-default-pie.patch | 24 ----------------- rustc-1.58.0-no-default-pie.patch | 44 +++++++++++++++++++++++++++++++ sources | 2 +- sources-bootstrap | 2 +- 6 files changed, 54 insertions(+), 30 deletions(-) delete mode 100644 rustc-1.57.0-no-default-pie.patch create mode 100644 rustc-1.58.0-no-default-pie.patch diff --git a/.gitignore b/.gitignore index 4c3cd4e..39872d3 100644 --- a/.gitignore +++ b/.gitignore @@ -390,3 +390,4 @@ /rust-1.57.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.57.0-s390x-unknown-linux-gnu.tar.xz /rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.58.1-src.tar.xz diff --git a/rust.spec b/rust.spec index a2289e8..f278e60 100644 --- a/rust.spec +++ b/rust.spec @@ -78,7 +78,7 @@ %endif Name: rust -Version: 1.58.0 +Version: 1.58.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -109,7 +109,7 @@ Patch101: rustc-1.58.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.57.0-no-default-pie.patch +Patch102: rustc-1.58.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -507,7 +507,7 @@ useful as a reference for code completion tools in various editors. %package analysis Summary: Compiler analysis data for the Rust standard library -Requires: rust-std-static%{?_isa} = %{version}-%{release} +Requires: %{name}-std-static%{?_isa} = %{version}-%{release} %description analysis This package contains analysis data files produced with rustc's -Zsave-analysis @@ -639,7 +639,7 @@ fi --set target.%{rust_triple}.cc=%{__cc} --set target.%{rust_triple}.cxx=%{__cxx} --set target.%{rust_triple}.ar=%{__ar} - --set target.%{rust_triple}.ranlib=/usr/bin/ranlib + --set target.%{rust_triple}.ranlib=%{__ranlib} } %if %defined mingw_targets @@ -970,6 +970,9 @@ end} %changelog +* 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. diff --git a/rustc-1.57.0-no-default-pie.patch b/rustc-1.57.0-no-default-pie.patch deleted file mode 100644 index c9c8693..0000000 --- a/rustc-1.57.0-no-default-pie.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-11-29 10:41:02.380100917 -0800 -+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-11-29 10:53:31.014783112 -0800 -@@ -1485,15 +1485,14 @@ - } - - fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { -- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { -+ // Only use PIE if explicity specified. -+ let explicit_pic = -+ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); -+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { - (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, -- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { -- LinkOutputKind::DynamicPicExe -- } -+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, - (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, -- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { -- LinkOutputKind::StaticPicExe -- } -+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, - (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, - (_, true, _) => LinkOutputKind::StaticDylib, - (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/rustc-1.58.0-no-default-pie.patch b/rustc-1.58.0-no-default-pie.patch new file mode 100644 index 0000000..67fb0c6 --- /dev/null +++ b/rustc-1.58.0-no-default-pie.patch @@ -0,0 +1,44 @@ +diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs +index 638b2a7b5a9f..79d4ecf4cb91 100644 +--- a/compiler/rustc_codegen_ssa/src/back/link.rs ++++ b/compiler/rustc_codegen_ssa/src/back/link.rs +@@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( + && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie") + { + info!("linker output: {:?}", out); +- warn!("Linker does not support -no-pie command line option. Retrying without."); ++ info!("Linker does not support -no-pie command line option. Retrying without."); + for arg in cmd.take_args() { + if arg.to_string_lossy() != "-no-pie" { + cmd.arg(arg); +@@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( + && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie") + { + info!("linker output: {:?}", out); +- warn!( ++ info!( + "Linker does not support -static-pie command line option. Retrying with -static instead." + ); + // Mirror `add_(pre,post)_link_objects` to replace CRT objects. +@@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + } + + fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { +- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { ++ // Only use PIE if explicitly specified. ++ let explicit_pic = ++ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); ++ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { + (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, +- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { +- LinkOutputKind::DynamicPicExe +- } ++ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, +- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { +- LinkOutputKind::StaticPicExe +- } ++ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, + (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, + (_, true, _) => LinkOutputKind::StaticDylib, + (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/sources b/sources index 0775c6e..32eee25 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.58.0-src.tar.xz) = 70104f4d3b474dcb9935200ef0503f29cb15f10d38ba8630e1dadbb384924dd9137fced647794699efe83ac88083e4ae5f45712f0e1c8bc0a6f8c23eecdb0aeb +SHA512 (rustc-1.58.1-src.tar.xz) = eff3279d2e519343cea542a9ae2daab592e44f35af344e33ff43ed55fc7c824511790d1991dd36a603d12465de8c3688e7194c2b9557f288c587ffa04738c2ce SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 diff --git a/sources-bootstrap b/sources-bootstrap index 4b8ab4b..48742c8 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,4 +1,4 @@ -SHA512 (rustc-1.58.0-src.tar.xz) = 70104f4d3b474dcb9935200ef0503f29cb15f10d38ba8630e1dadbb384924dd9137fced647794699efe83ac88083e4ae5f45712f0e1c8bc0a6f8c23eecdb0aeb +SHA512 (rustc-1.58.1-src.tar.xz) = eff3279d2e519343cea542a9ae2daab592e44f35af344e33ff43ed55fc7c824511790d1991dd36a603d12465de8c3688e7194c2b9557f288c587ffa04738c2ce SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 SHA512 (rust-1.57.0-aarch64-unknown-linux-gnu.tar.xz) = 71d32e1ed3fc4a2eaf3594112b3b43ab82bd28b35e547542f6c1ed006175d7cf805be373a4da8b962762962dd32fe951c8ca7c0a424addad5d4e828441d5386c SHA512 (rust-1.57.0-armv7-unknown-linux-gnueabihf.tar.xz) = 667d8f6fb56408782c7a9e0c5086013d0350d6161d52ca4cd948ea39a02ebdf657dd45cb0a135ade8bc1e856c0962040969416fa1762e3bb55a03574fff3b1d1 From a929a38db92b481cb47d56b7f6ce2072fafa5f6d Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sun, 20 Feb 2022 19:43:35 +0100 Subject: [PATCH 073/222] Rebuild for libgit2 1.4.x Signed-off-by: Igor Raits --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index f278e60..1128159 100644 --- a/rust.spec +++ b/rust.spec @@ -79,7 +79,7 @@ Name: rust Version: 1.58.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -970,6 +970,9 @@ end} %changelog +* 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. From e605359b2b00d5f929d367c7a87a8ff83cbb7b6d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Feb 2022 11:40:26 -0800 Subject: [PATCH 074/222] Update to 1.59.0. Revert to libgit2 1.3.x --- .gitignore | 7 +++++ rust.spec | 26 ++++++++++++------- ....patch => rustc-1.59.0-disable-http2.patch | 18 ++++++------- ...atch => rustc-1.59.0-disable-libssh2.patch | 18 ++++++------- sources | 2 +- sources-bootstrap | 14 +++++----- 6 files changed, 49 insertions(+), 36 deletions(-) rename rustc-1.58.0-disable-http2.patch => rustc-1.59.0-disable-http2.patch (73%) rename rustc-1.56.0-disable-libssh2.patch => rustc-1.59.0-disable-libssh2.patch (59%) diff --git a/.gitignore b/.gitignore index 39872d3..b19c5b2 100644 --- a/.gitignore +++ b/.gitignore @@ -391,3 +391,10 @@ /rust-1.57.0-s390x-unknown-linux-gnu.tar.xz /rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz /rustc-1.58.1-src.tar.xz +/rustc-1.59.0-src.tar.xz +/rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz +/rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz +/rust-1.58.0-i686-unknown-linux-gnu.tar.xz +/rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz +/rust-1.58.0-s390x-unknown-linux-gnu.tar.xz +/rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/rust.spec b/rust.spec index 1128159..5759f17 100644 --- a/rust.spec +++ b/rust.spec @@ -9,10 +9,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.57.0 -%global bootstrap_cargo 1.57.0 -%global bootstrap_channel 1.57.0 -%global bootstrap_date 2021-12-02 +%global bootstrap_rust 1.58.0 +%global bootstrap_cargo 1.58.0 +%global bootstrap_channel 1.58.0 +%global bootstrap_date 2022-01-13 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -46,8 +46,10 @@ %global bundled_llvm_version 13.0.0 %bcond_with bundled_llvm -# Requires stable libgit2 1.3 +# Requires stable libgit2 1.3, and not the next minor soname change. +# This needs to be consistent with the bindings in vendor/libgit2-sys. %global min_libgit2_version 1.3.0 +%global next_libgit2_version 1.4.0~ %global bundled_libgit2_version 1.3.0 %if 0%{?fedora} >= 36 %bcond_with bundled_libgit2 @@ -78,8 +80,8 @@ %endif Name: rust -Version: 1.58.1 -Release: 2%{?dist} +Version: 1.59.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -101,11 +103,11 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.56.0-disable-libssh2.patch +Patch100: rustc-1.59.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.58.0-disable-http2.patch +Patch101: rustc-1.59.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -179,7 +181,7 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %{without bundled_libgit2} -BuildRequires: pkgconfig(libgit2) >= %{min_libgit2_version} +BuildRequires: (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(libgit2) < %{next_libgit2_version}) %endif %if %{without disabled_libssh2} @@ -970,6 +972,10 @@ end} %changelog +* 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 diff --git a/rustc-1.58.0-disable-http2.patch b/rustc-1.59.0-disable-http2.patch similarity index 73% rename from rustc-1.58.0-disable-http2.patch rename to rustc-1.59.0-disable-http2.patch index 215e0c7..603bd32 100644 --- a/rustc-1.58.0-disable-http2.patch +++ b/rustc-1.59.0-disable-http2.patch @@ -1,5 +1,5 @@ ---- rustc-1.58.0-src/Cargo.lock.orig 2022-01-11 16:13:10.125323813 -0800 -+++ rustc-1.58.0-src/Cargo.lock 2022-01-11 16:22:54.313011908 -0800 +--- rustc-1.59.0-src/Cargo.lock.orig 2022-02-22 10:19:00.330367749 -0800 ++++ rustc-1.59.0-src/Cargo.lock 2022-02-22 10:19:00.332367706 -0800 @@ -909,7 +909,6 @@ dependencies = [ "cc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1927,16 +1926,6 @@ +@@ -1957,16 +1956,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,19 +25,19 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.58.0-src/src/tools/cargo/Cargo.toml.orig 2022-01-11 16:13:10.127323771 -0800 -+++ rustc-1.58.0-src/src/tools/cargo/Cargo.toml 2022-01-11 16:14:50.721203730 -0800 +--- rustc-1.59.0-src/src/tools/cargo/Cargo.toml.orig 2022-02-22 10:19:00.332367706 -0800 ++++ rustc-1.59.0-src/src/tools/cargo/Cargo.toml 2022-02-22 10:19:54.029231795 -0800 @@ -22,7 +22,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.1.1" } - crates-io = { path = "crates/crates-io", version = "0.33.0" } + cargo-util = { path = "crates/cargo-util", version = "0.1.2" } + crates-io = { path = "crates/crates-io", version = "0.33.1" } crossbeam-utils = "0.8" -curl = { version = "0.4.41", features = ["http2"] } +curl = { version = "0.4.41", features = [] } curl-sys = "0.4.50" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.58.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-01-11 03:18:44.000000000 -0800 -+++ rustc-1.58.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-01-11 16:13:10.127323771 -0800 +--- rustc-1.59.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-02-21 18:48:53.000000000 -0800 ++++ rustc-1.59.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-02-22 10:19:00.332367706 -0800 @@ -419,14 +419,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP diff --git a/rustc-1.56.0-disable-libssh2.patch b/rustc-1.59.0-disable-libssh2.patch similarity index 59% rename from rustc-1.56.0-disable-libssh2.patch rename to rustc-1.59.0-disable-libssh2.patch index 4d9331b..4afd67c 100644 --- a/rustc-1.56.0-disable-libssh2.patch +++ b/rustc-1.59.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-1.56.0-src/Cargo.lock.orig 2021-10-18 02:52:36.000000000 -0700 -+++ rustc-1.56.0-src/Cargo.lock 2021-10-19 18:00:47.999793566 -0700 -@@ -1895,7 +1895,6 @@ +--- rustc-1.59.0-src/Cargo.lock.orig 2022-02-21 18:48:37.000000000 -0800 ++++ rustc-1.59.0-src/Cargo.lock 2022-02-22 10:16:10.381962862 -0800 +@@ -1935,7 +1935,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1918,20 +1917,6 @@ +@@ -1968,20 +1967,6 @@ ] [[package]] -name = "libssh2-sys" --version = "0.2.19" +-version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" +-checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" -dependencies = [ - "cc", - "libc", @@ -29,9 +29,9 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.56.0-src/vendor/git2/Cargo.toml.orig 2021-10-18 04:05:54.000000000 -0700 -+++ rustc-1.56.0-src/vendor/git2/Cargo.toml 2021-10-19 17:57:37.960500359 -0700 -@@ -52,7 +52,7 @@ +--- rustc-1.59.0-src/vendor/git2/Cargo.toml.orig 2022-02-21 20:14:37.000000000 -0800 ++++ rustc-1.59.0-src/vendor/git2/Cargo.toml 2022-02-22 10:12:23.021772490 -0800 +@@ -51,7 +51,7 @@ version = "0.1.39" [features] diff --git a/sources b/sources index 32eee25..fa999c3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.58.1-src.tar.xz) = eff3279d2e519343cea542a9ae2daab592e44f35af344e33ff43ed55fc7c824511790d1991dd36a603d12465de8c3688e7194c2b9557f288c587ffa04738c2ce +SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 diff --git a/sources-bootstrap b/sources-bootstrap index 48742c8..c78dbe1 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -SHA512 (rustc-1.58.1-src.tar.xz) = eff3279d2e519343cea542a9ae2daab592e44f35af344e33ff43ed55fc7c824511790d1991dd36a603d12465de8c3688e7194c2b9557f288c587ffa04738c2ce +SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 -SHA512 (rust-1.57.0-aarch64-unknown-linux-gnu.tar.xz) = 71d32e1ed3fc4a2eaf3594112b3b43ab82bd28b35e547542f6c1ed006175d7cf805be373a4da8b962762962dd32fe951c8ca7c0a424addad5d4e828441d5386c -SHA512 (rust-1.57.0-armv7-unknown-linux-gnueabihf.tar.xz) = 667d8f6fb56408782c7a9e0c5086013d0350d6161d52ca4cd948ea39a02ebdf657dd45cb0a135ade8bc1e856c0962040969416fa1762e3bb55a03574fff3b1d1 -SHA512 (rust-1.57.0-i686-unknown-linux-gnu.tar.xz) = 9dc7d650bbe35d3967a883e91bfd2a3dcad633c41c00a41d9ca78bc336b1e3262bbb4100a76d42169700dc3b15d4066fa065e785aed1c0a46df4736dfd00d7c6 -SHA512 (rust-1.57.0-powerpc64le-unknown-linux-gnu.tar.xz) = 7e0809b66086f1c9dde14df5bd9f08757e32bb58041b74150415f798d81cb4ca01a6d69d529efe8a93026f251aa8f1711520defa8d86de64f20d9055ee1568e5 -SHA512 (rust-1.57.0-s390x-unknown-linux-gnu.tar.xz) = 4cc63e93bbafcbba2122a862200bf1dd241fe84f526778e1877c14237984fdeccdd3d2b3dfe73428b1b97bd253c1ddf98f4302f40709abbdd52ec721d5ccdb6e -SHA512 (rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz) = 54016b58fe85208c0d98e61cb52f2549bbb9731d7d631b4964663c91c91b7ea0ff4c224c3d29a770de433e6a0bcd92d2fe757563bf68e224a20c1cec6d031a7e +SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 +SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f +SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 +SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 +SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 +SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 From ca4487984017f35609486d7ce5626eaa9f3baf0d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 1 Mar 2022 17:32:36 -0800 Subject: [PATCH 075/222] Fix s390x hangs, rhbz#2058803 --- rust-pr94505-mono-item-sort-local.patch | 34 +++++++++++++++++++++++++ rust.spec | 10 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 rust-pr94505-mono-item-sort-local.patch diff --git a/rust-pr94505-mono-item-sort-local.patch b/rust-pr94505-mono-item-sort-local.patch new file mode 100644 index 0000000..7710704 --- /dev/null +++ b/rust-pr94505-mono-item-sort-local.patch @@ -0,0 +1,34 @@ +diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs +index 892808386dee..13c325a14e40 100644 +--- a/compiler/rustc_middle/src/mir/mono.rs ++++ b/compiler/rustc_middle/src/mir/mono.rs +@@ -7,6 +7,7 @@ + use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; + use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; + use rustc_hir::ItemId; ++use rustc_index::vec::Idx; + use rustc_query_system::ich::{NodeIdHashingMode, StableHashingContext}; + use rustc_session::config::OptLevel; + use rustc_span::source_map::Span; +@@ -380,7 +381,7 @@ fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx>, item: MonoItem<'tcx>) -> ItemSortKey<' + // instances into account. The others don't matter for + // the codegen tests and can even make item order + // unstable. +- InstanceDef::Item(def) => Some(def.did.index.as_usize()), ++ InstanceDef::Item(def) => def.did.as_local().map(Idx::index), + InstanceDef::VtableShim(..) + | InstanceDef::ReifyShim(..) + | InstanceDef::Intrinsic(..) +@@ -391,10 +392,8 @@ fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx>, item: MonoItem<'tcx>) -> ItemSortKey<' + | InstanceDef::CloneShim(..) => None, + } + } +- MonoItem::Static(def_id) => Some(def_id.index.as_usize()), +- MonoItem::GlobalAsm(item_id) => { +- Some(item_id.def_id.to_def_id().index.as_usize()) +- } ++ MonoItem::Static(def_id) => def_id.as_local().map(Idx::index), ++ MonoItem::GlobalAsm(item_id) => Some(item_id.def_id.index()), + }, + item.symbol_name(tcx), + ) diff --git a/rust.spec b/rust.spec index 5759f17..831a54c 100644 --- a/rust.spec +++ b/rust.spec @@ -81,7 +81,7 @@ Name: rust Version: 1.59.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -100,6 +100,10 @@ Source1: %{wasi_libc_source} # By default, rust tries to use "rust-lld" as a linker for WebAssembly. Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch +# This regressed in 1.59, hanging builds on s390x, rhbz#2058803 +# https://github.com/rust-lang/rust/pull/94505 +Patch2: rust-pr94505-mono-item-sort-local.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -534,6 +538,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 +%patch2 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -972,6 +977,9 @@ end} %changelog +* 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 From eb8a9d02cd23f55da74cc2f38323282f6cd1fda2 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 4 Mar 2022 11:39:28 -0500 Subject: [PATCH 076/222] Bootstrapping for Fedora ELN Signed-off-by: Stephen Gallagher --- rust.spec | 7 +++++-- sources | 6 ++++++ sources-bootstrap | 8 -------- sources-non-bootsrap | 2 ++ 4 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 sources-bootstrap create mode 100644 sources-non-bootsrap diff --git a/rust.spec b/rust.spec index 831a54c..d1bebdc 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2022-01-13 # Only the specified arches will use bootstrap binaries. -#global bootstrap_arches %%{rust_arches} +%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 @@ -81,7 +81,7 @@ Name: rust Version: 1.59.0 -Release: 2%{?dist} +Release: 2.1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -977,6 +977,9 @@ end} %changelog +* 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 diff --git a/sources b/sources index fa999c3..c78dbe1 100644 --- a/sources +++ b/sources @@ -1,2 +1,8 @@ SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 +SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 +SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f +SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 +SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 +SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 +SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 diff --git a/sources-bootstrap b/sources-bootstrap deleted file mode 100644 index c78dbe1..0000000 --- a/sources-bootstrap +++ /dev/null @@ -1,8 +0,0 @@ -SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 -SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 -SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 -SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f -SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 -SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 -SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 -SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 diff --git a/sources-non-bootsrap b/sources-non-bootsrap new file mode 100644 index 0000000..fa999c3 --- /dev/null +++ b/sources-non-bootsrap @@ -0,0 +1,2 @@ +SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 +SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 From 58058fcf899255a5745b85120f4ee87b468338e7 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 4 Mar 2022 16:54:46 -0500 Subject: [PATCH 077/222] Rebuild against the bootstrapped build Signed-off-by: Stephen Gallagher --- rust.spec | 7 +++++-- sources | 6 ------ sources-bootstrap | 8 ++++++++ sources-non-bootsrap | 2 -- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 sources-bootstrap delete mode 100644 sources-non-bootsrap diff --git a/rust.spec b/rust.spec index d1bebdc..4142a40 100644 --- a/rust.spec +++ b/rust.spec @@ -15,7 +15,7 @@ %global bootstrap_date 2022-01-13 # Only the specified arches will use bootstrap binaries. -%global bootstrap_arches %%{rust_arches} +#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 @@ -81,7 +81,7 @@ Name: rust Version: 1.59.0 -Release: 2.1%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -977,6 +977,9 @@ end} %changelog +* 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 diff --git a/sources b/sources index c78dbe1..fa999c3 100644 --- a/sources +++ b/sources @@ -1,8 +1,2 @@ SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 -SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 -SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f -SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 -SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 -SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 -SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 diff --git a/sources-bootstrap b/sources-bootstrap new file mode 100644 index 0000000..c78dbe1 --- /dev/null +++ b/sources-bootstrap @@ -0,0 +1,8 @@ +SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 +SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 +SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 +SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f +SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 +SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 +SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 +SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 diff --git a/sources-non-bootsrap b/sources-non-bootsrap deleted file mode 100644 index fa999c3..0000000 --- a/sources-non-bootsrap +++ /dev/null @@ -1,2 +0,0 @@ -SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 -SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 From 96205271fc7566327007bcc2ec89c77c9043c361 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 25 Mar 2022 13:32:40 -0700 Subject: [PATCH 078/222] Fix the archive index for wasm32-wasi's libc.a --- rust.spec | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 4142a40..b0b174e 100644 --- a/rust.spec +++ b/rust.spec @@ -81,7 +81,7 @@ Name: rust Version: 1.59.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -287,16 +287,21 @@ BuildRequires: %{devtoolset_name}-gcc-c++ %if %defined mingw_targets BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw32-crt +BuildRequires: mingw64-crt BuildRequires: mingw32-gcc BuildRequires: mingw64-gcc +BuildRequires: mingw32-winpthreads-static +BuildRequires: mingw64-winpthreads-static %endif %if %defined wasm_targets BuildRequires: clang +BuildRequires: lld # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ %__os_install_post \ -find '%{buildroot}%{rustlibdir}' -type f -path '*/wasm*/lib/*.rlib' -print -exec '%{llvm_root}/bin/llvm-ranlib' '{}' ';' \ +find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' -print -exec '%{llvm_root}/bin/llvm-ranlib' '{}' ';' \ %{nil} %endif @@ -800,6 +805,13 @@ env RUSTC=%{buildroot}%{_bindir}/rustc \ LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml +# Try a build sanity-check for other targets +for triple in %{?mingw_targets} %{?wasm_targets}; do + env RUSTC=%{buildroot}%{_bindir}/rustc \ + LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ + %{buildroot}%{_bindir}/cargo build --manifest-path build/hello-world/Cargo.toml --target=$triple +done + # 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. %{__python3} ./x.py test --no-fail-fast --stage 2 || : @@ -977,6 +989,9 @@ end} %changelog +* 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 From 2732633a74f2480fa9c165e99988667a55d1c255 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 17 Mar 2022 17:36:25 -0700 Subject: [PATCH 079/222] split up the bootstrap downloads --- rust.spec | 48 ++++++++++++++++++++++++++++------------------- sources-bootstrap | 8 -------- 2 files changed, 29 insertions(+), 27 deletions(-) delete mode 100644 sources-bootstrap diff --git a/rust.spec b/rust.spec index b0b174e..9ea2a6b 100644 --- a/rust.spec +++ b/rust.spec @@ -6,15 +6,17 @@ %{!?channel: %global channel stable} # To bootstrap from scratch, set the channel and date from src/stage0.json -# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 +# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -# Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.58.0 -%global bootstrap_cargo 1.58.0 +%global bootstrap_version 1.58.0 %global bootstrap_channel 1.58.0 %global bootstrap_date 2022-01-13 # Only the specified arches will use bootstrap binaries. +# NOTE: Those binaries used to be uploaded with every new release, but that was +# a waste of lookaside cache space when they're most often unused. +# Run "spectool -g rust.spec" after changing this and then "fedpkg upload" to +# 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 @@ -144,31 +146,35 @@ end} for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do table.insert(bootstrap_arches, arch) end - local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}" - .."/rust-%{bootstrap_channel}") + local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}") + local channel = rpm.expand("%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do - i = 100 + i - print(string.format("Source%d: %s-%s.tar.xz\n", - i, base, rust_triple(arch))) + i = 100 + i * 3 + local suffix = channel.."-"..rust_triple(arch) + print(string.format("Source%d: %s/cargo-%s.tar.xz\n", i, base, suffix)) + print(string.format("Source%d: %s/rustc-%s.tar.xz\n", i+1, base, suffix)) + print(string.format("Source%d: %s/rust-std-%s.tar.xz\n", i+2, base, suffix)) if arch == target_arch then - rpm.define("bootstrap_source "..i) + rpm.define("bootstrap_source_cargo "..i) + rpm.define("bootstrap_source_rustc "..i+1) + rpm.define("bootstrap_source_std "..i+2) + rpm.define("bootstrap_suffix "..suffix) end end end} %endif %ifarch %{bootstrap_arches} -%global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple} -%global local_rust_root %{_builddir}/%{bootstrap_root}/usr -Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} +%global local_rust_root %{_builddir}/rust-%{bootstrap_suffix} +Provides: bundled(%{name}-bootstrap) = %{bootstrap_version} %else -BuildRequires: cargo >= %{bootstrap_cargo} +BuildRequires: cargo >= %{bootstrap_version} %if 0%{?rhel} && 0%{?rhel} < 8 -BuildRequires: %{name} >= %{bootstrap_rust} +BuildRequires: %{name} >= %{bootstrap_version} BuildConflicts: %{name} > %{version} %else -BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) +BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) %endif %global local_rust_root %{_prefix} %endif @@ -529,9 +535,13 @@ data to provide information about the Rust standard library. %prep %ifarch %{bootstrap_arches} -%setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} -./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \ - --prefix=%{local_rust_root} --disable-ldconfig +rm -rf %{local_rust_root} +%setup -q -n cargo-%{bootstrap_suffix} -T -b %{bootstrap_source_cargo} +./install.sh --prefix=%{local_rust_root} --disable-ldconfig +%setup -q -n rustc-%{bootstrap_suffix} -T -b %{bootstrap_source_rustc} +./install.sh --prefix=%{local_rust_root} --disable-ldconfig +%setup -q -n rust-std-%{bootstrap_suffix} -T -b %{bootstrap_source_std} +./install.sh --prefix=%{local_rust_root} --disable-ldconfig test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif diff --git a/sources-bootstrap b/sources-bootstrap deleted file mode 100644 index c78dbe1..0000000 --- a/sources-bootstrap +++ /dev/null @@ -1,8 +0,0 @@ -SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 -SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 -SHA512 (rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz) = 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 -SHA512 (rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz) = c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f -SHA512 (rust-1.58.0-i686-unknown-linux-gnu.tar.xz) = 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 -SHA512 (rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz) = bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 -SHA512 (rust-1.58.0-s390x-unknown-linux-gnu.tar.xz) = 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 -SHA512 (rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz) = 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 From 04da44cfe0ae07cf4b04a0c946569df452bc932e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 7 Apr 2022 10:16:05 -0700 Subject: [PATCH 080/222] Update to 1.60.0. --- .gitignore | 1 + rust.spec | 42 +++++++++++--------- rustc-1.59.0-disable-http2.patch | 66 -------------------------------- sources | 2 +- wasi-libc-clang-14-compat.patch | 15 ++++++++ 5 files changed, 41 insertions(+), 85 deletions(-) delete mode 100644 rustc-1.59.0-disable-http2.patch create mode 100644 wasi-libc-clang-14-compat.patch diff --git a/.gitignore b/.gitignore index b19c5b2..1b3ca29 100644 --- a/.gitignore +++ b/.gitignore @@ -398,3 +398,4 @@ /rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz /rust-1.58.0-s390x-unknown-linux-gnu.tar.xz /rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz +/rustc-1.60.0-src.tar.xz diff --git a/rust.spec b/rust.spec index 9ea2a6b..fc844a8 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.58.0 -%global bootstrap_channel 1.58.0 -%global bootstrap_date 2022-01-13 +%global bootstrap_version 1.59.0 +%global bootstrap_channel 1.59.0 +%global bootstrap_date 2022-02-24 # 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 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. %global min_llvm_version 12.0.0 -%global bundled_llvm_version 13.0.0 +%global bundled_llvm_version 14.0.0 %bcond_with bundled_llvm # Requires stable libgit2 1.3, and not the next minor soname change. @@ -82,8 +82,8 @@ %endif Name: rust -Version: 1.59.0 -Release: 4%{?dist} +Version: 1.60.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,10 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # https://github.com/rust-lang/rust/pull/94505 Patch2: rust-pr94505-mono-item-sort-local.patch +# Clang 14 adds new builtin macros that wasi-libc doesn't expect yet +# See https://github.com/WebAssembly/wasi-libc/pull/265 +Patch3: wasi-libc-clang-14-compat.patch + ### RHEL-specific patches below ### # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) @@ -113,7 +117,7 @@ Patch100: rustc-1.59.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.59.0-disable-http2.patch +Patch101: rustc-1.60.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -548,6 +552,7 @@ test -f '%{local_rust_root}/bin/rustc' %if %defined wasm_targets %setup -q -n %{wasi_libc_name} -T -b 1 +%patch3 -p1 %endif %setup -q -n %{rustc_package} @@ -656,14 +661,6 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then ncpus="$max_cpus" fi -%define target_config %{shrink: - --set target.%{rust_triple}.linker=%{__cc} - --set target.%{rust_triple}.cc=%{__cc} - --set target.%{rust_triple}.cxx=%{__cxx} - --set target.%{rust_triple}.ar=%{__ar} - --set target.%{rust_triple}.ranlib=%{__ranlib} -} - %if %defined mingw_targets %{lua: do local cfg = "" @@ -672,14 +669,15 @@ fi triple = triple, mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", } - local s = string.gsub([[%{shrink: + local s = string.gsub([[ --set target.{{triple}}.linker=%{{{mingw}}_cc} --set target.{{triple}}.cc=%{{{mingw}}_cc} --set target.{{triple}}.ar=%{{{mingw}}_ar} --set target.{{triple}}.ranlib=%{{{mingw}}_ranlib} - }]], "{{(%w+)}}", subs) + ]], "{{(%w+)}}", subs) cfg = cfg .. " " .. s end + cfg = string.gsub(cfg, "%s+", " ") rpm.define("mingw_target_config " .. cfg) end} %endif @@ -701,11 +699,16 @@ end} %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ - %{target_config} \ + --set target.%{rust_triple}.linker=%{__cc} \ + --set target.%{rust_triple}.cc=%{__cc} \ + --set target.%{rust_triple}.cxx=%{__cxx} \ + --set target.%{rust_triple}.ar=%{__ar} \ + --set target.%{rust_triple}.ranlib=%{__ranlib} \ %{?mingw_target_config} \ %{?wasm_target_config} \ --python=%{__python3} \ --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 } } \ @@ -999,6 +1002,9 @@ end} %changelog +* 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 diff --git a/rustc-1.59.0-disable-http2.patch b/rustc-1.59.0-disable-http2.patch deleted file mode 100644 index 603bd32..0000000 --- a/rustc-1.59.0-disable-http2.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- rustc-1.59.0-src/Cargo.lock.orig 2022-02-22 10:19:00.330367749 -0800 -+++ rustc-1.59.0-src/Cargo.lock 2022-02-22 10:19:00.332367706 -0800 -@@ -909,7 +909,6 @@ - dependencies = [ - "cc", - "libc", -- "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -1957,16 +1956,6 @@ - checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - - [[package]] --name = "libnghttp2-sys" --version = "0.1.4+1.41.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" --dependencies = [ -- "cc", -- "libc", --] -- --[[package]] - name = "libz-sys" - version = "1.1.3" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.59.0-src/src/tools/cargo/Cargo.toml.orig 2022-02-22 10:19:00.332367706 -0800 -+++ rustc-1.59.0-src/src/tools/cargo/Cargo.toml 2022-02-22 10:19:54.029231795 -0800 -@@ -22,7 +22,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.1.2" } - crates-io = { path = "crates/crates-io", version = "0.33.1" } - crossbeam-utils = "0.8" --curl = { version = "0.4.41", features = ["http2"] } -+curl = { version = "0.4.41", features = [] } - curl-sys = "0.4.50" - env_logger = "0.9.0" - pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.59.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-02-21 18:48:53.000000000 -0800 -+++ rustc-1.59.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-02-22 10:19:00.332367706 -0800 -@@ -419,14 +419,8 @@ - // Also note that pipelining is disabled as curl authors have indicated - // that it's buggy, and we've empirically seen that it's buggy with HTTP - // proxies. -- let mut multi = Multi::new(); -- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); -- multi -- .pipelining(false, multiplexing) -- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood crates.io with connections -- multi.set_max_host_connections(2)?; -+ let multi = Multi::new(); -+ let multiplexing = false; - - Ok(PackageSet { - packages: package_ids -@@ -655,7 +649,7 @@ - macro_rules! try_old_curl { - ($e:expr, $msg:expr) => { - let result = $e; -- if cfg!(target_os = "macos") { -+ if cfg!(any(target_os = "linux", target_os = "macos")) { - if let Err(e) = result { - warn!("ignoring libcurl {} error: {}", $msg, e); - } diff --git a/sources b/sources index fa999c3..c832043 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.59.0-src.tar.xz) = acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 +SHA512 (rustc-1.60.0-src.tar.xz) = d0c113e8c2c67bf10773c9403dc4c4700c4deb2fb287bfec51e565d3473d2b481d8ae2c90b272cd67b3a87d7443ea25a34c7b40ba8cd7106bf5d71126ab141c3 SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 diff --git a/wasi-libc-clang-14-compat.patch b/wasi-libc-clang-14-compat.patch new file mode 100644 index 0000000..32d52f0 --- /dev/null +++ b/wasi-libc-clang-14-compat.patch @@ -0,0 +1,15 @@ +diff --git a/Makefile b/Makefile +index a93b10a6757a..518bab0aaf78 100644 +--- a/Makefile ++++ b/Makefile +@@ -538,6 +538,10 @@ check-symbols: startup_files libc + -U__GNUC_PATCHLEVEL__ \ + -U__VERSION__ \ + -U__FLOAT128__ \ ++ -U__NO_MATH_ERRNO__ \ ++ -U__BITINT_MAXWIDTH__ \ ++ | grep -vE '^#define __(BOOL|INT|LLONG|LONG|SHRT)_WIDTH__' \ ++ | grep -vE '^#define __INT_(FAST|LEAST)(8|16|32|64)_WIDTH__' \ + | sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \ + | grep -v '^#define __FLT16_' \ + > "$(SYSROOT_SHARE)/predefined-macros.txt" From 70748e85ce4399ca5a191f32b3685fd1d37da637 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 7 Apr 2022 10:33:38 -0700 Subject: [PATCH 081/222] re-add a broken patch rename --- rustc-1.60.0-disable-http2.patch | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 rustc-1.60.0-disable-http2.patch diff --git a/rustc-1.60.0-disable-http2.patch b/rustc-1.60.0-disable-http2.patch new file mode 100644 index 0000000..a3a9e2c --- /dev/null +++ b/rustc-1.60.0-disable-http2.patch @@ -0,0 +1,66 @@ +--- rustc-beta-src/Cargo.lock.orig 2022-03-18 10:27:54.154949492 -0700 ++++ rustc-beta-src/Cargo.lock 2022-03-18 10:27:54.156949449 -0700 +@@ -958,7 +958,6 @@ + dependencies = [ + "cc", + "libc", +- "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -2009,16 +2008,6 @@ + checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" + + [[package]] +-name = "libnghttp2-sys" +-version = "0.1.4+1.41.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +-dependencies = [ +- "cc", +- "libc", +-] +- +-[[package]] + name = "libz-sys" + version = "1.1.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-03-18 10:27:54.156949449 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-03-18 10:29:15.967184238 -0700 +@@ -22,7 +22,7 @@ + cargo-util = { path = "crates/cargo-util", version = "0.1.2" } + crates-io = { path = "crates/crates-io", version = "0.34.0" } + crossbeam-utils = "0.8" +-curl = { version = "0.4.41", features = ["http2"] } ++curl = { version = "0.4.41", features = [] } + curl-sys = "0.4.50" + env_logger = "0.9.0" + pretty_env_logger = { version = "0.4", optional = true } +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-03-14 11:49:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-03-18 10:27:54.156949449 -0700 +@@ -412,14 +412,8 @@ + // Also note that pipelining is disabled as curl authors have indicated + // that it's buggy, and we've empirically seen that it's buggy with HTTP + // proxies. +- let mut multi = Multi::new(); +- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); +- multi +- .pipelining(false, multiplexing) +- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; +- +- // let's not flood crates.io with connections +- multi.set_max_host_connections(2)?; ++ let multi = Multi::new(); ++ let multiplexing = false; + + Ok(PackageSet { + packages: package_ids +@@ -648,7 +642,7 @@ + macro_rules! try_old_curl { + ($e:expr, $msg:expr) => { + let result = $e; +- if cfg!(target_os = "macos") { ++ if cfg!(any(target_os = "linux", target_os = "macos")) { + if let Err(e) = result { + warn!("ignoring libcurl {} error: {}", $msg, e); + } From 3c34da705bf9c41da7af552e50da1439f808258d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 May 2022 16:19:51 -0700 Subject: [PATCH 082/222] Update to 1.61.0. Add rust-toolset for ELN. --- .gitignore | 2 + ...-Use-lld-provided-by-system-for-wasm.patch | 10 +-- macros.rust-toolset | 51 +++++++++++++ rust-pr94505-mono-item-sort-local.patch | 34 --------- rust.spec | 76 +++++++++++++------ ....patch => rustc-1.61.0-disable-http2.patch | 50 ++++++++---- rustc-1.61.0-rust-gdb-substitute-path.patch | 18 +++++ sources | 4 +- wasi-libc-clang-14-compat.patch | 15 ---- 9 files changed, 169 insertions(+), 91 deletions(-) create mode 100644 macros.rust-toolset delete mode 100644 rust-pr94505-mono-item-sort-local.patch rename rustc-1.60.0-disable-http2.patch => rustc-1.61.0-disable-http2.patch (51%) create mode 100644 rustc-1.61.0-rust-gdb-substitute-path.patch delete mode 100644 wasi-libc-clang-14-compat.patch diff --git a/.gitignore b/.gitignore index 1b3ca29..18ac470 100644 --- a/.gitignore +++ b/.gitignore @@ -399,3 +399,5 @@ /rust-1.58.0-s390x-unknown-linux-gnu.tar.xz /rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz /rustc-1.60.0-src.tar.xz +/rustc-1.61.0-src.tar.xz +/wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch index 681b21a..fa75ad3 100644 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -1,4 +1,4 @@ -From 9ac837c237568a6c1c5f0e979fcce208cd9c926a Mon Sep 17 00:00:00 2001 +From b521511174b1a08dddfac243604d649b71cc7386 Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sun, 8 Dec 2019 17:23:08 +0500 Subject: [PATCH] Use lld provided by system for wasm @@ -8,7 +8,7 @@ Subject: [PATCH] Use lld provided by system for wasm 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index 4c954a1e567c..15c4f1bda5eb 100644 +index de7b7374af31..eebbe616e9b6 100644 --- a/compiler/rustc_target/src/spec/wasm_base.rs +++ b/compiler/rustc_target/src/spec/wasm_base.rs @@ -99,8 +99,7 @@ pub fn options() -> TargetOptions { @@ -16,11 +16,11 @@ index 4c954a1e567c..15c4f1bda5eb 100644 limit_rdylib_exports: false, - // we use the LLD shipped with the Rust toolchain by default -- linker: Some("rust-lld".to_owned()), -+ linker: Some("lld".to_owned()), +- linker: Some("rust-lld".into()), ++ linker: Some("lld".into()), lld_flavor: LldFlavor::Wasm, linker_is_gnu: false, -- -2.31.1 +2.35.1 diff --git a/macros.rust-toolset b/macros.rust-toolset new file mode 100644 index 0000000..41bb129 --- /dev/null +++ b/macros.rust-toolset @@ -0,0 +1,51 @@ +# 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 %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo +%__rustc %{_bindir}/rustc +%__rustdoc %{_bindir}/rustdoc + +# Enable optimization, debuginfo, and link hardening. +%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now + +%__global_rustflags_toml [%{lua: + for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do + print('"' .. arg .. '", ') + end}] + +%cargo_prep(V:) (\ +%{__mkdir} -p .cargo \ +cat > .cargo/config << EOF \ +[build]\ +rustc = "%{__rustc}"\ +rustdoc = "%{__rustdoc}"\ +rustflags = %{__global_rustflags_toml}\ +\ +[install]\ +root = "%{buildroot}%{_prefix}"\ +\ +[term]\ +verbose = true\ +EOF\ +%if 0%{-V:1}\ +%{__tar} -xoaf %{S:%{-V*}}\ +cat >> .cargo/config << EOF \ +\ +[source.crates-io]\ +replace-with = "vendored-sources"\ +\ +[source.vendored-sources]\ +directory = "./vendor"\ +EOF\ +%endif\ +) + +%cargo_build %__cargo build --release %{?_smp_mflags} + +%cargo_test %__cargo test --release %{?_smp_mflags} --no-fail-fast + +%cargo_install %__cargo install --no-track --path . diff --git a/rust-pr94505-mono-item-sort-local.patch b/rust-pr94505-mono-item-sort-local.patch deleted file mode 100644 index 7710704..0000000 --- a/rust-pr94505-mono-item-sort-local.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs -index 892808386dee..13c325a14e40 100644 ---- a/compiler/rustc_middle/src/mir/mono.rs -+++ b/compiler/rustc_middle/src/mir/mono.rs -@@ -7,6 +7,7 @@ - use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; - use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; - use rustc_hir::ItemId; -+use rustc_index::vec::Idx; - use rustc_query_system::ich::{NodeIdHashingMode, StableHashingContext}; - use rustc_session::config::OptLevel; - use rustc_span::source_map::Span; -@@ -380,7 +381,7 @@ fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx>, item: MonoItem<'tcx>) -> ItemSortKey<' - // instances into account. The others don't matter for - // the codegen tests and can even make item order - // unstable. -- InstanceDef::Item(def) => Some(def.did.index.as_usize()), -+ InstanceDef::Item(def) => def.did.as_local().map(Idx::index), - InstanceDef::VtableShim(..) - | InstanceDef::ReifyShim(..) - | InstanceDef::Intrinsic(..) -@@ -391,10 +392,8 @@ fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx>, item: MonoItem<'tcx>) -> ItemSortKey<' - | InstanceDef::CloneShim(..) => None, - } - } -- MonoItem::Static(def_id) => Some(def_id.index.as_usize()), -- MonoItem::GlobalAsm(item_id) => { -- Some(item_id.def_id.to_def_id().index.as_usize()) -- } -+ MonoItem::Static(def_id) => def_id.as_local().map(Idx::index), -+ MonoItem::GlobalAsm(item_id) => Some(item_id.def_id.index()), - }, - item.symbol_name(tcx), - ) diff --git a/rust.spec b/rust.spec index fc844a8..fc424b9 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.59.0 -%global bootstrap_channel 1.59.0 -%global bootstrap_date 2022-02-24 +%global bootstrap_version 1.60.0 +%global bootstrap_channel 1.60.0 +%global bootstrap_date 2022-04-07 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -33,8 +33,9 @@ # 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_commit ad5133410f66b93a2381db5b542aad5e0964db96 +%global wasi_libc_commit 9886d3d6200fcc3726329966860fc058707406cd %global wasi_libc_name wasi-libc-%{wasi_libc_commit} %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_commit}/%{wasi_libc_name}.tar.gz %global wasi_libc_dir %{_builddir}/%{wasi_libc_name} @@ -48,12 +49,12 @@ %global bundled_llvm_version 14.0.0 %bcond_with bundled_llvm -# Requires stable libgit2 1.3, and not the next minor soname change. +# Requires stable libgit2 1.4, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.3.0 -%global next_libgit2_version 1.4.0~ -%global bundled_libgit2_version 1.3.0 -%if 0%{?fedora} >= 36 +%global min_libgit2_version 1.4.0 +%global next_libgit2_version 1.5.0~ +%global bundled_libgit2_version 1.4.2 +%if 0%{?fedora} >= 99 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -82,7 +83,7 @@ %endif Name: rust -Version: 1.60.0 +Version: 1.61.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -102,22 +103,20 @@ Source1: %{wasi_libc_source} # By default, rust tries to use "rust-lld" as a linker for WebAssembly. Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch -# This regressed in 1.59, hanging builds on s390x, rhbz#2058803 -# https://github.com/rust-lang/rust/pull/94505 -Patch2: rust-pr94505-mono-item-sort-local.patch - -# Clang 14 adds new builtin macros that wasi-libc doesn't expect yet -# See https://github.com/WebAssembly/wasi-libc/pull/265 -Patch3: wasi-libc-clang-14-compat.patch +# Set a substitute-path in rust-gdb for standard library sources. +Patch2: rustc-1.61.0-rust-gdb-substitute-path.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.59.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.60.0-disable-http2.patch +Patch101: rustc-1.61.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -154,7 +153,7 @@ end} local channel = rpm.expand("%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do - i = 100 + i * 3 + i = 1000 + i * 3 local suffix = channel.."-"..rust_triple(arch) print(string.format("Source%d: %s/cargo-%s.tar.xz\n", i, base, suffix)) print(string.format("Source%d: %s/rustc-%s.tar.xz\n", i+1, base, suffix)) @@ -536,6 +535,20 @@ feature for the Rust standard library. The RLS (Rust Language Server) uses this data to provide information about the Rust standard library. +%if 0%{?rhel} && 0%{?rhel} >= 8 + +%package toolset +Summary: Rust Toolset +Requires: rust%{?_isa} = %{version}-%{release} +Requires: cargo%{?_isa} = %{version}-%{release} + +%description toolset +This is the metapackage for Rust Toolset, bringing in the Rust compiler, +the Cargo package manager, and a few convenience macros for rpm builds. + +%endif + + %prep %ifarch %{bootstrap_arches} @@ -552,7 +565,6 @@ test -f '%{local_rust_root}/bin/rustc' %if %defined wasm_targets %setup -q -n %{wasi_libc_name} -T -b 1 -%patch3 -p1 %endif %setup -q -n %{rustc_package} @@ -576,6 +588,9 @@ rm -rf vendor/libnghttp2-sys/ # Use our explicit python3 first sed -i.try-python -e '/^try python3 /i try "%{__python3}" "$@"' ./configure +# Set a substitute-path in rust-gdb for standard library sources. +sed -i.rust-src -e "s#@BUILDDIR@#$PWD#" ./src/etc/rust-gdb + %if %without bundled_llvm rm -rf src/llvm-project/ mkdir -p src/llvm-project/libunwind/ @@ -583,7 +598,8 @@ mkdir -p src/llvm-project/libunwind/ # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ -rm -rf vendor/jemalloc-sys/jemalloc/ +rm -rf vendor/*jemalloc-sys*/jemalloc/ +rm -rf vendor/libmimalloc-sys/c_src/mimalloc/ rm -rf vendor/libssh2-sys/libssh2/ rm -rf vendor/libz-sys/src/zlib/ rm -rf vendor/libz-sys/src/zlib-ng/ @@ -683,7 +699,7 @@ end} %endif %if %defined wasm_targets -%make_build --quiet -C %{wasi_libc_dir} +%make_build --quiet -C %{wasi_libc_dir} CC=clang AR=llvm-ar NM=llvm-nm %{lua: do local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot" local cfg = "" @@ -712,6 +728,7 @@ end} %{!?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-rpath \ %{enable_debuginfo} \ --set rust.codegen-units-std=1 \ @@ -808,6 +825,11 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_* # We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp) rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* +%if 0%{?rhel} && 0%{?rhel} >= 8 +# This allows users to build packages using Rust Toolset. +%{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset +%endif + %check %{export_rust_env} @@ -1001,7 +1023,17 @@ end} %{rustlibdir}/%{rust_triple}/analysis/ +%if 0%{?rhel} && 0%{?rhel} >= 8 +%files toolset +%{rpmmacrodir}/macros.rust-toolset +%endif + + %changelog +* 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. diff --git a/rustc-1.60.0-disable-http2.patch b/rustc-1.61.0-disable-http2.patch similarity index 51% rename from rustc-1.60.0-disable-http2.patch rename to rustc-1.61.0-disable-http2.patch index a3a9e2c..97a8227 100644 --- a/rustc-1.60.0-disable-http2.patch +++ b/rustc-1.61.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2022-03-18 10:27:54.154949492 -0700 -+++ rustc-beta-src/Cargo.lock 2022-03-18 10:27:54.156949449 -0700 -@@ -958,7 +958,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2022-04-28 15:34:11.668960640 -0700 ++++ rustc-beta-src/Cargo.lock 2022-04-28 15:35:24.542419588 -0700 +@@ -951,7 +951,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2009,16 +2008,6 @@ +@@ -2002,16 +2001,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,8 +25,8 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-03-18 10:27:54.156949449 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-03-18 10:29:15.967184238 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-04-24 17:43:07.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-04-28 15:34:11.670960598 -0700 @@ -22,7 +22,7 @@ cargo-util = { path = "crates/cargo-util", version = "0.1.2" } crates-io = { path = "crates/crates-io", version = "0.34.0" } @@ -36,12 +36,35 @@ curl-sys = "0.4.50" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-03-14 11:49:37.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-03-18 10:27:54.156949449 -0700 -@@ -412,14 +412,8 @@ - // Also note that pipelining is disabled as curl authors have indicated - // that it's buggy, and we've empirically seen that it's buggy with HTTP - // proxies. +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-04-24 17:43:07.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-04-28 15:34:11.670960598 -0700 +@@ -183,16 +183,8 @@ + } + self.fetch_started = true; + +- // We've enabled the `http2` feature of `curl` in Cargo, so treat +- // failures here as fatal as it would indicate a build-time problem. +- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true); +- +- self.multi +- .pipelining(false, self.multiplexing) +- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; +- +- // let's not flood the server with connections +- self.multi.set_max_host_connections(2)?; ++ // Multiplexing is disabled because the system libcurl doesn't support it. ++ self.multiplexing = false; + + self.config + .shell() +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-04-24 17:43:07.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-04-28 15:34:11.670960598 -0700 +@@ -403,16 +403,9 @@ + sources: SourceMap<'cfg>, + config: &'cfg Config, + ) -> CargoResult> { +- // We've enabled the `http2` feature of `curl` in Cargo, so treat +- // failures here as fatal as it would indicate a build-time problem. - let mut multi = Multi::new(); - let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); - multi @@ -50,12 +73,13 @@ - - // let's not flood crates.io with connections - multi.set_max_host_connections(2)?; ++ // Multiplexing is disabled because the system libcurl doesn't support it. + let multi = Multi::new(); + let multiplexing = false; Ok(PackageSet { packages: package_ids -@@ -648,7 +642,7 @@ +@@ -658,7 +651,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.61.0-rust-gdb-substitute-path.patch b/rustc-1.61.0-rust-gdb-substitute-path.patch new file mode 100644 index 0000000..b94e23e --- /dev/null +++ b/rustc-1.61.0-rust-gdb-substitute-path.patch @@ -0,0 +1,18 @@ +--- rustc-1.61.0-src/src/etc/rust-gdb.orig 2022-05-17 18:29:36.000000000 -0700 ++++ rustc-1.61.0-src/src/etc/rust-gdb 2022-05-18 11:18:13.732709661 -0700 +@@ -14,6 +14,9 @@ fi + RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" + GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" + ++RUST_STD_BUILD="@BUILDDIR@/library/" ++RUST_STD_SRC="$RUSTC_SYSROOT/lib/rustlib/src/rust/library/" ++ + # Run GDB with the additional arguments that load the pretty printers + # Set the environment variable `RUST_GDB` to overwrite the call to a + # different/specific command (defaults to `gdb`). +@@ -21,4 +24,5 @@ RUST_GDB="${RUST_GDB:-gdb}" + PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \ + --directory="$GDB_PYTHON_MODULE_DIRECTORY" \ + -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \ ++ -iex "set substitute-path $RUST_STD_BUILD $RUST_STD_SRC" \ + "$@" diff --git a/sources b/sources index c832043..eb259eb 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.60.0-src.tar.xz) = d0c113e8c2c67bf10773c9403dc4c4700c4deb2fb287bfec51e565d3473d2b481d8ae2c90b272cd67b3a87d7443ea25a34c7b40ba8cd7106bf5d71126ab141c3 -SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6 +SHA512 (rustc-1.61.0-src.tar.xz) = 9bbdcc1c37f7b889be0c8d195963b4c3b65267a63ea309315eda12bd3b2cd36e0060301805dfc7da440c0a8702d085ccb0bf763155b27035a078769333637fb3 +SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 diff --git a/wasi-libc-clang-14-compat.patch b/wasi-libc-clang-14-compat.patch deleted file mode 100644 index 32d52f0..0000000 --- a/wasi-libc-clang-14-compat.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/Makefile b/Makefile -index a93b10a6757a..518bab0aaf78 100644 ---- a/Makefile -+++ b/Makefile -@@ -538,6 +538,10 @@ check-symbols: startup_files libc - -U__GNUC_PATCHLEVEL__ \ - -U__VERSION__ \ - -U__FLOAT128__ \ -+ -U__NO_MATH_ERRNO__ \ -+ -U__BITINT_MAXWIDTH__ \ -+ | grep -vE '^#define __(BOOL|INT|LLONG|LONG|SHRT)_WIDTH__' \ -+ | grep -vE '^#define __INT_(FAST|LEAST)(8|16|32|64)_WIDTH__' \ - | sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \ - | grep -v '^#define __FLT16_' \ - > "$(SYSROOT_SHARE)/predefined-macros.txt" From f2eed3dd39318a812e37edf989ee6741bce11730 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 23 May 2022 15:42:58 -0700 Subject: [PATCH 083/222] Add missing target_feature to the list of well known cfg names --- ...et_feature-to-the-list-of-well-known.patch | 36 +++++++++++++++++++ rust.spec | 14 +++++++- ....61.0-fix-compiletest-ignore_message.patch | 13 +++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 0001-Add-missing-target_feature-to-the-list-of-well-known.patch create mode 100644 rustc-1.61.0-fix-compiletest-ignore_message.patch diff --git a/0001-Add-missing-target_feature-to-the-list-of-well-known.patch b/0001-Add-missing-target_feature-to-the-list-of-well-known.patch new file mode 100644 index 0000000..7127255 --- /dev/null +++ b/0001-Add-missing-target_feature-to-the-list-of-well-known.patch @@ -0,0 +1,36 @@ +From beb4e16f055aa7925194fd2c360105a6d55f10f6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20BRANSTETT?= +Date: Wed, 27 Apr 2022 19:11:56 +0200 +Subject: [PATCH] Add missing `target_feature` to the list of well known cfg + names + +--- + compiler/rustc_session/src/config.rs | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs +index 12c5c4445d46..330201dd8fef 100644 +--- a/compiler/rustc_session/src/config.rs ++++ b/compiler/rustc_session/src/config.rs +@@ -1038,6 +1038,7 @@ fn fill_well_known_names(&mut self) { + sym::target_has_atomic_load_store, + sym::target_has_atomic, + sym::target_has_atomic_equal_alignment, ++ sym::target_feature, + sym::panic, + sym::sanitize, + sym::debug_assertions, +@@ -1081,6 +1082,10 @@ fn fill_well_known_values(&mut self) { + .into_iter() + .map(|sanitizer| Symbol::intern(sanitizer.as_str().unwrap())); + ++ // Unknown possible values: ++ // - `feature` ++ // - `target_feature` ++ + // No-values + for name in [ + sym::doc, +-- +2.36.1 + diff --git a/rust.spec b/rust.spec index fc424b9..694dd92 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.61.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,13 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +# Infer the type that compiletest uses for TestDesc ignore_message +Patch3: rustc-1.61.0-fix-compiletest-ignore_message.patch + +# Add missing target_feature to the list of well known cfg names +# https://github.com/rust-lang/rust/pull/96483 +Patch4: 0001-Add-missing-target_feature-to-the-list-of-well-known.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -571,6 +578,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1030,6 +1039,9 @@ end} %changelog +* 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. diff --git a/rustc-1.61.0-fix-compiletest-ignore_message.patch b/rustc-1.61.0-fix-compiletest-ignore_message.patch new file mode 100644 index 0000000..d2dece4 --- /dev/null +++ b/rustc-1.61.0-fix-compiletest-ignore_message.patch @@ -0,0 +1,13 @@ +diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs +index 1bdea33dffaf..1c21d5e87b68 100644 +--- a/src/tools/compiletest/src/header.rs ++++ b/src/tools/compiletest/src/header.rs +@@ -807,7 +807,7 @@ pub fn make_test_description( + ) -> test::TestDesc { + let mut ignore = false; + #[cfg(not(bootstrap))] +- let ignore_message: Option = None; ++ let ignore_message = None; + let mut should_fail = false; + + let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some(); From da6e6dd42c297bd581af49027819573f09cfa7ca Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 30 Jun 2022 09:43:59 -0700 Subject: [PATCH 084/222] Update to 1.62.0. --- .gitignore | 1 + ...et_feature-to-the-list-of-well-known.patch | 36 ------------------- rust.spec | 27 ++++++-------- ....61.0-fix-compiletest-ignore_message.patch | 13 ------- ....patch => rustc-1.62.0-disable-http2.patch | 22 ++++++------ sources | 2 +- 6 files changed, 23 insertions(+), 78 deletions(-) delete mode 100644 0001-Add-missing-target_feature-to-the-list-of-well-known.patch delete mode 100644 rustc-1.61.0-fix-compiletest-ignore_message.patch rename rustc-1.61.0-disable-http2.patch => rustc-1.62.0-disable-http2.patch (84%) diff --git a/.gitignore b/.gitignore index 18ac470..da615ea 100644 --- a/.gitignore +++ b/.gitignore @@ -401,3 +401,4 @@ /rustc-1.60.0-src.tar.xz /rustc-1.61.0-src.tar.xz /wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz +/rustc-1.62.0-src.tar.xz diff --git a/0001-Add-missing-target_feature-to-the-list-of-well-known.patch b/0001-Add-missing-target_feature-to-the-list-of-well-known.patch deleted file mode 100644 index 7127255..0000000 --- a/0001-Add-missing-target_feature-to-the-list-of-well-known.patch +++ /dev/null @@ -1,36 +0,0 @@ -From beb4e16f055aa7925194fd2c360105a6d55f10f6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20BRANSTETT?= -Date: Wed, 27 Apr 2022 19:11:56 +0200 -Subject: [PATCH] Add missing `target_feature` to the list of well known cfg - names - ---- - compiler/rustc_session/src/config.rs | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs -index 12c5c4445d46..330201dd8fef 100644 ---- a/compiler/rustc_session/src/config.rs -+++ b/compiler/rustc_session/src/config.rs -@@ -1038,6 +1038,7 @@ fn fill_well_known_names(&mut self) { - sym::target_has_atomic_load_store, - sym::target_has_atomic, - sym::target_has_atomic_equal_alignment, -+ sym::target_feature, - sym::panic, - sym::sanitize, - sym::debug_assertions, -@@ -1081,6 +1082,10 @@ fn fill_well_known_values(&mut self) { - .into_iter() - .map(|sanitizer| Symbol::intern(sanitizer.as_str().unwrap())); - -+ // Unknown possible values: -+ // - `feature` -+ // - `target_feature` -+ - // No-values - for name in [ - sym::doc, --- -2.36.1 - diff --git a/rust.spec b/rust.spec index 694dd92..82c65f5 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.60.0 -%global bootstrap_channel 1.60.0 -%global bootstrap_date 2022-04-07 +%global bootstrap_version 1.61.0 +%global bootstrap_channel 1.61.0 +%global bootstrap_date 2022-05-19 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -46,7 +46,7 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. %global min_llvm_version 12.0.0 -%global bundled_llvm_version 14.0.0 +%global bundled_llvm_version 14.0.4 %bcond_with bundled_llvm # Requires stable libgit2 1.4, and not the next minor soname change. @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.61.0 -Release: 2%{?dist} +Version: 1.62.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,13 +106,6 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# Infer the type that compiletest uses for TestDesc ignore_message -Patch3: rustc-1.61.0-fix-compiletest-ignore_message.patch - -# Add missing target_feature to the list of well known cfg names -# https://github.com/rust-lang/rust/pull/96483 -Patch4: 0001-Add-missing-target_feature-to-the-list-of-well-known.patch - ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -123,7 +116,7 @@ Patch100: rustc-1.59.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.61.0-disable-http2.patch +Patch101: rustc-1.62.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -578,8 +571,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -979,7 +970,6 @@ end} %{_docdir}/%{name}/html/*.js %{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg -%{_docdir}/%{name}/html/*.woff %{_docdir}/%{name}/html/*.woff2 %license %{_docdir}/%{name}/html/*.txt %license %{_docdir}/%{name}/html/*.md @@ -1039,6 +1029,9 @@ end} %changelog +* 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 diff --git a/rustc-1.61.0-fix-compiletest-ignore_message.patch b/rustc-1.61.0-fix-compiletest-ignore_message.patch deleted file mode 100644 index d2dece4..0000000 --- a/rustc-1.61.0-fix-compiletest-ignore_message.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs -index 1bdea33dffaf..1c21d5e87b68 100644 ---- a/src/tools/compiletest/src/header.rs -+++ b/src/tools/compiletest/src/header.rs -@@ -807,7 +807,7 @@ pub fn make_test_description( - ) -> test::TestDesc { - let mut ignore = false; - #[cfg(not(bootstrap))] -- let ignore_message: Option = None; -+ let ignore_message = None; - let mut should_fail = false; - - let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some(); diff --git a/rustc-1.61.0-disable-http2.patch b/rustc-1.62.0-disable-http2.patch similarity index 84% rename from rustc-1.61.0-disable-http2.patch rename to rustc-1.62.0-disable-http2.patch index 97a8227..71b019e 100644 --- a/rustc-1.61.0-disable-http2.patch +++ b/rustc-1.62.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2022-04-28 15:34:11.668960640 -0700 -+++ rustc-beta-src/Cargo.lock 2022-04-28 15:35:24.542419588 -0700 -@@ -951,7 +951,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2022-06-22 14:03:26.309745526 -0700 ++++ rustc-beta-src/Cargo.lock 2022-06-22 14:03:26.310745506 -0700 +@@ -990,7 +990,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2002,16 +2001,6 @@ +@@ -2101,16 +2100,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,10 +25,10 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-04-24 17:43:07.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-04-28 15:34:11.670960598 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-06-22 14:03:26.310745506 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-06-22 14:04:22.058596881 -0700 @@ -22,7 +22,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.1.2" } + cargo-util = { path = "crates/cargo-util", version = "0.1.3" } crates-io = { path = "crates/crates-io", version = "0.34.0" } crossbeam-utils = "0.8" -curl = { version = "0.4.41", features = ["http2"] } @@ -36,8 +36,8 @@ curl-sys = "0.4.50" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-04-24 17:43:07.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-04-28 15:34:11.670960598 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-06-13 07:34:54.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-06-22 14:03:26.311745485 -0700 @@ -183,16 +183,8 @@ } self.fetch_started = true; @@ -57,8 +57,8 @@ self.config .shell() ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-04-24 17:43:07.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-04-28 15:34:11.670960598 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-06-13 07:34:54.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-06-22 14:03:26.311745485 -0700 @@ -403,16 +403,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, diff --git a/sources b/sources index eb259eb..f8bfd99 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.61.0-src.tar.xz) = 9bbdcc1c37f7b889be0c8d195963b4c3b65267a63ea309315eda12bd3b2cd36e0060301805dfc7da440c0a8702d085ccb0bf763155b27035a078769333637fb3 +SHA512 (rustc-1.62.0-src.tar.xz) = 02872a8409b0490fa9fa7a70756cbf103643694df6b2e2aea32ad8b70032a3162c7751cd92d78291587ee0120daeb9bc1ae5ec6136c7eb6eb584d8be3032dd3d SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 From 9079a8b665c21ff7487d8acfc496a08997f43f28 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 13 Jul 2022 12:50:50 -0700 Subject: [PATCH 085/222] Prevent unsound coercions from functions with opaque return types. --- rust.spec | 10 +- rustc-1.62.0-pr98614.patch | 846 +++++++++++++++++++++++++++++++++++++ 2 files changed, 855 insertions(+), 1 deletion(-) create mode 100644 rustc-1.62.0-pr98614.patch diff --git a/rust.spec b/rust.spec index 82c65f5..d967000 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.62.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,10 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +# Prevent unsound coercions from functions with opaque return types. +# https://github.com/rust-lang/rust/pull/98614 +Patch3: rustc-1.62.0-pr98614.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -571,6 +575,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1029,6 +1034,9 @@ end} %changelog +* 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. diff --git a/rustc-1.62.0-pr98614.patch b/rustc-1.62.0-pr98614.patch new file mode 100644 index 0000000..04794b4 --- /dev/null +++ b/rustc-1.62.0-pr98614.patch @@ -0,0 +1,846 @@ +From 3dfd37fcd387c18205a93ad2ad519c2ab5e1b289 Mon Sep 17 00:00:00 2001 +From: Oli Scherer +Date: Wed, 29 Jun 2022 14:25:44 +0000 +Subject: [PATCH 1/7] pessimistically treat all function items as containing an + opaque type + +(cherry picked from commit 9dbfcbcbb5d835c2a5784e2f4da4816b90c43ff5) +--- + compiler/rustc_middle/src/ty/flags.rs | 5 +++++ + .../issue-53398-cyclic-types.rs | 2 +- + .../issue-53398-cyclic-types.stderr | 4 +--- + .../ui/type-alias-impl-trait/issue-98604.rs | 13 +++++++++++++ + .../type-alias-impl-trait/issue-98604.stderr | 18 ++++++++++++++++++ + .../ui/type-alias-impl-trait/issue-98608.rs | 9 +++++++++ + .../type-alias-impl-trait/issue-98608.stderr | 16 ++++++++++++++++ + 7 files changed, 63 insertions(+), 4 deletions(-) + create mode 100644 src/test/ui/type-alias-impl-trait/issue-98604.rs + create mode 100644 src/test/ui/type-alias-impl-trait/issue-98604.stderr + create mode 100644 src/test/ui/type-alias-impl-trait/issue-98608.rs + create mode 100644 src/test/ui/type-alias-impl-trait/issue-98608.stderr + +diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs +index 7a3d615862cb..63b1352e66b8 100644 +--- a/compiler/rustc_middle/src/ty/flags.rs ++++ b/compiler/rustc_middle/src/ty/flags.rs +@@ -207,6 +207,11 @@ fn add_kind(&mut self, kind: &ty::TyKind<'_>) { + + &ty::FnDef(_, substs) => { + self.add_substs(substs); ++ // HACK(#98608, oli-obk): Function items with opaque types in their signature will ++ // end up not having the HAS_TY_OPAQUE flag set, causing `evaluate_obligation` to ++ // optimistically assume the function item matches any signature. See documentation ++ // on `HAS_FREE_LOCAL_NAMES` for details. ++ self.add_flags(TypeFlags::HAS_TY_OPAQUE); + } + + &ty::FnPtr(fn_sig) => self.bound_computation(fn_sig, |computation, fn_sig| { +diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs +index 6c838f410036..4bc0f9d92008 100644 +--- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs ++++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs +@@ -3,7 +3,7 @@ + type Foo = impl Fn() -> Foo; + + fn foo() -> Foo { +- foo //~ ERROR: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` ++ foo //~ ERROR: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` + } + + fn main() {} +diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr +index a9c2c18630c0..f69514b7808f 100644 +--- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr ++++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr +@@ -1,10 +1,8 @@ +-error[E0275]: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` ++error[E0275]: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` + --> $DIR/issue-53398-cyclic-types.rs:6:5 + | + LL | foo + | ^^^ +- | +- = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`) + + error: aborting due to previous error + +diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.rs b/src/test/ui/type-alias-impl-trait/issue-98604.rs +new file mode 100644 +index 000000000000..a4fd8a82a04f +--- /dev/null ++++ b/src/test/ui/type-alias-impl-trait/issue-98604.rs +@@ -0,0 +1,13 @@ ++// edition:2018 ++ ++type AsyncFnPtr = Box< ++ dyn Fn() -> std::pin::Pin>>, ++>; ++ ++async fn test() {} ++ ++#[allow(unused_must_use)] ++fn main() { ++ Box::new(test) as AsyncFnPtr; ++ //~^ ERROR type mismatch ++} +diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.stderr b/src/test/ui/type-alias-impl-trait/issue-98604.stderr +new file mode 100644 +index 000000000000..f04d1b4d7877 +--- /dev/null ++++ b/src/test/ui/type-alias-impl-trait/issue-98604.stderr +@@ -0,0 +1,18 @@ ++error[E0271]: type mismatch resolving ` impl Future {test} as FnOnce<()>>::Output == Pin + 'static)>>` ++ --> $DIR/issue-98604.rs:11:5 ++ | ++LL | Box::new(test) as AsyncFnPtr; ++ | ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type ++ | ++note: while checking the return type of the `async fn` ++ --> $DIR/issue-98604.rs:7:17 ++ | ++LL | async fn test() {} ++ | ^ checked the `Output` of this `async fn`, found opaque type ++ = note: expected struct `Pin + 'static)>>` ++ found opaque type `impl Future` ++ = note: required for the cast from `fn() -> impl Future {test}` to the object type `dyn Fn() -> Pin + 'static)>>` ++ ++error: aborting due to previous error ++ ++For more information about this error, try `rustc --explain E0271`. +diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.rs b/src/test/ui/type-alias-impl-trait/issue-98608.rs +new file mode 100644 +index 000000000000..d75762a8b62f +--- /dev/null ++++ b/src/test/ui/type-alias-impl-trait/issue-98608.rs +@@ -0,0 +1,9 @@ ++fn hi() -> impl Sized { std::ptr::null::() } ++ ++fn main() { ++ let b: Box Box> = Box::new(hi); ++ //~^ ERROR type mismatch resolving ` impl Sized {hi} as FnOnce<()>>::Output == Box` ++ let boxed = b(); ++ let null = *boxed; ++ println!("{null:?}"); ++} +diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.stderr b/src/test/ui/type-alias-impl-trait/issue-98608.stderr +new file mode 100644 +index 000000000000..8f3ec7d9d161 +--- /dev/null ++++ b/src/test/ui/type-alias-impl-trait/issue-98608.stderr +@@ -0,0 +1,16 @@ ++error[E0271]: type mismatch resolving ` impl Sized {hi} as FnOnce<()>>::Output == Box` ++ --> $DIR/issue-98608.rs:4:39 ++ | ++LL | fn hi() -> impl Sized { std::ptr::null::() } ++ | ---------- the found opaque type ++... ++LL | let b: Box Box> = Box::new(hi); ++ | ^^^^^^^^^^^^ expected struct `Box`, found opaque type ++ | ++ = note: expected struct `Box` ++ found opaque type `impl Sized` ++ = note: required for the cast from `fn() -> impl Sized {hi}` to the object type `dyn Fn() -> Box` ++ ++error: aborting due to previous error ++ ++For more information about this error, try `rustc --explain E0271`. +-- +2.36.1 + + +From f2572a99471d046bef973512026b682bbd60fc1d Mon Sep 17 00:00:00 2001 +From: Oli Scherer +Date: Thu, 30 Jun 2022 13:24:35 +0000 +Subject: [PATCH 2/7] use a method instead of manually doing what its body does + +(cherry picked from commit ade2a96ff1e2c3d434f57b8fa07da66969bceaae) +--- + compiler/rustc_infer/src/traits/project.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/compiler/rustc_infer/src/traits/project.rs b/compiler/rustc_infer/src/traits/project.rs +index b84ed3dc6893..18469208731c 100644 +--- a/compiler/rustc_infer/src/traits/project.rs ++++ b/compiler/rustc_infer/src/traits/project.rs +@@ -203,7 +203,7 @@ pub fn complete(&mut self, key: ProjectionCacheKey<'tcx>, result: EvaluationResu + Some(&ProjectionCacheEntry::NormalizedTy { ref ty, complete: _ }) => { + info!("ProjectionCacheEntry::complete({:?}) - completing {:?}", key, ty); + let mut ty = ty.clone(); +- if result == EvaluationResult::EvaluatedToOk { ++ if result.must_apply_considering_regions() { + ty.obligations = vec![]; + } + map.insert(key, ProjectionCacheEntry::NormalizedTy { ty, complete: Some(result) }); +-- +2.36.1 + + +From 2c7eb77c52989ea098e8b50e97d62ff4a3dc6c97 Mon Sep 17 00:00:00 2001 +From: Oli Scherer +Date: Thu, 30 Jun 2022 14:23:31 +0000 +Subject: [PATCH 3/7] Make `evaluate_obligation` not succeed unconditionally if + it registered new hidden types for opaque types + +(cherry picked from commit 84fc5516648e34f15d17b2ca0b892adb3743a5c0) +--- + compiler/rustc_infer/src/infer/mod.rs | 4 ++++ + compiler/rustc_infer/src/infer/undo_log.rs | 4 ++++ + compiler/rustc_middle/src/traits/select.rs | 18 ++++++++++++++---- + compiler/rustc_middle/src/ty/flags.rs | 5 ----- + .../src/traits/error_reporting/suggestions.rs | 1 + + .../src/traits/select/mod.rs | 4 ++++ + .../issue-53398-cyclic-types.rs | 2 +- + .../issue-53398-cyclic-types.stderr | 4 +++- + 8 files changed, 31 insertions(+), 11 deletions(-) + +diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs +index c9121f7d348c..989cc551a82f 100644 +--- a/compiler/rustc_infer/src/infer/mod.rs ++++ b/compiler/rustc_infer/src/infer/mod.rs +@@ -929,6 +929,10 @@ pub fn region_constraints_added_in_snapshot( + .region_constraints_added_in_snapshot(&snapshot.undo_snapshot) + } + ++ pub fn opaque_types_added_in_snapshot(&self, snapshot: &CombinedSnapshot<'a, 'tcx>) -> bool { ++ self.inner.borrow().undo_log.opaque_types_in_snapshot(&snapshot.undo_snapshot) ++ } ++ + pub fn add_given(&self, sub: ty::Region<'tcx>, sup: ty::RegionVid) { + self.inner.borrow_mut().unwrap_region_constraints().add_given(sub, sup); + } +diff --git a/compiler/rustc_infer/src/infer/undo_log.rs b/compiler/rustc_infer/src/infer/undo_log.rs +index 1b696f21cbcf..74a26ebc39f8 100644 +--- a/compiler/rustc_infer/src/infer/undo_log.rs ++++ b/compiler/rustc_infer/src/infer/undo_log.rs +@@ -185,6 +185,10 @@ pub(crate) fn region_constraints_in_snapshot( + }) + } + ++ pub(crate) fn opaque_types_in_snapshot(&self, s: &Snapshot<'tcx>) -> bool { ++ self.logs[s.undo_len..].iter().any(|log| matches!(log, UndoLog::OpaqueTypes(..))) ++ } ++ + pub(crate) fn region_constraints( + &self, + ) -> impl Iterator> + Clone { +diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs +index ffa70cddbd59..025059fcbcfb 100644 +--- a/compiler/rustc_middle/src/traits/select.rs ++++ b/compiler/rustc_middle/src/traits/select.rs +@@ -174,6 +174,10 @@ pub enum SelectionCandidate<'tcx> { + pub enum EvaluationResult { + /// Evaluation successful. + EvaluatedToOk, ++ /// Evaluation successful, but need to rerun because opaque types got ++ /// hidden types assigned without it being known whether the opaque types ++ /// are within their defining scope ++ EvaluatedToOkModuloOpaqueTypes, + /// Evaluation successful, but there were unevaluated region obligations. + EvaluatedToOkModuloRegions, + /// Evaluation is known to be ambiguous -- it *might* hold for some +@@ -252,9 +256,11 @@ pub fn must_apply_modulo_regions(self) -> bool { + + pub fn may_apply(self) -> bool { + match self { +- EvaluatedToOk | EvaluatedToOkModuloRegions | EvaluatedToAmbig | EvaluatedToUnknown => { +- true +- } ++ EvaluatedToOkModuloOpaqueTypes ++ | EvaluatedToOk ++ | EvaluatedToOkModuloRegions ++ | EvaluatedToAmbig ++ | EvaluatedToUnknown => true, + + EvaluatedToErr | EvaluatedToRecur => false, + } +@@ -264,7 +270,11 @@ pub fn is_stack_dependent(self) -> bool { + match self { + EvaluatedToUnknown | EvaluatedToRecur => true, + +- EvaluatedToOk | EvaluatedToOkModuloRegions | EvaluatedToAmbig | EvaluatedToErr => false, ++ EvaluatedToOkModuloOpaqueTypes ++ | EvaluatedToOk ++ | EvaluatedToOkModuloRegions ++ | EvaluatedToAmbig ++ | EvaluatedToErr => false, + } + } + } +diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs +index 63b1352e66b8..7a3d615862cb 100644 +--- a/compiler/rustc_middle/src/ty/flags.rs ++++ b/compiler/rustc_middle/src/ty/flags.rs +@@ -207,11 +207,6 @@ fn add_kind(&mut self, kind: &ty::TyKind<'_>) { + + &ty::FnDef(_, substs) => { + self.add_substs(substs); +- // HACK(#98608, oli-obk): Function items with opaque types in their signature will +- // end up not having the HAS_TY_OPAQUE flag set, causing `evaluate_obligation` to +- // optimistically assume the function item matches any signature. See documentation +- // on `HAS_FREE_LOCAL_NAMES` for details. +- self.add_flags(TypeFlags::HAS_TY_OPAQUE); + } + + &ty::FnPtr(fn_sig) => self.bound_computation(fn_sig, |computation, fn_sig| { +diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +index d20ba99ebc9b..60cb5914dada 100644 +--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs ++++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +@@ -761,6 +761,7 @@ fn suggest_fn_call( + Ok( + EvaluationResult::EvaluatedToOk + | EvaluationResult::EvaluatedToOkModuloRegions ++ | EvaluationResult::EvaluatedToOkModuloOpaqueTypes + | EvaluationResult::EvaluatedToAmbig, + ) => {} + _ => return false, +diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs +index 1c9f83f8f340..ed4877638bff 100644 +--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs ++++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs +@@ -388,6 +388,10 @@ fn evaluation_probe( + Err(_) => return Ok(EvaluatedToErr), + } + ++ if self.infcx.opaque_types_added_in_snapshot(snapshot) { ++ return Ok(result.max(EvaluatedToOkModuloOpaqueTypes)); ++ } ++ + match self.infcx.region_constraints_added_in_snapshot(snapshot) { + None => Ok(result), + Some(_) => Ok(result.max(EvaluatedToOkModuloRegions)), +diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs +index 4bc0f9d92008..6c838f410036 100644 +--- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs ++++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs +@@ -3,7 +3,7 @@ + type Foo = impl Fn() -> Foo; + + fn foo() -> Foo { +- foo //~ ERROR: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` ++ foo //~ ERROR: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` + } + + fn main() {} +diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr +index f69514b7808f..a9c2c18630c0 100644 +--- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr ++++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr +@@ -1,8 +1,10 @@ +-error[E0275]: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` ++error[E0275]: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` + --> $DIR/issue-53398-cyclic-types.rs:6:5 + | + LL | foo + | ^^^ ++ | ++ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`) + + error: aborting due to previous error + +-- +2.36.1 + + +From 74197dae66d15fdf202ce63481bc0b7d1a98b7cd Mon Sep 17 00:00:00 2001 +From: Oli Scherer +Date: Fri, 1 Jul 2022 13:19:27 +0000 +Subject: [PATCH 4/7] Remove type flag based opaque type workaround + +(cherry picked from commit 58c08cd0373eaabfe05d9e78efa417075ef019fb) +--- + compiler/rustc_type_ir/src/lib.rs | 8 -- + src/test/ui/impl-trait/auto-trait-leak.rs | 1 - + src/test/ui/impl-trait/auto-trait-leak.stderr | 112 +++--------------- + .../auto-trait-leakage3.rs | 1 - + .../auto-trait-leakage3.stderr | 27 +---- + .../type-alias-impl-trait/inference-cycle.rs | 1 - + .../inference-cycle.stderr | 27 +---- + .../ui/type-alias-impl-trait/reveal_local.rs | 1 - + .../type-alias-impl-trait/reveal_local.stderr | 33 +----- + 9 files changed, 30 insertions(+), 181 deletions(-) + +diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs +index c63e9c31d535..a46729f229e2 100644 +--- a/compiler/rustc_type_ir/src/lib.rs ++++ b/compiler/rustc_type_ir/src/lib.rs +@@ -61,14 +61,6 @@ pub struct TypeFlags: u32 { + | TypeFlags::HAS_CT_INFER.bits + | TypeFlags::HAS_TY_PLACEHOLDER.bits + | TypeFlags::HAS_CT_PLACEHOLDER.bits +- // The `evaluate_obligation` query does not return further +- // obligations. If it evaluates an obligation with an opaque +- // type, that opaque type may get compared to another type, +- // constraining it. We would lose this information. +- // FIXME: differentiate between crate-local opaque types +- // and opaque types from other crates, as only opaque types +- // from the local crate can possibly be a local name +- | TypeFlags::HAS_TY_OPAQUE.bits + // We consider 'freshened' types and constants + // to depend on a particular fn. + // The freshening process throws away information, +diff --git a/src/test/ui/impl-trait/auto-trait-leak.rs b/src/test/ui/impl-trait/auto-trait-leak.rs +index d2452abab025..c2fbbf94fd66 100644 +--- a/src/test/ui/impl-trait/auto-trait-leak.rs ++++ b/src/test/ui/impl-trait/auto-trait-leak.rs +@@ -11,7 +11,6 @@ fn main() { + // return type, which can't depend on the obligation. + fn cycle1() -> impl Clone { + //~^ ERROR cycle detected +- //~| ERROR cycle detected + send(cycle2().clone()); + + Rc::new(Cell::new(5)) +diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr +index 14db864f1c28..634ff14869eb 100644 +--- a/src/test/ui/impl-trait/auto-trait-leak.stderr ++++ b/src/test/ui/impl-trait/auto-trait-leak.stderr +@@ -30,129 +30,47 @@ note: ...which requires building MIR for `cycle1`... + LL | fn cycle1() -> impl Clone { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + note: ...which requires type-checking `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires computing type of `cycle2::{opaque#0}`... +- --> $DIR/auto-trait-leak.rs:20:16 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^ +-note: ...which requires borrow-checking `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires processing `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires processing MIR for `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires unsafety-checking `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires building MIR for `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires type-checking `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 +- | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +- = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle +-note: cycle used when checking item types in top-level module +- --> $DIR/auto-trait-leak.rs:1:1 +- | +-LL | / use std::cell::Cell; +-LL | | use std::rc::Rc; +-LL | | +-LL | | fn send(_: T) {} +-... | +-LL | | Rc::new(String::from("foo")) +-LL | | } +- | |_^ +- +-error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}` +- --> $DIR/auto-trait-leak.rs:12:16 ++ --> $DIR/auto-trait-leak.rs:14:5 + | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^ +- | +-note: ...which requires borrow-checking `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires processing `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires processing MIR for `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires unsafety-checking `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires building MIR for `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ +-note: ...which requires type-checking `cycle1`... +- --> $DIR/auto-trait-leak.rs:12:1 +- | +-LL | fn cycle1() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ ++LL | send(cycle2().clone()); ++ | ^^^^ ++ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`... + note: ...which requires computing type of `cycle2::{opaque#0}`... +- --> $DIR/auto-trait-leak.rs:20:16 ++ --> $DIR/auto-trait-leak.rs:19:16 + | + LL | fn cycle2() -> impl Clone { + | ^^^^^^^^^^ + note: ...which requires borrow-checking `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 ++ --> $DIR/auto-trait-leak.rs:19:1 + | + LL | fn cycle2() -> impl Clone { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + note: ...which requires processing `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 ++ --> $DIR/auto-trait-leak.rs:19:1 + | + LL | fn cycle2() -> impl Clone { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + note: ...which requires processing MIR for `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 ++ --> $DIR/auto-trait-leak.rs:19:1 + | + LL | fn cycle2() -> impl Clone { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + note: ...which requires unsafety-checking `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 ++ --> $DIR/auto-trait-leak.rs:19:1 + | + LL | fn cycle2() -> impl Clone { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + note: ...which requires building MIR for `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 ++ --> $DIR/auto-trait-leak.rs:19:1 + | + LL | fn cycle2() -> impl Clone { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + note: ...which requires type-checking `cycle2`... +- --> $DIR/auto-trait-leak.rs:20:1 ++ --> $DIR/auto-trait-leak.rs:20:5 + | +-LL | fn cycle2() -> impl Clone { +- | ^^^^^^^^^^^^^^^^^^^^^^^^^ ++LL | send(cycle1().clone()); ++ | ^^^^ ++ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`... + = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle + note: cycle used when checking item types in top-level module + --> $DIR/auto-trait-leak.rs:1:1 +@@ -166,6 +84,6 @@ LL | | Rc::new(String::from("foo")) + LL | | } + | |_^ + +-error: aborting due to 2 previous errors ++error: aborting due to previous error + + For more information about this error, try `rustc --explain E0391`. +diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs +index b456b1445e78..5fb7a9473d3d 100644 +--- a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs ++++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs +@@ -6,7 +6,6 @@ + mod m { + type Foo = impl std::fmt::Debug; + //~^ ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391] +- //~| ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391] + + pub fn foo() -> Foo { + 22_u32 +diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr +index 4c44875b4a54..1e9a45aac79e 100644 +--- a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr ++++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr +@@ -5,10 +5,11 @@ LL | type Foo = impl std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^ + | + note: ...which requires type-checking `m::bar`... +- --> $DIR/auto-trait-leakage3.rs:15:5 ++ --> $DIR/auto-trait-leakage3.rs:15:9 + | +-LL | pub fn bar() { +- | ^^^^^^^^^^^^ ++LL | is_send(foo()); ++ | ^^^^^^^ ++ = note: ...which requires evaluating trait selection obligation `m::Foo: core::marker::Send`... + = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle + note: cycle used when checking item types in module `m` + --> $DIR/auto-trait-leakage3.rs:6:1 +@@ -16,24 +17,6 @@ note: cycle used when checking item types in module `m` + LL | mod m { + | ^^^^^ + +-error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}` +- --> $DIR/auto-trait-leakage3.rs:7:16 +- | +-LL | type Foo = impl std::fmt::Debug; +- | ^^^^^^^^^^^^^^^^^^^^ +- | +-note: ...which requires type-checking `m::bar`... +- --> $DIR/auto-trait-leakage3.rs:15:5 +- | +-LL | pub fn bar() { +- | ^^^^^^^^^^^^ +- = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle +-note: cycle used when checking item types in module `m` +- --> $DIR/auto-trait-leakage3.rs:6:1 +- | +-LL | mod m { +- | ^^^^^ +- +-error: aborting due to 2 previous errors ++error: aborting due to previous error + + For more information about this error, try `rustc --explain E0391`. +diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.rs b/src/test/ui/type-alias-impl-trait/inference-cycle.rs +index 608572978a35..79caddf79132 100644 +--- a/src/test/ui/type-alias-impl-trait/inference-cycle.rs ++++ b/src/test/ui/type-alias-impl-trait/inference-cycle.rs +@@ -4,7 +4,6 @@ + mod m { + type Foo = impl std::fmt::Debug; + //~^ ERROR cycle detected +- //~| ERROR cycle detected + + // Cycle: error today, but it'd be nice if it eventually worked + +diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr +index 3ed86fae8a18..b9d646b927a6 100644 +--- a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr ++++ b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr +@@ -5,10 +5,11 @@ LL | type Foo = impl std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^ + | + note: ...which requires type-checking `m::bar`... +- --> $DIR/inference-cycle.rs:15:5 ++ --> $DIR/inference-cycle.rs:15:9 + | +-LL | pub fn bar() { +- | ^^^^^^^^^^^^ ++LL | is_send(foo()); // Today: error ++ | ^^^^^^^ ++ = note: ...which requires evaluating trait selection obligation `m::Foo: core::marker::Send`... + = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle + note: cycle used when checking item types in module `m` + --> $DIR/inference-cycle.rs:4:1 +@@ -16,24 +17,6 @@ note: cycle used when checking item types in module `m` + LL | mod m { + | ^^^^^ + +-error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}` +- --> $DIR/inference-cycle.rs:5:16 +- | +-LL | type Foo = impl std::fmt::Debug; +- | ^^^^^^^^^^^^^^^^^^^^ +- | +-note: ...which requires type-checking `m::bar`... +- --> $DIR/inference-cycle.rs:15:5 +- | +-LL | pub fn bar() { +- | ^^^^^^^^^^^^ +- = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle +-note: cycle used when checking item types in module `m` +- --> $DIR/inference-cycle.rs:4:1 +- | +-LL | mod m { +- | ^^^^^ +- +-error: aborting due to 2 previous errors ++error: aborting due to previous error + + For more information about this error, try `rustc --explain E0391`. +diff --git a/src/test/ui/type-alias-impl-trait/reveal_local.rs b/src/test/ui/type-alias-impl-trait/reveal_local.rs +index 145186baa1fa..7ecb55353010 100644 +--- a/src/test/ui/type-alias-impl-trait/reveal_local.rs ++++ b/src/test/ui/type-alias-impl-trait/reveal_local.rs +@@ -4,7 +4,6 @@ + + type Foo = impl Debug; + //~^ ERROR cycle detected +-//~| ERROR cycle detected + + fn is_send() { } + +diff --git a/src/test/ui/type-alias-impl-trait/reveal_local.stderr b/src/test/ui/type-alias-impl-trait/reveal_local.stderr +index 5d48dd5b2bf7..27fded333292 100644 +--- a/src/test/ui/type-alias-impl-trait/reveal_local.stderr ++++ b/src/test/ui/type-alias-impl-trait/reveal_local.stderr +@@ -5,10 +5,11 @@ LL | type Foo = impl Debug; + | ^^^^^^^^^^ + | + note: ...which requires type-checking `not_good`... +- --> $DIR/reveal_local.rs:11:1 ++ --> $DIR/reveal_local.rs:13:5 + | +-LL | fn not_good() { +- | ^^^^^^^^^^^^^ ++LL | is_send::(); ++ | ^^^^^^^^^^^^^^ ++ = note: ...which requires evaluating trait selection obligation `Foo: core::marker::Send`... + = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle + note: cycle used when checking item types in top-level module + --> $DIR/reveal_local.rs:1:1 +@@ -22,30 +23,6 @@ LL | | + LL | | fn main() {} + | |____________^ + +-error[E0391]: cycle detected when computing type of `Foo::{opaque#0}` +- --> $DIR/reveal_local.rs:5:12 +- | +-LL | type Foo = impl Debug; +- | ^^^^^^^^^^ +- | +-note: ...which requires type-checking `not_gooder`... +- --> $DIR/reveal_local.rs:17:1 +- | +-LL | fn not_gooder() { +- | ^^^^^^^^^^^^^^^ +- = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle +-note: cycle used when checking item types in top-level module +- --> $DIR/reveal_local.rs:1:1 +- | +-LL | / #![feature(type_alias_impl_trait)] +-LL | | +-LL | | use std::fmt::Debug; +-LL | | +-... | +-LL | | +-LL | | fn main() {} +- | |____________^ +- +-error: aborting due to 2 previous errors ++error: aborting due to previous error + + For more information about this error, try `rustc --explain E0391`. +-- +2.36.1 + + +From 60ea1625bffb09786a8ed9c1d4db52312d2675df Mon Sep 17 00:00:00 2001 +From: Oli Scherer +Date: Thu, 7 Jul 2022 08:10:50 +0000 +Subject: [PATCH 5/7] not knowing about opaque types is worse than not knowing + about regions, make sure we don't accidentally mark something as + ok-modulo-regions if there are opaque types involved + +(cherry picked from commit 0b863e0024df84ca6f58bad3a7226e8d0ca6c5f6) +--- + compiler/rustc_middle/src/traits/select.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs +index 025059fcbcfb..854dd215a37c 100644 +--- a/compiler/rustc_middle/src/traits/select.rs ++++ b/compiler/rustc_middle/src/traits/select.rs +@@ -174,12 +174,12 @@ pub enum SelectionCandidate<'tcx> { + pub enum EvaluationResult { + /// Evaluation successful. + EvaluatedToOk, ++ /// Evaluation successful, but there were unevaluated region obligations. ++ EvaluatedToOkModuloRegions, + /// Evaluation successful, but need to rerun because opaque types got + /// hidden types assigned without it being known whether the opaque types + /// are within their defining scope + EvaluatedToOkModuloOpaqueTypes, +- /// Evaluation successful, but there were unevaluated region obligations. +- EvaluatedToOkModuloRegions, + /// Evaluation is known to be ambiguous -- it *might* hold for some + /// assignment of inference variables, but it might not. + /// +-- +2.36.1 + + +From 735b8590e78ffe0b0e0083ea08d75d03b92c43fb Mon Sep 17 00:00:00 2001 +From: Oli Scherer +Date: Fri, 8 Jul 2022 13:59:44 +0000 +Subject: [PATCH 6/7] Only register hidden types for opaque types from the + current crate, nothing else would work anyway. + +(cherry picked from commit d6b93eb79352149bae0fd1efc0bb181947a9e6f1) +--- + compiler/rustc_infer/src/infer/opaque_types.rs | 2 +- + compiler/rustc_middle/src/ty/mod.rs | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs +index 92c0ed84057a..3b9b6f7a2af9 100644 +--- a/compiler/rustc_infer/src/infer/opaque_types.rs ++++ b/compiler/rustc_infer/src/infer/opaque_types.rs +@@ -99,7 +99,7 @@ pub fn handle_opaque_type( + } + let (a, b) = if a_is_expected { (a, b) } else { (b, a) }; + let process = |a: Ty<'tcx>, b: Ty<'tcx>| match *a.kind() { +- ty::Opaque(def_id, substs) => { ++ ty::Opaque(def_id, substs) if def_id.is_local() => { + let origin = if self.defining_use_anchor.is_some() { + // Check that this is `impl Trait` type is + // declared by `parent_def_id` -- i.e., one whose +diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs +index 1c552591b117..a254979162e8 100644 +--- a/compiler/rustc_middle/src/ty/mod.rs ++++ b/compiler/rustc_middle/src/ty/mod.rs +@@ -1065,6 +1065,7 @@ pub fn is_empty(&self) -> bool { + Lift + )] + pub struct OpaqueTypeKey<'tcx> { ++ // FIXME(oli-obk): make this a LocalDefId + pub def_id: DefId, + pub substs: SubstsRef<'tcx>, + } +-- +2.36.1 + + +From 1d4d0122ac5cbf7f4b948df36f7e315734c171b9 Mon Sep 17 00:00:00 2001 +From: Mark Rousskov +Date: Sat, 9 Jul 2022 18:16:53 -0400 +Subject: [PATCH 7/7] Fix tests after beta backport + +(cherry picked from commit 5a81254ef29b968f15f5296568c4b985657e8c49) +--- + src/test/ui/type-alias-impl-trait/issue-98604.stderr | 2 +- + src/test/ui/type-alias-impl-trait/issue-98608.stderr | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.stderr b/src/test/ui/type-alias-impl-trait/issue-98604.stderr +index f04d1b4d7877..ad3982760c39 100644 +--- a/src/test/ui/type-alias-impl-trait/issue-98604.stderr ++++ b/src/test/ui/type-alias-impl-trait/issue-98604.stderr +@@ -11,7 +11,7 @@ LL | async fn test() {} + | ^ checked the `Output` of this `async fn`, found opaque type + = note: expected struct `Pin + 'static)>>` + found opaque type `impl Future` +- = note: required for the cast from `fn() -> impl Future {test}` to the object type `dyn Fn() -> Pin + 'static)>>` ++ = note: required for the cast to the object type `dyn Fn() -> Pin + 'static)>>` + + error: aborting due to previous error + +diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.stderr b/src/test/ui/type-alias-impl-trait/issue-98608.stderr +index 8f3ec7d9d161..6773b01112d8 100644 +--- a/src/test/ui/type-alias-impl-trait/issue-98608.stderr ++++ b/src/test/ui/type-alias-impl-trait/issue-98608.stderr +@@ -9,7 +9,7 @@ LL | let b: Box Box> = Box::new(hi); + | + = note: expected struct `Box` + found opaque type `impl Sized` +- = note: required for the cast from `fn() -> impl Sized {hi}` to the object type `dyn Fn() -> Box` ++ = note: required for the cast to the object type `dyn Fn() -> Box` + + error: aborting due to previous error + +-- +2.36.1 + From 329f0aa507c74777cdb1187f0a9b75f5b3f799ce Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 19 Jul 2022 09:10:30 -0700 Subject: [PATCH 086/222] Update to 1.62.1. --- .gitignore | 1 + rust.spec | 15 +- rustc-1.62.0-pr98614.patch | 846 ------------------------------------- sources | 2 +- 4 files changed, 10 insertions(+), 854 deletions(-) delete mode 100644 rustc-1.62.0-pr98614.patch diff --git a/.gitignore b/.gitignore index da615ea..bde8a26 100644 --- a/.gitignore +++ b/.gitignore @@ -402,3 +402,4 @@ /rustc-1.61.0-src.tar.xz /wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz /rustc-1.62.0-src.tar.xz +/rustc-1.62.1-src.tar.xz diff --git a/rust.spec b/rust.spec index d967000..b030256 100644 --- a/rust.spec +++ b/rust.spec @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.62.0 -Release: 2%{?dist} +Version: 1.62.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,10 +106,6 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# Prevent unsound coercions from functions with opaque return types. -# https://github.com/rust-lang/rust/pull/98614 -Patch3: rustc-1.62.0-pr98614.patch - ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -240,6 +236,9 @@ BuildRequires: procps-ng # debuginfo-gdb tests need gdb BuildRequires: gdb +# For src/test/run-make/static-pie +BuildRequires: glibc-static + # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} Provides: rustc%{?_isa} = %{version}-%{release} @@ -575,7 +574,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 -%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1034,6 +1032,9 @@ end} %changelog +* 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. diff --git a/rustc-1.62.0-pr98614.patch b/rustc-1.62.0-pr98614.patch deleted file mode 100644 index 04794b4..0000000 --- a/rustc-1.62.0-pr98614.patch +++ /dev/null @@ -1,846 +0,0 @@ -From 3dfd37fcd387c18205a93ad2ad519c2ab5e1b289 Mon Sep 17 00:00:00 2001 -From: Oli Scherer -Date: Wed, 29 Jun 2022 14:25:44 +0000 -Subject: [PATCH 1/7] pessimistically treat all function items as containing an - opaque type - -(cherry picked from commit 9dbfcbcbb5d835c2a5784e2f4da4816b90c43ff5) ---- - compiler/rustc_middle/src/ty/flags.rs | 5 +++++ - .../issue-53398-cyclic-types.rs | 2 +- - .../issue-53398-cyclic-types.stderr | 4 +--- - .../ui/type-alias-impl-trait/issue-98604.rs | 13 +++++++++++++ - .../type-alias-impl-trait/issue-98604.stderr | 18 ++++++++++++++++++ - .../ui/type-alias-impl-trait/issue-98608.rs | 9 +++++++++ - .../type-alias-impl-trait/issue-98608.stderr | 16 ++++++++++++++++ - 7 files changed, 63 insertions(+), 4 deletions(-) - create mode 100644 src/test/ui/type-alias-impl-trait/issue-98604.rs - create mode 100644 src/test/ui/type-alias-impl-trait/issue-98604.stderr - create mode 100644 src/test/ui/type-alias-impl-trait/issue-98608.rs - create mode 100644 src/test/ui/type-alias-impl-trait/issue-98608.stderr - -diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs -index 7a3d615862cb..63b1352e66b8 100644 ---- a/compiler/rustc_middle/src/ty/flags.rs -+++ b/compiler/rustc_middle/src/ty/flags.rs -@@ -207,6 +207,11 @@ fn add_kind(&mut self, kind: &ty::TyKind<'_>) { - - &ty::FnDef(_, substs) => { - self.add_substs(substs); -+ // HACK(#98608, oli-obk): Function items with opaque types in their signature will -+ // end up not having the HAS_TY_OPAQUE flag set, causing `evaluate_obligation` to -+ // optimistically assume the function item matches any signature. See documentation -+ // on `HAS_FREE_LOCAL_NAMES` for details. -+ self.add_flags(TypeFlags::HAS_TY_OPAQUE); - } - - &ty::FnPtr(fn_sig) => self.bound_computation(fn_sig, |computation, fn_sig| { -diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs -index 6c838f410036..4bc0f9d92008 100644 ---- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs -+++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs -@@ -3,7 +3,7 @@ - type Foo = impl Fn() -> Foo; - - fn foo() -> Foo { -- foo //~ ERROR: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` -+ foo //~ ERROR: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` - } - - fn main() {} -diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr -index a9c2c18630c0..f69514b7808f 100644 ---- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr -+++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr -@@ -1,10 +1,8 @@ --error[E0275]: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` -+error[E0275]: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` - --> $DIR/issue-53398-cyclic-types.rs:6:5 - | - LL | foo - | ^^^ -- | -- = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`) - - error: aborting due to previous error - -diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.rs b/src/test/ui/type-alias-impl-trait/issue-98604.rs -new file mode 100644 -index 000000000000..a4fd8a82a04f ---- /dev/null -+++ b/src/test/ui/type-alias-impl-trait/issue-98604.rs -@@ -0,0 +1,13 @@ -+// edition:2018 -+ -+type AsyncFnPtr = Box< -+ dyn Fn() -> std::pin::Pin>>, -+>; -+ -+async fn test() {} -+ -+#[allow(unused_must_use)] -+fn main() { -+ Box::new(test) as AsyncFnPtr; -+ //~^ ERROR type mismatch -+} -diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.stderr b/src/test/ui/type-alias-impl-trait/issue-98604.stderr -new file mode 100644 -index 000000000000..f04d1b4d7877 ---- /dev/null -+++ b/src/test/ui/type-alias-impl-trait/issue-98604.stderr -@@ -0,0 +1,18 @@ -+error[E0271]: type mismatch resolving ` impl Future {test} as FnOnce<()>>::Output == Pin + 'static)>>` -+ --> $DIR/issue-98604.rs:11:5 -+ | -+LL | Box::new(test) as AsyncFnPtr; -+ | ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type -+ | -+note: while checking the return type of the `async fn` -+ --> $DIR/issue-98604.rs:7:17 -+ | -+LL | async fn test() {} -+ | ^ checked the `Output` of this `async fn`, found opaque type -+ = note: expected struct `Pin + 'static)>>` -+ found opaque type `impl Future` -+ = note: required for the cast from `fn() -> impl Future {test}` to the object type `dyn Fn() -> Pin + 'static)>>` -+ -+error: aborting due to previous error -+ -+For more information about this error, try `rustc --explain E0271`. -diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.rs b/src/test/ui/type-alias-impl-trait/issue-98608.rs -new file mode 100644 -index 000000000000..d75762a8b62f ---- /dev/null -+++ b/src/test/ui/type-alias-impl-trait/issue-98608.rs -@@ -0,0 +1,9 @@ -+fn hi() -> impl Sized { std::ptr::null::() } -+ -+fn main() { -+ let b: Box Box> = Box::new(hi); -+ //~^ ERROR type mismatch resolving ` impl Sized {hi} as FnOnce<()>>::Output == Box` -+ let boxed = b(); -+ let null = *boxed; -+ println!("{null:?}"); -+} -diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.stderr b/src/test/ui/type-alias-impl-trait/issue-98608.stderr -new file mode 100644 -index 000000000000..8f3ec7d9d161 ---- /dev/null -+++ b/src/test/ui/type-alias-impl-trait/issue-98608.stderr -@@ -0,0 +1,16 @@ -+error[E0271]: type mismatch resolving ` impl Sized {hi} as FnOnce<()>>::Output == Box` -+ --> $DIR/issue-98608.rs:4:39 -+ | -+LL | fn hi() -> impl Sized { std::ptr::null::() } -+ | ---------- the found opaque type -+... -+LL | let b: Box Box> = Box::new(hi); -+ | ^^^^^^^^^^^^ expected struct `Box`, found opaque type -+ | -+ = note: expected struct `Box` -+ found opaque type `impl Sized` -+ = note: required for the cast from `fn() -> impl Sized {hi}` to the object type `dyn Fn() -> Box` -+ -+error: aborting due to previous error -+ -+For more information about this error, try `rustc --explain E0271`. --- -2.36.1 - - -From f2572a99471d046bef973512026b682bbd60fc1d Mon Sep 17 00:00:00 2001 -From: Oli Scherer -Date: Thu, 30 Jun 2022 13:24:35 +0000 -Subject: [PATCH 2/7] use a method instead of manually doing what its body does - -(cherry picked from commit ade2a96ff1e2c3d434f57b8fa07da66969bceaae) ---- - compiler/rustc_infer/src/traits/project.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/compiler/rustc_infer/src/traits/project.rs b/compiler/rustc_infer/src/traits/project.rs -index b84ed3dc6893..18469208731c 100644 ---- a/compiler/rustc_infer/src/traits/project.rs -+++ b/compiler/rustc_infer/src/traits/project.rs -@@ -203,7 +203,7 @@ pub fn complete(&mut self, key: ProjectionCacheKey<'tcx>, result: EvaluationResu - Some(&ProjectionCacheEntry::NormalizedTy { ref ty, complete: _ }) => { - info!("ProjectionCacheEntry::complete({:?}) - completing {:?}", key, ty); - let mut ty = ty.clone(); -- if result == EvaluationResult::EvaluatedToOk { -+ if result.must_apply_considering_regions() { - ty.obligations = vec![]; - } - map.insert(key, ProjectionCacheEntry::NormalizedTy { ty, complete: Some(result) }); --- -2.36.1 - - -From 2c7eb77c52989ea098e8b50e97d62ff4a3dc6c97 Mon Sep 17 00:00:00 2001 -From: Oli Scherer -Date: Thu, 30 Jun 2022 14:23:31 +0000 -Subject: [PATCH 3/7] Make `evaluate_obligation` not succeed unconditionally if - it registered new hidden types for opaque types - -(cherry picked from commit 84fc5516648e34f15d17b2ca0b892adb3743a5c0) ---- - compiler/rustc_infer/src/infer/mod.rs | 4 ++++ - compiler/rustc_infer/src/infer/undo_log.rs | 4 ++++ - compiler/rustc_middle/src/traits/select.rs | 18 ++++++++++++++---- - compiler/rustc_middle/src/ty/flags.rs | 5 ----- - .../src/traits/error_reporting/suggestions.rs | 1 + - .../src/traits/select/mod.rs | 4 ++++ - .../issue-53398-cyclic-types.rs | 2 +- - .../issue-53398-cyclic-types.stderr | 4 +++- - 8 files changed, 31 insertions(+), 11 deletions(-) - -diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs -index c9121f7d348c..989cc551a82f 100644 ---- a/compiler/rustc_infer/src/infer/mod.rs -+++ b/compiler/rustc_infer/src/infer/mod.rs -@@ -929,6 +929,10 @@ pub fn region_constraints_added_in_snapshot( - .region_constraints_added_in_snapshot(&snapshot.undo_snapshot) - } - -+ pub fn opaque_types_added_in_snapshot(&self, snapshot: &CombinedSnapshot<'a, 'tcx>) -> bool { -+ self.inner.borrow().undo_log.opaque_types_in_snapshot(&snapshot.undo_snapshot) -+ } -+ - pub fn add_given(&self, sub: ty::Region<'tcx>, sup: ty::RegionVid) { - self.inner.borrow_mut().unwrap_region_constraints().add_given(sub, sup); - } -diff --git a/compiler/rustc_infer/src/infer/undo_log.rs b/compiler/rustc_infer/src/infer/undo_log.rs -index 1b696f21cbcf..74a26ebc39f8 100644 ---- a/compiler/rustc_infer/src/infer/undo_log.rs -+++ b/compiler/rustc_infer/src/infer/undo_log.rs -@@ -185,6 +185,10 @@ pub(crate) fn region_constraints_in_snapshot( - }) - } - -+ pub(crate) fn opaque_types_in_snapshot(&self, s: &Snapshot<'tcx>) -> bool { -+ self.logs[s.undo_len..].iter().any(|log| matches!(log, UndoLog::OpaqueTypes(..))) -+ } -+ - pub(crate) fn region_constraints( - &self, - ) -> impl Iterator> + Clone { -diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs -index ffa70cddbd59..025059fcbcfb 100644 ---- a/compiler/rustc_middle/src/traits/select.rs -+++ b/compiler/rustc_middle/src/traits/select.rs -@@ -174,6 +174,10 @@ pub enum SelectionCandidate<'tcx> { - pub enum EvaluationResult { - /// Evaluation successful. - EvaluatedToOk, -+ /// Evaluation successful, but need to rerun because opaque types got -+ /// hidden types assigned without it being known whether the opaque types -+ /// are within their defining scope -+ EvaluatedToOkModuloOpaqueTypes, - /// Evaluation successful, but there were unevaluated region obligations. - EvaluatedToOkModuloRegions, - /// Evaluation is known to be ambiguous -- it *might* hold for some -@@ -252,9 +256,11 @@ pub fn must_apply_modulo_regions(self) -> bool { - - pub fn may_apply(self) -> bool { - match self { -- EvaluatedToOk | EvaluatedToOkModuloRegions | EvaluatedToAmbig | EvaluatedToUnknown => { -- true -- } -+ EvaluatedToOkModuloOpaqueTypes -+ | EvaluatedToOk -+ | EvaluatedToOkModuloRegions -+ | EvaluatedToAmbig -+ | EvaluatedToUnknown => true, - - EvaluatedToErr | EvaluatedToRecur => false, - } -@@ -264,7 +270,11 @@ pub fn is_stack_dependent(self) -> bool { - match self { - EvaluatedToUnknown | EvaluatedToRecur => true, - -- EvaluatedToOk | EvaluatedToOkModuloRegions | EvaluatedToAmbig | EvaluatedToErr => false, -+ EvaluatedToOkModuloOpaqueTypes -+ | EvaluatedToOk -+ | EvaluatedToOkModuloRegions -+ | EvaluatedToAmbig -+ | EvaluatedToErr => false, - } - } - } -diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs -index 63b1352e66b8..7a3d615862cb 100644 ---- a/compiler/rustc_middle/src/ty/flags.rs -+++ b/compiler/rustc_middle/src/ty/flags.rs -@@ -207,11 +207,6 @@ fn add_kind(&mut self, kind: &ty::TyKind<'_>) { - - &ty::FnDef(_, substs) => { - self.add_substs(substs); -- // HACK(#98608, oli-obk): Function items with opaque types in their signature will -- // end up not having the HAS_TY_OPAQUE flag set, causing `evaluate_obligation` to -- // optimistically assume the function item matches any signature. See documentation -- // on `HAS_FREE_LOCAL_NAMES` for details. -- self.add_flags(TypeFlags::HAS_TY_OPAQUE); - } - - &ty::FnPtr(fn_sig) => self.bound_computation(fn_sig, |computation, fn_sig| { -diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs -index d20ba99ebc9b..60cb5914dada 100644 ---- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs -+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs -@@ -761,6 +761,7 @@ fn suggest_fn_call( - Ok( - EvaluationResult::EvaluatedToOk - | EvaluationResult::EvaluatedToOkModuloRegions -+ | EvaluationResult::EvaluatedToOkModuloOpaqueTypes - | EvaluationResult::EvaluatedToAmbig, - ) => {} - _ => return false, -diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs -index 1c9f83f8f340..ed4877638bff 100644 ---- a/compiler/rustc_trait_selection/src/traits/select/mod.rs -+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs -@@ -388,6 +388,10 @@ fn evaluation_probe( - Err(_) => return Ok(EvaluatedToErr), - } - -+ if self.infcx.opaque_types_added_in_snapshot(snapshot) { -+ return Ok(result.max(EvaluatedToOkModuloOpaqueTypes)); -+ } -+ - match self.infcx.region_constraints_added_in_snapshot(snapshot) { - None => Ok(result), - Some(_) => Ok(result.max(EvaluatedToOkModuloRegions)), -diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs -index 4bc0f9d92008..6c838f410036 100644 ---- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs -+++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs -@@ -3,7 +3,7 @@ - type Foo = impl Fn() -> Foo; - - fn foo() -> Foo { -- foo //~ ERROR: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` -+ foo //~ ERROR: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` - } - - fn main() {} -diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr -index f69514b7808f..a9c2c18630c0 100644 ---- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr -+++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr -@@ -1,8 +1,10 @@ --error[E0275]: overflow evaluating the requirement ` Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` -+error[E0275]: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` - --> $DIR/issue-53398-cyclic-types.rs:6:5 - | - LL | foo - | ^^^ -+ | -+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`) - - error: aborting due to previous error - --- -2.36.1 - - -From 74197dae66d15fdf202ce63481bc0b7d1a98b7cd Mon Sep 17 00:00:00 2001 -From: Oli Scherer -Date: Fri, 1 Jul 2022 13:19:27 +0000 -Subject: [PATCH 4/7] Remove type flag based opaque type workaround - -(cherry picked from commit 58c08cd0373eaabfe05d9e78efa417075ef019fb) ---- - compiler/rustc_type_ir/src/lib.rs | 8 -- - src/test/ui/impl-trait/auto-trait-leak.rs | 1 - - src/test/ui/impl-trait/auto-trait-leak.stderr | 112 +++--------------- - .../auto-trait-leakage3.rs | 1 - - .../auto-trait-leakage3.stderr | 27 +---- - .../type-alias-impl-trait/inference-cycle.rs | 1 - - .../inference-cycle.stderr | 27 +---- - .../ui/type-alias-impl-trait/reveal_local.rs | 1 - - .../type-alias-impl-trait/reveal_local.stderr | 33 +----- - 9 files changed, 30 insertions(+), 181 deletions(-) - -diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs -index c63e9c31d535..a46729f229e2 100644 ---- a/compiler/rustc_type_ir/src/lib.rs -+++ b/compiler/rustc_type_ir/src/lib.rs -@@ -61,14 +61,6 @@ pub struct TypeFlags: u32 { - | TypeFlags::HAS_CT_INFER.bits - | TypeFlags::HAS_TY_PLACEHOLDER.bits - | TypeFlags::HAS_CT_PLACEHOLDER.bits -- // The `evaluate_obligation` query does not return further -- // obligations. If it evaluates an obligation with an opaque -- // type, that opaque type may get compared to another type, -- // constraining it. We would lose this information. -- // FIXME: differentiate between crate-local opaque types -- // and opaque types from other crates, as only opaque types -- // from the local crate can possibly be a local name -- | TypeFlags::HAS_TY_OPAQUE.bits - // We consider 'freshened' types and constants - // to depend on a particular fn. - // The freshening process throws away information, -diff --git a/src/test/ui/impl-trait/auto-trait-leak.rs b/src/test/ui/impl-trait/auto-trait-leak.rs -index d2452abab025..c2fbbf94fd66 100644 ---- a/src/test/ui/impl-trait/auto-trait-leak.rs -+++ b/src/test/ui/impl-trait/auto-trait-leak.rs -@@ -11,7 +11,6 @@ fn main() { - // return type, which can't depend on the obligation. - fn cycle1() -> impl Clone { - //~^ ERROR cycle detected -- //~| ERROR cycle detected - send(cycle2().clone()); - - Rc::new(Cell::new(5)) -diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr -index 14db864f1c28..634ff14869eb 100644 ---- a/src/test/ui/impl-trait/auto-trait-leak.stderr -+++ b/src/test/ui/impl-trait/auto-trait-leak.stderr -@@ -30,129 +30,47 @@ note: ...which requires building MIR for `cycle1`... - LL | fn cycle1() -> impl Clone { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - note: ...which requires type-checking `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires computing type of `cycle2::{opaque#0}`... -- --> $DIR/auto-trait-leak.rs:20:16 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^ --note: ...which requires borrow-checking `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires processing `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires processing MIR for `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires unsafety-checking `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires building MIR for `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires type-checking `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -- | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ -- = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle --note: cycle used when checking item types in top-level module -- --> $DIR/auto-trait-leak.rs:1:1 -- | --LL | / use std::cell::Cell; --LL | | use std::rc::Rc; --LL | | --LL | | fn send(_: T) {} --... | --LL | | Rc::new(String::from("foo")) --LL | | } -- | |_^ -- --error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}` -- --> $DIR/auto-trait-leak.rs:12:16 -+ --> $DIR/auto-trait-leak.rs:14:5 - | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^ -- | --note: ...which requires borrow-checking `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires processing `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires processing MIR for `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires unsafety-checking `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires building MIR for `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ --note: ...which requires type-checking `cycle1`... -- --> $DIR/auto-trait-leak.rs:12:1 -- | --LL | fn cycle1() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ -+LL | send(cycle2().clone()); -+ | ^^^^ -+ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`... - note: ...which requires computing type of `cycle2::{opaque#0}`... -- --> $DIR/auto-trait-leak.rs:20:16 -+ --> $DIR/auto-trait-leak.rs:19:16 - | - LL | fn cycle2() -> impl Clone { - | ^^^^^^^^^^ - note: ...which requires borrow-checking `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -+ --> $DIR/auto-trait-leak.rs:19:1 - | - LL | fn cycle2() -> impl Clone { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - note: ...which requires processing `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -+ --> $DIR/auto-trait-leak.rs:19:1 - | - LL | fn cycle2() -> impl Clone { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - note: ...which requires processing MIR for `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -+ --> $DIR/auto-trait-leak.rs:19:1 - | - LL | fn cycle2() -> impl Clone { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - note: ...which requires unsafety-checking `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -+ --> $DIR/auto-trait-leak.rs:19:1 - | - LL | fn cycle2() -> impl Clone { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - note: ...which requires building MIR for `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -+ --> $DIR/auto-trait-leak.rs:19:1 - | - LL | fn cycle2() -> impl Clone { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - note: ...which requires type-checking `cycle2`... -- --> $DIR/auto-trait-leak.rs:20:1 -+ --> $DIR/auto-trait-leak.rs:20:5 - | --LL | fn cycle2() -> impl Clone { -- | ^^^^^^^^^^^^^^^^^^^^^^^^^ -+LL | send(cycle1().clone()); -+ | ^^^^ -+ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`... - = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle - note: cycle used when checking item types in top-level module - --> $DIR/auto-trait-leak.rs:1:1 -@@ -166,6 +84,6 @@ LL | | Rc::new(String::from("foo")) - LL | | } - | |_^ - --error: aborting due to 2 previous errors -+error: aborting due to previous error - - For more information about this error, try `rustc --explain E0391`. -diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs -index b456b1445e78..5fb7a9473d3d 100644 ---- a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs -+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs -@@ -6,7 +6,6 @@ - mod m { - type Foo = impl std::fmt::Debug; - //~^ ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391] -- //~| ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391] - - pub fn foo() -> Foo { - 22_u32 -diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr -index 4c44875b4a54..1e9a45aac79e 100644 ---- a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr -+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr -@@ -5,10 +5,11 @@ LL | type Foo = impl std::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^ - | - note: ...which requires type-checking `m::bar`... -- --> $DIR/auto-trait-leakage3.rs:15:5 -+ --> $DIR/auto-trait-leakage3.rs:15:9 - | --LL | pub fn bar() { -- | ^^^^^^^^^^^^ -+LL | is_send(foo()); -+ | ^^^^^^^ -+ = note: ...which requires evaluating trait selection obligation `m::Foo: core::marker::Send`... - = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle - note: cycle used when checking item types in module `m` - --> $DIR/auto-trait-leakage3.rs:6:1 -@@ -16,24 +17,6 @@ note: cycle used when checking item types in module `m` - LL | mod m { - | ^^^^^ - --error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}` -- --> $DIR/auto-trait-leakage3.rs:7:16 -- | --LL | type Foo = impl std::fmt::Debug; -- | ^^^^^^^^^^^^^^^^^^^^ -- | --note: ...which requires type-checking `m::bar`... -- --> $DIR/auto-trait-leakage3.rs:15:5 -- | --LL | pub fn bar() { -- | ^^^^^^^^^^^^ -- = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle --note: cycle used when checking item types in module `m` -- --> $DIR/auto-trait-leakage3.rs:6:1 -- | --LL | mod m { -- | ^^^^^ -- --error: aborting due to 2 previous errors -+error: aborting due to previous error - - For more information about this error, try `rustc --explain E0391`. -diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.rs b/src/test/ui/type-alias-impl-trait/inference-cycle.rs -index 608572978a35..79caddf79132 100644 ---- a/src/test/ui/type-alias-impl-trait/inference-cycle.rs -+++ b/src/test/ui/type-alias-impl-trait/inference-cycle.rs -@@ -4,7 +4,6 @@ - mod m { - type Foo = impl std::fmt::Debug; - //~^ ERROR cycle detected -- //~| ERROR cycle detected - - // Cycle: error today, but it'd be nice if it eventually worked - -diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr -index 3ed86fae8a18..b9d646b927a6 100644 ---- a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr -+++ b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr -@@ -5,10 +5,11 @@ LL | type Foo = impl std::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^ - | - note: ...which requires type-checking `m::bar`... -- --> $DIR/inference-cycle.rs:15:5 -+ --> $DIR/inference-cycle.rs:15:9 - | --LL | pub fn bar() { -- | ^^^^^^^^^^^^ -+LL | is_send(foo()); // Today: error -+ | ^^^^^^^ -+ = note: ...which requires evaluating trait selection obligation `m::Foo: core::marker::Send`... - = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle - note: cycle used when checking item types in module `m` - --> $DIR/inference-cycle.rs:4:1 -@@ -16,24 +17,6 @@ note: cycle used when checking item types in module `m` - LL | mod m { - | ^^^^^ - --error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}` -- --> $DIR/inference-cycle.rs:5:16 -- | --LL | type Foo = impl std::fmt::Debug; -- | ^^^^^^^^^^^^^^^^^^^^ -- | --note: ...which requires type-checking `m::bar`... -- --> $DIR/inference-cycle.rs:15:5 -- | --LL | pub fn bar() { -- | ^^^^^^^^^^^^ -- = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle --note: cycle used when checking item types in module `m` -- --> $DIR/inference-cycle.rs:4:1 -- | --LL | mod m { -- | ^^^^^ -- --error: aborting due to 2 previous errors -+error: aborting due to previous error - - For more information about this error, try `rustc --explain E0391`. -diff --git a/src/test/ui/type-alias-impl-trait/reveal_local.rs b/src/test/ui/type-alias-impl-trait/reveal_local.rs -index 145186baa1fa..7ecb55353010 100644 ---- a/src/test/ui/type-alias-impl-trait/reveal_local.rs -+++ b/src/test/ui/type-alias-impl-trait/reveal_local.rs -@@ -4,7 +4,6 @@ - - type Foo = impl Debug; - //~^ ERROR cycle detected --//~| ERROR cycle detected - - fn is_send() { } - -diff --git a/src/test/ui/type-alias-impl-trait/reveal_local.stderr b/src/test/ui/type-alias-impl-trait/reveal_local.stderr -index 5d48dd5b2bf7..27fded333292 100644 ---- a/src/test/ui/type-alias-impl-trait/reveal_local.stderr -+++ b/src/test/ui/type-alias-impl-trait/reveal_local.stderr -@@ -5,10 +5,11 @@ LL | type Foo = impl Debug; - | ^^^^^^^^^^ - | - note: ...which requires type-checking `not_good`... -- --> $DIR/reveal_local.rs:11:1 -+ --> $DIR/reveal_local.rs:13:5 - | --LL | fn not_good() { -- | ^^^^^^^^^^^^^ -+LL | is_send::(); -+ | ^^^^^^^^^^^^^^ -+ = note: ...which requires evaluating trait selection obligation `Foo: core::marker::Send`... - = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle - note: cycle used when checking item types in top-level module - --> $DIR/reveal_local.rs:1:1 -@@ -22,30 +23,6 @@ LL | | - LL | | fn main() {} - | |____________^ - --error[E0391]: cycle detected when computing type of `Foo::{opaque#0}` -- --> $DIR/reveal_local.rs:5:12 -- | --LL | type Foo = impl Debug; -- | ^^^^^^^^^^ -- | --note: ...which requires type-checking `not_gooder`... -- --> $DIR/reveal_local.rs:17:1 -- | --LL | fn not_gooder() { -- | ^^^^^^^^^^^^^^^ -- = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle --note: cycle used when checking item types in top-level module -- --> $DIR/reveal_local.rs:1:1 -- | --LL | / #![feature(type_alias_impl_trait)] --LL | | --LL | | use std::fmt::Debug; --LL | | --... | --LL | | --LL | | fn main() {} -- | |____________^ -- --error: aborting due to 2 previous errors -+error: aborting due to previous error - - For more information about this error, try `rustc --explain E0391`. --- -2.36.1 - - -From 60ea1625bffb09786a8ed9c1d4db52312d2675df Mon Sep 17 00:00:00 2001 -From: Oli Scherer -Date: Thu, 7 Jul 2022 08:10:50 +0000 -Subject: [PATCH 5/7] not knowing about opaque types is worse than not knowing - about regions, make sure we don't accidentally mark something as - ok-modulo-regions if there are opaque types involved - -(cherry picked from commit 0b863e0024df84ca6f58bad3a7226e8d0ca6c5f6) ---- - compiler/rustc_middle/src/traits/select.rs | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs -index 025059fcbcfb..854dd215a37c 100644 ---- a/compiler/rustc_middle/src/traits/select.rs -+++ b/compiler/rustc_middle/src/traits/select.rs -@@ -174,12 +174,12 @@ pub enum SelectionCandidate<'tcx> { - pub enum EvaluationResult { - /// Evaluation successful. - EvaluatedToOk, -+ /// Evaluation successful, but there were unevaluated region obligations. -+ EvaluatedToOkModuloRegions, - /// Evaluation successful, but need to rerun because opaque types got - /// hidden types assigned without it being known whether the opaque types - /// are within their defining scope - EvaluatedToOkModuloOpaqueTypes, -- /// Evaluation successful, but there were unevaluated region obligations. -- EvaluatedToOkModuloRegions, - /// Evaluation is known to be ambiguous -- it *might* hold for some - /// assignment of inference variables, but it might not. - /// --- -2.36.1 - - -From 735b8590e78ffe0b0e0083ea08d75d03b92c43fb Mon Sep 17 00:00:00 2001 -From: Oli Scherer -Date: Fri, 8 Jul 2022 13:59:44 +0000 -Subject: [PATCH 6/7] Only register hidden types for opaque types from the - current crate, nothing else would work anyway. - -(cherry picked from commit d6b93eb79352149bae0fd1efc0bb181947a9e6f1) ---- - compiler/rustc_infer/src/infer/opaque_types.rs | 2 +- - compiler/rustc_middle/src/ty/mod.rs | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs -index 92c0ed84057a..3b9b6f7a2af9 100644 ---- a/compiler/rustc_infer/src/infer/opaque_types.rs -+++ b/compiler/rustc_infer/src/infer/opaque_types.rs -@@ -99,7 +99,7 @@ pub fn handle_opaque_type( - } - let (a, b) = if a_is_expected { (a, b) } else { (b, a) }; - let process = |a: Ty<'tcx>, b: Ty<'tcx>| match *a.kind() { -- ty::Opaque(def_id, substs) => { -+ ty::Opaque(def_id, substs) if def_id.is_local() => { - let origin = if self.defining_use_anchor.is_some() { - // Check that this is `impl Trait` type is - // declared by `parent_def_id` -- i.e., one whose -diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs -index 1c552591b117..a254979162e8 100644 ---- a/compiler/rustc_middle/src/ty/mod.rs -+++ b/compiler/rustc_middle/src/ty/mod.rs -@@ -1065,6 +1065,7 @@ pub fn is_empty(&self) -> bool { - Lift - )] - pub struct OpaqueTypeKey<'tcx> { -+ // FIXME(oli-obk): make this a LocalDefId - pub def_id: DefId, - pub substs: SubstsRef<'tcx>, - } --- -2.36.1 - - -From 1d4d0122ac5cbf7f4b948df36f7e315734c171b9 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Sat, 9 Jul 2022 18:16:53 -0400 -Subject: [PATCH 7/7] Fix tests after beta backport - -(cherry picked from commit 5a81254ef29b968f15f5296568c4b985657e8c49) ---- - src/test/ui/type-alias-impl-trait/issue-98604.stderr | 2 +- - src/test/ui/type-alias-impl-trait/issue-98608.stderr | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.stderr b/src/test/ui/type-alias-impl-trait/issue-98604.stderr -index f04d1b4d7877..ad3982760c39 100644 ---- a/src/test/ui/type-alias-impl-trait/issue-98604.stderr -+++ b/src/test/ui/type-alias-impl-trait/issue-98604.stderr -@@ -11,7 +11,7 @@ LL | async fn test() {} - | ^ checked the `Output` of this `async fn`, found opaque type - = note: expected struct `Pin + 'static)>>` - found opaque type `impl Future` -- = note: required for the cast from `fn() -> impl Future {test}` to the object type `dyn Fn() -> Pin + 'static)>>` -+ = note: required for the cast to the object type `dyn Fn() -> Pin + 'static)>>` - - error: aborting due to previous error - -diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.stderr b/src/test/ui/type-alias-impl-trait/issue-98608.stderr -index 8f3ec7d9d161..6773b01112d8 100644 ---- a/src/test/ui/type-alias-impl-trait/issue-98608.stderr -+++ b/src/test/ui/type-alias-impl-trait/issue-98608.stderr -@@ -9,7 +9,7 @@ LL | let b: Box Box> = Box::new(hi); - | - = note: expected struct `Box` - found opaque type `impl Sized` -- = note: required for the cast from `fn() -> impl Sized {hi}` to the object type `dyn Fn() -> Box` -+ = note: required for the cast to the object type `dyn Fn() -> Box` - - error: aborting due to previous error - --- -2.36.1 - diff --git a/sources b/sources index f8bfd99..e48ce40 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.62.0-src.tar.xz) = 02872a8409b0490fa9fa7a70756cbf103643694df6b2e2aea32ad8b70032a3162c7751cd92d78291587ee0120daeb9bc1ae5ec6136c7eb6eb584d8be3032dd3d +SHA512 (rustc-1.62.1-src.tar.xz) = 6f7fa855acdf20525e907a6fc8c7aa8b206603e3bcbd532d3bdce165380f0019f45dba2b2b06d20b541381accf67ca0d256fbddfcb1642a2e60e1237807d5410 SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 From f8bc0ed0d92366549c23e50eafbeb6ba745d5676 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 02:34:28 +0000 Subject: [PATCH 087/222] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index b030256..7ea0bbf 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.62.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -1032,6 +1032,9 @@ end} %changelog +* 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. From f4ffb080bacca7436453df5503645ab37a497079 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 11 Aug 2022 09:00:53 -0700 Subject: [PATCH 088/222] Update to 1.63.0. --- .gitignore | 1 + rust.spec | 19 +++++++----- ....patch => rustc-1.63.0-disable-http2.patch | 30 +++++++++---------- sources | 2 +- 4 files changed, 28 insertions(+), 24 deletions(-) rename rustc-1.62.0-disable-http2.patch => rustc-1.63.0-disable-http2.patch (72%) diff --git a/.gitignore b/.gitignore index bde8a26..a82d7cc 100644 --- a/.gitignore +++ b/.gitignore @@ -403,3 +403,4 @@ /wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz /rustc-1.62.0-src.tar.xz /rustc-1.62.1-src.tar.xz +/rustc-1.63.0-src.tar.xz diff --git a/rust.spec b/rust.spec index 7ea0bbf..9f4aa26 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.61.0 -%global bootstrap_channel 1.61.0 -%global bootstrap_date 2022-05-19 +%global bootstrap_version 1.62.0 +%global bootstrap_channel 1.62.0 +%global bootstrap_date 2022-06-30 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -46,7 +46,7 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. %global min_llvm_version 12.0.0 -%global bundled_llvm_version 14.0.4 +%global bundled_llvm_version 14.0.5 %bcond_with bundled_llvm # Requires stable libgit2 1.4, and not the next minor soname change. @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.62.1 -Release: 2%{?dist} +Version: 1.63.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -116,7 +116,7 @@ Patch100: rustc-1.59.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.62.0-disable-http2.patch +Patch101: rustc-1.63.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -630,7 +630,7 @@ ln -s /usr/bin/cmake3 cmake-bin/cmake # 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 {}' \ - src/librustc_llvm/lib.rs + compiler/rustc_llvm/src/lib.rs %endif # The configure macro will modify some autoconf-related files, which upsets @@ -1032,6 +1032,9 @@ end} %changelog +* 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 diff --git a/rustc-1.62.0-disable-http2.patch b/rustc-1.63.0-disable-http2.patch similarity index 72% rename from rustc-1.62.0-disable-http2.patch rename to rustc-1.63.0-disable-http2.patch index 71b019e..2e0c8f2 100644 --- a/rustc-1.62.0-disable-http2.patch +++ b/rustc-1.63.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2022-06-22 14:03:26.309745526 -0700 -+++ rustc-beta-src/Cargo.lock 2022-06-22 14:03:26.310745506 -0700 -@@ -990,7 +990,6 @@ +--- rustc-1.63.0-src/Cargo.lock.orig 2022-08-10 12:25:16.512185135 -0700 ++++ rustc-1.63.0-src/Cargo.lock 2022-08-10 12:25:16.513185114 -0700 +@@ -1054,7 +1054,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2101,16 +2100,6 @@ +@@ -2160,16 +2159,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-06-22 14:03:26.310745506 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-06-22 14:04:22.058596881 -0700 +--- rustc-1.63.0-src/src/tools/cargo/Cargo.toml.orig 2022-08-10 12:25:16.514185093 -0700 ++++ rustc-1.63.0-src/src/tools/cargo/Cargo.toml 2022-08-10 12:25:51.441455282 -0700 @@ -22,7 +22,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.1.3" } + cargo-util = { path = "crates/cargo-util", version = "0.2.1" } crates-io = { path = "crates/crates-io", version = "0.34.0" } crossbeam-utils = "0.8" --curl = { version = "0.4.41", features = ["http2"] } -+curl = { version = "0.4.41", features = [] } - curl-sys = "0.4.50" +-curl = { version = "0.4.43", features = ["http2"] } ++curl = { version = "0.4.43", features = [] } + curl-sys = "0.4.55" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-06-13 07:34:54.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-06-22 14:03:26.311745485 -0700 -@@ -183,16 +183,8 @@ +--- rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-08-08 15:47:35.000000000 -0700 ++++ rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-08-10 12:25:16.514185093 -0700 +@@ -192,16 +192,8 @@ } self.fetch_started = true; @@ -57,8 +57,8 @@ self.config .shell() ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-06-13 07:34:54.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-06-22 14:03:26.311745485 -0700 +--- rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-08-08 15:47:35.000000000 -0700 ++++ rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-08-10 12:25:16.514185093 -0700 @@ -403,16 +403,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, diff --git a/sources b/sources index e48ce40..88d8af1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.62.1-src.tar.xz) = 6f7fa855acdf20525e907a6fc8c7aa8b206603e3bcbd532d3bdce165380f0019f45dba2b2b06d20b541381accf67ca0d256fbddfcb1642a2e60e1237807d5410 +SHA512 (rustc-1.63.0-src.tar.xz) = 0dd3cd1546bd9c1438afe0c4694e1ed80507f6b437674682c0474e13f83457e9ced4560ddeee58602e01837140f9e34a9e24c6828643dd6f613e07755af6997c SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 From fbf19ab00e07cba408d3c2d5856b3c21b3d35acb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 22 Sep 2022 13:06:42 -0700 Subject: [PATCH 089/222] Update to 1.64.0. Add rust-analyzer. --- .gitignore | 1 + ...ansmute-fix-big-endian-discriminants.patch | 53 +++++++++++++++ rust.spec | 64 +++++++++++++------ ...patch => rustc-1.64.0-no-default-pie.patch | 9 +-- sources | 2 +- 5 files changed, 105 insertions(+), 24 deletions(-) create mode 100644 0001-rustc_transmute-fix-big-endian-discriminants.patch rename rustc-1.58.0-no-default-pie.patch => rustc-1.64.0-no-default-pie.patch (90%) diff --git a/.gitignore b/.gitignore index a82d7cc..28ca26f 100644 --- a/.gitignore +++ b/.gitignore @@ -404,3 +404,4 @@ /rustc-1.62.0-src.tar.xz /rustc-1.62.1-src.tar.xz /rustc-1.63.0-src.tar.xz +/rustc-1.64.0-src.tar.xz diff --git a/0001-rustc_transmute-fix-big-endian-discriminants.patch b/0001-rustc_transmute-fix-big-endian-discriminants.patch new file mode 100644 index 0000000..372852d --- /dev/null +++ b/0001-rustc_transmute-fix-big-endian-discriminants.patch @@ -0,0 +1,53 @@ +From 2946828fcb8e2e68a16839dfcf4319bf119f8acd Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 20 Sep 2022 13:03:43 -0700 +Subject: [PATCH] rustc_transmute: fix big-endian discriminants + +(cherry picked from commit a72666ed56ec5f1b6d254c7020cf86143edc6dbd) +--- + compiler/rustc_transmute/src/layout/tree.rs | 22 +++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs +index 70b3ba02b05b..e4fcde35ed37 100644 +--- a/compiler/rustc_transmute/src/layout/tree.rs ++++ b/compiler/rustc_transmute/src/layout/tree.rs +@@ -402,7 +402,7 @@ fn from_repr_c_variant( + .unwrap(); + tracing::trace!(?discr_layout, "computed discriminant layout"); + variant_layout = variant_layout.extend(discr_layout).unwrap().0; +- tree = tree.then(Self::from_disr(discr, tcx, layout_summary.discriminant_size)); ++ tree = tree.then(Self::from_discr(discr, tcx, layout_summary.discriminant_size)); + } + + // Next come fields. +@@ -442,11 +442,21 @@ fn from_repr_c_variant( + Ok(tree) + } + +- pub fn from_disr(discr: Discr<'tcx>, tcx: TyCtxt<'tcx>, size: usize) -> Self { +- // FIXME(@jswrenn): I'm certain this is missing needed endian nuance. +- let bytes = discr.val.to_ne_bytes(); +- let bytes = &bytes[..size]; +- Self::Seq(bytes.into_iter().copied().map(|b| Self::from_bits(b)).collect()) ++ pub fn from_discr(discr: Discr<'tcx>, tcx: TyCtxt<'tcx>, size: usize) -> Self { ++ use rustc_target::abi::Endian; ++ ++ let bytes: [u8; 16]; ++ let bytes = match tcx.data_layout.endian { ++ Endian::Little => { ++ bytes = discr.val.to_le_bytes(); ++ &bytes[..size] ++ } ++ Endian::Big => { ++ bytes = discr.val.to_be_bytes(); ++ &bytes[bytes.len() - size..] ++ } ++ }; ++ Self::Seq(bytes.iter().map(|&b| Self::from_bits(b)).collect()) + } + } + +-- +2.37.3 + diff --git a/rust.spec b/rust.spec index 9f4aa26..a0953ba 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.62.0 -%global bootstrap_channel 1.62.0 -%global bootstrap_date 2022-06-30 +%global bootstrap_version 1.63.0 +%global bootstrap_channel 1.63.0 +%global bootstrap_date 2022-08-11 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -46,7 +46,7 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. %global min_llvm_version 12.0.0 -%global bundled_llvm_version 14.0.5 +%global bundled_llvm_version 14.0.6 %bcond_with bundled_llvm # Requires stable libgit2 1.4, and not the next minor soname change. @@ -83,7 +83,7 @@ %endif Name: rust -Version: 1.63.0 +Version: 1.64.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -106,6 +106,9 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +# https://github.com/rust-lang/rust/pull/102076 +Patch3: 0001-rustc_transmute-fix-big-endian-discriminants.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -120,7 +123,7 @@ Patch101: rustc-1.63.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.58.0-no-default-pie.patch +Patch102: rustc-1.64.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -486,7 +489,7 @@ A tool for formatting Rust code according to style guidelines. %package -n rls -Summary: Rust Language Server for IDE integration +Summary: Rust Language Server for IDE integration (deprecated) %if %with bundled_libgit2 Provides: bundled(libgit2) = %{bundled_libgit2_version} %endif @@ -501,8 +504,17 @@ Provides: rls-preview = %{version}-%{release} %description -n rls The Rust Language Server provides a server that runs in the background, providing IDEs, editors, and other tools with information about Rust programs. -It supports functionality such as 'goto definition', symbol search, -reformatting, and code completion, and enables renaming and refactorings. +RLS is being deprecated in favor of rust-analyzer, and may be removed in the future. +https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html + + +%package analyzer +Summary: Rust implementation of the Language Server Protocol + +%description analyzer +rust-analyzer is an implementation of Language Server Protocol for the Rust +programming language. It provides features like completion and goto definition +for many code editors, including VS Code, Emacs and Vim. %package -n clippy @@ -574,6 +586,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -736,7 +749,7 @@ end} %{enable_debuginfo} \ --set rust.codegen-units-std=1 \ --enable-extended \ - --tools=analysis,cargo,clippy,rls,rustfmt,src \ + --tools=analysis,cargo,clippy,rls,rust-analyzer,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ --dist-compression-formats=gz \ @@ -776,15 +789,15 @@ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ # 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. -(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" && - find ../../../../%{_lib} -maxdepth 1 -name '*.so' | - while read lib; do - if [ -f "${lib##*/}" ]; then - # make sure they're actually identical! - cmp "$lib" "${lib##*/}" - ln -v -f -s -t . "$lib" - fi - done) +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 '{}' '+' @@ -863,6 +876,8 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" env RLS_TEST_WAIT_FOR_AGES=1 \ %{__python3} ./x.py test --no-fail-fast --stage 2 rls || : +%{__python3} ./x.py test --no-fail-fast --stage 2 rust-analyzer || : + %{__python3} ./x.py test --no-fail-fast --stage 2 rustfmt || : @@ -875,6 +890,7 @@ env RLS_TEST_WAIT_FOR_AGES=1 \ %{_bindir}/rustc %{_bindir}/rustdoc %{_libdir}/*.so +%{_libexecdir}/rust-analyzer-proc-macro-srv %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* %dir %{rustlibdir} @@ -1009,6 +1025,12 @@ end} %license src/tools/rls/LICENSE-{APACHE,MIT} +%files analyzer +%{_bindir}/rust-analyzer +%doc src/tools/rust-analyzer/README.md +%license src/tools/rust-analyzer/LICENSE-{APACHE,MIT} + + %files -n clippy %{_bindir}/cargo-clippy %{_bindir}/clippy-driver @@ -1032,6 +1054,10 @@ end} %changelog +* 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. diff --git a/rustc-1.58.0-no-default-pie.patch b/rustc-1.64.0-no-default-pie.patch similarity index 90% rename from rustc-1.58.0-no-default-pie.patch rename to rustc-1.64.0-no-default-pie.patch index 67fb0c6..c9dd827 100644 --- a/rustc-1.58.0-no-default-pie.patch +++ b/rustc-1.64.0-no-default-pie.patch @@ -1,8 +1,8 @@ diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 638b2a7b5a9f..79d4ecf4cb91 100644 +index 63207803e327..f5757760c409 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( +@@ -741,7 +741,7 @@ fn link_natively<'a>( && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie") { info!("linker output: {:?}", out); @@ -11,7 +11,7 @@ index 638b2a7b5a9f..79d4ecf4cb91 100644 for arg in cmd.take_args() { if arg.to_string_lossy() != "-no-pie" { cmd.arg(arg); -@@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( +@@ -760,7 +760,7 @@ fn link_natively<'a>( && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie") { info!("linker output: {:?}", out); @@ -20,12 +20,13 @@ index 638b2a7b5a9f..79d4ecf4cb91 100644 "Linker does not support -static-pie command line option. Retrying with -static instead." ); // Mirror `add_(pre,post)_link_objects` to replace CRT objects. -@@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +@@ -1507,15 +1507,15 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { + // Only use PIE if explicitly specified. ++ #[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] + let explicit_pic = + matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { diff --git a/sources b/sources index 88d8af1..ce4b974 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.63.0-src.tar.xz) = 0dd3cd1546bd9c1438afe0c4694e1ed80507f6b437674682c0474e13f83457e9ced4560ddeee58602e01837140f9e34a9e24c6828643dd6f613e07755af6997c +SHA512 (rustc-1.64.0-src.tar.xz) = 919f40acd8c6eaaef399aa3248503bea19feb96697ab221aaede9ee789ce340b47cb899d1e0e41a31e5d7756653968a10d2faaa4aee83294c9f1243949b43516 SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 From f5bf4afaf13e3522766392cd9e5c237b6f47c5bf Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 3 Nov 2022 10:40:06 -0700 Subject: [PATCH 090/222] Update to 1.65.0. rust-analyzer now obsoletes rls. --- .gitignore | 2 + ...the-dylib-path-when-gathering-target.patch | 182 ++++++++++++++++++ ...ansmute-fix-big-endian-discriminants.patch | 11 +- rust.spec | 146 +++++++------- rustc-1.59.0-disable-libssh2.patch | 42 ---- ....patch => rustc-1.65.0-disable-http2.patch | 24 +-- rustc-1.65.0-disable-libssh2.patch | 43 +++++ ...patch => rustc-1.65.0-no-default-pie.patch | 14 +- sources | 4 +- 9 files changed, 326 insertions(+), 142 deletions(-) create mode 100644 0001-compiletest-set-the-dylib-path-when-gathering-target.patch delete mode 100644 rustc-1.59.0-disable-libssh2.patch rename rustc-1.63.0-disable-http2.patch => rustc-1.65.0-disable-http2.patch (76%) create mode 100644 rustc-1.65.0-disable-libssh2.patch rename rustc-1.64.0-no-default-pie.patch => rustc-1.65.0-no-default-pie.patch (81%) diff --git a/.gitignore b/.gitignore index 28ca26f..7cce16d 100644 --- a/.gitignore +++ b/.gitignore @@ -405,3 +405,5 @@ /rustc-1.62.1-src.tar.xz /rustc-1.63.0-src.tar.xz /rustc-1.64.0-src.tar.xz +/rustc-1.65.0-src.tar.xz +/wasi-libc-wasi-sdk-16.tar.gz diff --git a/0001-compiletest-set-the-dylib-path-when-gathering-target.patch b/0001-compiletest-set-the-dylib-path-when-gathering-target.patch new file mode 100644 index 0000000..9fcfb3f --- /dev/null +++ b/0001-compiletest-set-the-dylib-path-when-gathering-target.patch @@ -0,0 +1,182 @@ +From 92b0b20e4119241aaeabb4b91189a9fca8ff8b5d Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 14 Oct 2022 16:11:28 -0700 +Subject: [PATCH] compiletest: set the dylib path when gathering target cfg + +If the compiler is built with `rpath = false`, then it won't find its +own libraries unless the library search path is set. We already do that +while running the actual compiletests, but #100260 added another rustc +command for getting the target cfg. + + Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) + thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" + --- stdout + + --- stderr + [...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory + ', src/tools/compiletest/src/common.rs:476:13 + +Now the library path is set here as well, so it works without rpath. + +(cherry picked from commit 97c3608326d123f5462e3504409a3a069611c0fb) +--- + src/tools/compiletest/src/common.rs | 17 ++++++++++------- + src/tools/compiletest/src/runtest.rs | 27 +++------------------------ + src/tools/compiletest/src/util.rs | 23 +++++++++++++++++++++++ + 3 files changed, 36 insertions(+), 31 deletions(-) + +diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs +index 64df76e27720..53b64e7d1fc3 100644 +--- a/src/tools/compiletest/src/common.rs ++++ b/src/tools/compiletest/src/common.rs +@@ -2,11 +2,12 @@ + + use std::ffi::OsString; + use std::fmt; ++use std::iter; + use std::path::{Path, PathBuf}; + use std::process::Command; + use std::str::FromStr; + +-use crate::util::PathBufExt; ++use crate::util::{add_dylib_path, PathBufExt}; + use lazycell::LazyCell; + use test::ColorConfig; + +@@ -389,7 +390,7 @@ pub fn run_enabled(&self) -> bool { + } + + fn target_cfg(&self) -> &TargetCfg { +- self.target_cfg.borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target)) ++ self.target_cfg.borrow_with(|| TargetCfg::new(self)) + } + + pub fn matches_arch(&self, arch: &str) -> bool { +@@ -455,20 +456,22 @@ pub enum Endian { + } + + impl TargetCfg { +- fn new(rustc_path: &Path, target: &str) -> TargetCfg { +- let output = match Command::new(rustc_path) ++ fn new(config: &Config) -> TargetCfg { ++ let mut command = Command::new(&config.rustc_path); ++ add_dylib_path(&mut command, iter::once(&config.compile_lib_path)); ++ let output = match command + .arg("--print=cfg") + .arg("--target") +- .arg(target) ++ .arg(&config.target) + .output() + { + Ok(output) => output, +- Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", rustc_path), ++ Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", config.rustc_path), + }; + if !output.status.success() { + panic!( + "error: failed to get cfg info from {:?}\n--- stdout\n{}\n--- stderr\n{}", +- rustc_path, ++ config.rustc_path, + String::from_utf8(output.stdout).unwrap(), + String::from_utf8(output.stderr).unwrap(), + ); +diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs +index 8f289876f730..eb467170249d 100644 +--- a/src/tools/compiletest/src/runtest.rs ++++ b/src/tools/compiletest/src/runtest.rs +@@ -13,7 +13,7 @@ + use crate::header::TestProps; + use crate::json; + use crate::read2::read2_abbreviated; +-use crate::util::{logv, PathBufExt}; ++use crate::util::{add_dylib_path, dylib_env_var, logv, PathBufExt}; + use crate::ColorConfig; + use regex::{Captures, Regex}; + use rustfix::{apply_suggestions, get_suggestions_from_json, Filter}; +@@ -26,6 +26,7 @@ + use std::hash::{Hash, Hasher}; + use std::io::prelude::*; + use std::io::{self, BufReader}; ++use std::iter; + use std::path::{Path, PathBuf}; + use std::process::{Child, Command, ExitStatus, Output, Stdio}; + use std::str; +@@ -72,19 +73,6 @@ fn disable_error_reporting R, R>(f: F) -> R { + f() + } + +-/// The name of the environment variable that holds dynamic library locations. +-pub fn dylib_env_var() -> &'static str { +- if cfg!(windows) { +- "PATH" +- } else if cfg!(target_os = "macos") { +- "DYLD_LIBRARY_PATH" +- } else if cfg!(target_os = "haiku") { +- "LIBRARY_PATH" +- } else { +- "LD_LIBRARY_PATH" +- } +-} +- + /// The platform-specific library name + pub fn get_lib_name(lib: &str, dylib: bool) -> String { + // In some casess (e.g. MUSL), we build a static +@@ -1826,16 +1814,7 @@ fn compose_and_run( + + // Need to be sure to put both the lib_path and the aux path in the dylib + // search path for the child. +- let mut path = +- env::split_paths(&env::var_os(dylib_env_var()).unwrap_or_default()).collect::>(); +- if let Some(p) = aux_path { +- path.insert(0, PathBuf::from(p)) +- } +- path.insert(0, PathBuf::from(lib_path)); +- +- // Add the new dylib search path var +- let newpath = env::join_paths(&path).unwrap(); +- command.env(dylib_env_var(), newpath); ++ add_dylib_path(&mut command, iter::once(lib_path).chain(aux_path)); + + let mut child = disable_error_reporting(|| command.spawn()) + .unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command)); +diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs +index 9d047b63c859..4b73be0fbb90 100644 +--- a/src/tools/compiletest/src/util.rs ++++ b/src/tools/compiletest/src/util.rs +@@ -2,6 +2,7 @@ + use std::env; + use std::ffi::OsStr; + use std::path::PathBuf; ++use std::process::Command; + + use tracing::*; + +@@ -105,3 +106,25 @@ fn with_extra_extension>(&self, extension: S) -> PathBuf { + } + } + } ++ ++/// The name of the environment variable that holds dynamic library locations. ++pub fn dylib_env_var() -> &'static str { ++ if cfg!(windows) { ++ "PATH" ++ } else if cfg!(target_os = "macos") { ++ "DYLD_LIBRARY_PATH" ++ } else if cfg!(target_os = "haiku") { ++ "LIBRARY_PATH" ++ } else { ++ "LD_LIBRARY_PATH" ++ } ++} ++ ++/// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. ++/// If the dylib_path_var is already set for this cmd, the old value will be overwritten! ++pub fn add_dylib_path(cmd: &mut Command, paths: impl Iterator>) { ++ let path_env = env::var_os(dylib_env_var()); ++ let old_paths = path_env.as_ref().map(env::split_paths); ++ let new_paths = paths.map(Into::into).chain(old_paths.into_iter().flatten()); ++ cmd.env(dylib_env_var(), env::join_paths(new_paths).unwrap()); ++} +-- +2.37.3 + diff --git a/0001-rustc_transmute-fix-big-endian-discriminants.patch b/0001-rustc_transmute-fix-big-endian-discriminants.patch index 372852d..aa4fa94 100644 --- a/0001-rustc_transmute-fix-big-endian-discriminants.patch +++ b/0001-rustc_transmute-fix-big-endian-discriminants.patch @@ -1,27 +1,26 @@ -From 2946828fcb8e2e68a16839dfcf4319bf119f8acd Mon Sep 17 00:00:00 2001 +From a72666ed56ec5f1b6d254c7020cf86143edc6dbd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 20 Sep 2022 13:03:43 -0700 Subject: [PATCH] rustc_transmute: fix big-endian discriminants -(cherry picked from commit a72666ed56ec5f1b6d254c7020cf86143edc6dbd) --- compiler/rustc_transmute/src/layout/tree.rs | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs -index 70b3ba02b05b..e4fcde35ed37 100644 +index 211c813b8001..acd4fa63d782 100644 --- a/compiler/rustc_transmute/src/layout/tree.rs +++ b/compiler/rustc_transmute/src/layout/tree.rs -@@ -402,7 +402,7 @@ fn from_repr_c_variant( +@@ -404,7 +404,7 @@ fn from_repr_c_variant( .unwrap(); - tracing::trace!(?discr_layout, "computed discriminant layout"); + trace!(?discr_layout, "computed discriminant layout"); variant_layout = variant_layout.extend(discr_layout).unwrap().0; - tree = tree.then(Self::from_disr(discr, tcx, layout_summary.discriminant_size)); + tree = tree.then(Self::from_discr(discr, tcx, layout_summary.discriminant_size)); } // Next come fields. -@@ -442,11 +442,21 @@ fn from_repr_c_variant( +@@ -444,11 +444,21 @@ fn from_repr_c_variant( Ok(tree) } diff --git a/rust.spec b/rust.spec index a0953ba..1a1492d 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.63.0 -%global bootstrap_channel 1.63.0 -%global bootstrap_date 2022-08-11 +%global bootstrap_version 1.64.0 +%global bootstrap_channel 1.64.0 +%global bootstrap_date 2022-09-22 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,9 +35,9 @@ # 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_commit 9886d3d6200fcc3726329966860fc058707406cd -%global wasi_libc_name wasi-libc-%{wasi_libc_commit} -%global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_commit}/%{wasi_libc_name}.tar.gz +%global wasi_libc_ref wasi-sdk-16 +%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} # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. @@ -45,15 +45,15 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. -%global min_llvm_version 12.0.0 -%global bundled_llvm_version 14.0.6 +%global min_llvm_version 13.0.0 +%global bundled_llvm_version 15.0.0 %bcond_with bundled_llvm -# Requires stable libgit2 1.4, and not the next minor soname change. +# Requires stable libgit2 1.5, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.4.0 -%global next_libgit2_version 1.5.0~ -%global bundled_libgit2_version 1.4.2 +%global min_libgit2_version 1.5.0 +%global next_libgit2_version 1.6.0~ +%global bundled_libgit2_version 1.5.0 %if 0%{?fedora} >= 99 %bcond_with bundled_libgit2 %else @@ -83,7 +83,7 @@ %endif Name: rust -Version: 1.64.0 +Version: 1.65.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -109,21 +109,24 @@ Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch # https://github.com/rust-lang/rust/pull/102076 Patch3: 0001-rustc_transmute-fix-big-endian-discriminants.patch +# https://github.com/rust-lang/rust/pull/103072 +Patch4: 0001-compiletest-set-the-dylib-path-when-gathering-target.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.59.0-disable-libssh2.patch +Patch100: rustc-1.65.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.63.0-disable-http2.patch +Patch101: rustc-1.65.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.64.0-no-default-pie.patch +Patch102: rustc-1.65.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -440,6 +443,12 @@ Summary: Documentation for Rust # Koji will fail the build in rpmdiff if two architectures build a noarch # subpackage differently, so instead we have to keep its arch. +# Cargo no longer builds its own documentation +# https://github.com/rust-lang/cargo/pull/4904 +# We used to keep a shim cargo-doc package, but now that's merged too. +Obsoletes: cargo-doc < 1.65.0~ +Provides: cargo-doc = %{version}-%{release} + %description doc This package includes HTML documentation for the Rust programming language and its standard library. @@ -465,17 +474,6 @@ Cargo is a tool that allows Rust projects to declare their various dependencies and ensure that you'll always get a repeatable build. -%package -n cargo-doc -Summary: Documentation for Cargo -BuildArch: noarch -# Cargo no longer builds its own documentation -# https://github.com/rust-lang/cargo/pull/4904 -Requires: %{name}-doc = %{version}-%{release} - -%description -n cargo-doc -This package includes HTML documentation for Cargo. - - %package -n rustfmt Summary: Tool to find and fix Rust formatting issues Requires: cargo @@ -488,29 +486,22 @@ Provides: rustfmt-preview = %{version}-%{release} A tool for formatting Rust code according to style guidelines. -%package -n rls -Summary: Rust Language Server for IDE integration (deprecated) -%if %with bundled_libgit2 -Provides: bundled(libgit2) = %{bundled_libgit2_version} -%endif -Requires: %{name}-analysis -# /usr/bin/rls is dynamically linked against internal rustc libs -Requires: %{name}%{?_isa} = %{version}-%{release} - -# The component/package was rls-preview until Rust 1.31. -Obsoletes: rls-preview < 1.31.6 -Provides: rls-preview = %{version}-%{release} - -%description -n rls -The Rust Language Server provides a server that runs in the background, -providing IDEs, editors, and other tools with information about Rust programs. -RLS is being deprecated in favor of rust-analyzer, and may be removed in the future. -https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html - - %package analyzer Summary: Rust implementation of the Language Server Protocol +# The standard library sources are needed for most functionality. +%if 0%{?rhel} && 0%{?rhel} < 8 +Requires: %{name}-src +%else +Recommends: %{name}-src +%endif + +# RLS is no longer available as of Rust 1.65, but we're including the stub +# binary that implements LSP just enough to recommend rust-analyzer. +Obsoletes: rls < 1.65.0~ +# The component/package was rls-preview until Rust 1.31. +Obsoletes: rls-preview < 1.31.6 + %description analyzer rust-analyzer is an implementation of Language Server Protocol for the Rust programming language. It provides features like completion and goto definition @@ -534,6 +525,11 @@ A collection of lints to catch common mistakes and improve your Rust code. %package src Summary: Sources for the Rust standard library BuildArch: noarch +%if 0%{?rhel} && 0%{?rhel} < 8 +Requires: %{name}-std-static = %{version}-%{release} +%else +Supplements: %{name}-std-static = %{version}-%{release} +%endif %description src This package includes source files for the Rust standard library. It may be @@ -542,7 +538,11 @@ useful as a reference for code completion tools in various editors. %package analysis Summary: Compiler analysis data for the Rust standard library +%if 0%{?rhel} && 0%{?rhel} < 8 Requires: %{name}-std-static%{?_isa} = %{version}-%{release} +%else +Supplements: %{name}-std-static%{?_isa} = %{version}-%{release} +%endif %description analysis This package contains analysis data files produced with rustc's -Zsave-analysis @@ -587,6 +587,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -671,7 +672,7 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %build %{export_rust_env} -%ifarch %{arm} %{ix86} s390x +%ifarch %{arm} %{ix86} # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 %if 0%{?rhel} && 0%{?rhel} < 8 @@ -748,6 +749,10 @@ end} --disable-rpath \ %{enable_debuginfo} \ --set rust.codegen-units-std=1 \ + --set build.build-stage=2 \ + --set build.doc-stage=2 \ + --set build.install-stage=2 \ + --set build.test-stage=2 \ --enable-extended \ --tools=analysis,cargo,clippy,rls,rust-analyzer,rustfmt,src \ --enable-vendor \ @@ -756,11 +761,11 @@ end} --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" -%{__python3} ./x.py build -j "$ncpus" --stage 2 -%{__python3} ./x.py doc --stage 2 +%{__python3} ./x.py build -j "$ncpus" +%{__python3} ./x.py doc for triple in %{?mingw_targets} %{?wasm_targets}; do - %{__python3} ./x.py build --stage 2 --target=$triple std + %{__python3} ./x.py build --target=$triple std done %install @@ -772,6 +777,9 @@ for triple in %{?mingw_targets} %{?wasm_targets}; do DESTDIR=%{buildroot} %{__python3} ./x.py 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/ @@ -865,20 +873,17 @@ done # 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. -%{__python3} ./x.py test --no-fail-fast --stage 2 || : +%{__python3} ./x.py test --no-fail-fast || : rm -rf "./build/%{rust_triple}/test/" -%{__python3} ./x.py test --no-fail-fast --stage 2 cargo || : +%{__python3} ./x.py test --no-fail-fast cargo || : rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" -%{__python3} ./x.py test --no-fail-fast --stage 2 clippy || : +%{__python3} ./x.py test --no-fail-fast clippy || : -env RLS_TEST_WAIT_FOR_AGES=1 \ -%{__python3} ./x.py test --no-fail-fast --stage 2 rls || : +%{__python3} ./x.py test --no-fail-fast rust-analyzer || : -%{__python3} ./x.py test --no-fail-fast --stage 2 rust-analyzer || : - -%{__python3} ./x.py test --no-fail-fast --stage 2 rustfmt || : +%{__python3} ./x.py test --no-fail-fast rustfmt || : %ldconfig_scriptlets @@ -992,10 +997,14 @@ end} %{_docdir}/%{name}/html/*.woff2 %license %{_docdir}/%{name}/html/*.txt %license %{_docdir}/%{name}/html/*.md +# former cargo-doc +%docdir %{_docdir}/cargo +%dir %{_docdir}/cargo +%{_docdir}/cargo/html %files -n cargo -%license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY +%license src/tools/cargo/LICENSE-{APACHE,MIT,THIRD-PARTY} %doc src/tools/cargo/README.md %{_bindir}/cargo %{_libexecdir}/cargo* @@ -1006,12 +1015,6 @@ end} %dir %{_datadir}/cargo/registry -%files -n cargo-doc -%docdir %{_docdir}/cargo -%dir %{_docdir}/cargo -%{_docdir}/cargo/html - - %files -n rustfmt %{_bindir}/rustfmt %{_bindir}/cargo-fmt @@ -1019,13 +1022,8 @@ end} %license src/tools/rustfmt/LICENSE-{APACHE,MIT} -%files -n rls -%{_bindir}/rls -%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md} -%license src/tools/rls/LICENSE-{APACHE,MIT} - - %files analyzer +%{_bindir}/rls %{_bindir}/rust-analyzer %doc src/tools/rust-analyzer/README.md %license src/tools/rust-analyzer/LICENSE-{APACHE,MIT} @@ -1054,6 +1052,10 @@ end} %changelog +* 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. diff --git a/rustc-1.59.0-disable-libssh2.patch b/rustc-1.59.0-disable-libssh2.patch deleted file mode 100644 index 4afd67c..0000000 --- a/rustc-1.59.0-disable-libssh2.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- rustc-1.59.0-src/Cargo.lock.orig 2022-02-21 18:48:37.000000000 -0800 -+++ rustc-1.59.0-src/Cargo.lock 2022-02-22 10:16:10.381962862 -0800 -@@ -1935,7 +1935,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -1968,20 +1967,6 @@ - ] - - [[package]] --name = "libssh2-sys" --version = "0.2.23" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" --dependencies = [ -- "cc", -- "libc", -- "libz-sys", -- "openssl-sys", -- "pkg-config", -- "vcpkg", --] -- --[[package]] - name = "libz-sys" - version = "1.1.3" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.59.0-src/vendor/git2/Cargo.toml.orig 2022-02-21 20:14:37.000000000 -0800 -+++ rustc-1.59.0-src/vendor/git2/Cargo.toml 2022-02-22 10:12:23.021772490 -0800 -@@ -51,7 +51,7 @@ - version = "0.1.39" - - [features] --default = ["ssh", "https", "ssh_key_from_memory"] -+default = ["https"] - https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] - ssh = ["libgit2-sys/ssh"] - ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/rustc-1.63.0-disable-http2.patch b/rustc-1.65.0-disable-http2.patch similarity index 76% rename from rustc-1.63.0-disable-http2.patch rename to rustc-1.65.0-disable-http2.patch index 2e0c8f2..99e33c7 100644 --- a/rustc-1.63.0-disable-http2.patch +++ b/rustc-1.65.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.63.0-src/Cargo.lock.orig 2022-08-10 12:25:16.512185135 -0700 -+++ rustc-1.63.0-src/Cargo.lock 2022-08-10 12:25:16.513185114 -0700 -@@ -1054,7 +1054,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2022-10-04 10:55:48.797517289 -0700 ++++ rustc-beta-src/Cargo.lock 2022-10-04 10:55:48.799517248 -0700 +@@ -1026,7 +1026,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2160,16 +2159,6 @@ +@@ -1993,16 +1992,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,19 +25,19 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.63.0-src/src/tools/cargo/Cargo.toml.orig 2022-08-10 12:25:16.514185093 -0700 -+++ rustc-1.63.0-src/src/tools/cargo/Cargo.toml 2022-08-10 12:25:51.441455282 -0700 -@@ -22,7 +22,7 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-10-04 10:55:48.799517248 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-10-04 11:00:55.057162743 -0700 +@@ -21,7 +21,7 @@ + cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } cargo-util = { path = "crates/cargo-util", version = "0.2.1" } crates-io = { path = "crates/crates-io", version = "0.34.0" } - crossbeam-utils = "0.8" -curl = { version = "0.4.43", features = ["http2"] } +curl = { version = "0.4.43", features = [] } curl-sys = "0.4.55" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-08-08 15:47:35.000000000 -0700 -+++ rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-08-10 12:25:16.514185093 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-09-24 10:23:17.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-10-04 10:55:48.799517248 -0700 @@ -192,16 +192,8 @@ } self.fetch_started = true; @@ -57,8 +57,8 @@ self.config .shell() ---- rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-08-08 15:47:35.000000000 -0700 -+++ rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-08-10 12:25:16.514185093 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-09-24 10:23:17.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-10-04 10:55:48.800517227 -0700 @@ -403,16 +403,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, diff --git a/rustc-1.65.0-disable-libssh2.patch b/rustc-1.65.0-disable-libssh2.patch new file mode 100644 index 0000000..24be1f3 --- /dev/null +++ b/rustc-1.65.0-disable-libssh2.patch @@ -0,0 +1,43 @@ +--- rustc-beta-src/Cargo.lock.orig 2022-09-24 10:20:14.000000000 -0700 ++++ rustc-beta-src/Cargo.lock 2022-10-04 10:26:35.490270607 -0700 +@@ -1971,7 +1971,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -2004,20 +2003,6 @@ + ] + + [[package]] +-name = "libssh2-sys" +-version = "0.2.23" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] +- +-[[package]] + name = "libz-sys" + version = "1.1.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-beta-src/vendor/git2/Cargo.toml.orig 2022-10-04 10:26:35.490270607 -0700 ++++ rustc-beta-src/vendor/git2/Cargo.toml 2022-10-04 10:28:14.002187686 -0700 +@@ -58,9 +58,7 @@ + + [features] + default = [ +- "ssh", + "https", +- "ssh_key_from_memory", + ] + https = [ + "libgit2-sys/https", diff --git a/rustc-1.64.0-no-default-pie.patch b/rustc-1.65.0-no-default-pie.patch similarity index 81% rename from rustc-1.64.0-no-default-pie.patch rename to rustc-1.65.0-no-default-pie.patch index c9dd827..2a69611 100644 --- a/rustc-1.64.0-no-default-pie.patch +++ b/rustc-1.65.0-no-default-pie.patch @@ -1,8 +1,6 @@ -diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 63207803e327..f5757760c409 100644 ---- a/compiler/rustc_codegen_ssa/src/back/link.rs -+++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -741,7 +741,7 @@ fn link_natively<'a>( +--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2022-09-24 10:20:14.000000000 -0700 ++++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2022-10-05 11:24:21.759564185 -0700 +@@ -755,7 +755,7 @@ && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie") { info!("linker output: {:?}", out); @@ -11,7 +9,7 @@ index 63207803e327..f5757760c409 100644 for arg in cmd.take_args() { if arg.to_string_lossy() != "-no-pie" { cmd.arg(arg); -@@ -760,7 +760,7 @@ fn link_natively<'a>( +@@ -774,7 +774,7 @@ && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie") { info!("linker output: {:?}", out); @@ -20,13 +18,13 @@ index 63207803e327..f5757760c409 100644 "Linker does not support -static-pie command line option. Retrying with -static instead." ); // Mirror `add_(pre,post)_link_objects` to replace CRT objects. -@@ -1507,15 +1507,15 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +@@ -1520,15 +1520,15 @@ } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { + // Only use PIE if explicitly specified. -+ #[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] ++ #[allow(rustc::bad_opt_access)] + let explicit_pic = + matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { diff --git a/sources b/sources index ce4b974..ae1d088 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.64.0-src.tar.xz) = 919f40acd8c6eaaef399aa3248503bea19feb96697ab221aaede9ee789ce340b47cb899d1e0e41a31e5d7756653968a10d2faaa4aee83294c9f1243949b43516 -SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 +SHA512 (rustc-1.65.0-src.tar.xz) = 3d0369ed3028209c4ecb9b9e7b5f5e3a20be8cc05199675df4f091d62a96c0734bc1dbd7630928fe162792392ec6d0daf9ceed10771531ce022200c7b631e3be +SHA512 (wasi-libc-wasi-sdk-16.tar.gz) = 4d3d12e233b2b3321e5287c0851a950d744208e05ed2c6d995dd2e7ff51452c7cfe62451589ed6d3ac58065f8cc87fc5c74a1853ed798e108662d1b0d3ad8a0e From 5379ac25ac84118a6fa60bb950566889dcf3e1ea Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 15 Dec 2022 09:12:22 -0800 Subject: [PATCH 091/222] Update to 1.66.0. --- .gitignore | 2 + ...ove-generating-Custom-entry-function.patch | 302 ++++++++++++++++++ ...e-main-as-__main_void-on-wasm32-wasi.patch | 34 ++ ...-Use-lld-provided-by-system-for-wasm.patch | 12 +- ...the-dylib-path-when-gathering-target.patch | 31 +- ...ansmute-fix-big-endian-discriminants.patch | 52 --- rust.spec | 31 +- sources | 4 +- 8 files changed, 382 insertions(+), 86 deletions(-) create mode 100644 0001-Improve-generating-Custom-entry-function.patch create mode 100644 0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch delete mode 100644 0001-rustc_transmute-fix-big-endian-discriminants.patch diff --git a/.gitignore b/.gitignore index 7cce16d..9c352d2 100644 --- a/.gitignore +++ b/.gitignore @@ -407,3 +407,5 @@ /rustc-1.64.0-src.tar.xz /rustc-1.65.0-src.tar.xz /wasi-libc-wasi-sdk-16.tar.gz +/rustc-1.66.0-src.tar.xz +/wasi-libc-wasi-sdk-17.tar.gz diff --git a/0001-Improve-generating-Custom-entry-function.patch b/0001-Improve-generating-Custom-entry-function.patch new file mode 100644 index 0000000..77cb30e --- /dev/null +++ b/0001-Improve-generating-Custom-entry-function.patch @@ -0,0 +1,302 @@ +From 9f0a8620bd7d325e6d42417b08daff3e55cb88f6 Mon Sep 17 00:00:00 2001 +From: Ayush Singh +Date: Sat, 5 Nov 2022 14:36:38 +0530 +Subject: [PATCH] Improve generating Custom entry function + +This commit is aimed at making compiler generated entry functions +(Basically just C `main` right now) more generic so other targets can do +similar things for custom entry. This was initially implemented as part +of https://github.com/rust-lang/rust/pull/100316. + +Currently, this moves the entry function name and Call convention to the +target spec. + +Signed-off-by: Ayush Singh +--- + compiler/rustc_codegen_llvm/src/abi.rs | 40 +++++++++++-------- + compiler/rustc_codegen_llvm/src/context.rs | 10 ++++- + compiler/rustc_codegen_llvm/src/declare.rs | 22 ++++++++++ + .../src/back/symbol_export.rs | 3 +- + compiler/rustc_target/src/abi/call/mod.rs | 28 +++++++++++++ + compiler/rustc_target/src/json.rs | 25 ++++++++++++ + compiler/rustc_target/src/spec/mod.rs | 27 +++++++++++++ + 7 files changed, 135 insertions(+), 20 deletions(-) + +diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs +index d478efc863a9..a6fd2a7de6bd 100644 +--- a/compiler/rustc_codegen_llvm/src/abi.rs ++++ b/compiler/rustc_codegen_llvm/src/abi.rs +@@ -398,23 +398,7 @@ fn ptr_to_llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type { + } + + fn llvm_cconv(&self) -> llvm::CallConv { +- match self.conv { +- Conv::C | Conv::Rust | Conv::CCmseNonSecureCall => llvm::CCallConv, +- Conv::RustCold => llvm::ColdCallConv, +- Conv::AmdGpuKernel => llvm::AmdGpuKernel, +- Conv::AvrInterrupt => llvm::AvrInterrupt, +- Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt, +- Conv::ArmAapcs => llvm::ArmAapcsCallConv, +- Conv::Msp430Intr => llvm::Msp430Intr, +- Conv::PtxKernel => llvm::PtxKernel, +- Conv::X86Fastcall => llvm::X86FastcallCallConv, +- Conv::X86Intr => llvm::X86_Intr, +- Conv::X86Stdcall => llvm::X86StdcallCallConv, +- Conv::X86ThisCall => llvm::X86_ThisCall, +- Conv::X86VectorCall => llvm::X86_VectorCall, +- Conv::X86_64SysV => llvm::X86_64_SysV, +- Conv::X86_64Win64 => llvm::X86_64_Win64, +- } ++ self.conv.into() + } + + fn apply_attrs_llfn(&self, cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value) { +@@ -596,3 +580,25 @@ fn get_param(&mut self, index: usize) -> Self::Value { + llvm::get_param(self.llfn(), index as c_uint) + } + } ++ ++impl From for llvm::CallConv { ++ fn from(conv: Conv) -> Self { ++ match conv { ++ Conv::C | Conv::Rust | Conv::CCmseNonSecureCall => llvm::CCallConv, ++ Conv::RustCold => llvm::ColdCallConv, ++ Conv::AmdGpuKernel => llvm::AmdGpuKernel, ++ Conv::AvrInterrupt => llvm::AvrInterrupt, ++ Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt, ++ Conv::ArmAapcs => llvm::ArmAapcsCallConv, ++ Conv::Msp430Intr => llvm::Msp430Intr, ++ Conv::PtxKernel => llvm::PtxKernel, ++ Conv::X86Fastcall => llvm::X86FastcallCallConv, ++ Conv::X86Intr => llvm::X86_Intr, ++ Conv::X86Stdcall => llvm::X86StdcallCallConv, ++ Conv::X86ThisCall => llvm::X86_ThisCall, ++ Conv::X86VectorCall => llvm::X86_VectorCall, ++ Conv::X86_64SysV => llvm::X86_64_SysV, ++ Conv::X86_64Win64 => llvm::X86_64_Win64, ++ } ++ } ++} +diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs +index 79ddfd884dfa..f3ef618fff54 100644 +--- a/compiler/rustc_codegen_llvm/src/context.rs ++++ b/compiler/rustc_codegen_llvm/src/context.rs +@@ -570,8 +570,14 @@ fn apply_target_cpu_attr(&self, llfn: &'ll Value) { + } + + fn declare_c_main(&self, fn_type: Self::Type) -> Option { +- if self.get_declared_value("main").is_none() { +- Some(self.declare_cfn("main", llvm::UnnamedAddr::Global, fn_type)) ++ let entry_name = self.sess().target.entry_name.as_ref(); ++ if self.get_declared_value(entry_name).is_none() { ++ Some(self.declare_entry_fn( ++ entry_name, ++ self.sess().target.entry_abi.into(), ++ llvm::UnnamedAddr::Global, ++ fn_type, ++ )) + } else { + // If the symbol already exists, it is an error: for example, the user wrote + // #[no_mangle] extern "C" fn main(..) {..} +diff --git a/compiler/rustc_codegen_llvm/src/declare.rs b/compiler/rustc_codegen_llvm/src/declare.rs +index f79ef11720df..dc21a02cec44 100644 +--- a/compiler/rustc_codegen_llvm/src/declare.rs ++++ b/compiler/rustc_codegen_llvm/src/declare.rs +@@ -90,6 +90,28 @@ pub fn declare_cfn( + declare_raw_fn(self, name, llvm::CCallConv, unnamed, visibility, fn_type) + } + ++ /// Declare an entry Function ++ /// ++ /// The ABI of this function can change depending on the target (although for now the same as ++ /// `declare_cfn`) ++ /// ++ /// If there’s a value with the same name already declared, the function will ++ /// update the declaration and return existing Value instead. ++ pub fn declare_entry_fn( ++ &self, ++ name: &str, ++ callconv: llvm::CallConv, ++ unnamed: llvm::UnnamedAddr, ++ fn_type: &'ll Type, ++ ) -> &'ll Value { ++ let visibility = if self.tcx.sess.target.default_hidden_visibility { ++ llvm::Visibility::Hidden ++ } else { ++ llvm::Visibility::Default ++ }; ++ declare_raw_fn(self, name, callconv, unnamed, visibility, fn_type) ++ } ++ + /// Declare a Rust function. + /// + /// If there’s a value with the same name already declared, the function will +diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +index 752f6b1ef40c..22f534d909ab 100644 +--- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs ++++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +@@ -180,7 +180,8 @@ fn exported_symbols_provider_local<'tcx>( + .collect(); + + if tcx.entry_fn(()).is_some() { +- let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, "main")); ++ let exported_symbol = ++ ExportedSymbol::NoDefId(SymbolName::new(tcx, tcx.sess.target.entry_name.as_ref())); + + symbols.push(( + exported_symbol, +diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs +index 9e5f0e4d158b..c622bd36b00c 100644 +--- a/compiler/rustc_target/src/abi/call/mod.rs ++++ b/compiler/rustc_target/src/abi/call/mod.rs +@@ -3,6 +3,7 @@ + use crate::spec::{self, HasTargetSpec}; + use rustc_span::Symbol; + use std::fmt; ++use std::str::FromStr; + + mod aarch64; + mod amdgpu; +@@ -735,6 +736,33 @@ pub fn adjust_for_foreign_abi( + } + } + ++impl FromStr for Conv { ++ type Err = String; ++ ++ fn from_str(s: &str) -> Result { ++ match s { ++ "C" => Ok(Conv::C), ++ "Rust" => Ok(Conv::Rust), ++ "RustCold" => Ok(Conv::Rust), ++ "ArmAapcs" => Ok(Conv::ArmAapcs), ++ "CCmseNonSecureCall" => Ok(Conv::CCmseNonSecureCall), ++ "Msp430Intr" => Ok(Conv::Msp430Intr), ++ "PtxKernel" => Ok(Conv::PtxKernel), ++ "X86Fastcall" => Ok(Conv::X86Fastcall), ++ "X86Intr" => Ok(Conv::X86Intr), ++ "X86Stdcall" => Ok(Conv::X86Stdcall), ++ "X86ThisCall" => Ok(Conv::X86ThisCall), ++ "X86VectorCall" => Ok(Conv::X86VectorCall), ++ "X86_64SysV" => Ok(Conv::X86_64SysV), ++ "X86_64Win64" => Ok(Conv::X86_64Win64), ++ "AmdGpuKernel" => Ok(Conv::AmdGpuKernel), ++ "AvrInterrupt" => Ok(Conv::AvrInterrupt), ++ "AvrNonBlockingInterrupt" => Ok(Conv::AvrNonBlockingInterrupt), ++ _ => Err(format!("'{}' is not a valid value for entry function call convetion.", s)), ++ } ++ } ++} ++ + // Some types are used a lot. Make sure they don't unintentionally get bigger. + #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] + mod size_asserts { +diff --git a/compiler/rustc_target/src/json.rs b/compiler/rustc_target/src/json.rs +index b5d926352122..75bb76a9de08 100644 +--- a/compiler/rustc_target/src/json.rs ++++ b/compiler/rustc_target/src/json.rs +@@ -89,3 +89,28 @@ fn to_json(&self) -> Json { + } + } + } ++ ++impl ToJson for crate::abi::call::Conv { ++ fn to_json(&self) -> Json { ++ let s = match self { ++ Self::C => "C", ++ Self::Rust => "Rust", ++ Self::RustCold => "RustCold", ++ Self::ArmAapcs => "ArmAapcs", ++ Self::CCmseNonSecureCall => "CCmseNonSecureCall", ++ Self::Msp430Intr => "Msp430Intr", ++ Self::PtxKernel => "PtxKernel", ++ Self::X86Fastcall => "X86Fastcall", ++ Self::X86Intr => "X86Intr", ++ Self::X86Stdcall => "X86Stdcall", ++ Self::X86ThisCall => "X86ThisCall", ++ Self::X86VectorCall => "X86VectorCall", ++ Self::X86_64SysV => "X86_64SysV", ++ Self::X86_64Win64 => "X86_64Win64", ++ Self::AmdGpuKernel => "AmdGpuKernel", ++ Self::AvrInterrupt => "AvrInterrupt", ++ Self::AvrNonBlockingInterrupt => "AvrNonBlockingInterrupt", ++ }; ++ Json::String(s.to_owned()) ++ } ++} +diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs +index 72b088d663b1..617de46a55aa 100644 +--- a/compiler/rustc_target/src/spec/mod.rs ++++ b/compiler/rustc_target/src/spec/mod.rs +@@ -34,6 +34,7 @@ + //! the target's settings, though `target-feature` and `link-args` will *add* + //! to the list specified by the target, rather than replace. + ++use crate::abi::call::Conv; + use crate::abi::Endian; + use crate::json::{Json, ToJson}; + use crate::spec::abi::{lookup as lookup_abi, Abi}; +@@ -1668,6 +1669,14 @@ pub struct TargetOptions { + /// Whether the target supports stack canary checks. `true` by default, + /// since this is most common among tier 1 and tier 2 targets. + pub supports_stack_protector: bool, ++ ++ // The name of entry function. ++ // Default value is "main" ++ pub entry_name: StaticCow, ++ ++ // The ABI of entry function. ++ // Default value is `Conv::C`, i.e. C call convention ++ pub entry_abi: Conv, + } + + /// Add arguments for the given flavor and also for its "twin" flavors +@@ -1884,6 +1893,8 @@ fn default() -> TargetOptions { + c_enum_min_bits: 32, + generate_arange_section: true, + supports_stack_protector: true, ++ entry_name: "main".into(), ++ entry_abi: Conv::C, + } + } + } +@@ -2401,6 +2412,18 @@ macro_rules! key { + } + } + } ); ++ ($key_name:ident, Conv) => ( { ++ let name = (stringify!($key_name)).replace("_", "-"); ++ obj.remove(&name).and_then(|o| o.as_str().and_then(|s| { ++ match Conv::from_str(s) { ++ Ok(c) => { ++ base.$key_name = c; ++ Some(Ok(())) ++ } ++ Err(e) => Some(Err(e)) ++ } ++ })).unwrap_or(Ok(())) ++ } ); + } + + if let Some(j) = obj.remove("target-endian") { +@@ -2520,6 +2543,8 @@ macro_rules! key { + key!(c_enum_min_bits, u64); + key!(generate_arange_section, bool); + key!(supports_stack_protector, bool); ++ key!(entry_name); ++ key!(entry_abi, Conv)?; + + if base.is_builtin { + // This can cause unfortunate ICEs later down the line. +@@ -2770,6 +2795,8 @@ macro_rules! target_option_val { + target_option_val!(c_enum_min_bits); + target_option_val!(generate_arange_section); + target_option_val!(supports_stack_protector); ++ target_option_val!(entry_name); ++ target_option_val!(entry_abi); + + if let Some(abi) = self.default_adjusted_cabi { + d.insert("default-adjusted-cabi".into(), Abi::name(abi).to_json()); +-- +2.38.1 + diff --git a/0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch b/0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch new file mode 100644 index 0000000..3f087ef --- /dev/null +++ b/0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch @@ -0,0 +1,34 @@ +From 98ae83daae67e9e7663b8345eced1de8c667271f Mon Sep 17 00:00:00 2001 +From: Dan Gohman +Date: Thu, 8 Dec 2022 10:35:46 -0800 +Subject: [PATCH] Mangle "main" as "__main_void" on wasm32-wasi + +On wasm, the age-old C trick of having a main function which can either have +no arguments or argc+argv doesn't work, because wasm requires caller and +callee signatures to match. WASI's current strategy is to have compilers +mangle main's name to indicate which signature they're using. Rust uses the +no-argument form, which should be mangled as `__main_void`. + +This is needed on wasm32-wasi as of #105395. +--- + compiler/rustc_target/src/spec/wasm32_wasi.rs | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/compiler/rustc_target/src/spec/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs +index 6f0bbf0672d4..a0476d542e64 100644 +--- a/compiler/rustc_target/src/spec/wasm32_wasi.rs ++++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs +@@ -104,6 +104,10 @@ pub fn target() -> Target { + // `args::args()` makes the WASI API calls itself. + options.main_needs_argc_argv = false; + ++ // And, WASI mangles the name of "main" to distinguish between different ++ // signatures. ++ options.entry_name = "__main_void".into(); ++ + Target { + llvm_target: "wasm32-wasi".into(), + pointer_width: 32, +-- +2.38.1 + diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch index fa75ad3..5fcc245 100644 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -1,4 +1,4 @@ -From b521511174b1a08dddfac243604d649b71cc7386 Mon Sep 17 00:00:00 2001 +From 37cb177eb53145103ae72b67562884782dde01c3 Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sun, 8 Dec 2019 17:23:08 +0500 Subject: [PATCH] Use lld provided by system for wasm @@ -8,19 +8,19 @@ Subject: [PATCH] Use lld provided by system for wasm 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index de7b7374af31..eebbe616e9b6 100644 +index 528a84a8b37c..353d742161d1 100644 --- a/compiler/rustc_target/src/spec/wasm_base.rs +++ b/compiler/rustc_target/src/spec/wasm_base.rs -@@ -99,8 +99,7 @@ pub fn options() -> TargetOptions { +@@ -89,8 +89,7 @@ macro_rules! args { // arguments just yet limit_rdylib_exports: false, - // we use the LLD shipped with the Rust toolchain by default - linker: Some("rust-lld".into()), + linker: Some("lld".into()), - lld_flavor: LldFlavor::Wasm, - linker_is_gnu: false, + linker_flavor: LinkerFlavor::WasmLld(Cc::No), + pre_link_args, -- -2.35.1 +2.38.1 diff --git a/0001-compiletest-set-the-dylib-path-when-gathering-target.patch b/0001-compiletest-set-the-dylib-path-when-gathering-target.patch index 9fcfb3f..54185a7 100644 --- a/0001-compiletest-set-the-dylib-path-when-gathering-target.patch +++ b/0001-compiletest-set-the-dylib-path-when-gathering-target.patch @@ -1,4 +1,4 @@ -From 92b0b20e4119241aaeabb4b91189a9fca8ff8b5d Mon Sep 17 00:00:00 2001 +From 2bdbc5fbf7f84c62f8c7b1007f3b6fd6d3da06f6 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 14 Oct 2022 16:11:28 -0700 Subject: [PATCH] compiletest: set the dylib path when gathering target cfg @@ -18,15 +18,15 @@ command for getting the target cfg. Now the library path is set here as well, so it works without rpath. -(cherry picked from commit 97c3608326d123f5462e3504409a3a069611c0fb) +(cherry picked from commit f8a0cc2ca8a644ddb63867526711ba17cb7508c8) --- - src/tools/compiletest/src/common.rs | 17 ++++++++++------- + src/tools/compiletest/src/common.rs | 20 +++++++++++--------- src/tools/compiletest/src/runtest.rs | 27 +++------------------------ src/tools/compiletest/src/util.rs | 23 +++++++++++++++++++++++ - 3 files changed, 36 insertions(+), 31 deletions(-) + 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs -index 64df76e27720..53b64e7d1fc3 100644 +index 0260f6848386..9a432f11f82f 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -2,11 +2,12 @@ @@ -43,20 +43,21 @@ index 64df76e27720..53b64e7d1fc3 100644 use lazycell::LazyCell; use test::ColorConfig; -@@ -389,7 +390,7 @@ pub fn run_enabled(&self) -> bool { +@@ -385,8 +386,7 @@ pub fn run_enabled(&self) -> bool { } fn target_cfg(&self) -> &TargetCfg { -- self.target_cfg.borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target)) +- self.target_cfg +- .borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target, &self.target_rustcflags)) + self.target_cfg.borrow_with(|| TargetCfg::new(self)) } pub fn matches_arch(&self, arch: &str) -> bool { -@@ -455,20 +456,22 @@ pub enum Endian { +@@ -457,21 +457,23 @@ pub enum Endian { } impl TargetCfg { -- fn new(rustc_path: &Path, target: &str) -> TargetCfg { +- fn new(rustc_path: &Path, target: &str, target_rustcflags: &Vec) -> TargetCfg { - let output = match Command::new(rustc_path) + fn new(config: &Config) -> TargetCfg { + let mut command = Command::new(&config.rustc_path); @@ -65,7 +66,9 @@ index 64df76e27720..53b64e7d1fc3 100644 .arg("--print=cfg") .arg("--target") - .arg(target) +- .args(target_rustcflags) + .arg(&config.target) ++ .args(&config.target_rustcflags) .output() { Ok(output) => output, @@ -81,7 +84,7 @@ index 64df76e27720..53b64e7d1fc3 100644 String::from_utf8(output.stderr).unwrap(), ); diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs -index 8f289876f730..eb467170249d 100644 +index 8af5f1da694b..f8903f754f09 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -13,7 +13,7 @@ @@ -121,7 +124,7 @@ index 8f289876f730..eb467170249d 100644 /// The platform-specific library name pub fn get_lib_name(lib: &str, dylib: bool) -> String { // In some casess (e.g. MUSL), we build a static -@@ -1826,16 +1814,7 @@ fn compose_and_run( +@@ -1811,16 +1799,7 @@ fn compose_and_run( // Need to be sure to put both the lib_path and the aux path in the dylib // search path for the child. @@ -140,7 +143,7 @@ index 8f289876f730..eb467170249d 100644 let mut child = disable_error_reporting(|| command.spawn()) .unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command)); diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs -index 9d047b63c859..4b73be0fbb90 100644 +index e5ff0906be8a..ec36f1e4fb72 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -2,6 +2,7 @@ @@ -151,7 +154,7 @@ index 9d047b63c859..4b73be0fbb90 100644 use tracing::*; -@@ -105,3 +106,25 @@ fn with_extra_extension>(&self, extension: S) -> PathBuf { +@@ -111,3 +112,25 @@ fn with_extra_extension>(&self, extension: S) -> PathBuf { } } } @@ -178,5 +181,5 @@ index 9d047b63c859..4b73be0fbb90 100644 + cmd.env(dylib_env_var(), env::join_paths(new_paths).unwrap()); +} -- -2.37.3 +2.38.1 diff --git a/0001-rustc_transmute-fix-big-endian-discriminants.patch b/0001-rustc_transmute-fix-big-endian-discriminants.patch deleted file mode 100644 index aa4fa94..0000000 --- a/0001-rustc_transmute-fix-big-endian-discriminants.patch +++ /dev/null @@ -1,52 +0,0 @@ -From a72666ed56ec5f1b6d254c7020cf86143edc6dbd Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 20 Sep 2022 13:03:43 -0700 -Subject: [PATCH] rustc_transmute: fix big-endian discriminants - ---- - compiler/rustc_transmute/src/layout/tree.rs | 22 +++++++++++++++------ - 1 file changed, 16 insertions(+), 6 deletions(-) - -diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs -index 211c813b8001..acd4fa63d782 100644 ---- a/compiler/rustc_transmute/src/layout/tree.rs -+++ b/compiler/rustc_transmute/src/layout/tree.rs -@@ -404,7 +404,7 @@ fn from_repr_c_variant( - .unwrap(); - trace!(?discr_layout, "computed discriminant layout"); - variant_layout = variant_layout.extend(discr_layout).unwrap().0; -- tree = tree.then(Self::from_disr(discr, tcx, layout_summary.discriminant_size)); -+ tree = tree.then(Self::from_discr(discr, tcx, layout_summary.discriminant_size)); - } - - // Next come fields. -@@ -444,11 +444,21 @@ fn from_repr_c_variant( - Ok(tree) - } - -- pub fn from_disr(discr: Discr<'tcx>, tcx: TyCtxt<'tcx>, size: usize) -> Self { -- // FIXME(@jswrenn): I'm certain this is missing needed endian nuance. -- let bytes = discr.val.to_ne_bytes(); -- let bytes = &bytes[..size]; -- Self::Seq(bytes.into_iter().copied().map(|b| Self::from_bits(b)).collect()) -+ pub fn from_discr(discr: Discr<'tcx>, tcx: TyCtxt<'tcx>, size: usize) -> Self { -+ use rustc_target::abi::Endian; -+ -+ let bytes: [u8; 16]; -+ let bytes = match tcx.data_layout.endian { -+ Endian::Little => { -+ bytes = discr.val.to_le_bytes(); -+ &bytes[..size] -+ } -+ Endian::Big => { -+ bytes = discr.val.to_be_bytes(); -+ &bytes[bytes.len() - size..] -+ } -+ }; -+ Self::Seq(bytes.iter().map(|&b| Self::from_bits(b)).collect()) - } - } - --- -2.37.3 - diff --git a/rust.spec b/rust.spec index 1a1492d..d4dbb1c 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.64.0 -%global bootstrap_channel 1.64.0 -%global bootstrap_date 2022-09-22 +%global bootstrap_version 1.65.0 +%global bootstrap_channel 1.65.0 +%global bootstrap_date 2022-11-03 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,7 +35,7 @@ # 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-16 +%global wasi_libc_ref wasi-sdk-17 %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 +46,7 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. %global min_llvm_version 13.0.0 -%global bundled_llvm_version 15.0.0 +%global bundled_llvm_version 15.0.2 %bcond_with bundled_llvm # Requires stable libgit2 1.5, and not the next minor soname change. @@ -83,7 +83,7 @@ %endif Name: rust -Version: 1.65.0 +Version: 1.66.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -106,11 +106,14 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# https://github.com/rust-lang/rust/pull/102076 -Patch3: 0001-rustc_transmute-fix-big-endian-discriminants.patch - # https://github.com/rust-lang/rust/pull/103072 -Patch4: 0001-compiletest-set-the-dylib-path-when-gathering-target.patch +Patch3: 0001-compiletest-set-the-dylib-path-when-gathering-target.patch + +# https://github.com/rust-lang/rust/pull/104001 +Patch4: 0001-Improve-generating-Custom-entry-function.patch + +# https://github.com/rust-lang/rust/pull/105468 +Patch5: 0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch ### RHEL-specific patches below ### @@ -528,7 +531,7 @@ BuildArch: noarch %if 0%{?rhel} && 0%{?rhel} < 8 Requires: %{name}-std-static = %{version}-%{release} %else -Supplements: %{name}-std-static = %{version}-%{release} +Recommends: %{name}-std-static = %{version}-%{release} %endif %description src @@ -541,7 +544,7 @@ Summary: Compiler analysis data for the Rust standard library %if 0%{?rhel} && 0%{?rhel} < 8 Requires: %{name}-std-static%{?_isa} = %{version}-%{release} %else -Supplements: %{name}-std-static%{?_isa} = %{version}-%{release} +Recommends: %{name}-std-static%{?_isa} = %{version}-%{release} %endif %description analysis @@ -588,6 +591,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1052,6 +1056,9 @@ end} %changelog +* 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. diff --git a/sources b/sources index ae1d088..608b89d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.65.0-src.tar.xz) = 3d0369ed3028209c4ecb9b9e7b5f5e3a20be8cc05199675df4f091d62a96c0734bc1dbd7630928fe162792392ec6d0daf9ceed10771531ce022200c7b631e3be -SHA512 (wasi-libc-wasi-sdk-16.tar.gz) = 4d3d12e233b2b3321e5287c0851a950d744208e05ed2c6d995dd2e7ff51452c7cfe62451589ed6d3ac58065f8cc87fc5c74a1853ed798e108662d1b0d3ad8a0e +SHA512 (rustc-1.66.0-src.tar.xz) = df329bcabce309846e44d92a118758dfc65b63f06857226799c75568a2a018a96500fd07cd38c1927e3486d190a6f57340ee794c733bbbb69cf80a99855ced73 +SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376 From 1f0d4ff0a2ed689373502ecb208f5a3e4622a06f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 4 Jan 2023 10:51:03 -0800 Subject: [PATCH 092/222] Update CI plan to tmt --- plans/ci.fmf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plans/ci.fmf b/plans/ci.fmf index 1ad2c12..3fd3ab7 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -1,6 +1,5 @@ summary: CI Gating Plan discover: how: fmf - directory: tests execute: - how: beakerlib + how: tmt From 5a745388ed7af0edfd3bad1e706c9638d16a996c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 10 Jan 2023 18:05:07 -0800 Subject: [PATCH 093/222] Update to 1.66.1. Security fix for CVE-2022-46176 --- rust.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index d4dbb1c..ee05662 100644 --- a/rust.spec +++ b/rust.spec @@ -83,7 +83,7 @@ %endif Name: rust -Version: 1.66.0 +Version: 1.66.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -1056,6 +1056,10 @@ end} %changelog +* 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. From 256f31f182fd3a6deab11cfe1dd01711662852dd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 10 Jan 2023 18:30:35 -0800 Subject: [PATCH 094/222] fedpkg new-sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9c352d2..fd38bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -409,3 +409,4 @@ /wasi-libc-wasi-sdk-16.tar.gz /rustc-1.66.0-src.tar.xz /wasi-libc-wasi-sdk-17.tar.gz +/rustc-1.66.1-src.tar.xz diff --git a/sources b/sources index 608b89d..4fb006d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.66.0-src.tar.xz) = df329bcabce309846e44d92a118758dfc65b63f06857226799c75568a2a018a96500fd07cd38c1927e3486d190a6f57340ee794c733bbbb69cf80a99855ced73 +SHA512 (rustc-1.66.1-src.tar.xz) = 1944c024c603140d0a9236043a3bd1d0d211dd8d368d6d82a3a620f1ff43b29624755b0943f2b38b40a188c7eee77a840238ea757eaf435e2a3fa6a0e6b82832 SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376 From dbc2fd6f229f5655bef8091c9cb732c8a6d40644 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Wed, 11 Jan 2023 19:28:21 +0100 Subject: [PATCH 095/222] rpmbuild-librsvg2: Get deps from srpm instead spec file to generate the dynamic dependencies --- tests/Sanity/rpmbuild-librsvg2/runtest.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Sanity/rpmbuild-librsvg2/runtest.sh b/tests/Sanity/rpmbuild-librsvg2/runtest.sh index 8965c9e..470ecb5 100755 --- a/tests/Sanity/rpmbuild-librsvg2/runtest.sh +++ b/tests/Sanity/rpmbuild-librsvg2/runtest.sh @@ -48,7 +48,10 @@ rlJournalStart rlRun "rpm -ivh $SRPM" rlRun SPECDIR="$(rpm -E '%{_specdir}')" - rlRun "yum-builddep -y ${SPECDIR}/${PKG_TO_BUILD}.spec ${YUM_SWITCHES}" + # 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 From 4ee64c64a1984c066da63f8b6f84f293874a6fc3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 20 Jan 2023 21:24:34 +0000 Subject: [PATCH 096/222] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index ee05662..249e50b 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.66.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -1056,6 +1056,9 @@ end} %changelog +* 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 From d90cdf5795cd3d09751ab593ad6d27f985b42896 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 26 Jan 2023 12:09:44 -0800 Subject: [PATCH 097/222] Update to 1.67.0. --- .gitignore | 1 + ...ove-generating-Custom-entry-function.patch | 302 ------------------ ...e-main-as-__main_void-on-wasm32-wasi.patch | 34 -- ...the-dylib-path-when-gathering-target.patch | 185 ----------- rust.spec | 40 +-- ....patch => rustc-1.67.0-disable-http2.patch | 70 ++-- sources | 2 +- 7 files changed, 48 insertions(+), 586 deletions(-) delete mode 100644 0001-Improve-generating-Custom-entry-function.patch delete mode 100644 0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch delete mode 100644 0001-compiletest-set-the-dylib-path-when-gathering-target.patch rename rustc-1.65.0-disable-http2.patch => rustc-1.67.0-disable-http2.patch (77%) diff --git a/.gitignore b/.gitignore index fd38bd4..3de52c7 100644 --- a/.gitignore +++ b/.gitignore @@ -410,3 +410,4 @@ /rustc-1.66.0-src.tar.xz /wasi-libc-wasi-sdk-17.tar.gz /rustc-1.66.1-src.tar.xz +/rustc-1.67.0-src.tar.xz diff --git a/0001-Improve-generating-Custom-entry-function.patch b/0001-Improve-generating-Custom-entry-function.patch deleted file mode 100644 index 77cb30e..0000000 --- a/0001-Improve-generating-Custom-entry-function.patch +++ /dev/null @@ -1,302 +0,0 @@ -From 9f0a8620bd7d325e6d42417b08daff3e55cb88f6 Mon Sep 17 00:00:00 2001 -From: Ayush Singh -Date: Sat, 5 Nov 2022 14:36:38 +0530 -Subject: [PATCH] Improve generating Custom entry function - -This commit is aimed at making compiler generated entry functions -(Basically just C `main` right now) more generic so other targets can do -similar things for custom entry. This was initially implemented as part -of https://github.com/rust-lang/rust/pull/100316. - -Currently, this moves the entry function name and Call convention to the -target spec. - -Signed-off-by: Ayush Singh ---- - compiler/rustc_codegen_llvm/src/abi.rs | 40 +++++++++++-------- - compiler/rustc_codegen_llvm/src/context.rs | 10 ++++- - compiler/rustc_codegen_llvm/src/declare.rs | 22 ++++++++++ - .../src/back/symbol_export.rs | 3 +- - compiler/rustc_target/src/abi/call/mod.rs | 28 +++++++++++++ - compiler/rustc_target/src/json.rs | 25 ++++++++++++ - compiler/rustc_target/src/spec/mod.rs | 27 +++++++++++++ - 7 files changed, 135 insertions(+), 20 deletions(-) - -diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs -index d478efc863a9..a6fd2a7de6bd 100644 ---- a/compiler/rustc_codegen_llvm/src/abi.rs -+++ b/compiler/rustc_codegen_llvm/src/abi.rs -@@ -398,23 +398,7 @@ fn ptr_to_llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type { - } - - fn llvm_cconv(&self) -> llvm::CallConv { -- match self.conv { -- Conv::C | Conv::Rust | Conv::CCmseNonSecureCall => llvm::CCallConv, -- Conv::RustCold => llvm::ColdCallConv, -- Conv::AmdGpuKernel => llvm::AmdGpuKernel, -- Conv::AvrInterrupt => llvm::AvrInterrupt, -- Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt, -- Conv::ArmAapcs => llvm::ArmAapcsCallConv, -- Conv::Msp430Intr => llvm::Msp430Intr, -- Conv::PtxKernel => llvm::PtxKernel, -- Conv::X86Fastcall => llvm::X86FastcallCallConv, -- Conv::X86Intr => llvm::X86_Intr, -- Conv::X86Stdcall => llvm::X86StdcallCallConv, -- Conv::X86ThisCall => llvm::X86_ThisCall, -- Conv::X86VectorCall => llvm::X86_VectorCall, -- Conv::X86_64SysV => llvm::X86_64_SysV, -- Conv::X86_64Win64 => llvm::X86_64_Win64, -- } -+ self.conv.into() - } - - fn apply_attrs_llfn(&self, cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value) { -@@ -596,3 +580,25 @@ fn get_param(&mut self, index: usize) -> Self::Value { - llvm::get_param(self.llfn(), index as c_uint) - } - } -+ -+impl From for llvm::CallConv { -+ fn from(conv: Conv) -> Self { -+ match conv { -+ Conv::C | Conv::Rust | Conv::CCmseNonSecureCall => llvm::CCallConv, -+ Conv::RustCold => llvm::ColdCallConv, -+ Conv::AmdGpuKernel => llvm::AmdGpuKernel, -+ Conv::AvrInterrupt => llvm::AvrInterrupt, -+ Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt, -+ Conv::ArmAapcs => llvm::ArmAapcsCallConv, -+ Conv::Msp430Intr => llvm::Msp430Intr, -+ Conv::PtxKernel => llvm::PtxKernel, -+ Conv::X86Fastcall => llvm::X86FastcallCallConv, -+ Conv::X86Intr => llvm::X86_Intr, -+ Conv::X86Stdcall => llvm::X86StdcallCallConv, -+ Conv::X86ThisCall => llvm::X86_ThisCall, -+ Conv::X86VectorCall => llvm::X86_VectorCall, -+ Conv::X86_64SysV => llvm::X86_64_SysV, -+ Conv::X86_64Win64 => llvm::X86_64_Win64, -+ } -+ } -+} -diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs -index 79ddfd884dfa..f3ef618fff54 100644 ---- a/compiler/rustc_codegen_llvm/src/context.rs -+++ b/compiler/rustc_codegen_llvm/src/context.rs -@@ -570,8 +570,14 @@ fn apply_target_cpu_attr(&self, llfn: &'ll Value) { - } - - fn declare_c_main(&self, fn_type: Self::Type) -> Option { -- if self.get_declared_value("main").is_none() { -- Some(self.declare_cfn("main", llvm::UnnamedAddr::Global, fn_type)) -+ let entry_name = self.sess().target.entry_name.as_ref(); -+ if self.get_declared_value(entry_name).is_none() { -+ Some(self.declare_entry_fn( -+ entry_name, -+ self.sess().target.entry_abi.into(), -+ llvm::UnnamedAddr::Global, -+ fn_type, -+ )) - } else { - // If the symbol already exists, it is an error: for example, the user wrote - // #[no_mangle] extern "C" fn main(..) {..} -diff --git a/compiler/rustc_codegen_llvm/src/declare.rs b/compiler/rustc_codegen_llvm/src/declare.rs -index f79ef11720df..dc21a02cec44 100644 ---- a/compiler/rustc_codegen_llvm/src/declare.rs -+++ b/compiler/rustc_codegen_llvm/src/declare.rs -@@ -90,6 +90,28 @@ pub fn declare_cfn( - declare_raw_fn(self, name, llvm::CCallConv, unnamed, visibility, fn_type) - } - -+ /// Declare an entry Function -+ /// -+ /// The ABI of this function can change depending on the target (although for now the same as -+ /// `declare_cfn`) -+ /// -+ /// If there’s a value with the same name already declared, the function will -+ /// update the declaration and return existing Value instead. -+ pub fn declare_entry_fn( -+ &self, -+ name: &str, -+ callconv: llvm::CallConv, -+ unnamed: llvm::UnnamedAddr, -+ fn_type: &'ll Type, -+ ) -> &'ll Value { -+ let visibility = if self.tcx.sess.target.default_hidden_visibility { -+ llvm::Visibility::Hidden -+ } else { -+ llvm::Visibility::Default -+ }; -+ declare_raw_fn(self, name, callconv, unnamed, visibility, fn_type) -+ } -+ - /// Declare a Rust function. - /// - /// If there’s a value with the same name already declared, the function will -diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs -index 752f6b1ef40c..22f534d909ab 100644 ---- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs -+++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs -@@ -180,7 +180,8 @@ fn exported_symbols_provider_local<'tcx>( - .collect(); - - if tcx.entry_fn(()).is_some() { -- let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, "main")); -+ let exported_symbol = -+ ExportedSymbol::NoDefId(SymbolName::new(tcx, tcx.sess.target.entry_name.as_ref())); - - symbols.push(( - exported_symbol, -diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs -index 9e5f0e4d158b..c622bd36b00c 100644 ---- a/compiler/rustc_target/src/abi/call/mod.rs -+++ b/compiler/rustc_target/src/abi/call/mod.rs -@@ -3,6 +3,7 @@ - use crate::spec::{self, HasTargetSpec}; - use rustc_span::Symbol; - use std::fmt; -+use std::str::FromStr; - - mod aarch64; - mod amdgpu; -@@ -735,6 +736,33 @@ pub fn adjust_for_foreign_abi( - } - } - -+impl FromStr for Conv { -+ type Err = String; -+ -+ fn from_str(s: &str) -> Result { -+ match s { -+ "C" => Ok(Conv::C), -+ "Rust" => Ok(Conv::Rust), -+ "RustCold" => Ok(Conv::Rust), -+ "ArmAapcs" => Ok(Conv::ArmAapcs), -+ "CCmseNonSecureCall" => Ok(Conv::CCmseNonSecureCall), -+ "Msp430Intr" => Ok(Conv::Msp430Intr), -+ "PtxKernel" => Ok(Conv::PtxKernel), -+ "X86Fastcall" => Ok(Conv::X86Fastcall), -+ "X86Intr" => Ok(Conv::X86Intr), -+ "X86Stdcall" => Ok(Conv::X86Stdcall), -+ "X86ThisCall" => Ok(Conv::X86ThisCall), -+ "X86VectorCall" => Ok(Conv::X86VectorCall), -+ "X86_64SysV" => Ok(Conv::X86_64SysV), -+ "X86_64Win64" => Ok(Conv::X86_64Win64), -+ "AmdGpuKernel" => Ok(Conv::AmdGpuKernel), -+ "AvrInterrupt" => Ok(Conv::AvrInterrupt), -+ "AvrNonBlockingInterrupt" => Ok(Conv::AvrNonBlockingInterrupt), -+ _ => Err(format!("'{}' is not a valid value for entry function call convetion.", s)), -+ } -+ } -+} -+ - // Some types are used a lot. Make sure they don't unintentionally get bigger. - #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] - mod size_asserts { -diff --git a/compiler/rustc_target/src/json.rs b/compiler/rustc_target/src/json.rs -index b5d926352122..75bb76a9de08 100644 ---- a/compiler/rustc_target/src/json.rs -+++ b/compiler/rustc_target/src/json.rs -@@ -89,3 +89,28 @@ fn to_json(&self) -> Json { - } - } - } -+ -+impl ToJson for crate::abi::call::Conv { -+ fn to_json(&self) -> Json { -+ let s = match self { -+ Self::C => "C", -+ Self::Rust => "Rust", -+ Self::RustCold => "RustCold", -+ Self::ArmAapcs => "ArmAapcs", -+ Self::CCmseNonSecureCall => "CCmseNonSecureCall", -+ Self::Msp430Intr => "Msp430Intr", -+ Self::PtxKernel => "PtxKernel", -+ Self::X86Fastcall => "X86Fastcall", -+ Self::X86Intr => "X86Intr", -+ Self::X86Stdcall => "X86Stdcall", -+ Self::X86ThisCall => "X86ThisCall", -+ Self::X86VectorCall => "X86VectorCall", -+ Self::X86_64SysV => "X86_64SysV", -+ Self::X86_64Win64 => "X86_64Win64", -+ Self::AmdGpuKernel => "AmdGpuKernel", -+ Self::AvrInterrupt => "AvrInterrupt", -+ Self::AvrNonBlockingInterrupt => "AvrNonBlockingInterrupt", -+ }; -+ Json::String(s.to_owned()) -+ } -+} -diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 72b088d663b1..617de46a55aa 100644 ---- a/compiler/rustc_target/src/spec/mod.rs -+++ b/compiler/rustc_target/src/spec/mod.rs -@@ -34,6 +34,7 @@ - //! the target's settings, though `target-feature` and `link-args` will *add* - //! to the list specified by the target, rather than replace. - -+use crate::abi::call::Conv; - use crate::abi::Endian; - use crate::json::{Json, ToJson}; - use crate::spec::abi::{lookup as lookup_abi, Abi}; -@@ -1668,6 +1669,14 @@ pub struct TargetOptions { - /// Whether the target supports stack canary checks. `true` by default, - /// since this is most common among tier 1 and tier 2 targets. - pub supports_stack_protector: bool, -+ -+ // The name of entry function. -+ // Default value is "main" -+ pub entry_name: StaticCow, -+ -+ // The ABI of entry function. -+ // Default value is `Conv::C`, i.e. C call convention -+ pub entry_abi: Conv, - } - - /// Add arguments for the given flavor and also for its "twin" flavors -@@ -1884,6 +1893,8 @@ fn default() -> TargetOptions { - c_enum_min_bits: 32, - generate_arange_section: true, - supports_stack_protector: true, -+ entry_name: "main".into(), -+ entry_abi: Conv::C, - } - } - } -@@ -2401,6 +2412,18 @@ macro_rules! key { - } - } - } ); -+ ($key_name:ident, Conv) => ( { -+ let name = (stringify!($key_name)).replace("_", "-"); -+ obj.remove(&name).and_then(|o| o.as_str().and_then(|s| { -+ match Conv::from_str(s) { -+ Ok(c) => { -+ base.$key_name = c; -+ Some(Ok(())) -+ } -+ Err(e) => Some(Err(e)) -+ } -+ })).unwrap_or(Ok(())) -+ } ); - } - - if let Some(j) = obj.remove("target-endian") { -@@ -2520,6 +2543,8 @@ macro_rules! key { - key!(c_enum_min_bits, u64); - key!(generate_arange_section, bool); - key!(supports_stack_protector, bool); -+ key!(entry_name); -+ key!(entry_abi, Conv)?; - - if base.is_builtin { - // This can cause unfortunate ICEs later down the line. -@@ -2770,6 +2795,8 @@ macro_rules! target_option_val { - target_option_val!(c_enum_min_bits); - target_option_val!(generate_arange_section); - target_option_val!(supports_stack_protector); -+ target_option_val!(entry_name); -+ target_option_val!(entry_abi); - - if let Some(abi) = self.default_adjusted_cabi { - d.insert("default-adjusted-cabi".into(), Abi::name(abi).to_json()); --- -2.38.1 - diff --git a/0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch b/0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch deleted file mode 100644 index 3f087ef..0000000 --- a/0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 98ae83daae67e9e7663b8345eced1de8c667271f Mon Sep 17 00:00:00 2001 -From: Dan Gohman -Date: Thu, 8 Dec 2022 10:35:46 -0800 -Subject: [PATCH] Mangle "main" as "__main_void" on wasm32-wasi - -On wasm, the age-old C trick of having a main function which can either have -no arguments or argc+argv doesn't work, because wasm requires caller and -callee signatures to match. WASI's current strategy is to have compilers -mangle main's name to indicate which signature they're using. Rust uses the -no-argument form, which should be mangled as `__main_void`. - -This is needed on wasm32-wasi as of #105395. ---- - compiler/rustc_target/src/spec/wasm32_wasi.rs | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/compiler/rustc_target/src/spec/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs -index 6f0bbf0672d4..a0476d542e64 100644 ---- a/compiler/rustc_target/src/spec/wasm32_wasi.rs -+++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs -@@ -104,6 +104,10 @@ pub fn target() -> Target { - // `args::args()` makes the WASI API calls itself. - options.main_needs_argc_argv = false; - -+ // And, WASI mangles the name of "main" to distinguish between different -+ // signatures. -+ options.entry_name = "__main_void".into(); -+ - Target { - llvm_target: "wasm32-wasi".into(), - pointer_width: 32, --- -2.38.1 - diff --git a/0001-compiletest-set-the-dylib-path-when-gathering-target.patch b/0001-compiletest-set-the-dylib-path-when-gathering-target.patch deleted file mode 100644 index 54185a7..0000000 --- a/0001-compiletest-set-the-dylib-path-when-gathering-target.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 2bdbc5fbf7f84c62f8c7b1007f3b6fd6d3da06f6 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 14 Oct 2022 16:11:28 -0700 -Subject: [PATCH] compiletest: set the dylib path when gathering target cfg - -If the compiler is built with `rpath = false`, then it won't find its -own libraries unless the library search path is set. We already do that -while running the actual compiletests, but #100260 added another rustc -command for getting the target cfg. - - Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) - thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" - --- stdout - - --- stderr - [...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory - ', src/tools/compiletest/src/common.rs:476:13 - -Now the library path is set here as well, so it works without rpath. - -(cherry picked from commit f8a0cc2ca8a644ddb63867526711ba17cb7508c8) ---- - src/tools/compiletest/src/common.rs | 20 +++++++++++--------- - src/tools/compiletest/src/runtest.rs | 27 +++------------------------ - src/tools/compiletest/src/util.rs | 23 +++++++++++++++++++++++ - 3 files changed, 37 insertions(+), 33 deletions(-) - -diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs -index 0260f6848386..9a432f11f82f 100644 ---- a/src/tools/compiletest/src/common.rs -+++ b/src/tools/compiletest/src/common.rs -@@ -2,11 +2,12 @@ - - use std::ffi::OsString; - use std::fmt; -+use std::iter; - use std::path::{Path, PathBuf}; - use std::process::Command; - use std::str::FromStr; - --use crate::util::PathBufExt; -+use crate::util::{add_dylib_path, PathBufExt}; - use lazycell::LazyCell; - use test::ColorConfig; - -@@ -385,8 +386,7 @@ pub fn run_enabled(&self) -> bool { - } - - fn target_cfg(&self) -> &TargetCfg { -- self.target_cfg -- .borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target, &self.target_rustcflags)) -+ self.target_cfg.borrow_with(|| TargetCfg::new(self)) - } - - pub fn matches_arch(&self, arch: &str) -> bool { -@@ -457,21 +457,23 @@ pub enum Endian { - } - - impl TargetCfg { -- fn new(rustc_path: &Path, target: &str, target_rustcflags: &Vec) -> TargetCfg { -- let output = match Command::new(rustc_path) -+ fn new(config: &Config) -> TargetCfg { -+ let mut command = Command::new(&config.rustc_path); -+ add_dylib_path(&mut command, iter::once(&config.compile_lib_path)); -+ let output = match command - .arg("--print=cfg") - .arg("--target") -- .arg(target) -- .args(target_rustcflags) -+ .arg(&config.target) -+ .args(&config.target_rustcflags) - .output() - { - Ok(output) => output, -- Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", rustc_path), -+ Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", config.rustc_path), - }; - if !output.status.success() { - panic!( - "error: failed to get cfg info from {:?}\n--- stdout\n{}\n--- stderr\n{}", -- rustc_path, -+ config.rustc_path, - String::from_utf8(output.stdout).unwrap(), - String::from_utf8(output.stderr).unwrap(), - ); -diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs -index 8af5f1da694b..f8903f754f09 100644 ---- a/src/tools/compiletest/src/runtest.rs -+++ b/src/tools/compiletest/src/runtest.rs -@@ -13,7 +13,7 @@ - use crate::header::TestProps; - use crate::json; - use crate::read2::read2_abbreviated; --use crate::util::{logv, PathBufExt}; -+use crate::util::{add_dylib_path, dylib_env_var, logv, PathBufExt}; - use crate::ColorConfig; - use regex::{Captures, Regex}; - use rustfix::{apply_suggestions, get_suggestions_from_json, Filter}; -@@ -26,6 +26,7 @@ - use std::hash::{Hash, Hasher}; - use std::io::prelude::*; - use std::io::{self, BufReader}; -+use std::iter; - use std::path::{Path, PathBuf}; - use std::process::{Child, Command, ExitStatus, Output, Stdio}; - use std::str; -@@ -72,19 +73,6 @@ fn disable_error_reporting R, R>(f: F) -> R { - f() - } - --/// The name of the environment variable that holds dynamic library locations. --pub fn dylib_env_var() -> &'static str { -- if cfg!(windows) { -- "PATH" -- } else if cfg!(target_os = "macos") { -- "DYLD_LIBRARY_PATH" -- } else if cfg!(target_os = "haiku") { -- "LIBRARY_PATH" -- } else { -- "LD_LIBRARY_PATH" -- } --} -- - /// The platform-specific library name - pub fn get_lib_name(lib: &str, dylib: bool) -> String { - // In some casess (e.g. MUSL), we build a static -@@ -1811,16 +1799,7 @@ fn compose_and_run( - - // Need to be sure to put both the lib_path and the aux path in the dylib - // search path for the child. -- let mut path = -- env::split_paths(&env::var_os(dylib_env_var()).unwrap_or_default()).collect::>(); -- if let Some(p) = aux_path { -- path.insert(0, PathBuf::from(p)) -- } -- path.insert(0, PathBuf::from(lib_path)); -- -- // Add the new dylib search path var -- let newpath = env::join_paths(&path).unwrap(); -- command.env(dylib_env_var(), newpath); -+ add_dylib_path(&mut command, iter::once(lib_path).chain(aux_path)); - - let mut child = disable_error_reporting(|| command.spawn()) - .unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command)); -diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs -index e5ff0906be8a..ec36f1e4fb72 100644 ---- a/src/tools/compiletest/src/util.rs -+++ b/src/tools/compiletest/src/util.rs -@@ -2,6 +2,7 @@ - use std::env; - use std::ffi::OsStr; - use std::path::PathBuf; -+use std::process::Command; - - use tracing::*; - -@@ -111,3 +112,25 @@ fn with_extra_extension>(&self, extension: S) -> PathBuf { - } - } - } -+ -+/// The name of the environment variable that holds dynamic library locations. -+pub fn dylib_env_var() -> &'static str { -+ if cfg!(windows) { -+ "PATH" -+ } else if cfg!(target_os = "macos") { -+ "DYLD_LIBRARY_PATH" -+ } else if cfg!(target_os = "haiku") { -+ "LIBRARY_PATH" -+ } else { -+ "LD_LIBRARY_PATH" -+ } -+} -+ -+/// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. -+/// If the dylib_path_var is already set for this cmd, the old value will be overwritten! -+pub fn add_dylib_path(cmd: &mut Command, paths: impl Iterator>) { -+ let path_env = env::var_os(dylib_env_var()); -+ let old_paths = path_env.as_ref().map(env::split_paths); -+ let new_paths = paths.map(Into::into).chain(old_paths.into_iter().flatten()); -+ cmd.env(dylib_env_var(), env::join_paths(new_paths).unwrap()); -+} --- -2.38.1 - diff --git a/rust.spec b/rust.spec index 249e50b..04de8a6 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.65.0 -%global bootstrap_channel 1.65.0 -%global bootstrap_date 2022-11-03 +%global bootstrap_version 1.66.0 +%global bootstrap_channel 1.66.0 +%global bootstrap_date 2022-12-15 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -46,7 +46,7 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 12.0+. %global min_llvm_version 13.0.0 -%global bundled_llvm_version 15.0.2 +%global bundled_llvm_version 15.0.6 %bcond_with bundled_llvm # Requires stable libgit2 1.5, and not the next minor soname change. @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.66.1 -Release: 2%{?dist} +Version: 1.67.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,15 +106,6 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# https://github.com/rust-lang/rust/pull/103072 -Patch3: 0001-compiletest-set-the-dylib-path-when-gathering-target.patch - -# https://github.com/rust-lang/rust/pull/104001 -Patch4: 0001-Improve-generating-Custom-entry-function.patch - -# https://github.com/rust-lang/rust/pull/105468 -Patch5: 0001-Mangle-main-as-__main_void-on-wasm32-wasi.patch - ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -125,7 +116,7 @@ Patch100: rustc-1.65.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.65.0-disable-http2.patch +Patch101: rustc-1.67.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -589,9 +580,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -991,16 +979,7 @@ end} %files doc %docdir %{_docdir}/%{name} %dir %{_docdir}/%{name} -%dir %{_docdir}/%{name}/html -%{_docdir}/%{name}/html/*/ -%{_docdir}/%{name}/html/*.html -%{_docdir}/%{name}/html/*.css -%{_docdir}/%{name}/html/*.js -%{_docdir}/%{name}/html/*.png -%{_docdir}/%{name}/html/*.svg -%{_docdir}/%{name}/html/*.woff2 -%license %{_docdir}/%{name}/html/*.txt -%license %{_docdir}/%{name}/html/*.md +%{_docdir}/%{name}/html # former cargo-doc %docdir %{_docdir}/cargo %dir %{_docdir}/cargo @@ -1056,6 +1035,9 @@ end} %changelog +* 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 diff --git a/rustc-1.65.0-disable-http2.patch b/rustc-1.67.0-disable-http2.patch similarity index 77% rename from rustc-1.65.0-disable-http2.patch rename to rustc-1.67.0-disable-http2.patch index 99e33c7..7b346e9 100644 --- a/rustc-1.65.0-disable-http2.patch +++ b/rustc-1.67.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2022-10-04 10:55:48.797517289 -0700 -+++ rustc-beta-src/Cargo.lock 2022-10-04 10:55:48.799517248 -0700 -@@ -1026,7 +1026,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2023-01-24 13:25:47.822917185 -0800 ++++ rustc-beta-src/Cargo.lock 2023-01-24 13:25:47.824917142 -0800 +@@ -1062,7 +1062,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1993,16 +1992,6 @@ +@@ -2181,16 +2180,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,40 +25,19 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2022-10-04 10:55:48.799517248 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2022-10-04 11:00:55.057162743 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-01-24 13:25:47.824917142 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-01-24 13:26:29.209044200 -0800 @@ -21,7 +21,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } - cargo-util = { path = "crates/cargo-util", version = "0.2.1" } - crates-io = { path = "crates/crates-io", version = "0.34.0" } --curl = { version = "0.4.43", features = ["http2"] } -+curl = { version = "0.4.43", features = [] } - curl-sys = "0.4.55" - env_logger = "0.9.0" + cargo-util = { path = "crates/cargo-util", version = "0.2.3" } + crates-io = { path = "crates/crates-io", version = "0.35.0" } +-curl = { version = "0.4.44", features = ["http2"] } ++curl = { version = "0.4.44", features = [] } + curl-sys = "0.4.59" + env_logger = "0.10.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-09-24 10:23:17.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-10-04 10:55:48.799517248 -0700 -@@ -192,16 +192,8 @@ - } - self.fetch_started = true; - -- // We've enabled the `http2` feature of `curl` in Cargo, so treat -- // failures here as fatal as it would indicate a build-time problem. -- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true); -- -- self.multi -- .pipelining(false, self.multiplexing) -- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood the server with connections -- self.multi.set_max_host_connections(2)?; -+ // Multiplexing is disabled because the system libcurl doesn't support it. -+ self.multiplexing = false; - - self.config - .shell() ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-09-24 10:23:17.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2022-10-04 10:55:48.800517227 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-01-21 17:17:19.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-01-24 13:25:47.824917142 -0800 @@ -403,16 +403,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, @@ -88,3 +67,24 @@ if let Err(e) = result { warn!("ignoring libcurl {} error: {}", $msg, e); } +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-01-21 17:17:19.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-01-24 13:25:47.824917142 -0800 +@@ -223,16 +223,8 @@ + } + self.fetch_started = true; + +- // We've enabled the `http2` feature of `curl` in Cargo, so treat +- // failures here as fatal as it would indicate a build-time problem. +- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true); +- +- self.multi +- .pipelining(false, self.multiplexing) +- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; +- +- // let's not flood the server with connections +- self.multi.set_max_host_connections(2)?; ++ // Multiplexing is disabled because the system libcurl doesn't support it. ++ self.multiplexing = false; + + self.config + .shell() diff --git a/sources b/sources index 4fb006d..222afaa 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.66.1-src.tar.xz) = 1944c024c603140d0a9236043a3bd1d0d211dd8d368d6d82a3a620f1ff43b29624755b0943f2b38b40a188c7eee77a840238ea757eaf435e2a3fa6a0e6b82832 +SHA512 (rustc-1.67.0-src.tar.xz) = 6d1ddb54c0ee2c4f8ccf73f3c306c8d8868feb738d5e77eb5a5d25f716395c27d1b3666929c87f9dc84213a9acfdb56254feac92ef0fea3147e2c644391c12b4 SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376 From 23df2b257f7b947181dc4c049bfb7c6ef0cebf43 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 27 Jan 2023 15:00:45 -0800 Subject: [PATCH 098/222] Backport a couple of fixes from upstream One fix to a problem that broke mesa build, and one fix to a problem that broke rust bootstrap. --- 107360-modified.patch | 26 +++++++++++++ ...a0b3dd5fe14b43ad5b7862f4528df7322468.patch | 38 +++++++++++++++++++ rust.spec | 18 ++++++++- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 107360-modified.patch create mode 100644 675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch diff --git a/107360-modified.patch b/107360-modified.patch new file mode 100644 index 0000000..3d59653 --- /dev/null +++ b/107360-modified.patch @@ -0,0 +1,26 @@ +From de363d54c40a378717881240e719f5f7223ba376 Mon Sep 17 00:00:00 2001 +From: bjorn3 <17426603+bjorn3@users.noreply.github.com> +Date: Fri, 27 Jan 2023 11:48:36 +0000 +Subject: [PATCH 3/4] Revert back to LlvmArchiveBuilder on all platforms + +ArArchiveBuilder doesn't support reading thin archives, causing a +regression. +--- + compiler/rustc_codegen_llvm/src/back/archive.rs | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs +index b00676b7c592b..58ca87524deb6 100644 +--- a/compiler/rustc_codegen_llvm/src/back/archive.rs ++++ b/compiler/rustc_codegen_llvm/src/back/archive.rs +@@ -108,7 +108,9 @@ pub struct LlvmArchiveBuilderBuilder; + + impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { + fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box + 'a> { +- if sess.target.arch == "wasm32" || sess.target.arch == "wasm64" { ++ // FIXME use ArArchiveBuilder on most targets again once reading thin archives is ++ // implemented ++ if true || sess.target.arch == "wasm32" || sess.target.arch == "wasm64" { + Box::new(LlvmArchiveBuilder { sess, additions: Vec::new() }) + } else { + Box::new(ArArchiveBuilder::new(sess, get_llvm_object_symbols)) diff --git a/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch b/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch new file mode 100644 index 0000000..eb16066 --- /dev/null +++ b/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch @@ -0,0 +1,38 @@ +From 675fa0b3dd5fe14b43ad5b7862f4528df7322468 Mon Sep 17 00:00:00 2001 +From: Michael Goulet +Date: Mon, 12 Dec 2022 18:29:33 +0000 +Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?= + =?UTF-8?q?ap=20cache=20code?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + src/bootstrap/cache.rs | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs +index be5c9bb078808..05f25af68ea8f 100644 +--- a/src/bootstrap/cache.rs ++++ b/src/bootstrap/cache.rs +@@ -89,16 +89,16 @@ impl Hash for Interned { + + impl Deref for Interned { + type Target = T::Target; +- fn deref(&self) -> &'static Self::Target { ++ fn deref(&self) -> &Self::Target { + let l = T::intern_cache().lock().unwrap(); +- unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) } ++ unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) } + } + } + + impl, U: ?Sized> AsRef for Interned { +- fn as_ref(&self) -> &'static U { ++ fn as_ref(&self) -> &U { + let l = T::intern_cache().lock().unwrap(); +- unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) } ++ unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) } + } + } + diff --git a/rust.spec b/rust.spec index 04de8a6..1c2cc6c 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.67.0 -Release: 1%{?dist} +Release: 2awb%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,16 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +# Fix bootstrap failure +# https://github.com/rust-lang/rust/commit/675fa0b3dd5fe14b43ad5b7862f4528df7322468 +Patch3: 675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch + +# fix build of mesa, possibly other things; patch edited to only +# include the one commit necessary on top of 1.67.0 +# https://github.com/rust-lang/rust/issues/107334 +# https://github.com/rust-lang/rust/pull/107360 +Patch4: 107360-modified.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -580,6 +590,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1035,6 +1047,10 @@ end} %changelog +* 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. From de194644254b9a01eb6e010a907db02378270095 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 27 Jan 2023 15:02:29 -0800 Subject: [PATCH 099/222] Drop private build tag inadvertently left in release --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 1c2cc6c..63eca7d 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.67.0 -Release: 2awb%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) From d8cb2d0d2e842c3f97f9e9dbff097ae297cd15bf Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 3 Feb 2023 14:44:01 -0800 Subject: [PATCH 100/222] Unbundle libgit2 on Fedora 38. --- rust.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 63eca7d..03c816f 100644 --- a/rust.spec +++ b/rust.spec @@ -54,7 +54,7 @@ %global min_libgit2_version 1.5.0 %global next_libgit2_version 1.6.0~ %global bundled_libgit2_version 1.5.0 -%if 0%{?fedora} >= 99 +%if 0%{?fedora} >= 38 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -84,7 +84,7 @@ Name: rust Version: 1.67.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -1047,6 +1047,9 @@ end} %changelog +* 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 From 752fe3bcd2d1df989986fc5829445ec937311e74 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Feb 2023 16:52:15 -0800 Subject: [PATCH 101/222] Update to 1.67.1. --- 0001-Fix-Async-Generator-ABI.patch | 55 +++++++++++++++++++ 107360-modified.patch | 26 --------- ...a0b3dd5fe14b43ad5b7862f4528df7322468.patch | 38 ------------- rust.spec | 20 +++---- 4 files changed, 63 insertions(+), 76 deletions(-) create mode 100644 0001-Fix-Async-Generator-ABI.patch delete mode 100644 107360-modified.patch delete mode 100644 675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch diff --git a/0001-Fix-Async-Generator-ABI.patch b/0001-Fix-Async-Generator-ABI.patch new file mode 100644 index 0000000..34dd1bc --- /dev/null +++ b/0001-Fix-Async-Generator-ABI.patch @@ -0,0 +1,55 @@ +From ecf812777a260e35ec9cd0c7d9dbd17a3f5cf5f9 Mon Sep 17 00:00:00 2001 +From: Arpad Borsos +Date: Tue, 29 Nov 2022 23:17:08 +0100 +Subject: [PATCH] Fix Async Generator ABI + +This change was missed when making async generators implement `Future` directly. +It did not cause any problems in codegen so far, as `GeneratorState<(), Output>` +happens to have the same ABI as `Poll`. +--- + compiler/rustc_ty_utils/src/abi.rs | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs +index 73c7eb6992f0..d644cbccea11 100644 +--- a/compiler/rustc_ty_utils/src/abi.rs ++++ b/compiler/rustc_ty_utils/src/abi.rs +@@ -85,7 +85,7 @@ fn fn_sig_for_fn_abi<'tcx>( + bound_vars, + ) + } +- ty::Generator(_, substs, _) => { ++ ty::Generator(did, substs, _) => { + let sig = substs.as_generator().poly_sig(); + + let bound_vars = tcx.mk_bound_variable_kinds( +@@ -104,10 +104,22 @@ fn fn_sig_for_fn_abi<'tcx>( + let env_ty = tcx.mk_adt(pin_adt_ref, pin_substs); + + let sig = sig.skip_binder(); +- let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); +- let state_adt_ref = tcx.adt_def(state_did); +- let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); +- let ret_ty = tcx.mk_adt(state_adt_ref, state_substs); ++ // The `FnSig` and the `ret_ty` here is for a generators main ++ // `Generator::resume(...) -> GeneratorState` function in case we ++ // have an ordinary generator, or the `Future::poll(...) -> Poll` ++ // function in case this is a special generator backing an async construct. ++ let ret_ty = if tcx.generator_is_async(did) { ++ let state_did = tcx.require_lang_item(LangItem::Poll, None); ++ let state_adt_ref = tcx.adt_def(state_did); ++ let state_substs = tcx.intern_substs(&[sig.return_ty.into()]); ++ tcx.mk_adt(state_adt_ref, state_substs) ++ } else { ++ let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); ++ let state_adt_ref = tcx.adt_def(state_did); ++ let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); ++ tcx.mk_adt(state_adt_ref, state_substs) ++ }; ++ + ty::Binder::bind_with_vars( + tcx.mk_fn_sig( + [env_ty, sig.resume_ty].iter(), +-- +2.39.1 + diff --git a/107360-modified.patch b/107360-modified.patch deleted file mode 100644 index 3d59653..0000000 --- a/107360-modified.patch +++ /dev/null @@ -1,26 +0,0 @@ -From de363d54c40a378717881240e719f5f7223ba376 Mon Sep 17 00:00:00 2001 -From: bjorn3 <17426603+bjorn3@users.noreply.github.com> -Date: Fri, 27 Jan 2023 11:48:36 +0000 -Subject: [PATCH 3/4] Revert back to LlvmArchiveBuilder on all platforms - -ArArchiveBuilder doesn't support reading thin archives, causing a -regression. ---- - compiler/rustc_codegen_llvm/src/back/archive.rs | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs -index b00676b7c592b..58ca87524deb6 100644 ---- a/compiler/rustc_codegen_llvm/src/back/archive.rs -+++ b/compiler/rustc_codegen_llvm/src/back/archive.rs -@@ -108,7 +108,9 @@ pub struct LlvmArchiveBuilderBuilder; - - impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { - fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box + 'a> { -- if sess.target.arch == "wasm32" || sess.target.arch == "wasm64" { -+ // FIXME use ArArchiveBuilder on most targets again once reading thin archives is -+ // implemented -+ if true || sess.target.arch == "wasm32" || sess.target.arch == "wasm64" { - Box::new(LlvmArchiveBuilder { sess, additions: Vec::new() }) - } else { - Box::new(ArArchiveBuilder::new(sess, get_llvm_object_symbols)) diff --git a/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch b/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch deleted file mode 100644 index eb16066..0000000 --- a/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 675fa0b3dd5fe14b43ad5b7862f4528df7322468 Mon Sep 17 00:00:00 2001 -From: Michael Goulet -Date: Mon, 12 Dec 2022 18:29:33 +0000 -Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?= - =?UTF-8?q?ap=20cache=20code?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - ---- - src/bootstrap/cache.rs | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs -index be5c9bb078808..05f25af68ea8f 100644 ---- a/src/bootstrap/cache.rs -+++ b/src/bootstrap/cache.rs -@@ -89,16 +89,16 @@ impl Hash for Interned { - - impl Deref for Interned { - type Target = T::Target; -- fn deref(&self) -> &'static Self::Target { -+ fn deref(&self) -> &Self::Target { - let l = T::intern_cache().lock().unwrap(); -- unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) } -+ unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) } - } - } - - impl, U: ?Sized> AsRef for Interned { -- fn as_ref(&self) -> &'static U { -+ fn as_ref(&self) -> &U { - let l = T::intern_cache().lock().unwrap(); -- unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) } -+ unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) } - } - } - diff --git a/rust.spec b/rust.spec index 03c816f..5a377de 100644 --- a/rust.spec +++ b/rust.spec @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.67.0 -Release: 3%{?dist} +Version: 1.67.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,15 +106,9 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# Fix bootstrap failure -# https://github.com/rust-lang/rust/commit/675fa0b3dd5fe14b43ad5b7862f4528df7322468 -Patch3: 675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch - -# fix build of mesa, possibly other things; patch edited to only -# include the one commit necessary on top of 1.67.0 -# https://github.com/rust-lang/rust/issues/107334 -# https://github.com/rust-lang/rust/pull/107360 -Patch4: 107360-modified.patch +# Fix Async Generator ABI (rhbz2168622) +# https://github.com/rust-lang/rust/pull/105082 +Patch3: 0001-Fix-Async-Generator-ABI.patch ### RHEL-specific patches below ### @@ -591,7 +585,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1047,6 +1040,9 @@ end} %changelog +* 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. From f50b7f0c263de110a03416a5bdcc4454cdd112bd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Feb 2023 16:56:40 -0800 Subject: [PATCH 102/222] fedpkg new-sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3de52c7..d66305a 100644 --- a/.gitignore +++ b/.gitignore @@ -411,3 +411,4 @@ /wasi-libc-wasi-sdk-17.tar.gz /rustc-1.66.1-src.tar.xz /rustc-1.67.0-src.tar.xz +/rustc-1.67.1-src.tar.xz diff --git a/sources b/sources index 222afaa..a139b61 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.67.0-src.tar.xz) = 6d1ddb54c0ee2c4f8ccf73f3c306c8d8868feb738d5e77eb5a5d25f716395c27d1b3666929c87f9dc84213a9acfdb56254feac92ef0fea3147e2c644391c12b4 +SHA512 (rustc-1.67.1-src.tar.xz) = 42d77ee93b168ae139b026138fb48d925624ff436a836aa97ee235f870e61ea11643b0cf7ad20bcafda774c6cd3855a4bc10a2e2ed1c4d82c6f15158963b304d SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376 From 375b75425b9b973f9bcc2c795b44849240e1cc1b Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 20 Feb 2023 11:43:19 -0700 Subject: [PATCH 103/222] Ship rust-toolset for EPEL7 --- rust.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rust.spec b/rust.spec index 5a377de..4d60a3c 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.67.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -548,7 +548,7 @@ feature for the Rust standard library. The RLS (Rust Language Server) uses this data to provide information about the Rust standard library. -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} %package toolset Summary: Rust Toolset @@ -846,7 +846,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_* # We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp) rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} # This allows users to build packages using Rust Toolset. %{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset %endif @@ -1033,13 +1033,16 @@ end} %{rustlibdir}/%{rust_triple}/analysis/ -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} %files toolset %{rpmmacrodir}/macros.rust-toolset %endif %changelog +* 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. From 7f5b9608ec19e481fd248e44882e42828cf28ed1 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 20 Feb 2023 15:30:35 -0700 Subject: [PATCH 104/222] Make rust-toolset noarch --- rust.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 4d60a3c..0073cdb 100644 --- a/rust.spec +++ b/rust.spec @@ -552,8 +552,9 @@ data to provide information about the Rust standard library. %package toolset Summary: Rust Toolset -Requires: rust%{?_isa} = %{version}-%{release} -Requires: cargo%{?_isa} = %{version}-%{release} +BuildArch: noarch +Requires: rust = %{version}-%{release} +Requires: cargo = %{version}-%{release} %description toolset This is the metapackage for Rust Toolset, bringing in the Rust compiler, From b85b429e0026b2de8dabad1a4bdef2e4337d6053 Mon Sep 17 00:00:00 2001 From: David Michael Date: Tue, 7 Mar 2023 10:26:00 -0500 Subject: [PATCH 105/222] Add a virtual Provides to rust-std-static with the target triple This supports depending on a variable target using something like the following since the other target stdlib subpackages are named by this convention. BuildRequires: rust-std-static-%{cargo_target} --- rust.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 0073cdb..47628ee 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.67.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -330,6 +330,7 @@ This package includes the Rust compiler and documentation generator. %package std-static Summary: Standard library for Rust +Provides: %{name}-std-static-%{rust_triple} = %{version}-%{release} Requires: %{name} = %{version}-%{release} Requires: glibc-devel%{?_isa} >= 2.11 @@ -1041,6 +1042,9 @@ end} %changelog +* 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 From a07799699ff200fe13adbdc0780398794d1b6c11 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Mar 2023 08:52:34 -0800 Subject: [PATCH 106/222] Update to 1.68.0. --- .gitignore | 2 + 0001-Fix-Async-Generator-ABI.patch | 55 ------------------- rust.spec | 32 ++++++----- ....patch => rustc-1.68.0-disable-http2.patch | 46 ++++++++-------- sources | 4 +- 5 files changed, 46 insertions(+), 93 deletions(-) delete mode 100644 0001-Fix-Async-Generator-ABI.patch rename rustc-1.67.0-disable-http2.patch => rustc-1.68.0-disable-http2.patch (75%) diff --git a/.gitignore b/.gitignore index d66305a..357f367 100644 --- a/.gitignore +++ b/.gitignore @@ -412,3 +412,5 @@ /rustc-1.66.1-src.tar.xz /rustc-1.67.0-src.tar.xz /rustc-1.67.1-src.tar.xz +/rustc-1.68.0-src.tar.xz +/wasi-libc-wasi-sdk-19.tar.gz diff --git a/0001-Fix-Async-Generator-ABI.patch b/0001-Fix-Async-Generator-ABI.patch deleted file mode 100644 index 34dd1bc..0000000 --- a/0001-Fix-Async-Generator-ABI.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ecf812777a260e35ec9cd0c7d9dbd17a3f5cf5f9 Mon Sep 17 00:00:00 2001 -From: Arpad Borsos -Date: Tue, 29 Nov 2022 23:17:08 +0100 -Subject: [PATCH] Fix Async Generator ABI - -This change was missed when making async generators implement `Future` directly. -It did not cause any problems in codegen so far, as `GeneratorState<(), Output>` -happens to have the same ABI as `Poll`. ---- - compiler/rustc_ty_utils/src/abi.rs | 22 +++++++++++++++++----- - 1 file changed, 17 insertions(+), 5 deletions(-) - -diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs -index 73c7eb6992f0..d644cbccea11 100644 ---- a/compiler/rustc_ty_utils/src/abi.rs -+++ b/compiler/rustc_ty_utils/src/abi.rs -@@ -85,7 +85,7 @@ fn fn_sig_for_fn_abi<'tcx>( - bound_vars, - ) - } -- ty::Generator(_, substs, _) => { -+ ty::Generator(did, substs, _) => { - let sig = substs.as_generator().poly_sig(); - - let bound_vars = tcx.mk_bound_variable_kinds( -@@ -104,10 +104,22 @@ fn fn_sig_for_fn_abi<'tcx>( - let env_ty = tcx.mk_adt(pin_adt_ref, pin_substs); - - let sig = sig.skip_binder(); -- let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); -- let state_adt_ref = tcx.adt_def(state_did); -- let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); -- let ret_ty = tcx.mk_adt(state_adt_ref, state_substs); -+ // The `FnSig` and the `ret_ty` here is for a generators main -+ // `Generator::resume(...) -> GeneratorState` function in case we -+ // have an ordinary generator, or the `Future::poll(...) -> Poll` -+ // function in case this is a special generator backing an async construct. -+ let ret_ty = if tcx.generator_is_async(did) { -+ let state_did = tcx.require_lang_item(LangItem::Poll, None); -+ let state_adt_ref = tcx.adt_def(state_did); -+ let state_substs = tcx.intern_substs(&[sig.return_ty.into()]); -+ tcx.mk_adt(state_adt_ref, state_substs) -+ } else { -+ let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); -+ let state_adt_ref = tcx.adt_def(state_did); -+ let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); -+ tcx.mk_adt(state_adt_ref, state_substs) -+ }; -+ - ty::Binder::bind_with_vars( - tcx.mk_fn_sig( - [env_ty, sig.resume_ty].iter(), --- -2.39.1 - diff --git a/rust.spec b/rust.spec index 47628ee..6589fd3 100644 --- a/rust.spec +++ b/rust.spec @@ -1,4 +1,4 @@ -# Only x86_64 and i686 are Tier 1 platforms at this time. +# Only x86_64, i686, and aarch64 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html %global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x @@ -8,9 +8,9 @@ # 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.66.0 -%global bootstrap_channel 1.66.0 -%global bootstrap_date 2022-12-15 +%global bootstrap_version 1.67.1 +%global bootstrap_channel 1.67.1 +%global bootstrap_date 2023-02-09 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,7 +35,7 @@ # 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-17 +%global wasi_libc_ref wasi-sdk-19 %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} @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.67.1 -Release: 3%{?dist} +Version: 1.68.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,10 +106,6 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# Fix Async Generator ABI (rhbz2168622) -# https://github.com/rust-lang/rust/pull/105082 -Patch3: 0001-Fix-Async-Generator-ABI.patch - ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -120,7 +116,7 @@ Patch100: rustc-1.65.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.67.0-disable-http2.patch +Patch101: rustc-1.68.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -332,7 +328,7 @@ This package includes the Rust compiler and documentation generator. Summary: Standard library for Rust Provides: %{name}-std-static-%{rust_triple} = %{version}-%{release} Requires: %{name} = %{version}-%{release} -Requires: glibc-devel%{?_isa} >= 2.11 +Requires: glibc-devel%{?_isa} >= 2.17 %description std-static This package includes the standard libraries for building applications @@ -586,7 +582,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 -%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -656,6 +651,12 @@ find vendor -name .cargo-checksum.json \ # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' +# The distro flags are only appropriate for the host, not our cross-targets, +# and they're not as fine-grained as the settings we choose for std vs rustc. +%if %defined build_rustflags +%global build_rustflags %{nil} +%endif + # Set up shared environment variables for build/install/check %global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %if 0%{?cmake_path:1} @@ -1042,6 +1043,9 @@ end} %changelog +* 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. diff --git a/rustc-1.67.0-disable-http2.patch b/rustc-1.68.0-disable-http2.patch similarity index 75% rename from rustc-1.67.0-disable-http2.patch rename to rustc-1.68.0-disable-http2.patch index 7b346e9..09c4339 100644 --- a/rustc-1.67.0-disable-http2.patch +++ b/rustc-1.68.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-01-24 13:25:47.822917185 -0800 -+++ rustc-beta-src/Cargo.lock 2023-01-24 13:25:47.824917142 -0800 -@@ -1062,7 +1062,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2023-03-03 17:26:41.309081970 -0800 ++++ rustc-beta-src/Cargo.lock 2023-03-03 17:26:41.311081929 -0800 +@@ -1152,7 +1152,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2181,16 +2180,6 @@ +@@ -2399,16 +2398,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-01-24 13:25:47.824917142 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-01-24 13:26:29.209044200 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-03-03 17:26:41.311081929 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-03-03 17:27:32.999013773 -0800 @@ -21,7 +21,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } cargo-util = { path = "crates/cargo-util", version = "0.2.3" } - crates-io = { path = "crates/crates-io", version = "0.35.0" } + crates-io = { path = "crates/crates-io", version = "0.35.1" } -curl = { version = "0.4.44", features = ["http2"] } +curl = { version = "0.4.44", features = [] } curl-sys = "0.4.59" env_logger = "0.10.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-01-21 17:17:19.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-01-24 13:25:47.824917142 -0800 -@@ -403,16 +403,9 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-02-26 19:02:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-03-03 17:26:41.311081929 -0800 +@@ -402,16 +402,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,18 +58,9 @@ Ok(PackageSet { packages: package_ids -@@ -658,7 +651,7 @@ - macro_rules! try_old_curl { - ($e:expr, $msg:expr) => { - let result = $e; -- if cfg!(target_os = "macos") { -+ if cfg!(any(target_os = "linux", target_os = "macos")) { - if let Err(e) = result { - warn!("ignoring libcurl {} error: {}", $msg, e); - } ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-01-21 17:17:19.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-01-24 13:25:47.824917142 -0800 -@@ -223,16 +223,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-02-26 19:02:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-03-03 17:26:41.311081929 -0800 +@@ -220,16 +220,8 @@ } self.fetch_started = true; @@ -88,3 +79,14 @@ self.config .shell() +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs.orig 2023-02-26 19:02:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs 2023-03-03 17:29:54.808076261 -0800 +@@ -116,7 +116,7 @@ + macro_rules! try_old_curl { + ($e:expr, $msg:expr) => { + let result = $e; +- if cfg!(target_os = "macos") { ++ if cfg!(any(target_os = "linux", target_os = "macos")) { + if let Err(e) = result { + warn!("ignoring libcurl {} error: {}", $msg, e); + } diff --git a/sources b/sources index a139b61..1d510ad 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.67.1-src.tar.xz) = 42d77ee93b168ae139b026138fb48d925624ff436a836aa97ee235f870e61ea11643b0cf7ad20bcafda774c6cd3855a4bc10a2e2ed1c4d82c6f15158963b304d -SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376 +SHA512 (rustc-1.68.0-src.tar.xz) = f6cc5c06488080f2d7ce8c4f5adf7ca8ae8b10caea627b57876b051593af1201a48823d0abf5fcbcd344b46606b53957569db9844d647a5fdc4abca06e260f3a +SHA512 (wasi-libc-wasi-sdk-19.tar.gz) = 312f4d01d1b1108c24a1e9b233648ec44408ec1b7c17e8a65288038a94f117be9ed8181c60f99f9593ff80ca380f53c51756357bad466cd65027cb23a3646d23 From b4bb093ae0542643ac4d4d3d3e439153e7d1c5f9 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 23 Mar 2023 08:42:27 -0700 Subject: [PATCH 107/222] Update to 1.68.1. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 357f367..32af96d 100644 --- a/.gitignore +++ b/.gitignore @@ -414,3 +414,4 @@ /rustc-1.67.1-src.tar.xz /rustc-1.68.0-src.tar.xz /wasi-libc-wasi-sdk-19.tar.gz +/rustc-1.68.1-src.tar.xz diff --git a/rust.spec b/rust.spec index 6589fd3..fb51bb8 100644 --- a/rust.spec +++ b/rust.spec @@ -83,7 +83,7 @@ %endif Name: rust -Version: 1.68.0 +Version: 1.68.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -1043,6 +1043,9 @@ end} %changelog +* 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. diff --git a/sources b/sources index 1d510ad..4d7894e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.68.0-src.tar.xz) = f6cc5c06488080f2d7ce8c4f5adf7ca8ae8b10caea627b57876b051593af1201a48823d0abf5fcbcd344b46606b53957569db9844d647a5fdc4abca06e260f3a +SHA512 (rustc-1.68.1-src.tar.xz) = cf3921bc260db54b0f3afc0e6bc9fe8d560ddb81de5d2d4496746307d42a8010291f119d0cfc463996efce6ef829a0494b4eb6145e21c94fd113ff51ee010e21 SHA512 (wasi-libc-wasi-sdk-19.tar.gz) = 312f4d01d1b1108c24a1e9b233648ec44408ec1b7c17e8a65288038a94f117be9ed8181c60f99f9593ff80ca380f53c51756357bad466cd65027cb23a3646d23 From 7ac7a42b5e2fd46d73d2a0946c55109c03e22966 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 28 Mar 2023 10:11:01 -0700 Subject: [PATCH 108/222] Update to 1.68.2. --- .gitignore | 1 + rust.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 32af96d..ebd8c24 100644 --- a/.gitignore +++ b/.gitignore @@ -415,3 +415,4 @@ /rustc-1.68.0-src.tar.xz /wasi-libc-wasi-sdk-19.tar.gz /rustc-1.68.1-src.tar.xz +/rustc-1.68.2-src.tar.xz diff --git a/rust.spec b/rust.spec index fb51bb8..d01c2c4 100644 --- a/rust.spec +++ b/rust.spec @@ -83,7 +83,7 @@ %endif Name: rust -Version: 1.68.1 +Version: 1.68.2 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -1043,6 +1043,9 @@ end} %changelog +* 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. diff --git a/sources b/sources index 4d7894e..63e72f1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.68.1-src.tar.xz) = cf3921bc260db54b0f3afc0e6bc9fe8d560ddb81de5d2d4496746307d42a8010291f119d0cfc463996efce6ef829a0494b4eb6145e21c94fd113ff51ee010e21 +SHA512 (rustc-1.68.2-src.tar.xz) = 8b085d0351e19100e9abc24b10c44a0939a1d35ba23421da4ece345d7373f7dbad1dc6a2ae153c1259404dd96b41e2682e711cf2b0b63fd03a196760cddbcdd3 SHA512 (wasi-libc-wasi-sdk-19.tar.gz) = 312f4d01d1b1108c24a1e9b233648ec44408ec1b7c17e8a65288038a94f117be9ed8181c60f99f9593ff80ca380f53c51756357bad466cd65027cb23a3646d23 From 77613da92c9f095e8a67c2373892ec08d84dd7c0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 20 Apr 2023 09:47:54 -0700 Subject: [PATCH 109/222] Update to 1.69.0. Obsolete rust-analysis. --- .gitignore | 2 + rust.spec | 90 +++++++++++-------- ....patch => rustc-1.69.0-disable-http2.patch | 34 +++---- sources | 4 +- 4 files changed, 73 insertions(+), 57 deletions(-) rename rustc-1.68.0-disable-http2.patch => rustc-1.69.0-disable-http2.patch (74%) diff --git a/.gitignore b/.gitignore index ebd8c24..0b1ecb7 100644 --- a/.gitignore +++ b/.gitignore @@ -416,3 +416,5 @@ /wasi-libc-wasi-sdk-19.tar.gz /rustc-1.68.1-src.tar.xz /rustc-1.68.2-src.tar.xz +/rustc-1.69.0-src.tar.xz +/wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz diff --git a/rust.spec b/rust.spec index d01c2c4..4c7031e 100644 --- a/rust.spec +++ b/rust.spec @@ -1,6 +1,6 @@ # Only x86_64, i686, and aarch64 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html -%global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x +%global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x riscv64 # The channel can be stable, beta, or nightly %{!?channel: %global channel stable} @@ -8,9 +8,9 @@ # 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.67.1 -%global bootstrap_channel 1.67.1 -%global bootstrap_date 2023-02-09 +%global bootstrap_version 1.68.2 +%global bootstrap_channel 1.68.2 +%global bootstrap_date 2023-03-28 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,7 +35,8 @@ # 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-19 +#global wasi_libc_ref wasi-sdk-20 +%global wasi_libc_ref 1dfe5c302d1c5ab621f7abf04620fae92700fd22 %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,9 +45,9 @@ %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 12.0+. -%global min_llvm_version 13.0.0 -%global bundled_llvm_version 15.0.6 +# is insufficient. Rust currently requires LLVM 14.0+. +%global min_llvm_version 14.0.0 +%global bundled_llvm_version 15.0.7 %bcond_with bundled_llvm # Requires stable libgit2 1.5, and not the next minor soname change. @@ -83,7 +84,7 @@ %endif Name: rust -Version: 1.68.2 +Version: 1.69.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -116,7 +117,7 @@ Patch100: rustc-1.65.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.68.0-disable-http2.patch +Patch101: rustc-1.69.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -139,7 +140,14 @@ Patch102: rustc-1.65.0-no-default-pie.patch return arch.."-unknown-linux-"..abi end} +# Get the environment form of a Rust triple +%{lua: function rust_triple_env(triple) + local sub = string.gsub(triple, "-", "_") + return string.upper(sub) +end} + %global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} +%global rust_triple_env %{lua: print(rust_triple_env(rpm.expand("%{rust_triple}")))} %if %defined bootstrap_arches # For each bootstrap arch, add an additional binary Source. @@ -215,7 +223,7 @@ Provides: bundled(llvm) = %{bundled_llvm_version} %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 -%global llvm llvm13 +%global llvm llvm14 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -252,7 +260,7 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release} Requires: /usr/bin/cc %if 0%{?epel} == 7 -%global devtoolset_name devtoolset-9 +%global devtoolset_name devtoolset-11 BuildRequires: %{devtoolset_name}-binutils BuildRequires: %{devtoolset_name}-gcc BuildRequires: %{devtoolset_name}-gcc-c++ @@ -317,6 +325,10 @@ find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' %{nil} %endif +# This component was removed as of Rust 1.69.0. +# https://github.com/rust-lang/rust/pull/101841 +Obsoletes: %{name}-analysis < 1.69.0~ + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -531,20 +543,6 @@ This package includes source files for the Rust standard library. It may be useful as a reference for code completion tools in various editors. -%package analysis -Summary: Compiler analysis data for the Rust standard library -%if 0%{?rhel} && 0%{?rhel} < 8 -Requires: %{name}-std-static%{?_isa} = %{version}-%{release} -%else -Recommends: %{name}-std-static%{?_isa} = %{version}-%{release} -%endif - -%description analysis -This package contains analysis data files produced with rustc's -Zsave-analysis -feature for the Rust standard library. The RLS (Rust Language Server) uses this -data to provide information about the Rust standard library. - - %if 0%{?rhel} %package toolset @@ -580,20 +578,20 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -%patch2 -p1 +%patch -P1 -p1 +%patch -P2 -p1 %if %with disabled_libssh2 -%patch100 -p1 +%patch -P100 -p1 %endif %if %without curl_http2 -%patch101 -p1 +%patch -P101 -p1 rm -rf vendor/libnghttp2-sys/ %endif %if 0%{?rhel} && 0%{?rhel} < 8 -%patch102 -p1 +%patch -P102 -p1 %endif # Use our explicit python3 first @@ -657,9 +655,26 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %global build_rustflags %{nil} %endif +# These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros +%if 0%{?fedora} || 0%{?rhel} >= 9 +%ifarch x86_64 +%global rust_target_cpu %[0%{?rhel} >= 10 ? "x86-64-v3" : ""] +%global rust_target_cpu %[0%{?rhel} == 9 ? "x86-64-v2" : "%{rust_target_cpu}"] +%endif +%ifarch s390x +%global rust_target_cpu %[0%{?rhel} >= 9 ? "z14" : "zEC12"] +%endif +%ifarch ppc64le +%global rust_target_cpu %[0%{?rhel} >= 9 ? "pwr9" : "pwr8"] +%endif +%endif + # Set up shared environment variables for build/install/check %global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} -%if 0%{?cmake_path:1} +%if "%{?rust_target_cpu}" != "" +%global rust_env %{?rust_env} CARGO_TARGET_%{rust_triple_env}_RUSTFLAGS=-Ctarget-cpu=%{rust_target_cpu} +%endif +%if %defined cmake_path %global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" %endif %if %without disabled_libssh2 @@ -668,7 +683,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %endif %global export_rust_env %{?rust_env:export %{rust_env}} - %build %{export_rust_env} @@ -754,7 +768,7 @@ end} --set build.install-stage=2 \ --set build.test-stage=2 \ --enable-extended \ - --tools=analysis,cargo,clippy,rls,rust-analyzer,rustfmt,src \ + --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ --dist-compression-formats=gz \ @@ -1032,10 +1046,6 @@ end} %{rustlibdir}/src -%files analysis -%{rustlibdir}/%{rust_triple}/analysis/ - - %if 0%{?rhel} %files toolset %{rpmmacrodir}/macros.rust-toolset @@ -1043,6 +1053,10 @@ end} %changelog +* 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. diff --git a/rustc-1.68.0-disable-http2.patch b/rustc-1.69.0-disable-http2.patch similarity index 74% rename from rustc-1.68.0-disable-http2.patch rename to rustc-1.69.0-disable-http2.patch index 09c4339..09e7930 100644 --- a/rustc-1.68.0-disable-http2.patch +++ b/rustc-1.69.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-03-03 17:26:41.309081970 -0800 -+++ rustc-beta-src/Cargo.lock 2023-03-03 17:26:41.311081929 -0800 -@@ -1152,7 +1152,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2023-03-23 17:10:30.810989345 -0700 ++++ rustc-beta-src/Cargo.lock 2023-03-23 17:10:30.812989303 -0700 +@@ -1142,7 +1142,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2399,16 +2398,6 @@ +@@ -2375,16 +2374,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-03-03 17:26:41.311081929 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-03-03 17:27:32.999013773 -0800 -@@ -21,7 +21,7 @@ - cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-03-23 17:10:30.812989303 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-03-23 17:11:26.242836664 -0700 +@@ -23,7 +23,7 @@ cargo-util = { path = "crates/cargo-util", version = "0.2.3" } - crates-io = { path = "crates/crates-io", version = "0.35.1" } + clap = "4.1.3" + crates-io = { path = "crates/crates-io", version = "0.36.0" } -curl = { version = "0.4.44", features = ["http2"] } +curl = { version = "0.4.44", features = [] } curl-sys = "0.4.59" env_logger = "0.10.0" - pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-02-26 19:02:38.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-03-03 17:26:41.311081929 -0800 -@@ -402,16 +402,9 @@ + filetime = "0.2.9" +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-03-19 00:20:55.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-03-23 17:10:30.812989303 -0700 +@@ -401,16 +401,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,8 +58,8 @@ Ok(PackageSet { packages: package_ids ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-02-26 19:02:38.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-03-03 17:26:41.311081929 -0800 +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-03-19 00:20:55.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-03-23 17:10:30.813989282 -0700 @@ -220,16 +220,8 @@ } self.fetch_started = true; @@ -79,8 +79,8 @@ self.config .shell() ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs.orig 2023-02-26 19:02:38.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs 2023-03-03 17:29:54.808076261 -0800 +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs.orig 2023-03-19 00:20:55.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs 2023-03-23 17:10:30.813989282 -0700 @@ -116,7 +116,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { diff --git a/sources b/sources index 63e72f1..577db98 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.68.2-src.tar.xz) = 8b085d0351e19100e9abc24b10c44a0939a1d35ba23421da4ece345d7373f7dbad1dc6a2ae153c1259404dd96b41e2682e711cf2b0b63fd03a196760cddbcdd3 -SHA512 (wasi-libc-wasi-sdk-19.tar.gz) = 312f4d01d1b1108c24a1e9b233648ec44408ec1b7c17e8a65288038a94f117be9ed8181c60f99f9593ff80ca380f53c51756357bad466cd65027cb23a3646d23 +SHA512 (rustc-1.69.0-src.tar.xz) = 724398fc208ec18adbd8ba81a445e23d1001b746990f36b869126be8a45f1cdfa75f5b9cbdd0abbab506f91a56d3736ab247677699ebd69525245558cfc01a60 +SHA512 (wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz) = 6f813bc7822746c161932de6b84fb965111400a1a38c25dd0981209d588b9ccafe1a5923349110c536f1b7cda707dfa2d0be42c92b2fa6fd89c957eda27bda27 From 41fd9d78988e1fd1a9238cb67d8a96070bf72698 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 1 May 2023 10:07:31 -0700 Subject: [PATCH 110/222] Build with LLVM 15 on Fedora 38+ --- rust.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 4c7031e..cf35d33 100644 --- a/rust.spec +++ b/rust.spec @@ -85,7 +85,7 @@ Name: rust Version: 1.69.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -222,6 +222,12 @@ BuildRequires: ninja-build Provides: bundled(llvm) = %{bundled_llvm_version} %else BuildRequires: cmake >= 2.8.11 +# LLVM 16 is breaking firefox with "error: Cannot represent a difference across sections" +# https://bugzilla.redhat.com/show_bug.cgi?id=2189964 +# https://github.com/llvm/llvm-project/issues/61932 +%if 0%{?fedora} >= 38 +%global llvm llvm15 +%endif %if 0%{?epel} == 7 %global llvm llvm14 %endif @@ -1053,6 +1059,9 @@ end} %changelog +* 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. From 777115da9e2892eb47502c8afcbe2b7742b14879 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 5 May 2023 13:28:08 -0700 Subject: [PATCH 111/222] Fix debuginfo with LLVM 16 --- ...it-method-declaration-and-definition.patch | 254 ++++++++++++++++++ rust.spec | 15 +- 2 files changed, 262 insertions(+), 7 deletions(-) create mode 100644 0001-debuginfo-split-method-declaration-and-definition.patch diff --git a/0001-debuginfo-split-method-declaration-and-definition.patch b/0001-debuginfo-split-method-declaration-and-definition.patch new file mode 100644 index 0000000..03a4937 --- /dev/null +++ b/0001-debuginfo-split-method-declaration-and-definition.patch @@ -0,0 +1,254 @@ +From 1476ebe761884e0cfc92f3f16809011663eb33f0 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Wed, 3 May 2023 15:52:31 -0700 +Subject: [PATCH] debuginfo: split method declaration and definition + +When we're adding a method to a type DIE, we only want a DW_AT_declaration +there, because LLVM LTO can't unify type definitions when a child DIE is a +full subprogram definition. Now the subprogram definition gets added at the +CU level with a specification link back to the abstract declaration. + +(cherry picked from commit 10b69dde3fd15334ea2382d2dc9e9a261de1afaf) +--- + .../rustc_codegen_llvm/src/debuginfo/mod.rs | 86 +++++++++++-------- + compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 15 ++++ + .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 22 +++++ + .../issue-109934-lto-debuginfo/Makefile | 12 +++ + .../issue-109934-lto-debuginfo/lib.rs | 9 ++ + 5 files changed, 110 insertions(+), 34 deletions(-) + create mode 100644 tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile + create mode 100644 tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs + +diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +index 5392534cfcb7..11426b150b6c 100644 +--- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs ++++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +@@ -322,7 +322,7 @@ fn dbg_scope_fn( + let tcx = self.tcx; + + let def_id = instance.def_id(); +- let containing_scope = get_containing_scope(self, instance); ++ let (containing_scope, is_method) = get_containing_scope(self, instance); + let span = tcx.def_span(def_id); + let loc = self.lookup_debug_loc(span.lo()); + let file_metadata = file_metadata(self, &loc.file); +@@ -378,8 +378,29 @@ fn dbg_scope_fn( + } + } + +- unsafe { +- return llvm::LLVMRustDIBuilderCreateFunction( ++ // When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because ++ // LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. ++ // When we use this `decl` below, the subprogram definition gets created at the CU level ++ // with a DW_AT_specification pointing back to the type's declaration. ++ let decl = is_method.then(|| unsafe { ++ llvm::LLVMRustDIBuilderCreateMethod( ++ DIB(self), ++ containing_scope, ++ name.as_ptr().cast(), ++ name.len(), ++ linkage_name.as_ptr().cast(), ++ linkage_name.len(), ++ file_metadata, ++ loc.line, ++ function_type_metadata, ++ flags, ++ spflags & !DISPFlags::SPFlagDefinition, ++ template_parameters, ++ ) ++ }); ++ ++ return unsafe { ++ llvm::LLVMRustDIBuilderCreateFunction( + DIB(self), + containing_scope, + name.as_ptr().cast(), +@@ -394,9 +415,9 @@ fn dbg_scope_fn( + spflags, + maybe_definition_llfn, + template_parameters, +- None, +- ); +- } ++ decl, ++ ) ++ }; + + fn get_function_signature<'ll, 'tcx>( + cx: &CodegenCx<'ll, 'tcx>, +@@ -495,14 +516,16 @@ fn get_parameter_names(cx: &CodegenCx<'_, '_>, generics: &ty::Generics) -> Vec( + cx: &CodegenCx<'ll, 'tcx>, + instance: Instance<'tcx>, +- ) -> &'ll DIScope { ++ ) -> (&'ll DIScope, bool) { + // First, let's see if this is a method within an inherent impl. Because + // if yes, we want to make the result subroutine DIE a child of the + // subroutine's self-type. +- let self_type = cx.tcx.impl_of_method(instance.def_id()).and_then(|impl_def_id| { ++ if let Some(impl_def_id) = cx.tcx.impl_of_method(instance.def_id()) { + // If the method does *not* belong to a trait, proceed + if cx.tcx.trait_id_of_impl(impl_def_id).is_none() { + let impl_self_ty = cx.tcx.subst_and_normalize_erasing_regions( +@@ -513,39 +536,34 @@ fn get_containing_scope<'ll, 'tcx>( + + // Only "class" methods are generally understood by LLVM, + // so avoid methods on other types (e.g., `<*mut T>::null`). +- match impl_self_ty.kind() { +- ty::Adt(def, ..) if !def.is_box() => { +- // Again, only create type information if full debuginfo is enabled +- if cx.sess().opts.debuginfo == DebugInfo::Full +- && !impl_self_ty.needs_subst() +- { +- Some(type_di_node(cx, impl_self_ty)) +- } else { +- Some(namespace::item_namespace(cx, def.did())) +- } ++ if let ty::Adt(def, ..) = impl_self_ty.kind() && !def.is_box() { ++ // Again, only create type information if full debuginfo is enabled ++ if cx.sess().opts.debuginfo == DebugInfo::Full ++ && !impl_self_ty.needs_subst() ++ { ++ return (type_di_node(cx, impl_self_ty), true); ++ } else { ++ return (namespace::item_namespace(cx, def.did()), false); + } +- _ => None, + } + } else { + // For trait method impls we still use the "parallel namespace" + // strategy +- None + } +- }); ++ } + +- self_type.unwrap_or_else(|| { +- namespace::item_namespace( +- cx, +- DefId { +- krate: instance.def_id().krate, +- index: cx +- .tcx +- .def_key(instance.def_id()) +- .parent +- .expect("get_containing_scope: missing parent?"), +- }, +- ) +- }) ++ let scope = namespace::item_namespace( ++ cx, ++ DefId { ++ krate: instance.def_id().krate, ++ index: cx ++ .tcx ++ .def_key(instance.def_id()) ++ .parent ++ .expect("get_containing_scope: missing parent?"), ++ }, ++ ); ++ (scope, false) + } + } + +diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +index 253c2ca7c768..9dd6db1929fc 100644 +--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs ++++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +@@ -1968,6 +1968,21 @@ pub fn LLVMRustDIBuilderCreateFunction<'a>( + Decl: Option<&'a DIDescriptor>, + ) -> &'a DISubprogram; + ++ pub fn LLVMRustDIBuilderCreateMethod<'a>( ++ Builder: &DIBuilder<'a>, ++ Scope: &'a DIDescriptor, ++ Name: *const c_char, ++ NameLen: size_t, ++ LinkageName: *const c_char, ++ LinkageNameLen: size_t, ++ File: &'a DIFile, ++ LineNo: c_uint, ++ Ty: &'a DIType, ++ Flags: DIFlags, ++ SPFlags: DISPFlags, ++ TParam: &'a DIArray, ++ ) -> &'a DISubprogram; ++ + pub fn LLVMRustDIBuilderCreateBasicType<'a>( + Builder: &DIBuilder<'a>, + Name: *const c_char, +diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +index e3493caaaf74..c4a97af1f0f4 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +@@ -841,6 +841,28 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFunction( + return wrap(Sub); + } + ++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateMethod( ++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, ++ const char *Name, size_t NameLen, ++ const char *LinkageName, size_t LinkageNameLen, ++ LLVMMetadataRef File, unsigned LineNo, ++ LLVMMetadataRef Ty, LLVMRustDIFlags Flags, ++ LLVMRustDISPFlags SPFlags, LLVMMetadataRef TParam) { ++ DITemplateParameterArray TParams = ++ DITemplateParameterArray(unwrap(TParam)); ++ DISubprogram::DISPFlags llvmSPFlags = fromRust(SPFlags); ++ DINode::DIFlags llvmFlags = fromRust(Flags); ++ DISubprogram *Sub = Builder->createMethod( ++ unwrapDI(Scope), ++ StringRef(Name, NameLen), ++ StringRef(LinkageName, LinkageNameLen), ++ unwrapDI(File), LineNo, ++ unwrapDI(Ty), ++ 0, 0, nullptr, // VTable params aren't used ++ llvmFlags, llvmSPFlags, TParams); ++ return wrap(Sub); ++} ++ + extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateBasicType( + LLVMRustDIBuilderRef Builder, const char *Name, size_t NameLen, + uint64_t SizeInBits, unsigned Encoding) { +diff --git a/tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile +new file mode 100644 +index 000000000000..3b7a99d3dbc6 +--- /dev/null ++++ b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile +@@ -0,0 +1,12 @@ ++# ignore-cross-compile ++include ../tools.mk ++ ++# With the upgrade to LLVM 16, this was getting: ++# ++# error: Cannot represent a difference across sections ++# ++# The error stemmed from DI function definitions under type scopes, fixed by ++# only declaring in type scope and defining the subprogram elsewhere. ++ ++all: ++ $(RUSTC) lib.rs --test -C lto=fat -C debuginfo=2 -C incremental=$(TMPDIR)/inc-fat +diff --git a/tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs +new file mode 100644 +index 000000000000..c405928bd182 +--- /dev/null ++++ b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs +@@ -0,0 +1,9 @@ ++extern crate alloc; ++ ++#[cfg(test)] ++mod tests { ++ #[test] ++ fn something_alloc() { ++ assert_eq!(Vec::::new(), Vec::::new()); ++ } ++} +-- +2.40.1 + diff --git a/rust.spec b/rust.spec index cf35d33..b9f2455 100644 --- a/rust.spec +++ b/rust.spec @@ -85,7 +85,7 @@ Name: rust Version: 1.69.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -107,6 +107,9 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +# https://github.com/rust-lang/rust/pull/111167 +Patch3: 0001-debuginfo-split-method-declaration-and-definition.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -222,12 +225,6 @@ BuildRequires: ninja-build Provides: bundled(llvm) = %{bundled_llvm_version} %else BuildRequires: cmake >= 2.8.11 -# LLVM 16 is breaking firefox with "error: Cannot represent a difference across sections" -# https://bugzilla.redhat.com/show_bug.cgi?id=2189964 -# https://github.com/llvm/llvm-project/issues/61932 -%if 0%{?fedora} >= 38 -%global llvm llvm15 -%endif %if 0%{?epel} == 7 %global llvm llvm14 %endif @@ -586,6 +583,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P1 -p1 %patch -P2 -p1 +%patch -P3 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -1059,6 +1057,9 @@ end} %changelog +* 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+ From 8745dbe4c6ca56ccf4e98fe7e13c757770b0656b Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Thu, 4 May 2023 17:13:51 +0200 Subject: [PATCH 112/222] Add rpminspect.yaml config file Added suppresion for reduced debuginfo in i386 builds. --- rpminspect.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 rpminspect.yaml diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..15b680b --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,8 @@ +--- +debuginfo: + ignore: + # i686 has limited debuginfo. From rust.spec + # full debuginfo is exhausting memory; just do libstd for now + # https://github.com/rust-lang/rust/issues/45854 + - /usr/lib/debug/usr/bin/rustc-*.i386.debug + From ff66501ce917bd1c3a0e05935bed1ac615f6fd59 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 9 May 2023 20:02:43 -0700 Subject: [PATCH 113/222] Apply set_build_flags on rhel --- rust.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust.spec b/rust.spec index b9f2455..3f23180 100644 --- a/rust.spec +++ b/rust.spec @@ -787,6 +787,9 @@ for triple in %{?mingw_targets} %{?wasm_targets}; do done %install +%if 0%{?rhel} && 0%{?rhel} <= 9 +%{?set_build_flags} +%endif %{export_rust_env} DESTDIR=%{buildroot} %{__python3} ./x.py install @@ -874,6 +877,9 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %check +%if 0%{?rhel} && 0%{?rhel} <= 9 +%{?set_build_flags} +%endif %{export_rust_env} # Sanity-check the installed binaries, debuginfo-stripped and all. From 6fff218b1962d9a7a85ca61b3c9fbcc9a54dba4f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 1 Jun 2023 12:46:43 -0700 Subject: [PATCH 114/222] Update to 1.70.0. --- .gitignore | 2 + ...it-method-declaration-and-definition.patch | 254 ------------------ rust.spec | 65 ++--- rustc-1.61.0-rust-gdb-substitute-path.patch | 18 -- rustc-1.65.0-no-default-pie.patch | 43 --- ....patch => rustc-1.70.0-disable-http2.patch | 42 +-- ...atch => rustc-1.70.0-disable-libssh2.patch | 18 +- rustc-1.70.0-rust-gdb-substitute-path.patch | 21 ++ sources | 4 +- 9 files changed, 82 insertions(+), 385 deletions(-) delete mode 100644 0001-debuginfo-split-method-declaration-and-definition.patch delete mode 100644 rustc-1.61.0-rust-gdb-substitute-path.patch delete mode 100644 rustc-1.65.0-no-default-pie.patch rename rustc-1.69.0-disable-http2.patch => rustc-1.70.0-disable-http2.patch (70%) rename rustc-1.65.0-disable-libssh2.patch => rustc-1.70.0-disable-libssh2.patch (55%) create mode 100644 rustc-1.70.0-rust-gdb-substitute-path.patch diff --git a/.gitignore b/.gitignore index 0b1ecb7..51331ef 100644 --- a/.gitignore +++ b/.gitignore @@ -418,3 +418,5 @@ /rustc-1.68.2-src.tar.xz /rustc-1.69.0-src.tar.xz /wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz +/rustc-1.70.0-src.tar.xz +/wasi-libc-wasi-sdk-20.tar.gz diff --git a/0001-debuginfo-split-method-declaration-and-definition.patch b/0001-debuginfo-split-method-declaration-and-definition.patch deleted file mode 100644 index 03a4937..0000000 --- a/0001-debuginfo-split-method-declaration-and-definition.patch +++ /dev/null @@ -1,254 +0,0 @@ -From 1476ebe761884e0cfc92f3f16809011663eb33f0 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 3 May 2023 15:52:31 -0700 -Subject: [PATCH] debuginfo: split method declaration and definition - -When we're adding a method to a type DIE, we only want a DW_AT_declaration -there, because LLVM LTO can't unify type definitions when a child DIE is a -full subprogram definition. Now the subprogram definition gets added at the -CU level with a specification link back to the abstract declaration. - -(cherry picked from commit 10b69dde3fd15334ea2382d2dc9e9a261de1afaf) ---- - .../rustc_codegen_llvm/src/debuginfo/mod.rs | 86 +++++++++++-------- - compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 15 ++++ - .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 22 +++++ - .../issue-109934-lto-debuginfo/Makefile | 12 +++ - .../issue-109934-lto-debuginfo/lib.rs | 9 ++ - 5 files changed, 110 insertions(+), 34 deletions(-) - create mode 100644 tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile - create mode 100644 tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs - -diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs -index 5392534cfcb7..11426b150b6c 100644 ---- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs -+++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs -@@ -322,7 +322,7 @@ fn dbg_scope_fn( - let tcx = self.tcx; - - let def_id = instance.def_id(); -- let containing_scope = get_containing_scope(self, instance); -+ let (containing_scope, is_method) = get_containing_scope(self, instance); - let span = tcx.def_span(def_id); - let loc = self.lookup_debug_loc(span.lo()); - let file_metadata = file_metadata(self, &loc.file); -@@ -378,8 +378,29 @@ fn dbg_scope_fn( - } - } - -- unsafe { -- return llvm::LLVMRustDIBuilderCreateFunction( -+ // When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because -+ // LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. -+ // When we use this `decl` below, the subprogram definition gets created at the CU level -+ // with a DW_AT_specification pointing back to the type's declaration. -+ let decl = is_method.then(|| unsafe { -+ llvm::LLVMRustDIBuilderCreateMethod( -+ DIB(self), -+ containing_scope, -+ name.as_ptr().cast(), -+ name.len(), -+ linkage_name.as_ptr().cast(), -+ linkage_name.len(), -+ file_metadata, -+ loc.line, -+ function_type_metadata, -+ flags, -+ spflags & !DISPFlags::SPFlagDefinition, -+ template_parameters, -+ ) -+ }); -+ -+ return unsafe { -+ llvm::LLVMRustDIBuilderCreateFunction( - DIB(self), - containing_scope, - name.as_ptr().cast(), -@@ -394,9 +415,9 @@ fn dbg_scope_fn( - spflags, - maybe_definition_llfn, - template_parameters, -- None, -- ); -- } -+ decl, -+ ) -+ }; - - fn get_function_signature<'ll, 'tcx>( - cx: &CodegenCx<'ll, 'tcx>, -@@ -495,14 +516,16 @@ fn get_parameter_names(cx: &CodegenCx<'_, '_>, generics: &ty::Generics) -> Vec( - cx: &CodegenCx<'ll, 'tcx>, - instance: Instance<'tcx>, -- ) -> &'ll DIScope { -+ ) -> (&'ll DIScope, bool) { - // First, let's see if this is a method within an inherent impl. Because - // if yes, we want to make the result subroutine DIE a child of the - // subroutine's self-type. -- let self_type = cx.tcx.impl_of_method(instance.def_id()).and_then(|impl_def_id| { -+ if let Some(impl_def_id) = cx.tcx.impl_of_method(instance.def_id()) { - // If the method does *not* belong to a trait, proceed - if cx.tcx.trait_id_of_impl(impl_def_id).is_none() { - let impl_self_ty = cx.tcx.subst_and_normalize_erasing_regions( -@@ -513,39 +536,34 @@ fn get_containing_scope<'ll, 'tcx>( - - // Only "class" methods are generally understood by LLVM, - // so avoid methods on other types (e.g., `<*mut T>::null`). -- match impl_self_ty.kind() { -- ty::Adt(def, ..) if !def.is_box() => { -- // Again, only create type information if full debuginfo is enabled -- if cx.sess().opts.debuginfo == DebugInfo::Full -- && !impl_self_ty.needs_subst() -- { -- Some(type_di_node(cx, impl_self_ty)) -- } else { -- Some(namespace::item_namespace(cx, def.did())) -- } -+ if let ty::Adt(def, ..) = impl_self_ty.kind() && !def.is_box() { -+ // Again, only create type information if full debuginfo is enabled -+ if cx.sess().opts.debuginfo == DebugInfo::Full -+ && !impl_self_ty.needs_subst() -+ { -+ return (type_di_node(cx, impl_self_ty), true); -+ } else { -+ return (namespace::item_namespace(cx, def.did()), false); - } -- _ => None, - } - } else { - // For trait method impls we still use the "parallel namespace" - // strategy -- None - } -- }); -+ } - -- self_type.unwrap_or_else(|| { -- namespace::item_namespace( -- cx, -- DefId { -- krate: instance.def_id().krate, -- index: cx -- .tcx -- .def_key(instance.def_id()) -- .parent -- .expect("get_containing_scope: missing parent?"), -- }, -- ) -- }) -+ let scope = namespace::item_namespace( -+ cx, -+ DefId { -+ krate: instance.def_id().krate, -+ index: cx -+ .tcx -+ .def_key(instance.def_id()) -+ .parent -+ .expect("get_containing_scope: missing parent?"), -+ }, -+ ); -+ (scope, false) - } - } - -diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -index 253c2ca7c768..9dd6db1929fc 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -@@ -1968,6 +1968,21 @@ pub fn LLVMRustDIBuilderCreateFunction<'a>( - Decl: Option<&'a DIDescriptor>, - ) -> &'a DISubprogram; - -+ pub fn LLVMRustDIBuilderCreateMethod<'a>( -+ Builder: &DIBuilder<'a>, -+ Scope: &'a DIDescriptor, -+ Name: *const c_char, -+ NameLen: size_t, -+ LinkageName: *const c_char, -+ LinkageNameLen: size_t, -+ File: &'a DIFile, -+ LineNo: c_uint, -+ Ty: &'a DIType, -+ Flags: DIFlags, -+ SPFlags: DISPFlags, -+ TParam: &'a DIArray, -+ ) -> &'a DISubprogram; -+ - pub fn LLVMRustDIBuilderCreateBasicType<'a>( - Builder: &DIBuilder<'a>, - Name: *const c_char, -diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -index e3493caaaf74..c4a97af1f0f4 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -@@ -841,6 +841,28 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFunction( - return wrap(Sub); - } - -+extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateMethod( -+ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, -+ const char *Name, size_t NameLen, -+ const char *LinkageName, size_t LinkageNameLen, -+ LLVMMetadataRef File, unsigned LineNo, -+ LLVMMetadataRef Ty, LLVMRustDIFlags Flags, -+ LLVMRustDISPFlags SPFlags, LLVMMetadataRef TParam) { -+ DITemplateParameterArray TParams = -+ DITemplateParameterArray(unwrap(TParam)); -+ DISubprogram::DISPFlags llvmSPFlags = fromRust(SPFlags); -+ DINode::DIFlags llvmFlags = fromRust(Flags); -+ DISubprogram *Sub = Builder->createMethod( -+ unwrapDI(Scope), -+ StringRef(Name, NameLen), -+ StringRef(LinkageName, LinkageNameLen), -+ unwrapDI(File), LineNo, -+ unwrapDI(Ty), -+ 0, 0, nullptr, // VTable params aren't used -+ llvmFlags, llvmSPFlags, TParams); -+ return wrap(Sub); -+} -+ - extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateBasicType( - LLVMRustDIBuilderRef Builder, const char *Name, size_t NameLen, - uint64_t SizeInBits, unsigned Encoding) { -diff --git a/tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile -new file mode 100644 -index 000000000000..3b7a99d3dbc6 ---- /dev/null -+++ b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/Makefile -@@ -0,0 +1,12 @@ -+# ignore-cross-compile -+include ../tools.mk -+ -+# With the upgrade to LLVM 16, this was getting: -+# -+# error: Cannot represent a difference across sections -+# -+# The error stemmed from DI function definitions under type scopes, fixed by -+# only declaring in type scope and defining the subprogram elsewhere. -+ -+all: -+ $(RUSTC) lib.rs --test -C lto=fat -C debuginfo=2 -C incremental=$(TMPDIR)/inc-fat -diff --git a/tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs -new file mode 100644 -index 000000000000..c405928bd182 ---- /dev/null -+++ b/tests/run-make-fulldeps/issue-109934-lto-debuginfo/lib.rs -@@ -0,0 +1,9 @@ -+extern crate alloc; -+ -+#[cfg(test)] -+mod tests { -+ #[test] -+ fn something_alloc() { -+ assert_eq!(Vec::::new(), Vec::::new()); -+ } -+} --- -2.40.1 - diff --git a/rust.spec b/rust.spec index 3f23180..f029807 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.68.2 -%global bootstrap_channel 1.68.2 -%global bootstrap_date 2023-03-28 +%global bootstrap_version 1.69.0 +%global bootstrap_channel 1.69.0 +%global bootstrap_date 2023-04-20 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,8 +35,7 @@ # 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 1dfe5c302d1c5ab621f7abf04620fae92700fd22 +%global wasi_libc_ref wasi-sdk-20 %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} @@ -47,14 +46,14 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 14.0+. %global min_llvm_version 14.0.0 -%global bundled_llvm_version 15.0.7 +%global bundled_llvm_version 16.0.2 %bcond_with bundled_llvm -# Requires stable libgit2 1.5, and not the next minor soname change. +# Requires stable libgit2 1.6, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.5.0 -%global next_libgit2_version 1.6.0~ -%global bundled_libgit2_version 1.5.0 +%global min_libgit2_version 1.6.0 +%global next_libgit2_version 1.7.0~ +%global bundled_libgit2_version 1.6.3 %if 0%{?fedora} >= 38 %bcond_with bundled_libgit2 %else @@ -84,8 +83,8 @@ %endif Name: rust -Version: 1.69.0 -Release: 3%{?dist} +Version: 1.70.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -105,10 +104,7 @@ Source1: %{wasi_libc_source} Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. -Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch - -# https://github.com/rust-lang/rust/pull/111167 -Patch3: 0001-debuginfo-split-method-declaration-and-definition.patch +Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch ### RHEL-specific patches below ### @@ -116,16 +112,11 @@ Patch3: 0001-debuginfo-split-method-declaration-and-definition.patch Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.65.0-disable-libssh2.patch +Patch100: rustc-1.70.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.69.0-disable-http2.patch - -# kernel rh1410097 causes too-small stacks for PIE. -# (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.65.0-no-default-pie.patch - +Patch101: rustc-1.70.0-disable-http2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -583,7 +574,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P1 -p1 %patch -P2 -p1 -%patch -P3 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -591,11 +581,7 @@ test -f '%{local_rust_root}/bin/rustc' %if %without curl_http2 %patch -P101 -p1 -rm -rf vendor/libnghttp2-sys/ -%endif - -%if 0%{?rhel} && 0%{?rhel} < 8 -%patch -P102 -p1 +rm -rf vendor/libnghttp2-sys*/ %endif # Use our explicit python3 first @@ -610,21 +596,21 @@ mkdir -p src/llvm-project/libunwind/ %endif # Remove other unused vendored libraries -rm -rf vendor/curl-sys/curl/ +rm -rf vendor/curl-sys*/curl/ rm -rf vendor/*jemalloc-sys*/jemalloc/ -rm -rf vendor/libmimalloc-sys/c_src/mimalloc/ -rm -rf vendor/libssh2-sys/libssh2/ -rm -rf vendor/libz-sys/src/zlib/ -rm -rf vendor/libz-sys/src/zlib-ng/ -rm -rf vendor/lzma-sys/xz-*/ -rm -rf vendor/openssl-src/openssl/ +rm -rf vendor/libffi-sys*/libffi/ +rm -rf vendor/libmimalloc-sys*/c_src/mimalloc/ +rm -rf vendor/libssh2-sys*/libssh2/ +rm -rf vendor/libz-sys*/src/zlib{,-ng}/ +rm -rf vendor/lzma-sys*/xz-*/ +rm -rf vendor/openssl-src*/openssl/ %if %without bundled_libgit2 -rm -rf vendor/libgit2-sys/libgit2/ +rm -rf vendor/libgit2-sys*/libgit2/ %endif %if %with disabled_libssh2 -rm -rf vendor/libssh2-sys/ +rm -rf vendor/libssh2-sys*/ %endif # This only affects the transient rust-installer, but let it use our dynamic xz-libs @@ -1063,6 +1049,9 @@ end} %changelog +* 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 diff --git a/rustc-1.61.0-rust-gdb-substitute-path.patch b/rustc-1.61.0-rust-gdb-substitute-path.patch deleted file mode 100644 index b94e23e..0000000 --- a/rustc-1.61.0-rust-gdb-substitute-path.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- rustc-1.61.0-src/src/etc/rust-gdb.orig 2022-05-17 18:29:36.000000000 -0700 -+++ rustc-1.61.0-src/src/etc/rust-gdb 2022-05-18 11:18:13.732709661 -0700 -@@ -14,6 +14,9 @@ fi - RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" - GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" - -+RUST_STD_BUILD="@BUILDDIR@/library/" -+RUST_STD_SRC="$RUSTC_SYSROOT/lib/rustlib/src/rust/library/" -+ - # Run GDB with the additional arguments that load the pretty printers - # Set the environment variable `RUST_GDB` to overwrite the call to a - # different/specific command (defaults to `gdb`). -@@ -21,4 +24,5 @@ RUST_GDB="${RUST_GDB:-gdb}" - PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \ - --directory="$GDB_PYTHON_MODULE_DIRECTORY" \ - -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \ -+ -iex "set substitute-path $RUST_STD_BUILD $RUST_STD_SRC" \ - "$@" diff --git a/rustc-1.65.0-no-default-pie.patch b/rustc-1.65.0-no-default-pie.patch deleted file mode 100644 index 2a69611..0000000 --- a/rustc-1.65.0-no-default-pie.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2022-09-24 10:20:14.000000000 -0700 -+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2022-10-05 11:24:21.759564185 -0700 -@@ -755,7 +755,7 @@ - && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie") - { - info!("linker output: {:?}", out); -- warn!("Linker does not support -no-pie command line option. Retrying without."); -+ info!("Linker does not support -no-pie command line option. Retrying without."); - for arg in cmd.take_args() { - if arg.to_string_lossy() != "-no-pie" { - cmd.arg(arg); -@@ -774,7 +774,7 @@ - && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie") - { - info!("linker output: {:?}", out); -- warn!( -+ info!( - "Linker does not support -static-pie command line option. Retrying with -static instead." - ); - // Mirror `add_(pre,post)_link_objects` to replace CRT objects. -@@ -1520,15 +1520,15 @@ - } - - fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { -- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { -+ // Only use PIE if explicitly specified. -+ #[allow(rustc::bad_opt_access)] -+ let explicit_pic = -+ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); -+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { - (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, -- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { -- LinkOutputKind::DynamicPicExe -- } -+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, - (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, -- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { -- LinkOutputKind::StaticPicExe -- } -+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, - (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, - (_, true, _) => LinkOutputKind::StaticDylib, - (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/rustc-1.69.0-disable-http2.patch b/rustc-1.70.0-disable-http2.patch similarity index 70% rename from rustc-1.69.0-disable-http2.patch rename to rustc-1.70.0-disable-http2.patch index 09e7930..0e779b3 100644 --- a/rustc-1.69.0-disable-http2.patch +++ b/rustc-1.70.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-03-23 17:10:30.810989345 -0700 -+++ rustc-beta-src/Cargo.lock 2023-03-23 17:10:30.812989303 -0700 -@@ -1142,7 +1142,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2023-05-24 16:49:05.242510531 -0700 ++++ rustc-beta-src/Cargo.lock 2023-05-24 16:51:11.741865603 -0700 +@@ -1197,7 +1197,6 @@ checksum = "14d05c10f541ae6f3bc5b3d923c2 dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2375,16 +2374,6 @@ +@@ -2989,16 +2988,6 @@ source = "registry+https://github.com/ru checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-03-23 17:10:30.812989303 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-03-23 17:11:26.242836664 -0700 -@@ -23,7 +23,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.2.3" } - clap = "4.1.3" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-05-24 16:49:05.244510489 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-05-24 16:51:04.683013189 -0700 +@@ -23,7 +23,7 @@ cargo-platform = { path = "crates/cargo- + cargo-util = { path = "crates/cargo-util", version = "0.2.4" } + clap = "4.2.0" crates-io = { path = "crates/crates-io", version = "0.36.0" } -curl = { version = "0.4.44", features = ["http2"] } +curl = { version = "0.4.44", features = [] } - curl-sys = "0.4.59" + curl-sys = "0.4.61" env_logger = "0.10.0" filetime = "0.2.9" ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-03-19 00:20:55.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-03-23 17:10:30.812989303 -0700 -@@ -401,16 +401,9 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-05-19 19:05:42.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-05-24 16:49:05.244510489 -0700 +@@ -407,16 +407,9 @@ impl<'cfg> PackageSet<'cfg> { sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,9 +58,9 @@ Ok(PackageSet { packages: package_ids ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-03-19 00:20:55.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-03-23 17:10:30.813989282 -0700 -@@ -220,16 +220,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-05-24 16:49:05.245510468 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-05-24 16:51:57.916900146 -0700 +@@ -229,16 +229,8 @@ impl<'cfg> HttpRegistry<'cfg> { } self.fetch_started = true; @@ -77,11 +77,11 @@ + // Multiplexing is disabled because the system libcurl doesn't support it. + self.multiplexing = false; - self.config - .shell() ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs.orig 2023-03-19 00:20:55.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs 2023-03-23 17:10:30.813989282 -0700 -@@ -116,7 +116,7 @@ + if !self.quiet { + self.config +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-05-19 19:05:42.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-05-24 16:49:05.245510468 -0700 +@@ -25,7 +25,7 @@ impl PollExt for Poll { macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.65.0-disable-libssh2.patch b/rustc-1.70.0-disable-libssh2.patch similarity index 55% rename from rustc-1.65.0-disable-libssh2.patch rename to rustc-1.70.0-disable-libssh2.patch index 24be1f3..f9202b4 100644 --- a/rustc-1.65.0-disable-libssh2.patch +++ b/rustc-1.70.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2022-09-24 10:20:14.000000000 -0700 -+++ rustc-beta-src/Cargo.lock 2022-10-04 10:26:35.490270607 -0700 -@@ -1971,7 +1971,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2023-05-19 19:02:31.000000000 -0700 ++++ rustc-beta-src/Cargo.lock 2023-05-24 16:36:33.312232441 -0700 +@@ -2967,7 +2967,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2004,20 +2003,6 @@ +@@ -3000,20 +2999,6 @@ ] [[package]] -name = "libssh2-sys" --version = "0.2.23" +-version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" +-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" -dependencies = [ - "cc", - "libc", @@ -29,9 +29,9 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/vendor/git2/Cargo.toml.orig 2022-10-04 10:26:35.490270607 -0700 -+++ rustc-beta-src/vendor/git2/Cargo.toml 2022-10-04 10:28:14.002187686 -0700 -@@ -58,9 +58,7 @@ +--- rustc-beta-src/vendor/git2/Cargo.toml.orig 2023-05-19 21:16:57.000000000 -0700 ++++ rustc-beta-src/vendor/git2/Cargo.toml 2023-05-24 16:33:42.043813439 -0700 +@@ -55,9 +55,7 @@ [features] default = [ diff --git a/rustc-1.70.0-rust-gdb-substitute-path.patch b/rustc-1.70.0-rust-gdb-substitute-path.patch new file mode 100644 index 0000000..e9e5e2e --- /dev/null +++ b/rustc-1.70.0-rust-gdb-substitute-path.patch @@ -0,0 +1,21 @@ +diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb +index 9abed30ea6f7..e4bf55df3688 100755 +--- a/src/etc/rust-gdb ++++ b/src/etc/rust-gdb +@@ -13,8 +13,6 @@ fi + # Find out where the pretty printer Python module is + RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" + GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" +-# Get the commit hash for path remapping +-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')" + + # Run GDB with the additional arguments that load the pretty printers + # Set the environment variable `RUST_GDB` to overwrite the call to a +@@ -23,6 +21,6 @@ RUST_GDB="${RUST_GDB:-gdb}" + PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \ + --directory="$GDB_PYTHON_MODULE_DIRECTORY" \ + -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \ +- -iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \ ++ -iex "set substitute-path @BUILDDIR@ $RUSTC_SYSROOT/lib/rustlib/src/rust" \ + "$@" + diff --git a/sources b/sources index 577db98..eac2d5d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.69.0-src.tar.xz) = 724398fc208ec18adbd8ba81a445e23d1001b746990f36b869126be8a45f1cdfa75f5b9cbdd0abbab506f91a56d3736ab247677699ebd69525245558cfc01a60 -SHA512 (wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz) = 6f813bc7822746c161932de6b84fb965111400a1a38c25dd0981209d588b9ccafe1a5923349110c536f1b7cda707dfa2d0be42c92b2fa6fd89c957eda27bda27 +SHA512 (rustc-1.70.0-src.tar.xz) = 21b35185fdcc35a059ee5ef6dca2b68f5f1d199e97f425a571cfc318a852c36a57bccf68e7673b4cb7cd83128f30d0b3eb93009a978f3ba3909b7eee50d40631 +SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05 From 356401c7f1a8be2c8e32da80739a3cd4e0452ae8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 23 Jun 2023 15:31:28 -0700 Subject: [PATCH 115/222] Override default target CPUs to match distro settings --- ...e-LLVM-coverage-of-print-target-cpus.patch | 98 +++++++++++++++++ ...variables-override-some-default-CPUs.patch | 53 +++++++++ ...110876-mj10021-issue-110647-fix-r-b-.patch | 102 ++++++++++++++++++ rust.spec | 48 ++++++--- 4 files changed, 284 insertions(+), 17 deletions(-) create mode 100644 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch create mode 100644 0001-Let-environment-variables-override-some-default-CPUs.patch create mode 100644 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch diff --git a/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch b/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch new file mode 100644 index 0000000..8dd209d --- /dev/null +++ b/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch @@ -0,0 +1,98 @@ +From 23b3553ca0332dee4bdd79251b881d552e6bbafa Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 5 May 2023 17:27:59 -0700 +Subject: [PATCH] Expand the LLVM coverage of `--print target-cpus` + +We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` +for `rustc --print target-cpus`, and just printing that it's not supported +on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` +that can replace ours, so now we try to use that. In addition, the fallback +path can at least print the native and default cpu options. + +There were also some mismatches in the function signatures here between +`LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these +functions and only using cpp to adjust the function bodies. + +(cherry picked from commit 67ae38a336599a7e0d2898a5ea3416b947458f5d) +--- + .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 30 ++++++++++--------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +index b1503e6e4b87..a4827a57f5cf 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +@@ -297,7 +297,6 @@ static Reloc::Model fromRust(LLVMRustRelocModel RustReloc) { + report_fatal_error("Bad RelocModel."); + } + +-#ifdef LLVM_RUSTLLVM + /// getLongestEntryLength - Return the length of the longest entry in the table. + template + static size_t getLongestEntryLength(ArrayRef Table) { +@@ -312,11 +311,21 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); + const Triple::ArchType TargetArch = Target->getTargetTriple().getArch(); ++ ++#if LLVM_VERSION_GE(17, 0) ++ const ArrayRef CPUTable = MCInfo->getAllProcessorDescriptions(); ++#elif defined(LLVM_RUSTLLVM) + const ArrayRef CPUTable = MCInfo->getCPUTable(); ++#else ++ printf("Full target CPU help is not supported by this LLVM version.\n\n"); ++ SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} }; ++ const ArrayRef CPUTable = TargetCPUKV; ++#endif + unsigned MaxCPULen = getLongestEntryLength(CPUTable); + + printf("Available CPUs for this target:\n"); + if (HostArch == TargetArch) { ++ MaxCPULen = std::max(MaxCPULen, (unsigned) std::strlen("native")); + const StringRef HostCPU = sys::getHostCPUName(); + printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", + MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); +@@ -336,34 +345,27 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar + } + + extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { ++#ifdef LLVM_RUSTLLVM + const TargetMachine *Target = unwrap(TM); + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const ArrayRef FeatTable = MCInfo->getFeatureTable(); + return FeatTable.size(); ++#else ++ return 0; ++#endif + } + + extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index, + const char** Feature, const char** Desc) { ++#ifdef LLVM_RUSTLLVM + const TargetMachine *Target = unwrap(TM); + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const ArrayRef FeatTable = MCInfo->getFeatureTable(); + const SubtargetFeatureKV Feat = FeatTable[Index]; + *Feature = Feat.Key; + *Desc = Feat.Desc; +-} +- +-#else +- +-extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef) { +- printf("Target CPU help is not supported by this LLVM version.\n\n"); +-} +- +-extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef) { +- return 0; +-} +- +-extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef, const char**, const char**) {} + #endif ++} + + extern "C" const char* LLVMRustGetHostCPUName(size_t *len) { + StringRef Name = sys::getHostCPUName(); +-- +2.40.1 + diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch new file mode 100644 index 0000000..c394f78 --- /dev/null +++ b/0001-Let-environment-variables-override-some-default-CPUs.patch @@ -0,0 +1,53 @@ +From 6e2adb05860b72610291d3b0e8bd525c44cb0cc9 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 +- + 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 +@@ -2,7 +2,7 @@ + + pub fn target() -> Target { + let mut base = super::linux_gnu_base::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 +@@ -5,7 +5,7 @@ pub fn target() -> Target { + let mut base = super::linux_gnu_base::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. +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 9af1049b8702..68f876dd18c3 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 +@@ -2,7 +2,7 @@ + + pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); +- base.cpu = "x86-64".into(); ++ base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into(); + base.max_atomic_width = Some(64); + base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); + base.stack_probes = StackProbeType::X86; +-- +2.40.1 + diff --git a/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch b/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch new file mode 100644 index 0000000..1eab090 --- /dev/null +++ b/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch @@ -0,0 +1,102 @@ +From 6edbc665ea37ba3bf852b4eb42898b7d6e7b919c Mon Sep 17 00:00:00 2001 +From: Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> +Date: Fri, 5 May 2023 18:40:35 +0530 +Subject: [PATCH] Rollup merge of #110876 - mj10021:issue-110647-fix, r=b-naber + +Added default target cpu to `--print target-cpus` output and updated docs + +Added default target cpu info as requested in issue #110647 and noted the new output in the documentation + +(cherry picked from commit 65702bfd6bfb8616e182ddd19d0520ce7e35314a) +--- + compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 2 +- + compiler/rustc_codegen_llvm/src/llvm_util.rs | 9 ++++++++- + .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 17 +++++++++++++---- + src/doc/rustc/src/codegen-options/index.md | 3 ++- + 4 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +index 05bbdbb7415c..383a9d2e5ddb 100644 +--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs ++++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +@@ -2263,7 +2263,7 @@ pub fn LLVMRustDIBuilderCreateDebugLocation<'a>( + + pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool; + +- pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine); ++ pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine, cpu: *const c_char); + pub fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t; + pub fn LLVMRustGetTargetFeature( + T: &TargetMachine, +diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs +index 46692fd5e8bc..2fbdab9f8ce0 100644 +--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs ++++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs +@@ -329,7 +329,14 @@ pub(crate) fn print(req: PrintRequest, sess: &Session) { + require_inited(); + let tm = create_informational_target_machine(sess); + match req { +- PrintRequest::TargetCPUs => unsafe { llvm::LLVMRustPrintTargetCPUs(tm) }, ++ PrintRequest::TargetCPUs => { ++ // SAFETY generate a C compatible string from a byte slice to pass ++ // the target CPU name into LLVM, the lifetime of the reference is ++ // at least as long as the C function ++ let cpu_cstring = CString::new(handle_native(sess.target.cpu.as_ref())) ++ .unwrap_or_else(|e| bug!("failed to convert to cstring: {}", e)); ++ unsafe { llvm::LLVMRustPrintTargetCPUs(tm, cpu_cstring.as_ptr()) }; ++ } + PrintRequest::TargetFeatures => print_target_features(sess, tm), + _ => bug!("rustc_codegen_llvm can't handle print request: {:?}", req), + } +diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +index 08e38b0c9d59..b1503e6e4b87 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +@@ -307,7 +307,7 @@ static size_t getLongestEntryLength(ArrayRef Table) { + return MaxLen; + } + +-extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { ++extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* TargetCPU) { + const TargetMachine *Target = unwrap(TM); + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); +@@ -321,9 +321,18 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { + printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", + MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); + } +- for (auto &CPU : CPUTable) +- printf(" %-*s\n", MaxCPULen, CPU.Key); +- printf("\n"); ++ for (auto &CPU : CPUTable) { ++ // Compare cpu against current target to label the default ++ if (strcmp(CPU.Key, TargetCPU) == 0) { ++ printf(" %-*s - This is the default target CPU" ++ " for the current build target (currently %s).", ++ MaxCPULen, CPU.Key, Target->getTargetTriple().str().c_str()); ++ } ++ else { ++ printf(" %-*s", MaxCPULen, CPU.Key); ++ } ++ printf("\n"); ++ } + } + + extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { +diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md +index 62347f169a5e..3a14f582d600 100644 +--- a/src/doc/rustc/src/codegen-options/index.md ++++ b/src/doc/rustc/src/codegen-options/index.md +@@ -574,7 +574,8 @@ change in the future. + This instructs `rustc` to generate code specifically for a particular processor. + + You can run `rustc --print target-cpus` to see the valid options to pass +-here. Each target has a default base CPU. Special values include: ++and the default target CPU for the current buid target. ++Each target has a default base CPU. Special values include: + + * `native` can be passed to use the processor of the host machine. + * `generic` refers to an LLVM target with minimal features but modern tuning. +-- +2.40.1 + diff --git a/rust.spec b/rust.spec index f029807..95ea45c 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.70.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,18 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch +# Override default target CPUs to match distro settings +# TODO: upstream this ability into the actual build configuration +Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch + +# Added default target cpu to `--print target-cpus` output +# https://github.com/rust-lang/rust/pull/110876 +Patch4: 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch + +# Improve `--print target-cpus` for non-bundled LLVM +# https://github.com/rust-lang/rust/pull/111274 +Patch5: 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -574,6 +586,9 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P1 -p1 %patch -P2 -p1 +%patch -P3 -p1 +%patch -P4 -p1 +%patch -P5 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -646,24 +661,20 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %endif # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros -%if 0%{?fedora} || 0%{?rhel} >= 9 -%ifarch x86_64 -%global rust_target_cpu %[0%{?rhel} >= 10 ? "x86-64-v3" : ""] -%global rust_target_cpu %[0%{?rhel} == 9 ? "x86-64-v2" : "%{rust_target_cpu}"] -%endif -%ifarch s390x -%global rust_target_cpu %[0%{?rhel} >= 9 ? "z14" : "zEC12"] -%endif -%ifarch ppc64le -%global rust_target_cpu %[0%{?rhel} >= 9 ? "pwr9" : "pwr8"] -%endif -%endif +%{lua: function rustc_target_cpus() + local fedora = tonumber(rpm.expand("0%{?fedora}")) + local rhel = tonumber(rpm.expand("0%{?rhel}")) + local env = + " RUSTC_TARGET_CPU_X86_64=x86-64" .. ((rhel >= 10) and "-v3" or (rhel == 9) and "-v2" or "") + .. " RUSTC_TARGET_CPU_PPC64LE=" .. ((rhel >= 9) and "pwr9" or "pwr8") + .. " RUSTC_TARGET_CPU_S390X=" .. + ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or + (fedora >= 26) and "zEC12" or (rhel == 7) and "z196" or "z10") + return env +end} # Set up shared environment variables for build/install/check -%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} -%if "%{?rust_target_cpu}" != "" -%global rust_env %{?rust_env} CARGO_TARGET_%{rust_triple_env}_RUSTFLAGS=-Ctarget-cpu=%{rust_target_cpu} -%endif +%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{lua: print(rustc_target_cpus())} %if %defined cmake_path %global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" %endif @@ -1049,6 +1060,9 @@ end} %changelog +* 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. From 386b9914c97fa484377fdf3e27deec741d1d02a5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 17 Jul 2023 09:24:25 -0700 Subject: [PATCH 116/222] Update to 1.71.0. --- .gitignore | 1 + ...e-LLVM-coverage-of-print-target-cpus.patch | 98 ----------------- ...t-lint-docs-when-download-rustc-is-e.patch | 60 +++++++++++ ...tc-bash_complettion-src-etc-.-to-avo.patch | 31 ++++++ ...110876-mj10021-issue-110647-fix-r-b-.patch | 102 ------------------ rust.spec | 38 ++++--- rustc-1.70.0-disable-libssh2.patch | 43 -------- ....patch => rustc-1.71.0-disable-http2.patch | 56 +++++----- rustc-1.71.0-disable-libssh2.patch | 42 ++++++++ sources | 2 +- 10 files changed, 185 insertions(+), 288 deletions(-) delete mode 100644 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch create mode 100644 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch create mode 100644 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch delete mode 100644 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch delete mode 100644 rustc-1.70.0-disable-libssh2.patch rename rustc-1.70.0-disable-http2.patch => rustc-1.71.0-disable-http2.patch (64%) create mode 100644 rustc-1.71.0-disable-libssh2.patch diff --git a/.gitignore b/.gitignore index 51331ef..d7f7e39 100644 --- a/.gitignore +++ b/.gitignore @@ -420,3 +420,4 @@ /wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz /rustc-1.70.0-src.tar.xz /wasi-libc-wasi-sdk-20.tar.gz +/rustc-1.71.0-src.tar.xz diff --git a/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch b/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch deleted file mode 100644 index 8dd209d..0000000 --- a/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 23b3553ca0332dee4bdd79251b881d552e6bbafa Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 5 May 2023 17:27:59 -0700 -Subject: [PATCH] Expand the LLVM coverage of `--print target-cpus` - -We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` -for `rustc --print target-cpus`, and just printing that it's not supported -on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` -that can replace ours, so now we try to use that. In addition, the fallback -path can at least print the native and default cpu options. - -There were also some mismatches in the function signatures here between -`LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these -functions and only using cpp to adjust the function bodies. - -(cherry picked from commit 67ae38a336599a7e0d2898a5ea3416b947458f5d) ---- - .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 30 ++++++++++--------- - 1 file changed, 16 insertions(+), 14 deletions(-) - -diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -index b1503e6e4b87..a4827a57f5cf 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -@@ -297,7 +297,6 @@ static Reloc::Model fromRust(LLVMRustRelocModel RustReloc) { - report_fatal_error("Bad RelocModel."); - } - --#ifdef LLVM_RUSTLLVM - /// getLongestEntryLength - Return the length of the longest entry in the table. - template - static size_t getLongestEntryLength(ArrayRef Table) { -@@ -312,11 +311,21 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); - const Triple::ArchType TargetArch = Target->getTargetTriple().getArch(); -+ -+#if LLVM_VERSION_GE(17, 0) -+ const ArrayRef CPUTable = MCInfo->getAllProcessorDescriptions(); -+#elif defined(LLVM_RUSTLLVM) - const ArrayRef CPUTable = MCInfo->getCPUTable(); -+#else -+ printf("Full target CPU help is not supported by this LLVM version.\n\n"); -+ SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} }; -+ const ArrayRef CPUTable = TargetCPUKV; -+#endif - unsigned MaxCPULen = getLongestEntryLength(CPUTable); - - printf("Available CPUs for this target:\n"); - if (HostArch == TargetArch) { -+ MaxCPULen = std::max(MaxCPULen, (unsigned) std::strlen("native")); - const StringRef HostCPU = sys::getHostCPUName(); - printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", - MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); -@@ -336,34 +345,27 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar - } - - extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { -+#ifdef LLVM_RUSTLLVM - const TargetMachine *Target = unwrap(TM); - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const ArrayRef FeatTable = MCInfo->getFeatureTable(); - return FeatTable.size(); -+#else -+ return 0; -+#endif - } - - extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index, - const char** Feature, const char** Desc) { -+#ifdef LLVM_RUSTLLVM - const TargetMachine *Target = unwrap(TM); - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const ArrayRef FeatTable = MCInfo->getFeatureTable(); - const SubtargetFeatureKV Feat = FeatTable[Index]; - *Feature = Feat.Key; - *Desc = Feat.Desc; --} -- --#else -- --extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef) { -- printf("Target CPU help is not supported by this LLVM version.\n\n"); --} -- --extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef) { -- return 0; --} -- --extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef, const char**, const char**) {} - #endif -+} - - extern "C" const char* LLVMRustGetHostCPUName(size_t *len) { - StringRef Name = sys::getHostCPUName(); --- -2.40.1 - diff --git a/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch b/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch new file mode 100644 index 0000000..50518c6 --- /dev/null +++ b/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch @@ -0,0 +1,60 @@ +From 9204a8359201271fd7b1c625d6f29ddd095a419d Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 10 Jul 2023 13:48:49 -0700 +Subject: [PATCH] Revert "Fix `x test lint-docs` when download-rustc is + enabled" + +This reverts commit abf9cbcb69e485b56776112bc587f6166e7ac5c9. +--- + src/tools/lint-docs/src/groups.rs | 3 +-- + src/tools/lint-docs/src/lib.rs | 9 --------- + 2 files changed, 1 insertion(+), 11 deletions(-) + +diff --git a/src/tools/lint-docs/src/groups.rs b/src/tools/lint-docs/src/groups.rs +index b11fb287cf4d..2a923a61b0a7 100644 +--- a/src/tools/lint-docs/src/groups.rs ++++ b/src/tools/lint-docs/src/groups.rs +@@ -39,12 +39,11 @@ pub(crate) fn generate_group_docs(&self, lints: &[Lint]) -> Result<(), Box Result> { + let mut result = BTreeMap::new(); + let mut cmd = Command::new(self.rustc_path); +- cmd.env_remove("LD_LIBRARY_PATH"); + cmd.arg("-Whelp"); + let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; + if !output.status.success() { + return Err(format!( +- "failed to collect lint info: failed to run {cmd:?}: {:?}\n--- stderr\n{}--- stdout\n{}\n", ++ "failed to collect lint info: {:?}\n--- stderr\n{}--- stdout\n{}\n", + output.status, + std::str::from_utf8(&output.stderr).unwrap(), + std::str::from_utf8(&output.stdout).unwrap(), +diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs +index fe29b9abda39..034c6aa0708e 100644 +--- a/src/tools/lint-docs/src/lib.rs ++++ b/src/tools/lint-docs/src/lib.rs +@@ -403,12 +403,6 @@ fn generate_lint_output( + fs::write(&tempfile, source) + .map_err(|e| format!("failed to write {}: {}", tempfile.display(), e))?; + let mut cmd = Command::new(self.rustc_path); +- // NOTE: bootstrap sets `LD_LIBRARY_PATH` for building lint-docs itself. +- // Unfortunately, lint-docs is a bootstrap tool while rustc is built from source, +- // and sometimes the paths conflict. In particular, when using `download-rustc`, +- // the LLVM versions can differ between `ci-llvm` and `ci-rustc-sysroot`. +- // Unset LD_LIBRARY_PATH here so it doesn't interfere with running the compiler. +- cmd.env_remove("LD_LIBRARY_PATH"); + if options.contains(&"edition2015") { + cmd.arg("--edition=2015"); + } else { +@@ -421,9 +415,6 @@ fn generate_lint_output( + } + cmd.arg("lint_example.rs"); + cmd.current_dir(tempdir.path()); +- if self.verbose { +- eprintln!("running: {cmd:?}"); +- } + let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; + let stderr = std::str::from_utf8(&output.stderr).unwrap(); + let msgs = stderr +-- +2.41.0 + diff --git a/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch b/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch new file mode 100644 index 0000000..a326207 --- /dev/null +++ b/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch @@ -0,0 +1,31 @@ +From cea2e61a03773ce28fd57b7338c4ae4d947650ca Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 10 Jul 2023 15:52:55 -0700 +Subject: [PATCH] Revert "fix: :bug: etc/bash_complettion -> src/etc/... to + avoid copy error" + +This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878. +--- + src/bootstrap/dist.rs | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index b49845386da1..9cead7adc8c3 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -1071,11 +1071,7 @@ fn run(self, builder: &Builder<'_>) -> Option { + + tarball.add_file(&cargo, "bin", 0o755); + tarball.add_file(etc.join("_cargo"), "share/zsh/site-functions", 0o644); +- tarball.add_renamed_file( +- etc.join("cargo.bashcomp.sh"), +- "src/etc/bash_completion.d", +- "cargo", +- ); ++ tarball.add_renamed_file(etc.join("cargo.bashcomp.sh"), "etc/bash_completion.d", "cargo"); + tarball.add_dir(etc.join("man"), "share/man/man1"); + tarball.add_legal_and_readme_to("share/doc/cargo"); + +-- +2.41.0 + diff --git a/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch b/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch deleted file mode 100644 index 1eab090..0000000 --- a/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 6edbc665ea37ba3bf852b4eb42898b7d6e7b919c Mon Sep 17 00:00:00 2001 -From: Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> -Date: Fri, 5 May 2023 18:40:35 +0530 -Subject: [PATCH] Rollup merge of #110876 - mj10021:issue-110647-fix, r=b-naber - -Added default target cpu to `--print target-cpus` output and updated docs - -Added default target cpu info as requested in issue #110647 and noted the new output in the documentation - -(cherry picked from commit 65702bfd6bfb8616e182ddd19d0520ce7e35314a) ---- - compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 2 +- - compiler/rustc_codegen_llvm/src/llvm_util.rs | 9 ++++++++- - .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 17 +++++++++++++---- - src/doc/rustc/src/codegen-options/index.md | 3 ++- - 4 files changed, 24 insertions(+), 7 deletions(-) - -diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -index 05bbdbb7415c..383a9d2e5ddb 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -@@ -2263,7 +2263,7 @@ pub fn LLVMRustDIBuilderCreateDebugLocation<'a>( - - pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool; - -- pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine); -+ pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine, cpu: *const c_char); - pub fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t; - pub fn LLVMRustGetTargetFeature( - T: &TargetMachine, -diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs -index 46692fd5e8bc..2fbdab9f8ce0 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm_util.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs -@@ -329,7 +329,14 @@ pub(crate) fn print(req: PrintRequest, sess: &Session) { - require_inited(); - let tm = create_informational_target_machine(sess); - match req { -- PrintRequest::TargetCPUs => unsafe { llvm::LLVMRustPrintTargetCPUs(tm) }, -+ PrintRequest::TargetCPUs => { -+ // SAFETY generate a C compatible string from a byte slice to pass -+ // the target CPU name into LLVM, the lifetime of the reference is -+ // at least as long as the C function -+ let cpu_cstring = CString::new(handle_native(sess.target.cpu.as_ref())) -+ .unwrap_or_else(|e| bug!("failed to convert to cstring: {}", e)); -+ unsafe { llvm::LLVMRustPrintTargetCPUs(tm, cpu_cstring.as_ptr()) }; -+ } - PrintRequest::TargetFeatures => print_target_features(sess, tm), - _ => bug!("rustc_codegen_llvm can't handle print request: {:?}", req), - } -diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -index 08e38b0c9d59..b1503e6e4b87 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -@@ -307,7 +307,7 @@ static size_t getLongestEntryLength(ArrayRef Table) { - return MaxLen; - } - --extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { -+extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* TargetCPU) { - const TargetMachine *Target = unwrap(TM); - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); -@@ -321,9 +321,18 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { - printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", - MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); - } -- for (auto &CPU : CPUTable) -- printf(" %-*s\n", MaxCPULen, CPU.Key); -- printf("\n"); -+ for (auto &CPU : CPUTable) { -+ // Compare cpu against current target to label the default -+ if (strcmp(CPU.Key, TargetCPU) == 0) { -+ printf(" %-*s - This is the default target CPU" -+ " for the current build target (currently %s).", -+ MaxCPULen, CPU.Key, Target->getTargetTriple().str().c_str()); -+ } -+ else { -+ printf(" %-*s", MaxCPULen, CPU.Key); -+ } -+ printf("\n"); -+ } - } - - extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { -diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md -index 62347f169a5e..3a14f582d600 100644 ---- a/src/doc/rustc/src/codegen-options/index.md -+++ b/src/doc/rustc/src/codegen-options/index.md -@@ -574,7 +574,8 @@ change in the future. - This instructs `rustc` to generate code specifically for a particular processor. - - You can run `rustc --print target-cpus` to see the valid options to pass --here. Each target has a default base CPU. Special values include: -+and the default target CPU for the current buid target. -+Each target has a default base CPU. Special values include: - - * `native` can be passed to use the processor of the host machine. - * `generic` refers to an LLVM target with minimal features but modern tuning. --- -2.40.1 - diff --git a/rust.spec b/rust.spec index 95ea45c..4fbbcf9 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.69.0 -%global bootstrap_channel 1.69.0 -%global bootstrap_date 2023-04-20 +%global bootstrap_version 1.70.0 +%global bootstrap_channel 1.70.0 +%global bootstrap_date 2023-06-01 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -46,14 +46,14 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 14.0+. %global min_llvm_version 14.0.0 -%global bundled_llvm_version 16.0.2 +%global bundled_llvm_version 16.0.5 %bcond_with bundled_llvm # Requires stable libgit2 1.6, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.6.0 +%global min_libgit2_version 1.6.4 %global next_libgit2_version 1.7.0~ -%global bundled_libgit2_version 1.6.3 +%global bundled_libgit2_version 1.6.4 %if 0%{?fedora} >= 38 %bcond_with bundled_libgit2 %else @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.70.0 -Release: 2%{?dist} +Version: 1.71.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -110,13 +110,13 @@ Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch # TODO: upstream this ability into the actual build configuration Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch -# Added default target cpu to `--print target-cpus` output -# https://github.com/rust-lang/rust/pull/110876 -Patch4: 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch +# Restore LD_LIBRARY_PATH when running lint-docs +# https://github.com/rust-lang/rust/pull/110521#issuecomment-1629705099 +Patch4: 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch -# Improve `--print target-cpus` for non-bundled LLVM -# https://github.com/rust-lang/rust/pull/111274 -Patch5: 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch +# Restore the bash completion path +# https://github.com/rust-lang/rust/pull/110906#issuecomment-1629832675 +Patch5: 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch ### RHEL-specific patches below ### @@ -124,11 +124,11 @@ Patch5: 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.70.0-disable-libssh2.patch +Patch100: rustc-1.71.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.70.0-disable-http2.patch +Patch101: rustc-1.71.0-disable-http2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -801,6 +801,9 @@ done # These are transient files used by x.py dist and install 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 %if "%{_libdir}" != "%{common_libdir}" mkdir -p %{buildroot}%{_libdir} @@ -1060,6 +1063,9 @@ end} %changelog +* 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 diff --git a/rustc-1.70.0-disable-libssh2.patch b/rustc-1.70.0-disable-libssh2.patch deleted file mode 100644 index f9202b4..0000000 --- a/rustc-1.70.0-disable-libssh2.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-05-19 19:02:31.000000000 -0700 -+++ rustc-beta-src/Cargo.lock 2023-05-24 16:36:33.312232441 -0700 -@@ -2967,7 +2967,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -3000,20 +2999,6 @@ - ] - - [[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" - version = "1.1.3" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/vendor/git2/Cargo.toml.orig 2023-05-19 21:16:57.000000000 -0700 -+++ rustc-beta-src/vendor/git2/Cargo.toml 2023-05-24 16:33:42.043813439 -0700 -@@ -55,9 +55,7 @@ - - [features] - default = [ -- "ssh", - "https", -- "ssh_key_from_memory", - ] - https = [ - "libgit2-sys/https", diff --git a/rustc-1.70.0-disable-http2.patch b/rustc-1.71.0-disable-http2.patch similarity index 64% rename from rustc-1.70.0-disable-http2.patch rename to rustc-1.71.0-disable-http2.patch index 0e779b3..34fdab3 100644 --- a/rustc-1.70.0-disable-http2.patch +++ b/rustc-1.71.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-05-24 16:49:05.242510531 -0700 -+++ rustc-beta-src/Cargo.lock 2023-05-24 16:51:11.741865603 -0700 -@@ -1197,7 +1197,6 @@ checksum = "14d05c10f541ae6f3bc5b3d923c2 +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-07-07 17:30:04.817452621 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:30:27.777988139 -0700 +@@ -734,7 +734,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2989,16 +2988,6 @@ source = "registry+https://github.com/ru - checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" +@@ -1954,16 +1953,6 @@ + checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] -name = "libnghttp2-sys" --version = "0.1.4+1.41.0" +-version = "0.1.7+1.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +-checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" -dependencies = [ - "cc", - "libc", @@ -23,22 +23,22 @@ - -[[package]] name = "libz-sys" - version = "1.1.3" + version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-05-24 16:49:05.244510489 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-05-24 16:51:04.683013189 -0700 -@@ -23,7 +23,7 @@ cargo-platform = { path = "crates/cargo- - cargo-util = { path = "crates/cargo-util", version = "0.2.4" } - clap = "4.2.0" - crates-io = { path = "crates/crates-io", version = "0.36.0" } --curl = { version = "0.4.44", features = ["http2"] } -+curl = { version = "0.4.44", features = [] } - curl-sys = "0.4.61" - env_logger = "0.10.0" - filetime = "0.2.9" ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-05-19 19:05:42.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-05-24 16:49:05.244510489 -0700 -@@ -407,16 +407,9 @@ impl<'cfg> PackageSet<'cfg> { +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-07-07 17:30:04.819452581 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:30:24.133061874 -0700 +@@ -118,7 +118,7 @@ + cargo-util.workspace = true + clap = { workspace = true, features = ["wrap_help"] } + crates-io.workspace = true +-curl = { workspace = true, features = ["http2"] } ++curl = { workspace = true, features = [] } + curl-sys.workspace = true + env_logger.workspace = true + filetime.workspace = true +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-07-07 17:30:04.819452581 -0700 +@@ -407,16 +407,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,9 +58,9 @@ Ok(PackageSet { packages: package_ids ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-05-24 16:49:05.245510468 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-05-24 16:51:57.916900146 -0700 -@@ -229,16 +229,8 @@ impl<'cfg> HttpRegistry<'cfg> { +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-07-07 17:30:04.819452581 -0700 +@@ -229,16 +229,8 @@ } self.fetch_started = true; @@ -79,9 +79,9 @@ if !self.quiet { self.config ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-05-19 19:05:42.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-05-24 16:49:05.245510468 -0700 -@@ -25,7 +25,7 @@ impl PollExt for Poll { +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-07-07 17:30:04.819452581 -0700 +@@ -26,7 +26,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.71.0-disable-libssh2.patch b/rustc-1.71.0-disable-libssh2.patch new file mode 100644 index 0000000..ba61454 --- /dev/null +++ b/rustc-1.71.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:12:23.406932870 -0700 +@@ -1942,7 +1942,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1965,20 +1964,6 @@ + ] + + [[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" + version = "1.1.8" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:12:00.688392750 -0700 +@@ -31,7 +31,7 @@ + filetime = "0.2.9" + flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] } + fwdansi = "1.1.0" +-git2 = "0.17.1" ++git2 = { version = "0.17.1", default-features = false, features = ["https"] } + git2-curl = "0.18.0" + gix = { version = "0.44.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } + gix-features-for-configuration-only = { version = "0.29.0", package = "gix-features", features = [ "parallel" ] } diff --git a/sources b/sources index eac2d5d..622ee4f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.70.0-src.tar.xz) = 21b35185fdcc35a059ee5ef6dca2b68f5f1d199e97f425a571cfc318a852c36a57bccf68e7673b4cb7cd83128f30d0b3eb93009a978f3ba3909b7eee50d40631 +SHA512 (rustc-1.71.0-src.tar.xz) = 2c93bafdd248563765a285add48ca77c1e4bad4d5431675ae6a5cdee4cfe7a41e6bcc880a489ca1069a307fd9a005f2d5f8e230dfc95b4a69152b4f9ca49ac44 SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05 From 2f56a4c9181a05cfc4535f1b2c62824a77b9e7fe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jul 2023 18:41:30 +0000 Subject: [PATCH 117/222] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 4fbbcf9..1901dc8 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.71.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -1063,6 +1063,9 @@ end} %changelog +* 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. From 8cfe070190bc5daab956a97580295c0ff6524505 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 25 Jul 2023 17:53:22 -0700 Subject: [PATCH 118/222] Relax the suspicious_double_ref_op lint Enable the profiler runtime for native hosts --- ...rnal-builds-of-the-compiler-rt-profi.patch | 142 ++++++++++++++ ...112517-fee1-dead-contrib-sus-op-no-b.patch | 185 ++++++++++++++++++ rust.spec | 24 ++- 3 files changed, 350 insertions(+), 1 deletion(-) create mode 100644 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch create mode 100644 0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch diff --git a/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch b/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch new file mode 100644 index 0000000..2b1ecb5 --- /dev/null +++ b/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch @@ -0,0 +1,142 @@ +From f2fd2d01f96b50b039402c9ab4278230687f7922 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 25 Jul 2023 13:11:50 -0700 +Subject: [PATCH] Allow using external builds of the compiler-rt profile lib + +This changes the bootstrap config `target.*.profiler` from a plain bool +to also allow a string, which will be used as a path to the pre-built +profiling runtime for that target. Then `profiler_builtins/build.rs` +reads that in a `LLVM_PROFILER_RT_LIB` environment variable. +--- + config.example.toml | 6 ++++-- + library/profiler_builtins/build.rs | 6 ++++++ + src/bootstrap/compile.rs | 4 ++++ + src/bootstrap/config.rs | 30 ++++++++++++++++++++++++------ + 4 files changed, 38 insertions(+), 8 deletions(-) + +diff --git a/config.example.toml b/config.example.toml +index d0eaa9fd7ffa..e0e991e679af 100644 +--- a/config.example.toml ++++ b/config.example.toml +@@ -745,8 +745,10 @@ changelog-seen = 2 + # This option will override the same option under [build] section. + #sanitizers = build.sanitizers (bool) + +-# Build the profiler runtime for this target(required when compiling with options that depend +-# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`). ++# When true, build the profiler runtime for this target(required when compiling ++# with options that depend on this runtime, such as `-C profile-generate` or ++# `-C instrument-coverage`). This may also be given a path to an existing build ++# of the profiling runtime library from LLVM's compiler-rt. + # This option will override the same option under [build] section. + #profiler = build.profiler (bool) + +diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs +index 1b1f11798d74..d14d0b82229a 100644 +--- a/library/profiler_builtins/build.rs ++++ b/library/profiler_builtins/build.rs +@@ -6,6 +6,12 @@ + use std::path::Path; + + fn main() { ++ println!("cargo:rerun-if-env-changed=LLVM_PROFILER_RT_LIB"); ++ if let Ok(rt) = env::var("LLVM_PROFILER_RT_LIB") { ++ println!("cargo:rustc-link-lib=static:+verbatim={rt}"); ++ return; ++ } ++ + let target = env::var("TARGET").expect("TARGET was not set"); + let cfg = &mut cc::Build::new(); + +diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs +index 33addb90da37..1d8b3c6e5435 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -305,6 +305,10 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car + cargo.env("MACOSX_DEPLOYMENT_TARGET", target); + } + ++ if let Some(path) = builder.config.profiler_path(target) { ++ cargo.env("LLVM_PROFILER_RT_LIB", path); ++ } ++ + // Determine if we're going to compile in optimized C intrinsics to + // the `compiler-builtins` crate. These intrinsics live in LLVM's + // `compiler-rt` repository, but our `src/llvm-project` submodule isn't +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index e192cda9a9a7..a4803db0a470 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -467,7 +467,7 @@ pub struct Target { + pub linker: Option, + pub ndk: Option, + pub sanitizers: Option, +- pub profiler: Option, ++ pub profiler: Option, + pub rpath: Option, + pub crt_static: Option, + pub musl_root: Option, +@@ -796,9 +796,9 @@ struct Dist { + } + } + +-#[derive(Debug, Deserialize)] ++#[derive(Clone, Debug, Deserialize)] + #[serde(untagged)] +-enum StringOrBool { ++pub enum StringOrBool { + String(String), + Bool(bool), + } +@@ -809,6 +809,12 @@ fn default() -> StringOrBool { + } + } + ++impl StringOrBool { ++ fn is_string_or_true(&self) -> bool { ++ matches!(self, Self::String(_) | Self::Bool(true)) ++ } ++} ++ + define_config! { + /// TOML representation of how the Rust build is configured. + struct Rust { +@@ -880,7 +886,7 @@ struct TomlTarget { + llvm_libunwind: Option = "llvm-libunwind", + android_ndk: Option = "android-ndk", + sanitizers: Option = "sanitizers", +- profiler: Option = "profiler", ++ profiler: Option = "profiler", + rpath: Option = "rpath", + crt_static: Option = "crt-static", + musl_root: Option = "musl-root", +@@ -1744,12 +1750,24 @@ pub fn any_sanitizers_enabled(&self) -> bool { + self.target_config.values().any(|t| t.sanitizers == Some(true)) || self.sanitizers + } + ++ pub fn profiler_path(&self, target: TargetSelection) -> Option<&str> { ++ match self.target_config.get(&target)?.profiler.as_ref()? { ++ StringOrBool::String(s) => Some(s), ++ StringOrBool::Bool(_) => None, ++ } ++ } ++ + pub fn profiler_enabled(&self, target: TargetSelection) -> bool { +- self.target_config.get(&target).map(|t| t.profiler).flatten().unwrap_or(self.profiler) ++ self.target_config ++ .get(&target) ++ .and_then(|t| t.profiler.as_ref()) ++ .map(StringOrBool::is_string_or_true) ++ .unwrap_or(self.profiler) + } + + pub fn any_profiler_enabled(&self) -> bool { +- self.target_config.values().any(|t| t.profiler == Some(true)) || self.profiler ++ self.target_config.values().any(|t| matches!(&t.profiler, Some(p) if p.is_string_or_true())) ++ || self.profiler + } + + pub fn rpath_enabled(&self, target: TargetSelection) -> bool { +-- +2.41.0 + diff --git a/0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch b/0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch new file mode 100644 index 0000000..8f8c544 --- /dev/null +++ b/0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch @@ -0,0 +1,185 @@ +From abb7c31ab038f38e33057062ae8b66b4e3cd699c Mon Sep 17 00:00:00 2001 +From: Guillaume Gomez +Date: Thu, 15 Jun 2023 22:04:55 +0200 +Subject: [PATCH] Rollup merge of #112517 - fee1-dead-contrib:sus-op-no-borrow, + r=compiler-errors + +`suspicious_double_ref_op`: don't lint on `.borrow()` + +closes #112489 + +(cherry picked from commit db7d8374c1b6f1e2e8297f43e6a2cbffeff21882) +--- + compiler/rustc_lint/messages.ftl | 12 ++-- + compiler/rustc_lint/src/lints.rs | 12 ++-- + compiler/rustc_lint/src/noop_method_call.rs | 62 +++++++++++---------- + tests/ui/lint/issue-112489.rs | 17 ++++++ + 4 files changed, 64 insertions(+), 39 deletions(-) + create mode 100644 tests/ui/lint/issue-112489.rs + +diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl +index d34a3afcba53..0fa67cdb391f 100644 +--- a/compiler/rustc_lint/messages.ftl ++++ b/compiler/rustc_lint/messages.ftl +@@ -463,13 +463,11 @@ lint_requested_level = requested on the command line with `{$level} {$lint_name} + lint_supertrait_as_deref_target = `{$t}` implements `Deref` with supertrait `{$target_principal}` as target + .label = target type is set here + +-lint_suspicious_double_ref_op = +- using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op -> +- *[should_not_happen] [{$op}] +- [deref] dereferencing +- [borrow] borrowing +- [clone] cloning +- } the inner type ++lint_suspicious_double_ref_clone = ++ using `.clone()` on a double reference, which returns `{$ty}` instead of cloning the inner type ++ ++lint_suspicious_double_ref_deref = ++ using `.deref()` on a double reference, which returns `{$ty}` instead of dereferencing the inner type + + lint_trivial_untranslatable_diag = diagnostic with static strings only + +diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs +index de1c2be28757..d96723a68eb6 100644 +--- a/compiler/rustc_lint/src/lints.rs ++++ b/compiler/rustc_lint/src/lints.rs +@@ -1188,11 +1188,15 @@ pub struct NoopMethodCallDiag<'a> { + } + + #[derive(LintDiagnostic)] +-#[diag(lint_suspicious_double_ref_op)] +-pub struct SuspiciousDoubleRefDiag<'a> { +- pub call: Symbol, ++#[diag(lint_suspicious_double_ref_deref)] ++pub struct SuspiciousDoubleRefDerefDiag<'a> { ++ pub ty: Ty<'a>, ++} ++ ++#[derive(LintDiagnostic)] ++#[diag(lint_suspicious_double_ref_clone)] ++pub struct SuspiciousDoubleRefCloneDiag<'a> { + pub ty: Ty<'a>, +- pub op: &'static str, + } + + // pass_by_value.rs +diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs +index d054966459d8..d56c35bb677a 100644 +--- a/compiler/rustc_lint/src/noop_method_call.rs ++++ b/compiler/rustc_lint/src/noop_method_call.rs +@@ -1,5 +1,7 @@ + use crate::context::LintContext; +-use crate::lints::{NoopMethodCallDiag, SuspiciousDoubleRefDiag}; ++use crate::lints::{ ++ NoopMethodCallDiag, SuspiciousDoubleRefCloneDiag, SuspiciousDoubleRefDerefDiag, ++}; + use crate::LateContext; + use crate::LateLintPass; + use rustc_hir::def::DefKind; +@@ -76,22 +78,22 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + + // We only care about method calls corresponding to the `Clone`, `Deref` and `Borrow` + // traits and ignore any other method call. +- let did = match cx.typeck_results().type_dependent_def(expr.hir_id) { +- // Verify we are dealing with a method/associated function. +- Some((DefKind::AssocFn, did)) => match cx.tcx.trait_of_item(did) { +- // Check that we're dealing with a trait method for one of the traits we care about. +- Some(trait_id) +- if matches!( +- cx.tcx.get_diagnostic_name(trait_id), +- Some(sym::Borrow | sym::Clone | sym::Deref) +- ) => +- { +- did +- } +- _ => return, +- }, +- _ => return, ++ ++ let Some((DefKind::AssocFn, did)) = ++ cx.typeck_results().type_dependent_def(expr.hir_id) ++ else { ++ return; ++ }; ++ ++ let Some(trait_id) = cx.tcx.trait_of_item(did) else { return }; ++ ++ if !matches!( ++ cx.tcx.get_diagnostic_name(trait_id), ++ Some(sym::Borrow | sym::Clone | sym::Deref) ++ ) { ++ return; + }; ++ + let substs = cx + .tcx + .normalize_erasing_regions(cx.param_env, cx.typeck_results().node_substs(expr.hir_id)); +@@ -102,13 +104,6 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + // (Re)check that it implements the noop diagnostic. + let Some(name) = cx.tcx.get_diagnostic_name(i.def_id()) else { return }; + +- let op = match name { +- sym::noop_method_borrow => "borrow", +- sym::noop_method_clone => "clone", +- sym::noop_method_deref => "deref", +- _ => return, +- }; +- + let receiver_ty = cx.typeck_results().expr_ty(receiver); + let expr_ty = cx.typeck_results().expr_ty_adjusted(expr); + let arg_adjustments = cx.typeck_results().expr_adjustments(receiver); +@@ -129,11 +124,22 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + NoopMethodCallDiag { method: call.ident.name, receiver_ty, label: span }, + ); + } else { +- cx.emit_spanned_lint( +- SUSPICIOUS_DOUBLE_REF_OP, +- span, +- SuspiciousDoubleRefDiag { call: call.ident.name, ty: expr_ty, op }, +- ) ++ match name { ++ // If `type_of(x) == T` and `x.borrow()` is used to get `&T`, ++ // then that should be allowed ++ sym::noop_method_borrow => return, ++ sym::noop_method_clone => cx.emit_spanned_lint( ++ SUSPICIOUS_DOUBLE_REF_OP, ++ span, ++ SuspiciousDoubleRefCloneDiag { ty: expr_ty }, ++ ), ++ sym::noop_method_deref => cx.emit_spanned_lint( ++ SUSPICIOUS_DOUBLE_REF_OP, ++ span, ++ SuspiciousDoubleRefDerefDiag { ty: expr_ty }, ++ ), ++ _ => return, ++ } + } + } + } +diff --git a/tests/ui/lint/issue-112489.rs b/tests/ui/lint/issue-112489.rs +new file mode 100644 +index 000000000000..559edf0e4f23 +--- /dev/null ++++ b/tests/ui/lint/issue-112489.rs +@@ -0,0 +1,17 @@ ++// check-pass ++use std::borrow::Borrow; ++ ++struct S; ++ ++trait T: Sized { ++ fn foo(self) {} ++} ++ ++impl T for S {} ++impl T for &S {} ++ ++fn main() { ++ let s = S; ++ s.borrow().foo(); ++ s.foo(); ++} +-- +2.41.0 + diff --git a/rust.spec b/rust.spec index 1901dc8..e5c7547 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.71.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -118,6 +118,14 @@ Patch4: 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch # https://github.com/rust-lang/rust/pull/110906#issuecomment-1629832675 Patch5: 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch +# (c9s) rhbz2225471: relax the suspicious_double_ref_op lint +# https://github.com/rust-lang/rust/pull/112517 +Patch6: 0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch + +# Enable the profiler runtime for native hosts +# https://github.com/rust-lang/rust/pull/114069 +Patch7: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -331,6 +339,9 @@ find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' %{nil} %endif +# For profiler_builtins +BuildRequires: compiler-rt + # This component was removed as of Rust 1.69.0. # https://github.com/rust-lang/rust/pull/101841 Obsoletes: %{name}-analysis < 1.69.0~ @@ -589,6 +600,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P3 -p1 %patch -P4 -p1 %patch -P5 -p1 +%patch -P6 -p1 +%patch -P7 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -744,6 +757,10 @@ end} end} %endif +# The exact profiler path is version dependent, and uses LLVM-specific +# arch names in the filename, but this find is good enough for now... +PROFILER=$(find %{_libdir}/clang -type f -name 'libclang_rt.profile-*.a') + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -752,6 +769,7 @@ end} --set target.%{rust_triple}.cxx=%{__cxx} \ --set target.%{rust_triple}.ar=%{__ar} \ --set target.%{rust_triple}.ranlib=%{__ranlib} \ + ${PROFILER:+--set target.%{rust_triple}.profiler="$PROFILER"} \ %{?mingw_target_config} \ %{?wasm_target_config} \ --python=%{__python3} \ @@ -1063,6 +1081,10 @@ end} %changelog +* 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 From cd2d5f3610773b37fb263f2ae51a0507192ae7e0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 7 Aug 2023 14:57:21 -0700 Subject: [PATCH 119/222] Update to 1.71.1. Security fix for CVE-2023-38497 --- .gitignore | 1 + ...t-lint-docs-when-download-rustc-is-e.patch | 60 ------ ...tc-bash_complettion-src-etc-.-to-avo.patch | 31 --- ...112517-fee1-dead-contrib-sus-op-no-b.patch | 185 ------------------ ...ap-config-fix-version-comparison-bug.patch | 36 ++++ rust.spec | 32 ++- sources | 2 +- 7 files changed, 52 insertions(+), 295 deletions(-) delete mode 100644 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch delete mode 100644 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch delete mode 100644 0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch create mode 100644 0001-bootstrap-config-fix-version-comparison-bug.patch diff --git a/.gitignore b/.gitignore index d7f7e39..3ec0cf1 100644 --- a/.gitignore +++ b/.gitignore @@ -421,3 +421,4 @@ /rustc-1.70.0-src.tar.xz /wasi-libc-wasi-sdk-20.tar.gz /rustc-1.71.0-src.tar.xz +/rustc-1.71.1-src.tar.xz diff --git a/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch b/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch deleted file mode 100644 index 50518c6..0000000 --- a/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 9204a8359201271fd7b1c625d6f29ddd095a419d Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Mon, 10 Jul 2023 13:48:49 -0700 -Subject: [PATCH] Revert "Fix `x test lint-docs` when download-rustc is - enabled" - -This reverts commit abf9cbcb69e485b56776112bc587f6166e7ac5c9. ---- - src/tools/lint-docs/src/groups.rs | 3 +-- - src/tools/lint-docs/src/lib.rs | 9 --------- - 2 files changed, 1 insertion(+), 11 deletions(-) - -diff --git a/src/tools/lint-docs/src/groups.rs b/src/tools/lint-docs/src/groups.rs -index b11fb287cf4d..2a923a61b0a7 100644 ---- a/src/tools/lint-docs/src/groups.rs -+++ b/src/tools/lint-docs/src/groups.rs -@@ -39,12 +39,11 @@ pub(crate) fn generate_group_docs(&self, lints: &[Lint]) -> Result<(), Box Result> { - let mut result = BTreeMap::new(); - let mut cmd = Command::new(self.rustc_path); -- cmd.env_remove("LD_LIBRARY_PATH"); - cmd.arg("-Whelp"); - let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; - if !output.status.success() { - return Err(format!( -- "failed to collect lint info: failed to run {cmd:?}: {:?}\n--- stderr\n{}--- stdout\n{}\n", -+ "failed to collect lint info: {:?}\n--- stderr\n{}--- stdout\n{}\n", - output.status, - std::str::from_utf8(&output.stderr).unwrap(), - std::str::from_utf8(&output.stdout).unwrap(), -diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs -index fe29b9abda39..034c6aa0708e 100644 ---- a/src/tools/lint-docs/src/lib.rs -+++ b/src/tools/lint-docs/src/lib.rs -@@ -403,12 +403,6 @@ fn generate_lint_output( - fs::write(&tempfile, source) - .map_err(|e| format!("failed to write {}: {}", tempfile.display(), e))?; - let mut cmd = Command::new(self.rustc_path); -- // NOTE: bootstrap sets `LD_LIBRARY_PATH` for building lint-docs itself. -- // Unfortunately, lint-docs is a bootstrap tool while rustc is built from source, -- // and sometimes the paths conflict. In particular, when using `download-rustc`, -- // the LLVM versions can differ between `ci-llvm` and `ci-rustc-sysroot`. -- // Unset LD_LIBRARY_PATH here so it doesn't interfere with running the compiler. -- cmd.env_remove("LD_LIBRARY_PATH"); - if options.contains(&"edition2015") { - cmd.arg("--edition=2015"); - } else { -@@ -421,9 +415,6 @@ fn generate_lint_output( - } - cmd.arg("lint_example.rs"); - cmd.current_dir(tempdir.path()); -- if self.verbose { -- eprintln!("running: {cmd:?}"); -- } - let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; - let stderr = std::str::from_utf8(&output.stderr).unwrap(); - let msgs = stderr --- -2.41.0 - diff --git a/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch b/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch deleted file mode 100644 index a326207..0000000 --- a/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch +++ /dev/null @@ -1,31 +0,0 @@ -From cea2e61a03773ce28fd57b7338c4ae4d947650ca Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Mon, 10 Jul 2023 15:52:55 -0700 -Subject: [PATCH] Revert "fix: :bug: etc/bash_complettion -> src/etc/... to - avoid copy error" - -This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878. ---- - src/bootstrap/dist.rs | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index b49845386da1..9cead7adc8c3 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -1071,11 +1071,7 @@ fn run(self, builder: &Builder<'_>) -> Option { - - tarball.add_file(&cargo, "bin", 0o755); - tarball.add_file(etc.join("_cargo"), "share/zsh/site-functions", 0o644); -- tarball.add_renamed_file( -- etc.join("cargo.bashcomp.sh"), -- "src/etc/bash_completion.d", -- "cargo", -- ); -+ tarball.add_renamed_file(etc.join("cargo.bashcomp.sh"), "etc/bash_completion.d", "cargo"); - tarball.add_dir(etc.join("man"), "share/man/man1"); - tarball.add_legal_and_readme_to("share/doc/cargo"); - --- -2.41.0 - diff --git a/0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch b/0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch deleted file mode 100644 index 8f8c544..0000000 --- a/0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch +++ /dev/null @@ -1,185 +0,0 @@ -From abb7c31ab038f38e33057062ae8b66b4e3cd699c Mon Sep 17 00:00:00 2001 -From: Guillaume Gomez -Date: Thu, 15 Jun 2023 22:04:55 +0200 -Subject: [PATCH] Rollup merge of #112517 - fee1-dead-contrib:sus-op-no-borrow, - r=compiler-errors - -`suspicious_double_ref_op`: don't lint on `.borrow()` - -closes #112489 - -(cherry picked from commit db7d8374c1b6f1e2e8297f43e6a2cbffeff21882) ---- - compiler/rustc_lint/messages.ftl | 12 ++-- - compiler/rustc_lint/src/lints.rs | 12 ++-- - compiler/rustc_lint/src/noop_method_call.rs | 62 +++++++++++---------- - tests/ui/lint/issue-112489.rs | 17 ++++++ - 4 files changed, 64 insertions(+), 39 deletions(-) - create mode 100644 tests/ui/lint/issue-112489.rs - -diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl -index d34a3afcba53..0fa67cdb391f 100644 ---- a/compiler/rustc_lint/messages.ftl -+++ b/compiler/rustc_lint/messages.ftl -@@ -463,13 +463,11 @@ lint_requested_level = requested on the command line with `{$level} {$lint_name} - lint_supertrait_as_deref_target = `{$t}` implements `Deref` with supertrait `{$target_principal}` as target - .label = target type is set here - --lint_suspicious_double_ref_op = -- using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op -> -- *[should_not_happen] [{$op}] -- [deref] dereferencing -- [borrow] borrowing -- [clone] cloning -- } the inner type -+lint_suspicious_double_ref_clone = -+ using `.clone()` on a double reference, which returns `{$ty}` instead of cloning the inner type -+ -+lint_suspicious_double_ref_deref = -+ using `.deref()` on a double reference, which returns `{$ty}` instead of dereferencing the inner type - - lint_trivial_untranslatable_diag = diagnostic with static strings only - -diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs -index de1c2be28757..d96723a68eb6 100644 ---- a/compiler/rustc_lint/src/lints.rs -+++ b/compiler/rustc_lint/src/lints.rs -@@ -1188,11 +1188,15 @@ pub struct NoopMethodCallDiag<'a> { - } - - #[derive(LintDiagnostic)] --#[diag(lint_suspicious_double_ref_op)] --pub struct SuspiciousDoubleRefDiag<'a> { -- pub call: Symbol, -+#[diag(lint_suspicious_double_ref_deref)] -+pub struct SuspiciousDoubleRefDerefDiag<'a> { -+ pub ty: Ty<'a>, -+} -+ -+#[derive(LintDiagnostic)] -+#[diag(lint_suspicious_double_ref_clone)] -+pub struct SuspiciousDoubleRefCloneDiag<'a> { - pub ty: Ty<'a>, -- pub op: &'static str, - } - - // pass_by_value.rs -diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs -index d054966459d8..d56c35bb677a 100644 ---- a/compiler/rustc_lint/src/noop_method_call.rs -+++ b/compiler/rustc_lint/src/noop_method_call.rs -@@ -1,5 +1,7 @@ - use crate::context::LintContext; --use crate::lints::{NoopMethodCallDiag, SuspiciousDoubleRefDiag}; -+use crate::lints::{ -+ NoopMethodCallDiag, SuspiciousDoubleRefCloneDiag, SuspiciousDoubleRefDerefDiag, -+}; - use crate::LateContext; - use crate::LateLintPass; - use rustc_hir::def::DefKind; -@@ -76,22 +78,22 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - - // We only care about method calls corresponding to the `Clone`, `Deref` and `Borrow` - // traits and ignore any other method call. -- let did = match cx.typeck_results().type_dependent_def(expr.hir_id) { -- // Verify we are dealing with a method/associated function. -- Some((DefKind::AssocFn, did)) => match cx.tcx.trait_of_item(did) { -- // Check that we're dealing with a trait method for one of the traits we care about. -- Some(trait_id) -- if matches!( -- cx.tcx.get_diagnostic_name(trait_id), -- Some(sym::Borrow | sym::Clone | sym::Deref) -- ) => -- { -- did -- } -- _ => return, -- }, -- _ => return, -+ -+ let Some((DefKind::AssocFn, did)) = -+ cx.typeck_results().type_dependent_def(expr.hir_id) -+ else { -+ return; -+ }; -+ -+ let Some(trait_id) = cx.tcx.trait_of_item(did) else { return }; -+ -+ if !matches!( -+ cx.tcx.get_diagnostic_name(trait_id), -+ Some(sym::Borrow | sym::Clone | sym::Deref) -+ ) { -+ return; - }; -+ - let substs = cx - .tcx - .normalize_erasing_regions(cx.param_env, cx.typeck_results().node_substs(expr.hir_id)); -@@ -102,13 +104,6 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - // (Re)check that it implements the noop diagnostic. - let Some(name) = cx.tcx.get_diagnostic_name(i.def_id()) else { return }; - -- let op = match name { -- sym::noop_method_borrow => "borrow", -- sym::noop_method_clone => "clone", -- sym::noop_method_deref => "deref", -- _ => return, -- }; -- - let receiver_ty = cx.typeck_results().expr_ty(receiver); - let expr_ty = cx.typeck_results().expr_ty_adjusted(expr); - let arg_adjustments = cx.typeck_results().expr_adjustments(receiver); -@@ -129,11 +124,22 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - NoopMethodCallDiag { method: call.ident.name, receiver_ty, label: span }, - ); - } else { -- cx.emit_spanned_lint( -- SUSPICIOUS_DOUBLE_REF_OP, -- span, -- SuspiciousDoubleRefDiag { call: call.ident.name, ty: expr_ty, op }, -- ) -+ match name { -+ // If `type_of(x) == T` and `x.borrow()` is used to get `&T`, -+ // then that should be allowed -+ sym::noop_method_borrow => return, -+ sym::noop_method_clone => cx.emit_spanned_lint( -+ SUSPICIOUS_DOUBLE_REF_OP, -+ span, -+ SuspiciousDoubleRefCloneDiag { ty: expr_ty }, -+ ), -+ sym::noop_method_deref => cx.emit_spanned_lint( -+ SUSPICIOUS_DOUBLE_REF_OP, -+ span, -+ SuspiciousDoubleRefDerefDiag { ty: expr_ty }, -+ ), -+ _ => return, -+ } - } - } - } -diff --git a/tests/ui/lint/issue-112489.rs b/tests/ui/lint/issue-112489.rs -new file mode 100644 -index 000000000000..559edf0e4f23 ---- /dev/null -+++ b/tests/ui/lint/issue-112489.rs -@@ -0,0 +1,17 @@ -+// check-pass -+use std::borrow::Borrow; -+ -+struct S; -+ -+trait T: Sized { -+ fn foo(self) {} -+} -+ -+impl T for S {} -+impl T for &S {} -+ -+fn main() { -+ let s = S; -+ s.borrow().foo(); -+ s.foo(); -+} --- -2.41.0 - diff --git a/0001-bootstrap-config-fix-version-comparison-bug.patch b/0001-bootstrap-config-fix-version-comparison-bug.patch new file mode 100644 index 0000000..f0c4e55 --- /dev/null +++ b/0001-bootstrap-config-fix-version-comparison-bug.patch @@ -0,0 +1,36 @@ +From a627c8f54cab6880dc7d36c55092a94c6f750a6e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 3 Aug 2023 15:05:40 -0700 +Subject: [PATCH] bootstrap: config: fix version comparison bug + +Rust requires a previous version of Rust to build, such as the current version, or the +previous version. However, the version comparison logic did not take patch releases +into consideration when doing the version comparison for the current branch, e.g. +Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version +match, or the previous version. + +Adjust the version comparison logic to tolerate mismatches in the patch version. + +Signed-off-by: Ariadne Conill +(cherry picked from commit 31a81a08786826cc6e832bd0b49fb8b934e29648) +--- + src/bootstrap/config.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index e192cda9a9a7..2b5d0b94e968 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -1805,7 +1805,8 @@ pub fn check_build_rustc_version(&self) { + .unwrap(); + if !(source_version == rustc_version + || (source_version.major == rustc_version.major +- && source_version.minor == rustc_version.minor + 1)) ++ && (source_version.minor == rustc_version.minor ++ || source_version.minor == rustc_version.minor + 1))) + { + let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1); + eprintln!( +-- +2.41.0 + diff --git a/rust.spec b/rust.spec index e5c7547..9cc64eb 100644 --- a/rust.spec +++ b/rust.spec @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.71.0 -Release: 3%{?dist} +Version: 1.71.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -110,21 +110,12 @@ Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch # TODO: upstream this ability into the actual build configuration Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch -# Restore LD_LIBRARY_PATH when running lint-docs -# https://github.com/rust-lang/rust/pull/110521#issuecomment-1629705099 -Patch4: 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch - -# Restore the bash completion path -# https://github.com/rust-lang/rust/pull/110906#issuecomment-1629832675 -Patch5: 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch - -# (c9s) rhbz2225471: relax the suspicious_double_ref_op lint -# https://github.com/rust-lang/rust/pull/112517 -Patch6: 0001-Rollup-merge-of-112517-fee1-dead-contrib-sus-op-no-b.patch - # Enable the profiler runtime for native hosts # https://github.com/rust-lang/rust/pull/114069 -Patch7: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch +Patch4: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch + +# https://github.com/rust-lang/rust/pull/114440 +Patch5: 0001-bootstrap-config-fix-version-comparison-bug.patch ### RHEL-specific patches below ### @@ -600,8 +591,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P3 -p1 %patch -P4 -p1 %patch -P5 -p1 -%patch -P6 -p1 -%patch -P7 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -915,7 +904,10 @@ done # 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. -%{__python3} ./x.py test --no-fail-fast || : + +# Bootstrap is excluded because it's not something we ship, and a lot of its +# tests are geared toward the upstream CI environment. +%{__python3} ./x.py test --no-fail-fast --exclude src/bootstrap || : rm -rf "./build/%{rust_triple}/test/" %{__python3} ./x.py test --no-fail-fast cargo || : @@ -1081,6 +1073,10 @@ end} %changelog +* 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 diff --git a/sources b/sources index 622ee4f..8a2c328 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.71.0-src.tar.xz) = 2c93bafdd248563765a285add48ca77c1e4bad4d5431675ae6a5cdee4cfe7a41e6bcc880a489ca1069a307fd9a005f2d5f8e230dfc95b4a69152b4f9ca49ac44 +SHA512 (rustc-1.71.1-src.tar.xz) = fd0e5a16bdbeb539184513583089e55f681cb772810df357b6b1464853f7022ac02edab3dd155b2262ed0047e2a25dea3808dd078dcdfce9d399384465009db4 SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05 From 1265039e134082c3888ab24f895cac6aeb662ec8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 7 Aug 2023 16:39:57 -0700 Subject: [PATCH 120/222] Disable profiler_builtins for EPEL7 We don't have compiler-rt available there. --- rust.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust.spec b/rust.spec index 9cc64eb..5e96177 100644 --- a/rust.spec +++ b/rust.spec @@ -330,8 +330,10 @@ find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' %{nil} %endif +%if 0%{?fedora} || 0%{?rhel} >= 8 # For profiler_builtins BuildRequires: compiler-rt +%endif # This component was removed as of Rust 1.69.0. # https://github.com/rust-lang/rust/pull/101841 @@ -746,9 +748,11 @@ end} end} %endif +%if 0%{?fedora} || 0%{?rhel} >= 8 # The exact profiler path is version dependent, and uses LLVM-specific # arch names in the filename, but this find is good enough for now... PROFILER=$(find %{_libdir}/clang -type f -name 'libclang_rt.profile-*.a') +%endif %configure --disable-option-checking \ --libdir=%{common_libdir} \ From 0764fad18bb6ddf005d563d34f7545c3bf94acd1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Aug 2023 11:15:39 -0700 Subject: [PATCH 121/222] Update to 1.72.0. --- .gitignore | 2 + ...rnal-builds-of-the-compiler-rt-profi.patch | 28 +-- ...il-early-if-try_run-returns-an-error.patch | 201 ++++++++++++++++++ ...variables-override-some-default-CPUs.patch | 8 +- ...mlAnchors-when-the-config-is-missing.patch | 32 +++ ...ap-config-fix-version-comparison-bug.patch | 36 ---- rust.spec | 28 ++- ....patch => rustc-1.72.0-disable-http2.patch | 36 ++-- ...atch => rustc-1.72.0-disable-libssh2.patch | 18 +- sources | 4 +- 10 files changed, 301 insertions(+), 92 deletions(-) create mode 100644 0001-Don-t-fail-early-if-try_run-returns-an-error.patch create mode 100644 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch delete mode 100644 0001-bootstrap-config-fix-version-comparison-bug.patch rename rustc-1.71.0-disable-http2.patch => rustc-1.72.0-disable-http2.patch (77%) rename rustc-1.71.0-disable-libssh2.patch => rustc-1.72.0-disable-libssh2.patch (61%) diff --git a/.gitignore b/.gitignore index 3ec0cf1..2961d88 100644 --- a/.gitignore +++ b/.gitignore @@ -422,3 +422,5 @@ /wasi-libc-wasi-sdk-20.tar.gz /rustc-1.71.0-src.tar.xz /rustc-1.71.1-src.tar.xz +/rustc-1.72.0-src.tar.xz +/wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz diff --git a/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch b/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch index 2b1ecb5..01f7847 100644 --- a/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch +++ b/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch @@ -1,4 +1,4 @@ -From f2fd2d01f96b50b039402c9ab4278230687f7922 Mon Sep 17 00:00:00 2001 +From e276ae1cb702fa830be126cccce4bb9e8676f9fb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 25 Jul 2023 13:11:50 -0700 Subject: [PATCH] Allow using external builds of the compiler-rt profile lib @@ -15,10 +15,10 @@ reads that in a `LLVM_PROFILER_RT_LIB` environment variable. 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/config.example.toml b/config.example.toml -index d0eaa9fd7ffa..e0e991e679af 100644 +index 0c65b25fe138..249847013259 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -745,8 +745,10 @@ changelog-seen = 2 +@@ -752,8 +752,10 @@ changelog-seen = 2 # This option will override the same option under [build] section. #sanitizers = build.sanitizers (bool) @@ -49,10 +49,10 @@ index 1b1f11798d74..d14d0b82229a 100644 let cfg = &mut cc::Build::new(); diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 33addb90da37..1d8b3c6e5435 100644 +index 14c3ef79a78f..64bdcd1a3b97 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -305,6 +305,10 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car +@@ -336,6 +336,10 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car cargo.env("MACOSX_DEPLOYMENT_TARGET", target); } @@ -64,10 +64,10 @@ index 33addb90da37..1d8b3c6e5435 100644 // the `compiler-builtins` crate. These intrinsics live in LLVM's // `compiler-rt` repository, but our `src/llvm-project` submodule isn't diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index e192cda9a9a7..a4803db0a470 100644 +index fe932fd6bd30..45a743082415 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -467,7 +467,7 @@ pub struct Target { +@@ -533,7 +533,7 @@ pub struct Target { pub linker: Option, pub ndk: Option, pub sanitizers: Option, @@ -76,7 +76,7 @@ index e192cda9a9a7..a4803db0a470 100644 pub rpath: Option, pub crt_static: Option, pub musl_root: Option, -@@ -796,9 +796,9 @@ struct Dist { +@@ -862,9 +862,9 @@ struct Dist { } } @@ -88,7 +88,7 @@ index e192cda9a9a7..a4803db0a470 100644 String(String), Bool(bool), } -@@ -809,6 +809,12 @@ fn default() -> StringOrBool { +@@ -875,6 +875,12 @@ fn default() -> StringOrBool { } } @@ -98,10 +98,10 @@ index e192cda9a9a7..a4803db0a470 100644 + } +} + - define_config! { - /// TOML representation of how the Rust build is configured. - struct Rust { -@@ -880,7 +886,7 @@ struct TomlTarget { + #[derive(Clone, Debug, Deserialize, PartialEq, Eq)] + #[serde(untagged)] + pub enum RustOptimize { +@@ -991,7 +997,7 @@ struct TomlTarget { llvm_libunwind: Option = "llvm-libunwind", android_ndk: Option = "android-ndk", sanitizers: Option = "sanitizers", @@ -110,7 +110,7 @@ index e192cda9a9a7..a4803db0a470 100644 rpath: Option = "rpath", crt_static: Option = "crt-static", musl_root: Option = "musl-root", -@@ -1744,12 +1750,24 @@ pub fn any_sanitizers_enabled(&self) -> bool { +@@ -1864,12 +1870,24 @@ pub fn any_sanitizers_enabled(&self) -> bool { self.target_config.values().any(|t| t.sanitizers == Some(true)) || self.sanitizers } diff --git a/0001-Don-t-fail-early-if-try_run-returns-an-error.patch b/0001-Don-t-fail-early-if-try_run-returns-an-error.patch new file mode 100644 index 0000000..d77ddc7 --- /dev/null +++ b/0001-Don-t-fail-early-if-try_run-returns-an-error.patch @@ -0,0 +1,201 @@ +From 98336f8f6e701ea99275f32d6e2127a621041994 Mon Sep 17 00:00:00 2001 +From: Guillaume Gomez +Date: Tue, 11 Jul 2023 17:01:35 +0200 +Subject: [PATCH] Don't fail early if `try_run` returns an error + +--- + src/bootstrap/download.rs | 2 +- + src/bootstrap/run.rs | 11 +++++------ + src/bootstrap/test.rs | 36 ++++++++++++++++-------------------- + 3 files changed, 22 insertions(+), 27 deletions(-) + +diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs +index cb40521dda76..9478ac7d9cea 100644 +--- a/src/bootstrap/download.rs ++++ b/src/bootstrap/download.rs +@@ -188,7 +188,7 @@ fn fix_bin_or_dylib(&self, fname: &Path) { + patchelf.args(&["--set-interpreter", dynamic_linker.trim_end()]); + } + +- self.try_run(patchelf.arg(fname)).unwrap(); ++ let _ = self.try_run(patchelf.arg(fname)); + } + + fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str) { +diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs +index c97b75927371..70b917000433 100644 +--- a/src/bootstrap/run.rs ++++ b/src/bootstrap/run.rs +@@ -27,8 +27,7 @@ fn run(self, builder: &Builder<'_>) { + try_run( + builder, + &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").arg(&builder.src), +- ) +- .unwrap(); ++ ); + } + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { +@@ -40,17 +39,17 @@ fn make_run(run: RunConfig<'_>) { + } + } + +-fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { ++fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { + if !builder.fail_fast { +- if let Err(e) = builder.try_run(cmd) { ++ if builder.try_run(cmd).is_err() { + let mut failures = builder.delayed_failures.borrow_mut(); + failures.push(format!("{:?}", cmd)); +- return Err(e); ++ return false; + } + } else { + builder.run(cmd); + } +- Ok(()) ++ true + } + + #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index 0907291b54da..13576aa787b6 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -48,17 +48,17 @@ + // build for, so there is no entry for "aarch64-apple-darwin" here. + ]; + +-fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { ++fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { + if !builder.fail_fast { +- if let Err(e) = builder.try_run(cmd) { ++ if builder.try_run(cmd).is_err() { + let mut failures = builder.delayed_failures.borrow_mut(); + failures.push(format!("{:?}", cmd)); +- return Err(e); ++ return false; + } + } else { + builder.run(cmd); + } +- Ok(()) ++ true + } + + fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool { +@@ -187,8 +187,7 @@ fn run(self, builder: &Builder<'_>) { + try_run( + builder, + builder.tool_cmd(Tool::Linkchecker).arg(builder.out.join(host.triple).join("doc")), +- ) +- .unwrap(); ++ ); + } + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { +@@ -241,8 +240,7 @@ fn run(self, builder: &Builder<'_>) { + builder.default_doc(&[]); + builder.ensure(crate::doc::Rustc::new(builder.top_stage, self.target, builder)); + +- try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))) +- .unwrap(); ++ try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))); + } + } + +@@ -288,8 +286,7 @@ fn run(self, builder: &Builder<'_>) { + .args(builder.config.test_args()) + .env("RUSTC", builder.rustc(compiler)) + .env("RUSTDOC", builder.rustdoc(compiler)), +- ) +- .unwrap(); ++ ); + } + } + +@@ -855,7 +852,7 @@ fn run(self, builder: &Builder<'_>) { + util::lld_flag_no_threads(self.compiler.host.contains("windows")), + ); + } +- try_run(builder, &mut cmd).unwrap(); ++ try_run(builder, &mut cmd); + } + } + +@@ -1106,7 +1103,7 @@ fn run(self, builder: &Builder<'_>) { + } + + builder.info("tidy check"); +- try_run(builder, &mut cmd).unwrap(); ++ try_run(builder, &mut cmd); + + builder.ensure(ExpandYamlAnchors); + +@@ -1154,8 +1151,7 @@ fn run(self, builder: &Builder<'_>) { + try_run( + builder, + &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), +- ) +- .unwrap(); ++ ); + } + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { +@@ -1948,7 +1944,7 @@ fn run_ext_doc(self, builder: &Builder<'_>) { + compiler.host, + ); + let _time = util::timeit(&builder); +- let toolstate = if try_run(builder, &mut rustbook_cmd).is_ok() { ++ let toolstate = if try_run(builder, &mut rustbook_cmd) { + ToolState::TestPass + } else { + ToolState::TestFail +@@ -2106,7 +2102,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> + cmd.arg("--test-args").arg(test_args); + + if builder.config.verbose_tests { +- try_run(builder, &mut cmd).is_ok() ++ try_run(builder, &mut cmd) + } else { + try_run_quiet(builder, &mut cmd) + } +@@ -2134,7 +2130,7 @@ fn run(self, builder: &Builder<'_>) { + + let src = builder.src.join(relative_path); + let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); +- let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)).is_ok() { ++ let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) { + ToolState::TestPass + } else { + ToolState::TestFail +@@ -2684,7 +2680,7 @@ fn run(self, builder: &Builder<'_>) { + .current_dir(builder.src.join("src/bootstrap/")); + // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible. + // Use `python -m unittest` manually if you want to pass arguments. +- try_run(builder, &mut check_bootstrap).unwrap(); ++ try_run(builder, &mut check_bootstrap); + + let host = builder.config.build; + let compiler = builder.compiler(0, host); +@@ -2756,7 +2752,7 @@ fn run(self, builder: &Builder<'_>) { + } + + builder.info("platform support check"); +- try_run(builder, &mut cargo.into()).unwrap(); ++ try_run(builder, &mut cargo.into()); + } + } + +@@ -2836,7 +2832,7 @@ fn run(self, builder: &Builder<'_>) { + cmd.env("CARGO", &builder.initial_cargo); + cmd.env("RUSTC", &builder.initial_rustc); + cmd.env("TMP_DIR", &tmpdir); +- try_run(builder, &mut cmd).unwrap(); ++ try_run(builder, &mut cmd); + } + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { +-- +2.41.0 + diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch index c394f78..04a0c9c 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 6e2adb05860b72610291d3b0e8bd525c44cb0cc9 Mon Sep 17 00:00:00 2001 +From 87caaab3681b95fa633aac48b9794364e18c467d 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 @@ -36,7 +36,7 @@ index f2c722b9a89d..17a14d10b27e 100644 // 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 9af1049b8702..68f876dd18c3 100644 +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 @@ -2,7 +2,7 @@ @@ -45,9 +45,9 @@ index 9af1049b8702..68f876dd18c3 100644 let mut base = super::linux_gnu_base::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; base.max_atomic_width = Some(64); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); - base.stack_probes = StackProbeType::X86; -- -2.40.1 +2.41.0 diff --git a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch new file mode 100644 index 0000000..62b4c56 --- /dev/null +++ b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch @@ -0,0 +1,32 @@ +From ab9c5148956c2b7d177cc94533370d6a01a8d15f Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 22 Aug 2023 10:42:12 -0700 +Subject: [PATCH] Skip ExpandYamlAnchors when the config is missing + +The dist-src tarball does not include `.github/` at all, so we can't +check whether it needs to be regenerated. + +(cherry picked from commit 35187c7e6474d346eea3113c4ae34d26d6b18756) +--- + src/bootstrap/test.rs | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index eed7a584b603..d41850783c6d 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -1150,6 +1150,11 @@ impl Step for ExpandYamlAnchors { + /// appropriate configuration for all our CI providers. This step ensures the tool was called + /// by the user before committing CI changes. + fn run(self, builder: &Builder<'_>) { ++ // Note: `.github/` is not included in dist-src tarballs ++ if !builder.src.join(".github/workflows/ci.yml").exists() { ++ builder.info("Skipping YAML anchors check: GitHub Actions config not found"); ++ return; ++ } + builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); + try_run( + builder, +-- +2.41.0 + diff --git a/0001-bootstrap-config-fix-version-comparison-bug.patch b/0001-bootstrap-config-fix-version-comparison-bug.patch deleted file mode 100644 index f0c4e55..0000000 --- a/0001-bootstrap-config-fix-version-comparison-bug.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a627c8f54cab6880dc7d36c55092a94c6f750a6e Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 3 Aug 2023 15:05:40 -0700 -Subject: [PATCH] bootstrap: config: fix version comparison bug - -Rust requires a previous version of Rust to build, such as the current version, or the -previous version. However, the version comparison logic did not take patch releases -into consideration when doing the version comparison for the current branch, e.g. -Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version -match, or the previous version. - -Adjust the version comparison logic to tolerate mismatches in the patch version. - -Signed-off-by: Ariadne Conill -(cherry picked from commit 31a81a08786826cc6e832bd0b49fb8b934e29648) ---- - src/bootstrap/config.rs | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index e192cda9a9a7..2b5d0b94e968 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -1805,7 +1805,8 @@ pub fn check_build_rustc_version(&self) { - .unwrap(); - if !(source_version == rustc_version - || (source_version.major == rustc_version.major -- && source_version.minor == rustc_version.minor + 1)) -+ && (source_version.minor == rustc_version.minor -+ || source_version.minor == rustc_version.minor + 1))) - { - let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1); - eprintln!( --- -2.41.0 - diff --git a/rust.spec b/rust.spec index 5e96177..de93f40 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.70.0 -%global bootstrap_channel 1.70.0 -%global bootstrap_date 2023-06-01 +%global bootstrap_version 1.71.0 +%global bootstrap_channel 1.71.0 +%global bootstrap_date 2023-07-13 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,7 +35,8 @@ # 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 wasi-sdk-20 +%global wasi_libc_ref 7018e24d8fe248596819d2e884761676f3542a04 %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} @@ -83,7 +84,7 @@ %endif Name: rust -Version: 1.71.1 +Version: 1.72.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -114,8 +115,13 @@ Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch # https://github.com/rust-lang/rust/pull/114069 Patch4: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch -# https://github.com/rust-lang/rust/pull/114440 -Patch5: 0001-bootstrap-config-fix-version-comparison-bug.patch +# Fix --no-fail-fast +# https://github.com/rust-lang/rust/pull/113214 +Patch5: 0001-Don-t-fail-early-if-try_run-returns-an-error.patch + +# The dist-src tarball doesn't include .github/ +# https://github.com/rust-lang/rust/pull/115109 +Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch ### RHEL-specific patches below ### @@ -123,11 +129,11 @@ Patch5: 0001-bootstrap-config-fix-version-comparison-bug.patch Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.71.0-disable-libssh2.patch +Patch100: rustc-1.72.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.71.0-disable-http2.patch +Patch101: rustc-1.72.0-disable-http2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -593,6 +599,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P3 -p1 %patch -P4 -p1 %patch -P5 -p1 +%patch -P6 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -1077,6 +1084,9 @@ end} %changelog +* 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 diff --git a/rustc-1.71.0-disable-http2.patch b/rustc-1.72.0-disable-http2.patch similarity index 77% rename from rustc-1.71.0-disable-http2.patch rename to rustc-1.72.0-disable-http2.patch index 34fdab3..db2213e 100644 --- a/rustc-1.71.0-disable-http2.patch +++ b/rustc-1.72.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-07-07 17:30:04.817452621 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:30:27.777988139 -0700 -@@ -734,7 +734,6 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-08-21 11:00:15.341608892 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-08-21 11:00:46.074984901 -0700 +@@ -743,7 +743,6 @@ dependencies = [ "cc", "libc", @@ -8,8 +8,8 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1954,16 +1953,6 @@ - checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +@@ -2011,16 +2010,6 @@ + checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] -name = "libnghttp2-sys" @@ -23,10 +23,10 @@ - -[[package]] name = "libz-sys" - version = "1.1.8" + version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-07-07 17:30:04.819452581 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:30:24.133061874 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-08-21 11:00:15.341608892 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-08-21 11:00:15.342608871 -0700 @@ -118,7 +118,7 @@ cargo-util.workspace = true clap = { workspace = true, features = ["wrap_help"] } @@ -36,9 +36,9 @@ curl-sys.workspace = true env_logger.workspace = true filetime.workspace = true ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-06-24 10:27:37.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-07-07 17:30:04.819452581 -0700 -@@ -407,16 +407,9 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-08-17 20:58:39.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-08-21 11:00:15.343608851 -0700 +@@ -408,16 +408,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,9 +58,9 @@ Ok(PackageSet { packages: package_ids ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-06-24 10:27:37.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-07-07 17:30:04.819452581 -0700 -@@ -229,16 +229,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-08-17 20:58:39.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-08-21 11:00:15.343608851 -0700 +@@ -250,16 +250,8 @@ } self.fetch_started = true; @@ -79,14 +79,14 @@ if !self.quiet { self.config ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-06-24 10:27:37.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-07-07 17:30:04.819452581 -0700 -@@ -26,7 +26,7 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-08-21 11:00:15.343608851 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-08-21 11:02:01.969443986 -0700 +@@ -27,7 +27,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; - if cfg!(target_os = "macos") { + if cfg!(any(target_os = "linux", target_os = "macos")) { if let Err(e) = result { - warn!("ignoring libcurl {} error: {}", $msg, e); + ::log::warn!("ignoring libcurl {} error: {}", $msg, e); } diff --git a/rustc-1.71.0-disable-libssh2.patch b/rustc-1.72.0-disable-libssh2.patch similarity index 61% rename from rustc-1.71.0-disable-libssh2.patch rename to rustc-1.72.0-disable-libssh2.patch index ba61454..1198954 100644 --- a/rustc-1.71.0-disable-libssh2.patch +++ b/rustc-1.72.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-06-24 10:27:37.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:12:23.406932870 -0700 -@@ -1942,7 +1942,6 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-08-17 20:58:39.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-08-21 10:52:50.520622927 -0700 +@@ -1999,7 +1999,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1965,20 +1964,6 @@ +@@ -2022,20 +2021,6 @@ ] [[package]] @@ -27,10 +27,10 @@ - -[[package]] name = "libz-sys" - version = "1.1.8" + version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-06-24 10:27:37.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:12:00.688392750 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-08-21 10:49:34.852578202 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-08-21 10:52:11.858404449 -0700 @@ -31,7 +31,7 @@ filetime = "0.2.9" flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] } @@ -38,5 +38,5 @@ -git2 = "0.17.1" +git2 = { version = "0.17.1", default-features = false, features = ["https"] } git2-curl = "0.18.0" - gix = { version = "0.44.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } - gix-features-for-configuration-only = { version = "0.29.0", package = "gix-features", features = [ "parallel" ] } + gix = { version = "0.45.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } + gix-features-for-configuration-only = { version = "0.30.0", package = "gix-features", features = [ "parallel" ] } diff --git a/sources b/sources index 8a2c328..f37ba8d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.71.1-src.tar.xz) = fd0e5a16bdbeb539184513583089e55f681cb772810df357b6b1464853f7022ac02edab3dd155b2262ed0047e2a25dea3808dd078dcdfce9d399384465009db4 -SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05 +SHA512 (rustc-1.72.0-src.tar.xz) = aed27c1babfec7f9b0815bc395302cff4f8e8ed83d8d3bde202f6c86fba4aec14ad2d3e99f4e22618c6727d876262511bfbcd83513731ea4b9c664462c97945b +SHA512 (wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz) = a2a4a952c3d9795792be8f055387057befaebe0675ad2464a478cb1f2c45d65f233e0ee4c4dbcaa137bf9649882ff6c6acf2f2bec07b2ad89f63ff980d972e6b From b1db162b38d8b2e8d2aacb242bc3d3bd5b089768 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 19 Sep 2023 10:09:40 -0700 Subject: [PATCH 122/222] Update to 1.72.1. Migrated to SPDX license --- .gitignore | 1 + rust.spec | 12 ++++++++++-- sources | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2961d88..59e2e5a 100644 --- a/.gitignore +++ b/.gitignore @@ -424,3 +424,4 @@ /rustc-1.71.1-src.tar.xz /rustc-1.72.0-src.tar.xz /wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz +/rustc-1.72.1-src.tar.xz diff --git a/rust.spec b/rust.spec index de93f40..b8c167b 100644 --- a/rust.spec +++ b/rust.spec @@ -84,10 +84,10 @@ %endif Name: rust -Version: 1.72.0 +Version: 1.72.1 Release: 1%{?dist} Summary: The Rust Programming Language -License: (ASL 2.0 or MIT) and (BSD and MIT) +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) URL: https://www.rust-lang.org ExclusiveArch: %{rust_arches} @@ -236,6 +236,10 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm14 %endif +# not ready for llvm-17 yet... +%if 0%{?fedora} >= 39 +%global llvm llvm16 +%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -1084,6 +1088,10 @@ end} %changelog +* 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. diff --git a/sources b/sources index f37ba8d..efdcb58 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.72.0-src.tar.xz) = aed27c1babfec7f9b0815bc395302cff4f8e8ed83d8d3bde202f6c86fba4aec14ad2d3e99f4e22618c6727d876262511bfbcd83513731ea4b9c664462c97945b +SHA512 (rustc-1.72.1-src.tar.xz) = 08232b5bf36f82a995d67f3d03d5e35b7d8914d31fb4491d4c37b72a830bc438e9d18d9e138d398b1b6ae4aa09f7f8e1e9b68da6273ab74bdae4c6123586a21b SHA512 (wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz) = a2a4a952c3d9795792be8f055387057befaebe0675ad2464a478cb1f2c45d65f233e0ee4c4dbcaa137bf9649882ff6c6acf2f2bec07b2ad89f63ff980d972e6b From da52e5d316125c9dc65d0ab98ed01c84eed4de78 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 20 Sep 2023 14:17:19 -0400 Subject: [PATCH 123/222] Fix ELN build ELN (RHEL 10) tracks rawhide and currently also has llvm-17. --- rust.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index b8c167b..f748f4d 100644 --- a/rust.spec +++ b/rust.spec @@ -85,7 +85,7 @@ Name: rust Version: 1.72.1 -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) @@ -237,7 +237,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm14 %endif # not ready for llvm-17 yet... -%if 0%{?fedora} >= 39 +%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10 %global llvm llvm16 %endif %if %defined llvm @@ -1088,6 +1088,9 @@ end} %changelog +* Mon Sep 25 2023 Josh Stone - 1.72.1-2 +- Fix LLVM dependency for ELN + * Tue Sep 19 2023 Josh Stone - 1.72.1-1 - Update to 1.72.1. - Migrated to SPDX license From 58662257c8186dc4b5f1a8d6d99946e88997e9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 31 Aug 2023 16:08:44 +0100 Subject: [PATCH 124/222] add 'x86_64-unknown-none' build target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The coconut-svsm project which provides a low level firmware for AMD SEV-SNP virtual machines uses 'x86_64-unknown-none' as its build target and has recently removed the requirement to use rust nightly[1]. Thus adding 'x86_64-unknown-none' as a build target will enable us to build coconut-svsm in Fedora using the standard Rust toolchain packages. [1] https://github.com/coconut-svsm/svsm/pull/81 Signed-off-by: Daniel P. Berrangé --- rust.spec | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index f748f4d..74fad24 100644 --- a/rust.spec +++ b/rust.spec @@ -29,6 +29,9 @@ %if 0%{?fedora} || 0%{?rhel} >= 8 %global wasm_targets wasm32-unknown-unknown wasm32-wasi %endif +%if 0%{?fedora} || 0%{?rhel} >= 10 +%global extra_targets x86_64-unknown-none +%endif %endif # We need CRT files for *-wasi targets, at least as new as the commit in @@ -428,6 +431,33 @@ end} %endif +%if %defined extra_targets +%{lua: do + for triple in string.gmatch(rpm.expand("%{extra_targets}"), "%S+") do + local subs = { + triple = triple, + name = rpm.expand("%{name}"), + verrel = rpm.expand("%{version}-%{release}"), + } + local s = string.gsub([[ + +%package std-static-{{triple}} +Summary: Standard library for Rust {{triple}} +BuildArch: noarch +Requires: {{name}} = {{verrel}} +Requires: lld >= 8.0 + +%description std-static-{{triple}} +This package includes the standard libraries for building applications +written in Rust for the embedded target {{triple}}. + +]], "{{(%w+)}}", subs) + print(s) + end +end} +%endif + + %package debugger-common Summary: Common debugger pretty printers for Rust BuildArch: noarch @@ -801,7 +831,7 @@ PROFILER=$(find %{_libdir}/clang -type f -name 'libclang_rt.profile-*.a') %{__python3} ./x.py build -j "$ncpus" %{__python3} ./x.py doc -for triple in %{?mingw_targets} %{?wasm_targets}; do +for triple in %{?mingw_targets} %{?wasm_targets} %{?extra_targets}; do %{__python3} ./x.py build --target=$triple std done @@ -813,7 +843,7 @@ done DESTDIR=%{buildroot} %{__python3} ./x.py install -for triple in %{?mingw_targets} %{?wasm_targets}; do +for triple in %{?mingw_targets} %{?wasm_targets} %{?extra_targets}; do DESTDIR=%{buildroot} %{__python3} ./x.py install --target=$triple std done @@ -1013,6 +1043,27 @@ end} end} %endif +%if %defined extra_targets +%{lua: do + for triple in string.gmatch(rpm.expand("%{extra_targets}"), "%S+") do + local subs = { + triple = triple, + rustlibdir = rpm.expand("%{rustlibdir}"), + } + local s = string.gsub([[ + +%files std-static-{{triple}} +%dir {{rustlibdir}} +%dir {{rustlibdir}}/{{triple}} +%dir {{rustlibdir}}/{{triple}}/lib +{{rustlibdir}}/{{triple}}/lib/*.rlib + +]], "{{(%w+)}}", subs) + print(s) + end +end} +%endif + %files debugger-common %dir %{rustlibdir} @@ -1090,6 +1141,7 @@ end} %changelog * Mon Sep 25 2023 Josh Stone - 1.72.1-2 - Fix LLVM dependency for ELN +- Add build target for x86_64-unknown-none * Tue Sep 19 2023 Josh Stone - 1.72.1-1 - Update to 1.72.1. From 9f66968c1064c19606b144b461a32a34fbc992c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 31 Aug 2023 16:08:44 +0100 Subject: [PATCH 125/222] add 'x86_64-unknown-uefi' build target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This target will facilitate the use of Rust in the UEFI environment Signed-off-by: Daniel P. Berrangé --- rust.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 74fad24..5b3a464 100644 --- a/rust.spec +++ b/rust.spec @@ -30,7 +30,7 @@ %global wasm_targets wasm32-unknown-unknown wasm32-wasi %endif %if 0%{?fedora} || 0%{?rhel} >= 10 -%global extra_targets x86_64-unknown-none +%global extra_targets x86_64-unknown-none x86_64-unknown-uefi %endif %endif @@ -1142,6 +1142,7 @@ end} * 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. From b2411fce725d39b473c9464ed1ec7375e35f6bf8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 25 Sep 2023 13:45:57 -0700 Subject: [PATCH 126/222] Drop noarch from embedded x86_64 targets and use lld --- ...-Use-lld-provided-by-system-for-wasm.patch | 26 ------------- 0001-Use-lld-provided-by-system.patch | 39 +++++++++++++++++++ rust.spec | 5 +-- 3 files changed, 41 insertions(+), 29 deletions(-) delete mode 100644 0001-Use-lld-provided-by-system-for-wasm.patch create mode 100644 0001-Use-lld-provided-by-system.patch diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch deleted file mode 100644 index 5fcc245..0000000 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 37cb177eb53145103ae72b67562884782dde01c3 Mon Sep 17 00:00:00 2001 -From: Ivan Mironov -Date: Sun, 8 Dec 2019 17:23:08 +0500 -Subject: [PATCH] Use lld provided by system for wasm - ---- - compiler/rustc_target/src/spec/wasm_base.rs | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index 528a84a8b37c..353d742161d1 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 { - // arguments just yet - limit_rdylib_exports: false, - -- // we use the LLD shipped with the Rust toolchain by default -- linker: Some("rust-lld".into()), -+ linker: Some("lld".into()), - linker_flavor: LinkerFlavor::WasmLld(Cc::No), - - pre_link_args, --- -2.38.1 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch new file mode 100644 index 0000000..2b22d48 --- /dev/null +++ b/0001-Use-lld-provided-by-system.patch @@ -0,0 +1,39 @@ +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 { + // arguments just yet + limit_rdylib_exports: false, + +- // we use the LLD shipped with the Rust toolchain by default +- linker: Some("rust-lld".into()), ++ linker: Some("lld".into()), + 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 +@@ -17,7 +17,7 @@ pub 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()), + 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 67664a74710a..53153cd120a3 100644 +--- a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs ++++ b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs +@@ -12,6 +12,7 @@ pub fn target() -> Target { + base.cpu = "x86-64".into(); + base.plt_by_default = false; + base.max_atomic_width = Some(64); ++ 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 diff --git a/rust.spec b/rust.spec index 5b3a464..924d954 100644 --- a/rust.spec +++ b/rust.spec @@ -104,8 +104,8 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz Source1: %{wasi_libc_source} # Sources for bootstrap_arches are inserted by lua below -# By default, rust tries to use "rust-lld" as a linker for WebAssembly. -Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch +# By default, rust tries to use "rust-lld" as a linker for some targets. +Patch1: 0001-Use-lld-provided-by-system.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch @@ -443,7 +443,6 @@ end} %package std-static-{{triple}} Summary: Standard library for Rust {{triple}} -BuildArch: noarch Requires: {{name}} = {{verrel}} Requires: lld >= 8.0 From 68e85e44284cecdbb00b5042b06a9d627d0d022b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 26 Sep 2023 17:08:10 -0700 Subject: [PATCH 127/222] Simplify the target definitions --- rust.spec | 282 ++++++++++++++++++++---------------------------------- 1 file changed, 103 insertions(+), 179 deletions(-) diff --git a/rust.spec b/rust.spec index 924d954..25a37a7 100644 --- a/rust.spec +++ b/rust.spec @@ -33,6 +33,10 @@ %global extra_targets x86_64-unknown-none x86_64-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) +} # 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 @@ -154,14 +158,12 @@ Patch101: rustc-1.72.0-disable-http2.patch return arch.."-unknown-linux-"..abi end} -# Get the environment form of a Rust triple -%{lua: function rust_triple_env(triple) - local sub = string.gsub(triple, "-", "_") - return string.upper(sub) -end} - %global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} -%global rust_triple_env %{lua: print(rust_triple_env(rpm.expand("%{rust_triple}")))} + +# Get the environment form of the Rust triple +%global rust_triple_env %{lua: + print(string.upper(string.gsub(rpm.expand("%{rust_triple}"), "-", "_"))) +} %if %defined bootstrap_arches # For each bootstrap arch, add an additional binary Source. @@ -369,91 +371,63 @@ Requires: glibc-devel%{?_isa} >= 2.17 This package includes the standard libraries for building applications written in Rust. -%if %defined mingw_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do - local subs = { - triple = triple, - name = rpm.expand("%{name}"), - verrel = rpm.expand("%{version}-%{release}"), - mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", - } - local s = string.gsub([[ +%global target_package() \ +%package std-static-%1 \ +Summary: Standard library for Rust %1 \ +Requires: %{name} = %{version}-%{release} -%package std-static-{{triple}} -Summary: Standard library for Rust {{triple}} +%global target_description() \ +%description std-static-%1 \ +This package includes the standard libraries for building applications \ +written in Rust for the %2 target %1. + +%if %target_enabled i686-pc-windows-gnu +%target_package i686-pc-windows-gnu +Requires: mingw32-crt +Requires: mingw32-gcc +Requires: mingw32-winpthreads-static +Provides: mingw32-rust = %{version}-%{release} +Provides: mingw32-rustc = %{version}-%{release} BuildArch: noarch -Provides: {{mingw}}-rust = {{verrel}} -Provides: {{mingw}}-rustc = {{verrel}} -Requires: {{mingw}}-crt -Requires: {{mingw}}-gcc -Requires: {{mingw}}-winpthreads-static -Requires: {{name}} = {{verrel}} - -%description std-static-{{triple}} -This package includes the standard libraries for building applications -written in Rust for the MinGW target {{triple}}. - -]], "{{(%w+)}}", subs) - print(s) - end -end} +%target_description i686-pc-windows-gnu MinGW %endif -%if %defined wasm_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do - local subs = { - triple = triple, - name = rpm.expand("%{name}"), - verrel = rpm.expand("%{version}-%{release}"), - wasi = string.find(triple, "-wasi") and 1 or 0, - } - local s = string.gsub([[ - -%package std-static-{{triple}} -Summary: Standard library for Rust {{triple}} +%if %target_enabled x86_64-pc-windows-gnu +%target_package x86_64-pc-windows-gnu +Requires: mingw64-crt +Requires: mingw64-gcc +Requires: mingw64-winpthreads-static +Provides: mingw64-rust = %{version}-%{release} +Provides: mingw64-rustc = %{version}-%{release} BuildArch: noarch -Requires: {{name}} = {{verrel}} +%target_description x86_64-pc-windows-gnu MinGW +%endif + +%if %target_enabled wasm32-unknown-unknown +%target_package wasm32-unknown-unknown +Requires: lld >= 8.0 +BuildArch: noarch +%target_description wasm32-unknown-unknown WebAssembly +%endif + +%if %target_enabled wasm32-wasi +%target_package wasm32-wasi Requires: lld >= 8.0 -%if {{wasi}} Provides: bundled(wasi-libc) +BuildArch: noarch +%target_description wasm32-wasi WebAssembly %endif -%description std-static-{{triple}} -This package includes the standard libraries for building applications -written in Rust for the WebAssembly target {{triple}}. - -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled x86_64-unknown-none +%target_package x86_64-unknown-none +Requires: lld +%target_description x86_64-unknown-none embedded %endif - -%if %defined extra_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{extra_targets}"), "%S+") do - local subs = { - triple = triple, - name = rpm.expand("%{name}"), - verrel = rpm.expand("%{version}-%{release}"), - } - local s = string.gsub([[ - -%package std-static-{{triple}} -Summary: Standard library for Rust {{triple}} -Requires: {{name}} = {{verrel}} -Requires: lld >= 8.0 - -%description std-static-{{triple}} -This package includes the standard libraries for building applications -written in Rust for the embedded target {{triple}}. - -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled x86_64-unknown-uefi +%target_package x86_64-unknown-uefi +Requires: lld +%target_description x86_64-unknown-uefi embedded %endif @@ -705,7 +679,7 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %endif # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros -%{lua: function rustc_target_cpus() +%global rustc_target_cpus %{lua: do local fedora = tonumber(rpm.expand("0%{?fedora}")) local rhel = tonumber(rpm.expand("0%{?rhel}")) local env = @@ -714,11 +688,11 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' .. " RUSTC_TARGET_CPU_S390X=" .. ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or (fedora >= 26) and "zEC12" or (rhel == 7) and "z196" or "z10") - return env + print(env) end} # Set up shared environment variables for build/install/check -%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{lua: print(rustc_target_cpus())} +%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{rustc_target_cpus} %if %defined cmake_path %global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" %endif @@ -754,38 +728,21 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then fi %if %defined mingw_targets -%{lua: do - local cfg = "" - for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do - local subs = { - triple = triple, - mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", - } - local s = string.gsub([[ - --set target.{{triple}}.linker=%{{{mingw}}_cc} - --set target.{{triple}}.cc=%{{{mingw}}_cc} - --set target.{{triple}}.ar=%{{{mingw}}_ar} - --set target.{{triple}}.ranlib=%{{{mingw}}_ranlib} - ]], "{{(%w+)}}", subs) - cfg = cfg .. " " .. s - end - cfg = string.gsub(cfg, "%s+", " ") - rpm.define("mingw_target_config " .. cfg) -end} +%define mingw_target_config %{shrink: + --set target.i686-pc-windows-gnu.linker=%{mingw32_cc} + --set target.i686-pc-windows-gnu.cc=%{mingw32_cc} + --set target.i686-pc-windows-gnu.ar=%{mingw32_ar} + --set target.i686-pc-windows-gnu.ranlib=%{mingw32_ranlib} + --set target.x86_64-pc-windows-gnu.linker=%{mingw64_cc} + --set target.x86_64-pc-windows-gnu.cc=%{mingw64_cc} + --set target.x86_64-pc-windows-gnu.ar=%{mingw64_ar} + --set target.x86_64-pc-windows-gnu.ranlib=%{mingw64_ranlib} +} %endif %if %defined wasm_targets %make_build --quiet -C %{wasi_libc_dir} CC=clang AR=llvm-ar NM=llvm-nm -%{lua: do - local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot" - local cfg = "" - for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do - if string.find(triple, "-wasi") then - cfg = cfg .. " --set target." .. triple .. ".wasi-root=" .. wasi_root - end - end - rpm.define("wasm_target_config "..cfg) -end} +%define wasm_target_config --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot %endif %if 0%{?fedora} || 0%{?rhel} >= 8 @@ -830,7 +787,7 @@ PROFILER=$(find %{_libdir}/clang -type f -name 'libclang_rt.profile-*.a') %{__python3} ./x.py build -j "$ncpus" %{__python3} ./x.py doc -for triple in %{?mingw_targets} %{?wasm_targets} %{?extra_targets}; do +for triple in %{?all_targets} ; do %{__python3} ./x.py build --target=$triple std done @@ -842,7 +799,7 @@ done DESTDIR=%{buildroot} %{__python3} ./x.py install -for triple in %{?mingw_targets} %{?wasm_targets} %{?extra_targets}; do +for triple in %{?all_targets} ; do DESTDIR=%{buildroot} %{__python3} ./x.py install --target=$triple std done @@ -939,7 +896,7 @@ env RUSTC=%{buildroot}%{_bindir}/rustc \ LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml -# Try a build sanity-check for other targets +# Try a build sanity-check for other std-enabled targets for triple in %{?mingw_targets} %{?wasm_targets}; do env RUSTC=%{buildroot}%{_bindir}/rustc \ LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ @@ -988,79 +945,46 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib +%global target_files() \ +%files std-static-%1 \ +%dir %{rustlibdir} \ +%dir %{rustlibdir}/%1 \ +%dir %{rustlibdir}/%1/lib \ +%{rustlibdir}/%1/lib/*.rlib -%if %defined mingw_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do - local subs = { - triple = triple, - rustlibdir = rpm.expand("%{rustlibdir}"), - } - local s = string.gsub([[ - -%files std-static-{{triple}} -%dir {{rustlibdir}} -%dir {{rustlibdir}}/{{triple}} -%dir {{rustlibdir}}/{{triple}}/lib -{{rustlibdir}}/{{triple}}/lib/*.rlib -{{rustlibdir}}/{{triple}}/lib/rs*.o -%exclude {{rustlibdir}}/{{triple}}/lib/*.dll -%exclude {{rustlibdir}}/{{triple}}/lib/*.dll.a -%exclude {{rustlibdir}}/{{triple}}/lib/self-contained - -]], "{{(%w+)}}", subs) - print(s) - end -end} +%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 +%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/self-contained %endif - -%if %defined wasm_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do - local subs = { - triple = triple, - rustlibdir = rpm.expand("%{rustlibdir}"), - wasi = string.find(triple, "-wasi") and 1 or 0, - } - local s = string.gsub([[ - -%files std-static-{{triple}} -%dir {{rustlibdir}} -%dir {{rustlibdir}}/{{triple}} -%dir {{rustlibdir}}/{{triple}}/lib -{{rustlibdir}}/{{triple}}/lib/*.rlib -%if {{wasi}} -%dir {{rustlibdir}}/{{triple}}/lib/self-contained -{{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o -{{rustlibdir}}/{{triple}}/lib/self-contained/libc.a +%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 +%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/self-contained %endif -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled wasm32-unknown-unknown +%target_files wasm32-unknown-unknown %endif -%if %defined extra_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{extra_targets}"), "%S+") do - local subs = { - triple = triple, - rustlibdir = rpm.expand("%{rustlibdir}"), - } - local s = string.gsub([[ +%if %target_enabled wasm32-wasi +%target_files wasm32-wasi +%dir %{rustlibdir}/wasm32-wasi/lib/self-contained +%{rustlibdir}/wasm32-wasi/lib/self-contained/crt*.o +%{rustlibdir}/wasm32-wasi/lib/self-contained/libc.a +%endif -%files std-static-{{triple}} -%dir {{rustlibdir}} -%dir {{rustlibdir}}/{{triple}} -%dir {{rustlibdir}}/{{triple}}/lib -{{rustlibdir}}/{{triple}}/lib/*.rlib +%if %target_enabled x86_64-unknown-none +%target_files x86_64-unknown-none +%endif -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled x86_64-unknown-uefi +%target_files x86_64-unknown-uefi %endif From 938db5293e8142bd1a38e5f0dcb18c9ae174c77c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 27 Sep 2023 11:17:12 -0700 Subject: [PATCH 128/222] Fix the profiler runtime with compiler-rt-17 --- rust.spec | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/rust.spec b/rust.spec index 25a37a7..1a49ee4 100644 --- a/rust.spec +++ b/rust.spec @@ -92,7 +92,7 @@ Name: rust Version: 1.72.1 -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) @@ -746,9 +746,14 @@ fi %endif %if 0%{?fedora} || 0%{?rhel} >= 8 -# The exact profiler path is version dependent, and uses LLVM-specific -# arch names in the filename, but this find is good enough for now... -PROFILER=$(find %{_libdir}/clang -type f -name 'libclang_rt.profile-*.a') +# Find the compiler-rt library for the Rust profiler_builtins crate. +%if 0%{?clang_major_version} >= 17 +PROFILER='%{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a' +%else +# The exact profiler path is version dependent.. +PROFILER=$(echo %{_libdir}/clang/*/lib/libclang_rt.profile-%{_arch}.a) +%endif +test -r "$PROFILER" %endif %configure --disable-option-checking \ @@ -892,16 +897,23 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* # Sanity-check the installed binaries, debuginfo-stripped and all. %{buildroot}%{_bindir}/cargo new build/hello-world -env RUSTC=%{buildroot}%{_bindir}/rustc \ - LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ - %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml +( + cd build/hello-world + export RUSTC=%{buildroot}%{_bindir}/rustc \ + LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" + %{buildroot}%{_bindir}/cargo run --verbose -# Try a build sanity-check for other std-enabled targets -for triple in %{?mingw_targets} %{?wasm_targets}; do - env RUSTC=%{buildroot}%{_bindir}/rustc \ - LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ - %{buildroot}%{_bindir}/cargo build --manifest-path build/hello-world/Cargo.toml --target=$triple -done +%if 0%{?fedora} || 0%{?rhel} >= 8 + # Sanity-check that code-coverage builds and runs + env RUSTFLAGS="-Cinstrument-coverage" %{buildroot}%{_bindir}/cargo run --verbose + test -r default_*.profraw +%endif + + # Try a build sanity-check for other std-enabled targets + for triple in %{?mingw_targets} %{?wasm_targets}; do + %{buildroot}%{_bindir}/cargo build --verbose --target=$triple + done +) # 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. @@ -1062,6 +1074,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* Wed Sep 27 2023 Josh Stone - 1.72.1-3 +- Fix the profiler runtime with compiler-rt-17 + * Mon Sep 25 2023 Josh Stone - 1.72.1-2 - Fix LLVM dependency for ELN - Add build target for x86_64-unknown-none From fbe7f8404be27dd136884bdccedbc86771ac714c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 29 Sep 2023 14:56:44 -0700 Subject: [PATCH 129/222] Switch to unbundled wasi-libc on Fedora Also, use emmalloc instead of CC0 dlmalloc when bundling wasi-libc. --- .gitignore | 1 + ...llow-disabling-target-self-contained.patch | 102 ++++++++++++++++++ ...-round-up-the-size-for-aligned_alloc.patch | 33 ++++++ ...xternal-library-path-for-wasm32-wasi.patch | 78 ++++++++++++++ rust.spec | 58 ++++++++-- sources | 2 +- 6 files changed, 264 insertions(+), 10 deletions(-) create mode 100644 0001-bootstrap-allow-disabling-target-self-contained.patch create mode 100644 0001-wasi-round-up-the-size-for-aligned_alloc.patch create mode 100644 0002-set-an-external-library-path-for-wasm32-wasi.patch diff --git a/.gitignore b/.gitignore index 59e2e5a..3e84863 100644 --- a/.gitignore +++ b/.gitignore @@ -425,3 +425,4 @@ /rustc-1.72.0-src.tar.xz /wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz /rustc-1.72.1-src.tar.xz +/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch new file mode 100644 index 0000000..d499588 --- /dev/null +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -0,0 +1,102 @@ +From 19c37083cdae94105f6429350dd0b6617e3c2d56 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 +++++ + 4 files changed, 22 insertions(+) + +diff --git a/config.example.toml b/config.example.toml +index 0c65b25fe138..6a0f1c01c328 100644 +--- a/config.example.toml ++++ b/config.example.toml +@@ -789,6 +789,11 @@ changelog-seen = 2 + # target triples containing `-none`, `nvptx`, `switch`, or `-uefi`. + #no-std = (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/compile.rs b/src/bootstrap/compile.rs +index 14c3ef79a78f..7adbf091acbb 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -263,6 +263,10 @@ fn copy_self_contained_objects( + compiler: &Compiler, + target: TargetSelection, + ) -> Vec<(PathBuf, DependencyType)> { ++ if builder.self_contained(target) != Some(true) { ++ return vec![]; ++ } ++ + 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 fe932fd6bd30..a626badc3e8a 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -541,6 +541,7 @@ pub struct Target { + pub wasi_root: Option, + pub qemu_rootfs: Option, + pub no_std: bool, ++ pub self_contained: bool, + } + + impl Target { +@@ -553,6 +554,9 @@ pub fn from_triple(triple: &str) -> Self { + { + target.no_std = true; + } ++ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") { ++ target.self_contained = true; ++ } + target + } + } +@@ -999,6 +1003,7 @@ struct TomlTarget { + wasi_root: Option = "wasi-root", + qemu_rootfs: Option = "qemu-rootfs", + no_std: Option = "no-std", ++ self_contained: Option = "self-contained", + } + } + +@@ -1524,6 +1529,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 0a7aff62257a..9b7c18a3353f 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -1285,6 +1285,11 @@ fn no_std(&self, target: TargetSelection) -> Option { + self.config.target_config.get(&target).map(|t| t.no_std) + } + ++ /// Returns `true` if this is a self-contained `target`, if defined ++ fn self_contained(&self, target: TargetSelection) -> Option { ++ self.config.target_config.get(&target).map(|t| t.self_contained) ++ } ++ + /// Returns `true` if the target will be tested using the `remote-test-client` + /// and `remote-test-server` binaries. + fn remote_tested(&self, target: TargetSelection) -> bool { +-- +2.41.0 + diff --git a/0001-wasi-round-up-the-size-for-aligned_alloc.patch b/0001-wasi-round-up-the-size-for-aligned_alloc.patch new file mode 100644 index 0000000..7fbe950 --- /dev/null +++ b/0001-wasi-round-up-the-size-for-aligned_alloc.patch @@ -0,0 +1,33 @@ +From 1c6d867d78475fd8c6274e2b64ebb27735b6cabf Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Sat, 26 Aug 2023 11:50:16 -0700 +Subject: [PATCH] wasi: round up the size for `aligned_alloc` + +C11 `aligned_alloc` requires that the size be a multiple of the +alignment. This is enforced in the wasi-libc emmalloc implementation, +which always returns NULL if the size is not a multiple. +(The default `MALLOC_IMPL=dlmalloc` does not currently check this.) +--- + library/std/src/sys/unix/alloc.rs | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/library/std/src/sys/unix/alloc.rs b/library/std/src/sys/unix/alloc.rs +index 8604b53983d6..af0089978ecb 100644 +--- a/library/std/src/sys/unix/alloc.rs ++++ b/library/std/src/sys/unix/alloc.rs +@@ -86,7 +86,11 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { + } else if #[cfg(target_os = "wasi")] { + #[inline] + unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { +- libc::aligned_alloc(layout.align(), layout.size()) as *mut u8 ++ // C11 aligned_alloc requires that the size be a multiple of the alignment. ++ // Layout already checks that the size rounded up doesn't overflow isize::MAX. ++ let align = layout.align(); ++ let size = layout.size().next_multiple_of(align); ++ libc::aligned_alloc(align, size) as *mut u8 + } + } else { + #[inline] +-- +2.41.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 new file mode 100644 index 0000000..e60433a --- /dev/null +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -0,0 +1,78 @@ +From 3016b2b7052d8b01d50c3a3c6591aeb99d918ca3 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 +++++- + 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 b603a8787460..40d878b64479 100644 +--- a/compiler/rustc_codegen_ssa/src/back/link.rs ++++ b/compiler/rustc_codegen_ssa/src/back/link.rs +@@ -1475,6 +1475,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat + return file_path; + } + } ++ if let Some(lib_path) = &sess.target.options.external_lib_path { ++ let file_path = Path::new(lib_path.as_ref()).join(name); ++ if file_path.exists() { ++ return file_path; ++ } ++ } + for search_path in fs.search_paths() { + let file_path = search_path.dir.join(name); + if file_path.exists() { +@@ -1967,6 +1973,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)); + } ++ if let Some(lib_path) = &sess.target.options.external_lib_path { ++ cmd.include_path(Path::new(lib_path.as_ref())); ++ } + } + + /// 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 2365dfaf1af8..35f3a686cf67 100644 +--- a/compiler/rustc_target/src/spec/mod.rs ++++ b/compiler/rustc_target/src/spec/mod.rs +@@ -1653,6 +1653,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, +@@ -2124,6 +2125,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/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 { + 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. +- 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 + diff --git a/rust.spec b/rust.spec index 1a49ee4..003be5a 100644 --- a/rust.spec +++ b/rust.spec @@ -43,10 +43,15 @@ # (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 7018e24d8fe248596819d2e884761676f3542a04 +%global wasi_libc_ref bd950eb128bff337153de217b11270f948d04bb4 %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} +%if 0%{?fedora} +%bcond_with bundled_wasi_libc +%else +%bcond_without bundled_wasi_libc +%endif # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static @@ -118,17 +123,27 @@ Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch # TODO: upstream this ability into the actual build configuration Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch +# Override the default self-contained system libraries +# TODO: the first can probably be upstreamed, but the second is hard-coded, +# and we're only applying that if not with bundled_wasi_libc. +Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch +Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch + # Enable the profiler runtime for native hosts # https://github.com/rust-lang/rust/pull/114069 -Patch4: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch +Patch6: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch # Fix --no-fail-fast # https://github.com/rust-lang/rust/pull/113214 -Patch5: 0001-Don-t-fail-early-if-try_run-returns-an-error.patch +Patch7: 0001-Don-t-fail-early-if-try_run-returns-an-error.patch # The dist-src tarball doesn't include .github/ # https://github.com/rust-lang/rust/pull/115109 -Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch +Patch8: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch + +# wasi: round up the size for aligned_alloc +# https://github.com/rust-lang/rust/pull/115254 +Patch9: 0001-wasi-round-up-the-size-for-aligned_alloc.patch ### RHEL-specific patches below ### @@ -336,7 +351,11 @@ BuildRequires: mingw64-winpthreads-static %endif %if %defined wasm_targets +%if %with bundled_wasi_libc BuildRequires: clang +%else +BuildRequires: wasi-libc-static +%endif BuildRequires: lld # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ @@ -413,7 +432,11 @@ BuildArch: noarch %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 @@ -595,8 +618,9 @@ test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif -%if %defined wasm_targets +%if %{defined wasm_targets} && %{with bundled_wasi_libc} %setup -q -n %{wasi_libc_name} -T -b 1 +rm -rf %{wasi_libc_dir}/dlmalloc/ %endif %setup -q -n %{rustc_package} @@ -605,8 +629,13 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P2 -p1 %patch -P3 -p1 %patch -P4 -p1 +%if %without bundled_wasi_libc %patch -P5 -p1 +%endif %patch -P6 -p1 +%patch -P7 -p1 +%patch -P8 -p1 +%patch -P9 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -733,16 +762,25 @@ fi --set target.i686-pc-windows-gnu.cc=%{mingw32_cc} --set target.i686-pc-windows-gnu.ar=%{mingw32_ar} --set target.i686-pc-windows-gnu.ranlib=%{mingw32_ranlib} + --set target.i686-pc-windows-gnu.self-contained=false --set target.x86_64-pc-windows-gnu.linker=%{mingw64_cc} --set target.x86_64-pc-windows-gnu.cc=%{mingw64_cc} --set target.x86_64-pc-windows-gnu.ar=%{mingw64_ar} --set target.x86_64-pc-windows-gnu.ranlib=%{mingw64_ranlib} + --set target.x86_64-pc-windows-gnu.self-contained=false } %endif %if %defined wasm_targets -%make_build --quiet -C %{wasi_libc_dir} CC=clang AR=llvm-ar NM=llvm-nm +%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 +%else +%define wasm_target_config %{shrink: + --set target.wasm32-wasi.wasi-root=%{_prefix}/wasm32-wasi + --set target.wasm32-wasi.self-contained=false +} +%endif %endif %if 0%{?fedora} || 0%{?rhel} >= 8 @@ -969,7 +1007,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{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 -%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/self-contained %endif %if %target_enabled x86_64-pc-windows-gnu @@ -977,7 +1014,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{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 -%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/self-contained %endif %if %target_enabled wasm32-unknown-unknown @@ -986,10 +1022,12 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %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 x86_64-unknown-none %target_files x86_64-unknown-none @@ -1074,8 +1112,10 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog -* Wed Sep 27 2023 Josh Stone - 1.72.1-3 +* 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 diff --git a/sources b/sources index efdcb58..c0c8375 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (rustc-1.72.1-src.tar.xz) = 08232b5bf36f82a995d67f3d03d5e35b7d8914d31fb4491d4c37b72a830bc438e9d18d9e138d398b1b6ae4aa09f7f8e1e9b68da6273ab74bdae4c6123586a21b -SHA512 (wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz) = a2a4a952c3d9795792be8f055387057befaebe0675ad2464a478cb1f2c45d65f233e0ee4c4dbcaa137bf9649882ff6c6acf2f2bec07b2ad89f63ff980d972e6b +SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066 From afbd2cf0c42e70f5dc6187a73458b2f5c5109cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 4 Oct 2023 10:50:58 +0100 Subject: [PATCH 130/222] ensure rustfmt pulls in exact matching rust evr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /usr/bin/rustfmt is linking to an internal rust library and this results in load errors if rustfmt and rust are at different evrs: $ rustfmt rustfmt: error while loading shared libraries: librustc_driver-69c69b1255476b63.so: cannot open shared object file: No such file or directory $ rpm -q rust rustfmt rust-1.72.0-1.fc38.x86_64 rustfmt-1.72.1-1.fc38.x86_64 Signed-off-by: Daniel P. Berrangé --- rust.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust.spec b/rust.spec index 003be5a..67c25ad 100644 --- a/rust.spec +++ b/rust.spec @@ -531,6 +531,9 @@ and ensure that you'll always get a repeatable build. Summary: Tool to find and fix Rust formatting issues Requires: cargo +# /usr/bin/rustfmt is dynamically linked against internal rustc libs +Requires: %{name}%{?_isa} = %{version}-%{release} + # The component/package was rustfmt-preview until Rust 1.31. Obsoletes: rustfmt-preview < 1.0.0 Provides: rustfmt-preview = %{version}-%{release} From 0b6ffb1d4ac83753c9d75a687ff799fa044a7d80 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 5 Oct 2023 09:24:56 -0700 Subject: [PATCH 131/222] Update to 1.73.0. Drop el7 conditionals from the spec. --- .gitignore | 1 + ...rnal-builds-of-the-compiler-rt-profi.patch | 142 ------------- ...il-early-if-try_run-returns-an-error.patch | 201 ------------------ ...mlAnchors-when-the-config-is-missing.patch | 12 +- rust.spec | 118 ++-------- rustc-1.72.0-disable-http2.patch | 92 -------- ...atch => rustc-1.73.0-disable-libssh2.patch | 22 +- sources | 2 +- 8 files changed, 38 insertions(+), 552 deletions(-) delete mode 100644 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch delete mode 100644 0001-Don-t-fail-early-if-try_run-returns-an-error.patch delete mode 100644 rustc-1.72.0-disable-http2.patch rename rustc-1.72.0-disable-libssh2.patch => rustc-1.73.0-disable-libssh2.patch (58%) diff --git a/.gitignore b/.gitignore index 3e84863..83aeea4 100644 --- a/.gitignore +++ b/.gitignore @@ -426,3 +426,4 @@ /wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz /rustc-1.72.1-src.tar.xz /wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz +/rustc-1.73.0-src.tar.xz diff --git a/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch b/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch deleted file mode 100644 index 01f7847..0000000 --- a/0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch +++ /dev/null @@ -1,142 +0,0 @@ -From e276ae1cb702fa830be126cccce4bb9e8676f9fb Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 25 Jul 2023 13:11:50 -0700 -Subject: [PATCH] Allow using external builds of the compiler-rt profile lib - -This changes the bootstrap config `target.*.profiler` from a plain bool -to also allow a string, which will be used as a path to the pre-built -profiling runtime for that target. Then `profiler_builtins/build.rs` -reads that in a `LLVM_PROFILER_RT_LIB` environment variable. ---- - config.example.toml | 6 ++++-- - library/profiler_builtins/build.rs | 6 ++++++ - src/bootstrap/compile.rs | 4 ++++ - src/bootstrap/config.rs | 30 ++++++++++++++++++++++++------ - 4 files changed, 38 insertions(+), 8 deletions(-) - -diff --git a/config.example.toml b/config.example.toml -index 0c65b25fe138..249847013259 100644 ---- a/config.example.toml -+++ b/config.example.toml -@@ -752,8 +752,10 @@ changelog-seen = 2 - # This option will override the same option under [build] section. - #sanitizers = build.sanitizers (bool) - --# Build the profiler runtime for this target(required when compiling with options that depend --# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`). -+# When true, build the profiler runtime for this target(required when compiling -+# with options that depend on this runtime, such as `-C profile-generate` or -+# `-C instrument-coverage`). This may also be given a path to an existing build -+# of the profiling runtime library from LLVM's compiler-rt. - # This option will override the same option under [build] section. - #profiler = build.profiler (bool) - -diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs -index 1b1f11798d74..d14d0b82229a 100644 ---- a/library/profiler_builtins/build.rs -+++ b/library/profiler_builtins/build.rs -@@ -6,6 +6,12 @@ - use std::path::Path; - - fn main() { -+ println!("cargo:rerun-if-env-changed=LLVM_PROFILER_RT_LIB"); -+ if let Ok(rt) = env::var("LLVM_PROFILER_RT_LIB") { -+ println!("cargo:rustc-link-lib=static:+verbatim={rt}"); -+ return; -+ } -+ - let target = env::var("TARGET").expect("TARGET was not set"); - let cfg = &mut cc::Build::new(); - -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 14c3ef79a78f..64bdcd1a3b97 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -336,6 +336,10 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car - cargo.env("MACOSX_DEPLOYMENT_TARGET", target); - } - -+ if let Some(path) = builder.config.profiler_path(target) { -+ cargo.env("LLVM_PROFILER_RT_LIB", path); -+ } -+ - // Determine if we're going to compile in optimized C intrinsics to - // the `compiler-builtins` crate. These intrinsics live in LLVM's - // `compiler-rt` repository, but our `src/llvm-project` submodule isn't -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index fe932fd6bd30..45a743082415 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -533,7 +533,7 @@ pub struct Target { - pub linker: Option, - pub ndk: Option, - pub sanitizers: Option, -- pub profiler: Option, -+ pub profiler: Option, - pub rpath: Option, - pub crt_static: Option, - pub musl_root: Option, -@@ -862,9 +862,9 @@ struct Dist { - } - } - --#[derive(Debug, Deserialize)] -+#[derive(Clone, Debug, Deserialize)] - #[serde(untagged)] --enum StringOrBool { -+pub enum StringOrBool { - String(String), - Bool(bool), - } -@@ -875,6 +875,12 @@ fn default() -> StringOrBool { - } - } - -+impl StringOrBool { -+ fn is_string_or_true(&self) -> bool { -+ matches!(self, Self::String(_) | Self::Bool(true)) -+ } -+} -+ - #[derive(Clone, Debug, Deserialize, PartialEq, Eq)] - #[serde(untagged)] - pub enum RustOptimize { -@@ -991,7 +997,7 @@ struct TomlTarget { - llvm_libunwind: Option = "llvm-libunwind", - android_ndk: Option = "android-ndk", - sanitizers: Option = "sanitizers", -- profiler: Option = "profiler", -+ profiler: Option = "profiler", - rpath: Option = "rpath", - crt_static: Option = "crt-static", - musl_root: Option = "musl-root", -@@ -1864,12 +1870,24 @@ pub fn any_sanitizers_enabled(&self) -> bool { - self.target_config.values().any(|t| t.sanitizers == Some(true)) || self.sanitizers - } - -+ pub fn profiler_path(&self, target: TargetSelection) -> Option<&str> { -+ match self.target_config.get(&target)?.profiler.as_ref()? { -+ StringOrBool::String(s) => Some(s), -+ StringOrBool::Bool(_) => None, -+ } -+ } -+ - pub fn profiler_enabled(&self, target: TargetSelection) -> bool { -- self.target_config.get(&target).map(|t| t.profiler).flatten().unwrap_or(self.profiler) -+ self.target_config -+ .get(&target) -+ .and_then(|t| t.profiler.as_ref()) -+ .map(StringOrBool::is_string_or_true) -+ .unwrap_or(self.profiler) - } - - pub fn any_profiler_enabled(&self) -> bool { -- self.target_config.values().any(|t| t.profiler == Some(true)) || self.profiler -+ self.target_config.values().any(|t| matches!(&t.profiler, Some(p) if p.is_string_or_true())) -+ || self.profiler - } - - pub fn rpath_enabled(&self, target: TargetSelection) -> bool { --- -2.41.0 - diff --git a/0001-Don-t-fail-early-if-try_run-returns-an-error.patch b/0001-Don-t-fail-early-if-try_run-returns-an-error.patch deleted file mode 100644 index d77ddc7..0000000 --- a/0001-Don-t-fail-early-if-try_run-returns-an-error.patch +++ /dev/null @@ -1,201 +0,0 @@ -From 98336f8f6e701ea99275f32d6e2127a621041994 Mon Sep 17 00:00:00 2001 -From: Guillaume Gomez -Date: Tue, 11 Jul 2023 17:01:35 +0200 -Subject: [PATCH] Don't fail early if `try_run` returns an error - ---- - src/bootstrap/download.rs | 2 +- - src/bootstrap/run.rs | 11 +++++------ - src/bootstrap/test.rs | 36 ++++++++++++++++-------------------- - 3 files changed, 22 insertions(+), 27 deletions(-) - -diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs -index cb40521dda76..9478ac7d9cea 100644 ---- a/src/bootstrap/download.rs -+++ b/src/bootstrap/download.rs -@@ -188,7 +188,7 @@ fn fix_bin_or_dylib(&self, fname: &Path) { - patchelf.args(&["--set-interpreter", dynamic_linker.trim_end()]); - } - -- self.try_run(patchelf.arg(fname)).unwrap(); -+ let _ = self.try_run(patchelf.arg(fname)); - } - - fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str) { -diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs -index c97b75927371..70b917000433 100644 ---- a/src/bootstrap/run.rs -+++ b/src/bootstrap/run.rs -@@ -27,8 +27,7 @@ fn run(self, builder: &Builder<'_>) { - try_run( - builder, - &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").arg(&builder.src), -- ) -- .unwrap(); -+ ); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -@@ -40,17 +39,17 @@ fn make_run(run: RunConfig<'_>) { - } - } - --fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { -+fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { - if !builder.fail_fast { -- if let Err(e) = builder.try_run(cmd) { -+ if builder.try_run(cmd).is_err() { - let mut failures = builder.delayed_failures.borrow_mut(); - failures.push(format!("{:?}", cmd)); -- return Err(e); -+ return false; - } - } else { - builder.run(cmd); - } -- Ok(()) -+ true - } - - #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index 0907291b54da..13576aa787b6 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -48,17 +48,17 @@ - // build for, so there is no entry for "aarch64-apple-darwin" here. - ]; - --fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { -+fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { - if !builder.fail_fast { -- if let Err(e) = builder.try_run(cmd) { -+ if builder.try_run(cmd).is_err() { - let mut failures = builder.delayed_failures.borrow_mut(); - failures.push(format!("{:?}", cmd)); -- return Err(e); -+ return false; - } - } else { - builder.run(cmd); - } -- Ok(()) -+ true - } - - fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool { -@@ -187,8 +187,7 @@ fn run(self, builder: &Builder<'_>) { - try_run( - builder, - builder.tool_cmd(Tool::Linkchecker).arg(builder.out.join(host.triple).join("doc")), -- ) -- .unwrap(); -+ ); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -@@ -241,8 +240,7 @@ fn run(self, builder: &Builder<'_>) { - builder.default_doc(&[]); - builder.ensure(crate::doc::Rustc::new(builder.top_stage, self.target, builder)); - -- try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))) -- .unwrap(); -+ try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))); - } - } - -@@ -288,8 +286,7 @@ fn run(self, builder: &Builder<'_>) { - .args(builder.config.test_args()) - .env("RUSTC", builder.rustc(compiler)) - .env("RUSTDOC", builder.rustdoc(compiler)), -- ) -- .unwrap(); -+ ); - } - } - -@@ -855,7 +852,7 @@ fn run(self, builder: &Builder<'_>) { - util::lld_flag_no_threads(self.compiler.host.contains("windows")), - ); - } -- try_run(builder, &mut cmd).unwrap(); -+ try_run(builder, &mut cmd); - } - } - -@@ -1106,7 +1103,7 @@ fn run(self, builder: &Builder<'_>) { - } - - builder.info("tidy check"); -- try_run(builder, &mut cmd).unwrap(); -+ try_run(builder, &mut cmd); - - builder.ensure(ExpandYamlAnchors); - -@@ -1154,8 +1151,7 @@ fn run(self, builder: &Builder<'_>) { - try_run( - builder, - &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), -- ) -- .unwrap(); -+ ); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -@@ -1948,7 +1944,7 @@ fn run_ext_doc(self, builder: &Builder<'_>) { - compiler.host, - ); - let _time = util::timeit(&builder); -- let toolstate = if try_run(builder, &mut rustbook_cmd).is_ok() { -+ let toolstate = if try_run(builder, &mut rustbook_cmd) { - ToolState::TestPass - } else { - ToolState::TestFail -@@ -2106,7 +2102,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> - cmd.arg("--test-args").arg(test_args); - - if builder.config.verbose_tests { -- try_run(builder, &mut cmd).is_ok() -+ try_run(builder, &mut cmd) - } else { - try_run_quiet(builder, &mut cmd) - } -@@ -2134,7 +2130,7 @@ fn run(self, builder: &Builder<'_>) { - - let src = builder.src.join(relative_path); - let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); -- let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)).is_ok() { -+ let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) { - ToolState::TestPass - } else { - ToolState::TestFail -@@ -2684,7 +2680,7 @@ fn run(self, builder: &Builder<'_>) { - .current_dir(builder.src.join("src/bootstrap/")); - // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible. - // Use `python -m unittest` manually if you want to pass arguments. -- try_run(builder, &mut check_bootstrap).unwrap(); -+ try_run(builder, &mut check_bootstrap); - - let host = builder.config.build; - let compiler = builder.compiler(0, host); -@@ -2756,7 +2752,7 @@ fn run(self, builder: &Builder<'_>) { - } - - builder.info("platform support check"); -- try_run(builder, &mut cargo.into()).unwrap(); -+ try_run(builder, &mut cargo.into()); - } - } - -@@ -2836,7 +2832,7 @@ fn run(self, builder: &Builder<'_>) { - cmd.env("CARGO", &builder.initial_cargo); - cmd.env("RUSTC", &builder.initial_rustc); - cmd.env("TMP_DIR", &tmpdir); -- try_run(builder, &mut cmd).unwrap(); -+ try_run(builder, &mut cmd); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { --- -2.41.0 - diff --git a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch index 62b4c56..6806d2a 100644 --- a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch +++ b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch @@ -1,21 +1,19 @@ -From ab9c5148956c2b7d177cc94533370d6a01a8d15f Mon Sep 17 00:00:00 2001 +From 35187c7e6474d346eea3113c4ae34d26d6b18756 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 22 Aug 2023 10:42:12 -0700 Subject: [PATCH] Skip ExpandYamlAnchors when the config is missing The dist-src tarball does not include `.github/` at all, so we can't check whether it needs to be regenerated. - -(cherry picked from commit 35187c7e6474d346eea3113c4ae34d26d6b18756) --- src/bootstrap/test.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index eed7a584b603..d41850783c6d 100644 +index db3b7ffbea4e..d1018978f78c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs -@@ -1150,6 +1150,11 @@ impl Step for ExpandYamlAnchors { +@@ -1174,6 +1174,11 @@ impl Step for ExpandYamlAnchors { /// appropriate configuration for all our CI providers. This step ensures the tool was called /// by the user before committing CI changes. fn run(self, builder: &Builder<'_>) { @@ -25,8 +23,8 @@ index eed7a584b603..d41850783c6d 100644 + return; + } builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); - try_run( - builder, + builder.run_delaying_failure( + &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), -- 2.41.0 diff --git a/rust.spec b/rust.spec index 67c25ad..b35408d 100644 --- a/rust.spec +++ b/rust.spec @@ -8,9 +8,9 @@ # 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.71.0 -%global bootstrap_channel 1.71.0 -%global bootstrap_date 2023-07-13 +%global bootstrap_version 1.72.0 +%global bootstrap_channel 1.72.0 +%global bootstrap_date 2023-08-24 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -26,9 +26,7 @@ %if 0%{?fedora} %global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 %global wasm_targets wasm32-unknown-unknown wasm32-wasi -%endif %if 0%{?fedora} || 0%{?rhel} >= 10 %global extra_targets x86_64-unknown-none x86_64-unknown-uefi %endif @@ -57,9 +55,9 @@ %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 14.0+. -%global min_llvm_version 14.0.0 -%global bundled_llvm_version 16.0.5 +# is insufficient. Rust currently requires LLVM 15.0+. +%global min_llvm_version 15.0.0 +%global bundled_llvm_version 17.0.2 %bcond_with bundled_llvm # Requires stable libgit2 1.6, and not the next minor soname change. @@ -82,22 +80,9 @@ %bcond_with disabled_libssh2 %endif -%if 0%{?rhel} && 0%{?rhel} < 8 -%bcond_with curl_http2 -%else -%bcond_without curl_http2 -%endif - -# LLDB isn't available everywhere... -%if 0%{?rhel} && 0%{?rhel} < 8 -%bcond_with lldb -%else -%bcond_without lldb -%endif - Name: rust -Version: 1.72.1 -Release: 3%{?dist} +Version: 1.73.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) @@ -129,21 +114,13 @@ 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 -# Enable the profiler runtime for native hosts -# https://github.com/rust-lang/rust/pull/114069 -Patch6: 0001-Allow-using-external-builds-of-the-compiler-rt-profi.patch - -# Fix --no-fail-fast -# https://github.com/rust-lang/rust/pull/113214 -Patch7: 0001-Don-t-fail-early-if-try_run-returns-an-error.patch - # The dist-src tarball doesn't include .github/ # https://github.com/rust-lang/rust/pull/115109 -Patch8: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch +Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch # wasi: round up the size for aligned_alloc # https://github.com/rust-lang/rust/pull/115254 -Patch9: 0001-wasi-round-up-the-size-for-aligned_alloc.patch +Patch7: 0001-wasi-round-up-the-size-for-aligned_alloc.patch ### RHEL-specific patches below ### @@ -151,11 +128,7 @@ Patch9: 0001-wasi-round-up-the-size-for-aligned_alloc.patch Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.72.0-disable-libssh2.patch - -# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys -# will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.72.0-disable-http2.patch +Patch100: rustc-1.73.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -212,12 +185,7 @@ end} Provides: bundled(%{name}-bootstrap) = %{bootstrap_version} %else BuildRequires: cargo >= %{bootstrap_version} -%if 0%{?rhel} && 0%{?rhel} < 8 -BuildRequires: %{name} >= %{bootstrap_version} -BuildConflicts: %{name} > %{version} -%else BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) -%endif %global local_rust_root %{_prefix} %endif @@ -256,10 +224,6 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm14 %endif -# not ready for llvm-17 yet... -%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10 -%global llvm llvm16 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -319,14 +283,7 @@ BuildRequires: %{devtoolset_name}-gcc-c++ # While we don't want to encourage dynamic linking to Rust shared libraries, as # there's no stable ABI, we still need the unallocated metadata (.rustc) to # support custom-derive plugins like #[proc_macro_derive(Foo)]. -%if 0%{?rhel} && 0%{?rhel} < 8 -# eu-strip is very eager by default, so we have to limit it to -g, only debugging symbols. -%global _find_debuginfo_opts -g -%undefine _include_minidebuginfo -%else -# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 %global _find_debuginfo_opts --keep-section .rustc -%endif %if %{without bundled_llvm} %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} @@ -364,10 +321,8 @@ find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' %{nil} %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 # For profiler_builtins BuildRequires: compiler-rt -%endif # This component was removed as of Rust 1.69.0. # https://github.com/rust-lang/rust/pull/101841 @@ -473,8 +428,6 @@ This package includes the rust-gdb script, which allows easier debugging of Rust programs. -%if %with lldb - %package lldb Summary: LLDB pretty printers for Rust BuildArch: noarch @@ -486,8 +439,6 @@ Requires: %{name}-debugger-common = %{version}-%{release} This package includes the rust-lldb script, which allows easier debugging of Rust programs. -%endif - %package doc Summary: Documentation for Rust @@ -546,11 +497,7 @@ A tool for formatting Rust code according to style guidelines. Summary: Rust implementation of the Language Server Protocol # The standard library sources are needed for most functionality. -%if 0%{?rhel} && 0%{?rhel} < 8 -Requires: %{name}-src -%else Recommends: %{name}-src -%endif # RLS is no longer available as of Rust 1.65, but we're including the stub # binary that implements LSP just enough to recommend rust-analyzer. @@ -581,11 +528,7 @@ A collection of lints to catch common mistakes and improve your Rust code. %package src Summary: Sources for the Rust standard library BuildArch: noarch -%if 0%{?rhel} && 0%{?rhel} < 8 -Requires: %{name}-std-static = %{version}-%{release} -%else Recommends: %{name}-std-static = %{version}-%{release} -%endif %description src This package includes source files for the Rust standard library. It may be @@ -637,18 +580,11 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %endif %patch -P6 -p1 %patch -P7 -p1 -%patch -P8 -p1 -%patch -P9 -p1 %if %with disabled_libssh2 %patch -P100 -p1 %endif -%if %without curl_http2 -%patch -P101 -p1 -rm -rf vendor/libnghttp2-sys*/ -%endif - # Use our explicit python3 first sed -i.try-python -e '/^try python3 /i try "%{__python3}" "$@"' ./configure @@ -740,13 +676,7 @@ end} %ifarch %{arm} %{ix86} # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 -%if 0%{?rhel} && 0%{?rhel} < 8 -# Older rpmbuild didn't work with partial debuginfo coverage. -%global debug_package %{nil} -%define enable_debuginfo --debuginfo-level=0 -%else %define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2 -%endif %else %define enable_debuginfo --debuginfo-level=2 %endif @@ -786,16 +716,14 @@ fi %endif %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 # Find the compiler-rt library for the Rust profiler_builtins crate. %if 0%{?clang_major_version} >= 17 -PROFILER='%{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a' +%define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a %else # The exact profiler path is version dependent.. -PROFILER=$(echo %{_libdir}/clang/*/lib/libclang_rt.profile-%{_arch}.a) -%endif -test -r "$PROFILER" +%define profiler %(echo %{_libdir}/clang/*/lib/libclang_rt.profile-%{_arch}.a) %endif +test -r "%{profiler}" %configure --disable-option-checking \ --libdir=%{common_libdir} \ @@ -805,7 +733,7 @@ test -r "$PROFILER" --set target.%{rust_triple}.cxx=%{__cxx} \ --set target.%{rust_triple}.ar=%{__ar} \ --set target.%{rust_triple}.ranlib=%{__ranlib} \ - ${PROFILER:+--set target.%{rust_triple}.profiler="$PROFILER"} \ + --set target.%{rust_triple}.profiler="%{profiler}" \ %{?mingw_target_config} \ %{?wasm_target_config} \ --python=%{__python3} \ @@ -916,11 +844,6 @@ mkdir -p %{buildroot}%{_datadir}/cargo/registry mkdir -p %{buildroot}%{_docdir}/cargo ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html -%if %without lldb -rm -f %{buildroot}%{_bindir}/rust-lldb -rm -f %{buildroot}%{rustlibdir}/etc/lldb_* -%endif - # We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp) rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* @@ -944,11 +867,9 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" %{buildroot}%{_bindir}/cargo run --verbose -%if 0%{?fedora} || 0%{?rhel} >= 8 # Sanity-check that code-coverage builds and runs env RUSTFLAGS="-Cinstrument-coverage" %{buildroot}%{_bindir}/cargo run --verbose test -r default_*.profraw -%endif # Try a build sanity-check for other std-enabled targets for triple in %{?mingw_targets} %{?wasm_targets}; do @@ -961,7 +882,7 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* # Bootstrap is excluded because it's not something we ship, and a lot of its # tests are geared toward the upstream CI environment. -%{__python3} ./x.py test --no-fail-fast --exclude src/bootstrap || : +%{__python3} ./x.py test --no-fail-fast --skip src/bootstrap || : rm -rf "./build/%{rust_triple}/test/" %{__python3} ./x.py test --no-fail-fast cargo || : @@ -1053,11 +974,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %exclude %{_bindir}/rust-gdbgui -%if %with lldb %files lldb %{_bindir}/rust-lldb %{rustlibdir}/etc/lldb_* -%endif %files doc @@ -1074,7 +993,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %license src/tools/cargo/LICENSE-{APACHE,MIT,THIRD-PARTY} %doc src/tools/cargo/README.md %{_bindir}/cargo -%{_libexecdir}/cargo* %{_mandir}/man1/cargo*.1* %{_sysconfdir}/bash_completion.d/cargo %{_datadir}/zsh/site-functions/_cargo @@ -1115,6 +1033,10 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* 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 diff --git a/rustc-1.72.0-disable-http2.patch b/rustc-1.72.0-disable-http2.patch deleted file mode 100644 index db2213e..0000000 --- a/rustc-1.72.0-disable-http2.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-08-21 11:00:15.341608892 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-08-21 11:00:46.074984901 -0700 -@@ -743,7 +743,6 @@ - dependencies = [ - "cc", - "libc", -- "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -2011,16 +2010,6 @@ - checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - - [[package]] --name = "libnghttp2-sys" --version = "0.1.7+1.45.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" --dependencies = [ -- "cc", -- "libc", --] -- --[[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-08-21 11:00:15.341608892 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-08-21 11:00:15.342608871 -0700 -@@ -118,7 +118,7 @@ - cargo-util.workspace = true - clap = { workspace = true, features = ["wrap_help"] } - crates-io.workspace = true --curl = { workspace = true, features = ["http2"] } -+curl = { workspace = true, features = [] } - curl-sys.workspace = true - env_logger.workspace = true - filetime.workspace = true ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-08-17 20:58:39.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-08-21 11:00:15.343608851 -0700 -@@ -408,16 +408,9 @@ - sources: SourceMap<'cfg>, - config: &'cfg Config, - ) -> CargoResult> { -- // We've enabled the `http2` feature of `curl` in Cargo, so treat -- // failures here as fatal as it would indicate a build-time problem. -- let mut multi = Multi::new(); -- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); -- multi -- .pipelining(false, multiplexing) -- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood crates.io with connections -- multi.set_max_host_connections(2)?; -+ // Multiplexing is disabled because the system libcurl doesn't support it. -+ let multi = Multi::new(); -+ let multiplexing = false; - - Ok(PackageSet { - packages: package_ids ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-08-17 20:58:39.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-08-21 11:00:15.343608851 -0700 -@@ -250,16 +250,8 @@ - } - self.fetch_started = true; - -- // We've enabled the `http2` feature of `curl` in Cargo, so treat -- // failures here as fatal as it would indicate a build-time problem. -- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true); -- -- self.multi -- .pipelining(false, self.multiplexing) -- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood the server with connections -- self.multi.set_max_host_connections(2)?; -+ // Multiplexing is disabled because the system libcurl doesn't support it. -+ self.multiplexing = false; - - if !self.quiet { - self.config ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-08-21 11:00:15.343608851 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-08-21 11:02:01.969443986 -0700 -@@ -27,7 +27,7 @@ - macro_rules! try_old_curl { - ($e:expr, $msg:expr) => { - let result = $e; -- if cfg!(target_os = "macos") { -+ if cfg!(any(target_os = "linux", target_os = "macos")) { - if let Err(e) = result { - ::log::warn!("ignoring libcurl {} error: {}", $msg, e); - } diff --git a/rustc-1.72.0-disable-libssh2.patch b/rustc-1.73.0-disable-libssh2.patch similarity index 58% rename from rustc-1.72.0-disable-libssh2.patch rename to rustc-1.73.0-disable-libssh2.patch index 1198954..96b5f4f 100644 --- a/rustc-1.72.0-disable-libssh2.patch +++ b/rustc-1.73.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-08-17 20:58:39.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-08-21 10:52:50.520622927 -0700 -@@ -1999,7 +1999,6 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-09-01 10:51:15.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-09-05 16:59:08.837345133 -0700 +@@ -1973,7 +1973,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2022,20 +2021,6 @@ +@@ -2006,20 +2005,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-08-21 10:49:34.852578202 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-08-21 10:52:11.858404449 -0700 -@@ -31,7 +31,7 @@ - filetime = "0.2.9" - flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] } +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-09-05 16:59:08.837345133 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-09-05 17:00:00.828461993 -0700 +@@ -37,7 +37,7 @@ + filetime = "0.2.21" + flate2 = { version = "1.0.26", default-features = false, features = ["zlib"] } fwdansi = "1.1.0" --git2 = "0.17.1" -+git2 = { version = "0.17.1", default-features = false, features = ["https"] } +-git2 = "0.17.2" ++git2 = { version = "0.17.2", default-features = false, features = ["https"] } git2-curl = "0.18.0" gix = { version = "0.45.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } gix-features-for-configuration-only = { version = "0.30.0", package = "gix-features", features = [ "parallel" ] } diff --git a/sources b/sources index c0c8375..1626147 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.72.1-src.tar.xz) = 08232b5bf36f82a995d67f3d03d5e35b7d8914d31fb4491d4c37b72a830bc438e9d18d9e138d398b1b6ae4aa09f7f8e1e9b68da6273ab74bdae4c6123586a21b +SHA512 (rustc-1.73.0-src.tar.xz) = 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066 From 4740f18b016e16265a95ec132b86e3b9061a67ae Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 5 Oct 2023 15:45:24 -0700 Subject: [PATCH 132/222] Loosen the search for older libclang_rt.profile --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index b35408d..7ff4c0a 100644 --- a/rust.spec +++ b/rust.spec @@ -721,7 +721,7 @@ fi %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-%{_arch}.a) +%define profiler %(echo %{_libdir}/clang/??/lib/libclang_rt.profile-*.a) %endif test -r "%{profiler}" From 9746593522f56550b00d16f82de5101526befbbd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 26 Oct 2023 09:01:56 -0700 Subject: [PATCH 133/222] Use thin-LTO and PGO for rustc itself. --- rust.spec | 56 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/rust.spec b/rust.spec index 7ff4c0a..c29fa40 100644 --- a/rust.spec +++ b/rust.spec @@ -80,9 +80,16 @@ %bcond_with disabled_libssh2 %endif +%if 0%{?__isa_bits} == 32 +# Disable PGO on 32-bit to reduce build memory +%bcond_with rustc_pgo +%else +%bcond_without rustc_pgo +%endif + Name: rust Version: 1.73.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) @@ -745,7 +752,8 @@ test -r "%{profiler}" --disable-llvm-static-stdcpp \ --disable-rpath \ %{enable_debuginfo} \ - --set rust.codegen-units-std=1 \ + --set rust.codegen-units=1 \ + --set rust.lto=thin \ --set build.build-stage=2 \ --set build.doc-stage=2 \ --set build.install-stage=2 \ @@ -758,11 +766,32 @@ test -r "%{profiler}" --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" -%{__python3} ./x.py build -j "$ncpus" -%{__python3} ./x.py doc +%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" +# 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 +%endif + +# Build everything else normally +%{xk} build +%{xk} doc for triple in %{?all_targets} ; do - %{__python3} ./x.py build --target=$triple std + %{xk} build --target=$triple std done %install @@ -771,10 +800,10 @@ done %endif %{export_rust_env} -DESTDIR=%{buildroot} %{__python3} ./x.py install +DESTDIR=%{buildroot} %{xk} install for triple in %{?all_targets} ; do - DESTDIR=%{buildroot} %{__python3} ./x.py 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 +911,17 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* # Bootstrap is excluded because it's not something we ship, and a lot of its # tests are geared toward the upstream CI environment. -%{__python3} ./x.py test --no-fail-fast --skip src/bootstrap || : +%{xk} test --no-fail-fast --skip src/bootstrap || : rm -rf "./build/%{rust_triple}/test/" -%{__python3} ./x.py test --no-fail-fast cargo || : +%{xk} test --no-fail-fast cargo || : rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" -%{__python3} ./x.py test --no-fail-fast clippy || : +%{xk} test --no-fail-fast clippy || : -%{__python3} ./x.py test --no-fail-fast rust-analyzer || : +%{xk} test --no-fail-fast rust-analyzer || : -%{__python3} ./x.py test --no-fail-fast rustfmt || : +%{xk} test --no-fail-fast rustfmt || : %ldconfig_scriptlets @@ -1033,6 +1062,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* 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. From 6b3346248599c5100284dc2873c115e71ee4b9e6 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 20 Sep 2023 14:18:33 -0400 Subject: [PATCH 134/222] Sync rust-toolset macros from rust-packaging This updates the RHEL/ELN rust-toolset macros to the state of macros.rust and macros.cargo from Fedora rust-packaging v24, with the following exceptions: * %__cargo_to_rpm, as cargo2rpm is not shipped in RHEL; * %cargo_registry, %cargo_instdir, and %cargo_generate_buildrequires which are for building and/or consuming "library" crates which are not built in RHEL; * %__cargo_is_{bin,lib} and the is-lib conditional section of %cargo_install, as they use cargo2rpm, and only "binary" crates are built in RHEL; * Dropped RUSTC_BOOTSTRAP and -Z avoid-dev-deps, as they are overly broad and should not be needed with vendored builds (rust-packaging#23); * Dropped rustflags that are already set by default (rust-packaging#24). --- macros.rust-toolset | 167 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 154 insertions(+), 13 deletions(-) diff --git a/macros.rust-toolset b/macros.rust-toolset index 41bb129..250e934 100644 --- a/macros.rust-toolset +++ b/macros.rust-toolset @@ -5,17 +5,55 @@ # 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 %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo -%__rustc %{_bindir}/rustc -%__rustdoc %{_bindir}/rustdoc +%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo +%__rustc /usr/bin/rustc +%__rustdoc /usr/bin/rustdoc -# Enable optimization, debuginfo, and link hardening. -%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now +# rustflags_opt_level: default optimization level +# +# It corresponds to the "-Copt-level" rustc command line option. +%rustflags_opt_level 3 -%__global_rustflags_toml [%{lua: - for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do - print('"' .. arg .. '", ') - end}] +# rustflags_debuginfo: default verbosity of debug information +# +# It corresponds to the "-Cdebuginfo" rustc command line option. +# In some cases, it might be required to override this macro with "1" or even +# "0", if memory usage gets too high during builds on some resource-constrained +# architectures (most likely on 32-bit architectures), which will however +# reduce the quality of the produced debug symbols. +%rustflags_debuginfo 2 + +# rustflags_codegen_units: default number of parallel code generation units +# +# The default value of "1" results in generation of better code, but comes at +# the cost of longer build times. +%rustflags_codegen_units 1 + +# build_rustflags: default compiler flags for rustc (RUSTFLAGS) +# +# -Copt-level: set optimization level (default: highest optimization level) +# -Cdebuginfo: set debuginfo verbosity (default: full debug information) +# -Ccodegen-units: set number of parallel code generation units (default: 1) +# -Cforce-frame-pointers: force inclusion of frame pointers (default: enabled +# on x86_64 and aarch64 on Fedora 37+) +# +# Additionally, some linker flags are set which correspond to the default +# Fedora compiler flags for hardening and for embedding package versions into +# compiled binaries. +# +# ref. https://doc.rust-lang.org/rustc/codegen-options/index.html +%build_rustflags %{shrink: + -Copt-level=%rustflags_opt_level + -Cdebuginfo=%rustflags_debuginfo + -Ccodegen-units=%rustflags_codegen_units + %{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_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 \ @@ -23,7 +61,11 @@ cat > .cargo/config << EOF \ [build]\ rustc = "%{__rustc}"\ rustdoc = "%{__rustdoc}"\ -rustflags = %{__global_rustflags_toml}\ +\ +[env]\ +CFLAGS = "%{build_cflags}"\ +CXXFLAGS = "%{build_cxxflags}"\ +LDFLAGS = "%{build_ldflags}"\ \ [install]\ root = "%{buildroot}%{_prefix}"\ @@ -44,8 +86,107 @@ EOF\ %endif\ ) -%cargo_build %__cargo build --release %{?_smp_mflags} +# __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} +} -%cargo_test %__cargo test --release %{?_smp_mflags} --no-fail-fast +# 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_install %__cargo install --no-track --path . +# cargo_test: runs the test suite with cargo with the specified feature flags +# +# To pass command-line arguments to the cargo test runners directly (for +# example, to skip certain tests during package builds), both the cargo_test +# 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_install: install files into the buildroot +# +# For "binary" crates, this macro installs all "bin" build targets to _bindir +# inside the buildroot. The "--no-track" option prevents the creation of the +# "$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_license: print license information for all crate dependencies +# +# The "no-build,no-dev,no-proc-macro" argument results in only crates which are +# linked into the final binary to be considered. +# +# Additionally, deprecated SPDX syntax ("/" instead of "OR") is normalized +# before sorting the results to ensure reproducible output of this macro. +# +# This macro must be called with the same feature flags as other cargo macros, +# in particular, "cargo_build", otherwise its output will be incomplete. +# +# The "cargo tree" command called by this macro will fail if there are missing +# (optional) dependencies. +%cargo_license(naf:)\ +%{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 +} + +# cargo_license_summary: print license summary for all crate dependencies +# +# This macro works in the same way as cargo_license, except that it only prints +# a list of licenses, and not the complete license information for every crate +# 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:\ + %{__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 \ +} From 69f0d3310010cea10d6308d04adc7584a1a81b55 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 13 Nov 2023 15:10:50 -0800 Subject: [PATCH 135/222] Detect non-stable channels from the version --- rust.spec | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/rust.spec b/rust.spec index c29fa40..72415fa 100644 --- a/rust.spec +++ b/rust.spec @@ -1,9 +1,15 @@ +Name: rust +Version: 1.73.0 +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) +URL: https://www.rust-lang.org + # Only x86_64, i686, and aarch64 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html %global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x riscv64 - -# The channel can be stable, beta, or nightly -%{!?channel: %global channel stable} +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 @@ -87,20 +93,13 @@ %bcond_without rustc_pgo %endif -Name: rust -Version: 1.73.0 -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) -URL: https://www.rust-lang.org -ExclusiveArch: %{rust_arches} - -%if "%{channel}" == "stable" -%global rustc_package rustc-%{version}-src -%else -%global rustc_package rustc-%{channel}-src -%endif +# 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) + rpm.define("channel " .. (subs ~= 0 and version_channel or "stable")) + rpm.define("rustc_package rustc-" .. version_channel .. "-src") +end} Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz Source1: %{wasi_libc_source} # Sources for bootstrap_arches are inserted by lua below From 6a528e91696ccebbb2a851ccec4e1e82ea543e10 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 Nov 2023 08:50:29 -0800 Subject: [PATCH 136/222] Update to 1.74.0. --- .gitignore | 1 + ...mlAnchors-when-the-config-is-missing.patch | 30 ------ 0001-Use-lld-provided-by-system.patch | 20 +++- ...llow-disabling-target-self-contained.patch | 26 +++--- ...-round-up-the-size-for-aligned_alloc.patch | 33 ------- ...xternal-library-path-for-wasm32-wasi.patch | 14 +-- rust.spec | 93 +++++++------------ rustc-1.73.0-disable-libssh2.patch | 42 --------- rustc-1.74.0-disable-libssh2.patch | 42 +++++++++ sources | 2 +- 10 files changed, 112 insertions(+), 191 deletions(-) delete mode 100644 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch delete mode 100644 0001-wasi-round-up-the-size-for-aligned_alloc.patch delete mode 100644 rustc-1.73.0-disable-libssh2.patch create mode 100644 rustc-1.74.0-disable-libssh2.patch diff --git a/.gitignore b/.gitignore index 83aeea4..63526cf 100644 --- a/.gitignore +++ b/.gitignore @@ -427,3 +427,4 @@ /rustc-1.72.1-src.tar.xz /wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz /rustc-1.73.0-src.tar.xz +/rustc-1.74.0-src.tar.xz diff --git a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch deleted file mode 100644 index 6806d2a..0000000 --- a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 35187c7e6474d346eea3113c4ae34d26d6b18756 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 22 Aug 2023 10:42:12 -0700 -Subject: [PATCH] Skip ExpandYamlAnchors when the config is missing - -The dist-src tarball does not include `.github/` at all, so we can't -check whether it needs to be regenerated. ---- - src/bootstrap/test.rs | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index db3b7ffbea4e..d1018978f78c 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -1174,6 +1174,11 @@ impl Step for ExpandYamlAnchors { - /// appropriate configuration for all our CI providers. This step ensures the tool was called - /// by the user before committing CI changes. - fn run(self, builder: &Builder<'_>) { -+ // Note: `.github/` is not included in dist-src tarballs -+ if !builder.src.join(".github/workflows/ci.yml").exists() { -+ builder.info("Skipping YAML anchors check: GitHub Actions config not found"); -+ return; -+ } - builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); - builder.run_delaying_failure( - &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), --- -2.41.0 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index 2b22d48..dc1f1ba 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -1,3 +1,14 @@ +From b6ca6a363a7c91136c723a21fda4816d3009e479 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 + + 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 @@ -26,14 +37,17 @@ index fe3b24f2d4af..1f1731d202ca 100644 "-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 67664a74710a..53153cd120a3 100644 +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 -@@ -12,6 +12,7 @@ pub fn target() -> Target { - base.cpu = "x86-64".into(); +@@ -13,6 +13,7 @@ pub fn target() -> Target { base.plt_by_default = false; base.max_atomic_width = Some(64); + base.entry_abi = Conv::X86_64Win64; + 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.41.0 + diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index d499588..a2cb874 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From 19c37083cdae94105f6429350dd0b6617e3c2d56 Mon Sep 17 00:00:00 2001 +From 4acc7d53182cf83f2c776c4005fc12756ecdfe8f 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 0c65b25fe138..6a0f1c01c328 100644 +index f3c2366d674e..c6c5e24fb592 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -789,6 +789,11 @@ changelog-seen = 2 +@@ -798,6 +798,11 @@ changelog-seen = 2 # target triples containing `-none`, `nvptx`, `switch`, or `-uefi`. #no-std = (bool) @@ -27,10 +27,10 @@ index 0c65b25fe138..6a0f1c01c328 100644 # Distribution options # diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 14c3ef79a78f..7adbf091acbb 100644 +index 292ccc5780fa..d4d79ce982af 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -263,6 +263,10 @@ fn copy_self_contained_objects( +@@ -251,6 +251,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -42,10 +42,10 @@ index 14c3ef79a78f..7adbf091acbb 100644 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 fe932fd6bd30..a626badc3e8a 100644 +index 836328f94ef8..4ae3d853ed88 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -541,6 +541,7 @@ pub struct Target { +@@ -527,6 +527,7 @@ pub struct Target { pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, @@ -53,8 +53,8 @@ index fe932fd6bd30..a626badc3e8a 100644 } impl Target { -@@ -553,6 +554,9 @@ pub fn from_triple(triple: &str) -> Self { - { +@@ -535,6 +536,9 @@ pub fn from_triple(triple: &str) -> Self { + if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") { target.no_std = true; } + if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") { @@ -63,7 +63,7 @@ index fe932fd6bd30..a626badc3e8a 100644 target } } -@@ -999,6 +1003,7 @@ struct TomlTarget { +@@ -1033,6 +1037,7 @@ struct TomlTarget { wasi_root: Option = "wasi-root", qemu_rootfs: Option = "qemu-rootfs", no_std: Option = "no-std", @@ -71,7 +71,7 @@ index fe932fd6bd30..a626badc3e8a 100644 } } -@@ -1524,6 +1529,9 @@ fn get_table(option: &str) -> Result { +@@ -1587,6 +1592,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index fe932fd6bd30..a626badc3e8a 100644 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 0a7aff62257a..9b7c18a3353f 100644 +index 8b8d4b237953..c3e7a1ccc00f 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1285,6 +1285,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1320,6 +1320,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } diff --git a/0001-wasi-round-up-the-size-for-aligned_alloc.patch b/0001-wasi-round-up-the-size-for-aligned_alloc.patch deleted file mode 100644 index 7fbe950..0000000 --- a/0001-wasi-round-up-the-size-for-aligned_alloc.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1c6d867d78475fd8c6274e2b64ebb27735b6cabf Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Sat, 26 Aug 2023 11:50:16 -0700 -Subject: [PATCH] wasi: round up the size for `aligned_alloc` - -C11 `aligned_alloc` requires that the size be a multiple of the -alignment. This is enforced in the wasi-libc emmalloc implementation, -which always returns NULL if the size is not a multiple. -(The default `MALLOC_IMPL=dlmalloc` does not currently check this.) ---- - library/std/src/sys/unix/alloc.rs | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/library/std/src/sys/unix/alloc.rs b/library/std/src/sys/unix/alloc.rs -index 8604b53983d6..af0089978ecb 100644 ---- a/library/std/src/sys/unix/alloc.rs -+++ b/library/std/src/sys/unix/alloc.rs -@@ -86,7 +86,11 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { - } else if #[cfg(target_os = "wasi")] { - #[inline] - unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { -- libc::aligned_alloc(layout.align(), layout.size()) as *mut u8 -+ // C11 aligned_alloc requires that the size be a multiple of the alignment. -+ // Layout already checks that the size rounded up doesn't overflow isize::MAX. -+ let align = layout.align(); -+ let size = layout.size().next_multiple_of(align); -+ libc::aligned_alloc(align, size) as *mut u8 - } - } else { - #[inline] --- -2.41.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 e60433a..951e360 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 3016b2b7052d8b01d50c3a3c6591aeb99d918ca3 Mon Sep 17 00:00:00 2001 +From 461f64c60ec897d8e9caa85190ac27fe81871ebf 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, 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 b603a8787460..40d878b64479 100644 +index c4a0f6291e7f..9421f2fda303 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1475,6 +1475,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1490,6 +1490,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -26,7 +26,7 @@ index b603a8787460..40d878b64479 100644 for search_path in fs.search_paths() { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -1967,6 +1973,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: +@@ -1982,6 +1988,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 b603a8787460..40d878b64479 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 2365dfaf1af8..35f3a686cf67 100644 +index 1bcb1f353159..33d9c54922cb 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -1653,6 +1653,7 @@ pub struct TargetOptions { +@@ -1701,6 +1701,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 2365dfaf1af8..35f3a686cf67 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, -@@ -2124,6 +2125,7 @@ fn default() -> TargetOptions { +@@ -2175,6 +2176,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), diff --git a/rust.spec b/rust.spec index 72415fa..6b51a37 100644 --- a/rust.spec +++ b/rust.spec @@ -1,6 +1,6 @@ Name: rust -Version: 1.73.0 -Release: 2%{?dist} +Version: 1.74.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.72.0 -%global bootstrap_channel 1.72.0 -%global bootstrap_date 2023-08-24 +%global bootstrap_version 1.73.0 +%global bootstrap_channel 1.73.0 +%global bootstrap_date 2023-10-05 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -63,22 +63,20 @@ 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.2 +%global bundled_llvm_version 17.0.4 %bcond_with bundled_llvm -# Requires stable libgit2 1.6, and not the next minor soname change. +# 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.6.4 -%global next_libgit2_version 1.7.0~ -%global bundled_libgit2_version 1.6.4 -%if 0%{?fedora} >= 38 +%global min_libgit2_version 1.7.1 +%global next_libgit2_version 1.8.0~ +%global bundled_libgit2_version 1.7.1 +%if 0%{?fedora} >= 39 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 %endif -# needs libssh2_userauth_publickey_frommemory -%global min_libssh2_version 1.6.0 %if 0%{?rhel} # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) %bcond_without disabled_libssh2 @@ -120,21 +118,13 @@ 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 -# The dist-src tarball doesn't include .github/ -# https://github.com/rust-lang/rust/pull/115109 -Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch - -# wasi: round up the size for aligned_alloc -# https://github.com/rust-lang/rust/pull/115254 -Patch7: 0001-wasi-round-up-the-size-for-aligned_alloc.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.73.0-disable-libssh2.patch +Patch100: rustc-1.74.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -211,7 +201,7 @@ BuildRequires: (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(lib %endif %if %{without disabled_libssh2} -BuildRequires: pkgconfig(libssh2) >= %{min_libssh2_version} +BuildRequires: pkgconfig(libssh2) %endif %if 0%{?rhel} == 8 @@ -222,14 +212,11 @@ BuildRequires: python3 BuildRequires: python3-rpm-macros %if %with bundled_llvm -BuildRequires: cmake3 >= 3.13.4 +BuildRequires: cmake >= 3.20.0 BuildRequires: ninja-build Provides: bundled(llvm) = %{bundled_llvm_version} %else -BuildRequires: cmake >= 2.8.11 -%if 0%{?epel} == 7 -%global llvm llvm14 -%endif +BuildRequires: cmake >= 3.5.1 %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -264,20 +251,7 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release} # https://github.com/rust-lang/rust/issues/11937 Requires: /usr/bin/cc -%if 0%{?epel} == 7 -%global devtoolset_name devtoolset-11 -BuildRequires: %{devtoolset_name}-binutils -BuildRequires: %{devtoolset_name}-gcc -BuildRequires: %{devtoolset_name}-gcc-c++ -%global devtoolset_bindir /opt/rh/%{devtoolset_name}/root/usr/bin -%global __cc %{devtoolset_bindir}/gcc -%global __cxx %{devtoolset_bindir}/g++ -%global __ar %{devtoolset_bindir}/ar -%global __ranlib %{devtoolset_bindir}/ranlib -%global __strip %{devtoolset_bindir}/strip -%else %global __ranlib %{_bindir}/ranlib -%endif # ALL Rust libraries are private, because they don't keep an ABI. %global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.* @@ -584,8 +558,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %if %without bundled_wasi_libc %patch -P5 -p1 %endif -%patch -P6 -p1 -%patch -P7 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -602,18 +574,21 @@ rm -rf src/llvm-project/ mkdir -p src/llvm-project/libunwind/ %endif -# Remove other unused vendored libraries -rm -rf vendor/curl-sys*/curl/ -rm -rf vendor/*jemalloc-sys*/jemalloc/ -rm -rf vendor/libffi-sys*/libffi/ -rm -rf vendor/libmimalloc-sys*/c_src/mimalloc/ -rm -rf vendor/libssh2-sys*/libssh2/ -rm -rf vendor/libz-sys*/src/zlib{,-ng}/ -rm -rf vendor/lzma-sys*/xz-*/ -rm -rf vendor/openssl-src*/openssl/ + +# Remove other unused vendored libraries. This leaves the directory in place, +# because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl". +%define clear_dir() find ./%1 -mindepth 1 -delete +%clear_dir vendor/curl-sys*/curl/ +%clear_dir vendor/*jemalloc-sys*/jemalloc/ +%clear_dir vendor/libffi-sys*/libffi/ +%clear_dir vendor/libmimalloc-sys*/c_src/mimalloc/ +%clear_dir vendor/libssh2-sys*/libssh2/ +%clear_dir vendor/libz-sys*/src/zlib{,-ng}/ +%clear_dir vendor/lzma-sys*/xz-*/ +%clear_dir vendor/openssl-src*/openssl/ %if %without bundled_libgit2 -rm -rf vendor/libgit2-sys*/libgit2/ +%clear_dir vendor/libgit2-sys*/libgit2/ %endif %if %with disabled_libssh2 @@ -623,12 +598,6 @@ rm -rf vendor/libssh2-sys*/ # 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 -%if %{with bundled_llvm} && 0%{?epel} == 7 -mkdir -p cmake-bin -ln -s /usr/bin/cmake3 cmake-bin/cmake -%global cmake_path $PWD/cmake-bin -%endif - %if %{without bundled_llvm} && %{with llvm_static} # Static linking to distro LLVM needs to add -lffi # https://github.com/rust-lang/rust/issues/34486 @@ -667,9 +636,6 @@ end} # Set up shared environment variables for build/install/check %global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{rustc_target_cpus} -%if %defined cmake_path -%global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" -%endif %if %without disabled_libssh2 # convince libssh2-sys to use the distro libssh2 %global rust_env %{?rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 @@ -1061,6 +1027,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* 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. diff --git a/rustc-1.73.0-disable-libssh2.patch b/rustc-1.73.0-disable-libssh2.patch deleted file mode 100644 index 96b5f4f..0000000 --- a/rustc-1.73.0-disable-libssh2.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-09-01 10:51:15.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-09-05 16:59:08.837345133 -0700 -@@ -1973,7 +1973,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -2006,20 +2005,6 @@ - ] - - [[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" - version = "1.1.9" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-09-05 16:59:08.837345133 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-09-05 17:00:00.828461993 -0700 -@@ -37,7 +37,7 @@ - filetime = "0.2.21" - flate2 = { version = "1.0.26", default-features = false, features = ["zlib"] } - fwdansi = "1.1.0" --git2 = "0.17.2" -+git2 = { version = "0.17.2", default-features = false, features = ["https"] } - git2-curl = "0.18.0" - gix = { version = "0.45.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } - gix-features-for-configuration-only = { version = "0.30.0", package = "gix-features", features = [ "parallel" ] } diff --git a/rustc-1.74.0-disable-libssh2.patch b/rustc-1.74.0-disable-libssh2.patch new file mode 100644 index 0000000..81c30b4 --- /dev/null +++ b/rustc-1.74.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- 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 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -2042,20 +2041,6 @@ + ] + + [[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" + 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 +@@ -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"] } + git2-curl = "0.19.0" + gix = { version = "0.54.1", 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 1626147..032c72b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.73.0-src.tar.xz) = 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c +SHA512 (rustc-1.74.0-src.tar.xz) = d949987fab5b7fa4d92910cd4384debd11e598fd2b31d003439dd479977f3389e399d9fd9b43b9a856c54e8777fd10339e169dbb9e87b1a8b07a7ff2ff280c34 SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066 From a057e85147979d256af6598ac764deaa851bfced Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 7 Dec 2023 09:56:29 -0800 Subject: [PATCH 137/222] 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 138/222] 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 139/222] 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 140/222] 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 141/222] 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 142/222] 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 143/222] 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 144/222] 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 145/222] 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 146/222] 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 147/222] 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 148/222] 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 149/222] 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 150/222] 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 151/222] 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 152/222] 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 153/222] [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 154/222] 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 155/222] 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 156/222] 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 157/222] 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 158/222] 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 159/222] 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 160/222] 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 161/222] 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 162/222] 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 163/222] 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 164/222] 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 165/222] 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 166/222] 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 167/222] 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 168/222] 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 169/222] 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 170/222] 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 171/222] 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 172/222] 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 173/222] 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 174/222] 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 175/222] 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 176/222] 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 177/222] 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 178/222] [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 179/222] 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 180/222] 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 181/222] 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 182/222] 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 183/222] 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 184/222] [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 185/222] 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 186/222] 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 187/222] 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 188/222] 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 189/222] 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 190/222] 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 191/222] 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 192/222] 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 193/222] 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 194/222] 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 195/222] 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 196/222] 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 197/222] 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 198/222] 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 199/222] 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 200/222] 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 201/222] 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 202/222] 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 203/222] 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 204/222] 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 205/222] 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 206/222] 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 207/222] 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 208/222] 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 209/222] 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 210/222] 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 211/222] 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 212/222] 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 213/222] 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 214/222] 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 215/222] 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 216/222] 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 217/222] 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 218/222] 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 219/222] 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 220/222] 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 221/222] 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 222/222] 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})"