Update to Rust 1.91.0

The ppc64le toolchain is now built with PGO optimizations.

Resolves: RHEL-111877
Related: RHEL-111845
This commit is contained in:
Paul Murphy 2025-11-05 17:11:43 -06:00
parent b0d94cb318
commit 99f4ccf53d
9 changed files with 93 additions and 426 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -1,278 +0,0 @@
From 4815c3cd733812bec777970ff4b1e73c2fcad1a6 Mon Sep 17 00:00:00 2001
From: Paul Murphy <paumurph@redhat.com>
Date: Tue, 24 Jun 2025 11:07:54 -0500
Subject: [PATCH] Allow linking a prebuilt optimized compiler-rt builtins
library
Extend the <target>.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<bool> = "no-std",
codegen_backends: Option<Vec<String>> = "codegen-backends",
runner: Option<String> = "runner",
- optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
+ optimized_compiler_builtins: Option<StringOrBool> = "optimized-compiler-builtins",
jemalloc: Option<bool> = "jemalloc",
self_contained: Option<bool> = "self-contained",
}
@@ -78,7 +78,7 @@ pub struct Target {
pub runner: Option<String>,
pub no_std: bool,
pub codegen_backends: Option<Vec<CodegenBackendKind>>,
- pub optimized_compiler_builtins: Option<bool>,
+ pub optimized_compiler_builtins: Option<StringOrBool>,
pub jemalloc: Option<bool>,
pub self_contained: bool,
}
--
2.50.1

View File

@ -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 <jistone@redhat.com>
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 = <platform-specific> (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<String> = "runner",
optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
jemalloc: Option<bool> = "jemalloc",
+ self_contained: Option<bool> = "self-contained",
}
}
@@ -79,6 +80,7 @@ pub struct Target {
pub codegen_backends: Option<Vec<CodegenBackendKind>>,
pub optimized_compiler_builtins: Option<bool>,
pub jemalloc: Option<bool>,
+ 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<HashMap<String, TomlTa
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 678a9b639522..9e45efc72d1a 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 {
target.no_std = s;
}
@ -78,11 +53,41 @@ index 9dedadff3a19..69afa8af3419 100644
target.cc = cfg.cc.map(PathBuf::from);
target.cxx = cfg.cxx.map(PathBuf::from);
target.ar = cfg.ar.map(PathBuf::from);
diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
index 020602e6a199..a944e1d194dd 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 {
runner: Option<String> = "runner",
optimized_compiler_builtins: Option<CompilerBuiltins> = "optimized-compiler-builtins",
jemalloc: Option<bool> = "jemalloc",
+ self_contained: Option<bool> = "self-contained",
}
}
@@ -75,6 +76,7 @@ pub struct Target {
pub codegen_backends: Option<Vec<CodegenBackendKind>>,
pub optimized_compiler_builtins: Option<CompilerBuiltins>,
pub jemalloc: Option<bool>,
+ 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<bool> {
@@ -1453,6 +1453,11 @@ fn no_std(&self, target: TargetSelection) -> Option<bool> {
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

View File

@ -1,49 +0,0 @@
From 8ff00974436f25585850e3029d8e5a3e2a8340da Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
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

View File

@ -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 <jistone@redhat.com>
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<CrtObjects>,
#[serde(rename = "post-link-objects")]
post_link_objects: Option<CrtObjects>,
@ -68,10 +68,10 @@ index d27c1929aef7..b995896450e0 100644
pre_link_objects_self_contained: Option<CrtObjects>,
#[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

View File

@ -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} \
@ -912,10 +902,7 @@ test -r "%{optimized_builtins}"
%global __x %{__python3} ./x.py
# 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" )
%if %{with rustc_pgo}
# Build the compiler with profile instrumentation
%define profraw $PWD/build/profiles
%define profdata $PWD/build/rustc.profdata
@ -1105,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

View File

@ -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" }

View File

@ -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" }

View File

@ -1,2 +1,2 @@
SHA512 (wasi-libc-wasi-sdk-27.tar.gz) = dfc2c36fabf32f465fc833ed0b10efffc9a35c68162ecc3e8d656d1d684d170b734d55e790614d12d925d17f49d60f0d2d01c46cecac941cf62d68eda84df13e
SHA512 (rustc-1.90.0-src.tar.xz) = fb0798b4c7450754db2fcbb641202909d209c6db2d9181d7df7282217b8320dc52f5e9853de9d7bdb79177f1f920389450cab07674dea5fb5501eaab5816662a
SHA512 (rustc-1.91.0-src.tar.xz) = 1e4c7a2435dc5bccfc63f34f5d210f7cafb0113787a4b5069d61f03528a32cd0a29ac516673cbc0eb564089f1dc5e13b962e6c3714bd0109de664c22ed340fb3