From c9224a07d6f58b431bab887fa7b6446fbfe265ea Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Apr 2025 14:15:58 -0700 Subject: [PATCH 01/17] 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 02/17] 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 03/17] 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 04/17] 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 05/17] 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 06/17] 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 07/17] 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 08/17] 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 09/17] 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 10/17] 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 11/17] 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 12/17] 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 13/17] 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 14/17] 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 15/17] 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 16/17] 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 17/17] 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})"