From 920d923779912fca1170d7e55538a1a8a55560d5 Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Fri, 26 Sep 2025 08:39:37 -0500 Subject: [PATCH] Update to Rust 1.90 Resolves: RHEL-111873 Related: RHEL-111847 --- .gitignore | 1 + ...prebuilt-optimized-compiler-rt-built.patch | 278 ++++++++++++++++++ ...ic-if-WASI_SDK_PATH-is-not-set-when-.patch | 39 --- ...llow-disabling-target-self-contained.patch | 31 +- ...ure-stack-in-InvocationCollector-vis.patch | 49 +++ ...xternal-library-path-for-wasm32-wasi.patch | 51 ++-- rust.spec | 57 ++-- 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, 480 insertions(+), 160 deletions(-) create mode 100644 0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch delete mode 100644 0001-Don-t-always-panic-if-WASI_SDK_PATH-is-not-set-when-.patch create mode 100644 0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.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 59aae5f..cd7715e 100644 --- a/.gitignore +++ b/.gitignore @@ -437,3 +437,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 new file mode 100644 index 0000000..3071556 --- /dev/null +++ b/0001-Allow-linking-a-prebuilt-optimized-compiler-rt-built.patch @@ -0,0 +1,278 @@ +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-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 new file mode 100644 index 0000000..e847c1d --- /dev/null +++ b/0001-rustc_expand-ensure-stack-in-InvocationCollector-vis.patch @@ -0,0 +1,49 @@ +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 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 65398bd..6a8dd58 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,13 +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. +# 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 ### @@ -154,7 +159,7 @@ Source101: cargo_vendor.attr Source102: 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) @@ -294,6 +299,7 @@ BuildRequires: %{llvm}-devel >= %{min_llvm_version} %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel +BuildRequires: libxml2-devel %endif %endif @@ -384,6 +390,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}" \ @@ -396,8 +403,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 @@ -507,6 +516,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 @@ -519,6 +530,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 @@ -675,6 +688,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %endif %patch -P7 -p1 %patch -P8 -p1 +%patch -P9 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -731,7 +745,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 @@ -828,11 +842,20 @@ 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. +%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 + + %configure --disable-option-checking \ --docdir=%{_pkgdocdir} \ --libdir=%{common_libdir} \ @@ -843,6 +866,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} \ @@ -873,10 +897,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. 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. +# pgo on ppc64le is enabled in fedora, but it had exposed bugs in +# llvm codgen on ppc64le which have since been fixed. It should be +# turned on in 1.91 if no new issues are found. %if %{with rustc_pgo} && !( "%{_target_cpu}" == "ppc64le" ) # Build the compiler with profile instrumentation %define profraw $PWD/build/profiles 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