From 0c755bb834563e126b76d87e95c666c408f2e542 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 30 Sep 2024 09:50:32 -0700 Subject: [PATCH 01/48] Only add an automatic SONAME for Rust dylibs Fixes RHBZ#2314879 --- ...-an-automatic-SONAME-for-Rust-dylibs.patch | 234 ++++++++++++++++++ rust.spec | 4 + 2 files changed, 238 insertions(+) create mode 100644 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch diff --git a/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch b/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch new file mode 100644 index 0000000..80970d1 --- /dev/null +++ b/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch @@ -0,0 +1,234 @@ +From f46057bf1cc0dc24a0ecd7d87c9c93872e685253 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 27 Sep 2024 15:53:26 -0700 +Subject: [PATCH] Only add an automatic SONAME for Rust dylibs + +--- + compiler/rustc_codegen_ssa/src/back/link.rs | 2 +- + compiler/rustc_codegen_ssa/src/back/linker.rs | 83 +++++++++++++++---- + tests/run-make/dylib-soname/rmake.rs | 16 ++-- + 3 files changed, 80 insertions(+), 21 deletions(-) + +diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs +index 80e8111516ee..a23cc5129261 100644 +--- a/compiler/rustc_codegen_ssa/src/back/link.rs ++++ b/compiler/rustc_codegen_ssa/src/back/link.rs +@@ -2490,7 +2490,7 @@ fn add_order_independent_options( + } + } + +- cmd.set_output_kind(link_output_kind, out_filename); ++ cmd.set_output_kind(link_output_kind, crate_type, out_filename); + + add_relro_args(cmd, sess); + +diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs +index a73ec83ee62c..3f3d305da014 100644 +--- a/compiler/rustc_codegen_ssa/src/back/linker.rs ++++ b/compiler/rustc_codegen_ssa/src/back/linker.rs +@@ -275,7 +275,12 @@ pub(crate) trait Linker { + fn is_cc(&self) -> bool { + false + } +- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path); ++ fn set_output_kind( ++ &mut self, ++ output_kind: LinkOutputKind, ++ crate_type: CrateType, ++ out_filename: &Path, ++ ); + fn link_dylib_by_name(&mut self, _name: &str, _verbatim: bool, _as_needed: bool) { + bug!("dylib linked with unsupported linker") + } +@@ -396,7 +401,7 @@ fn push_linker_plugin_lto_args(&mut self, plugin_path: Option<&OsStr>) { + ]); + } + +- fn build_dylib(&mut self, out_filename: &Path) { ++ fn build_dylib(&mut self, crate_type: CrateType, out_filename: &Path) { + // On mac we need to tell the linker to let this library be rpathed + if self.sess.target.is_like_osx { + if !self.is_ld { +@@ -427,7 +432,7 @@ fn build_dylib(&mut self, out_filename: &Path) { + let mut out_implib = OsString::from("--out-implib="); + out_implib.push(out_filename.with_file_name(implib_name)); + self.link_arg(out_implib); +- } else { ++ } else if crate_type == CrateType::Dylib { + // When dylibs are linked by a full path this value will get into `DT_NEEDED` + // instead of the full path, so the library can be later found in some other + // location than that specific path. +@@ -474,7 +479,12 @@ fn is_cc(&self) -> bool { + !self.is_ld + } + +- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) { ++ fn set_output_kind( ++ &mut self, ++ output_kind: LinkOutputKind, ++ crate_type: CrateType, ++ out_filename: &Path, ++ ) { + match output_kind { + LinkOutputKind::DynamicNoPicExe => { + if !self.is_ld && self.is_gnu { +@@ -509,10 +519,10 @@ fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) + self.link_args(&["-static", "-pie", "--no-dynamic-linker", "-z", "text"]); + } + } +- LinkOutputKind::DynamicDylib => self.build_dylib(out_filename), ++ LinkOutputKind::DynamicDylib => self.build_dylib(crate_type, out_filename), + LinkOutputKind::StaticDylib => { + self.link_or_cc_arg("-static"); +- self.build_dylib(out_filename); ++ self.build_dylib(crate_type, out_filename); + } + LinkOutputKind::WasiReactorExe => { + self.link_args(&["--entry", "_initialize"]); +@@ -866,7 +876,12 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) { ++ fn set_output_kind( ++ &mut self, ++ output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ out_filename: &Path, ++ ) { + match output_kind { + LinkOutputKind::DynamicNoPicExe + | LinkOutputKind::DynamicPicExe +@@ -1124,7 +1139,13 @@ fn is_cc(&self) -> bool { + true + } + +- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} ++ fn set_output_kind( ++ &mut self, ++ _output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ _out_filename: &Path, ++ ) { ++ } + + fn link_dylib_by_name(&mut self, name: &str, _verbatim: bool, _as_needed: bool) { + // Emscripten always links statically +@@ -1273,7 +1294,12 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, output_kind: LinkOutputKind, _out_filename: &Path) { ++ fn set_output_kind( ++ &mut self, ++ output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ _out_filename: &Path, ++ ) { + match output_kind { + LinkOutputKind::DynamicNoPicExe + | LinkOutputKind::DynamicPicExe +@@ -1422,7 +1448,13 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} ++ fn set_output_kind( ++ &mut self, ++ _output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ _out_filename: &Path, ++ ) { ++ } + + fn link_staticlib_by_name(&mut self, name: &str, _verbatim: bool, whole_archive: bool) { + self.hint_static(); +@@ -1568,7 +1600,12 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) { ++ fn set_output_kind( ++ &mut self, ++ output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ out_filename: &Path, ++ ) { + match output_kind { + LinkOutputKind::DynamicDylib => { + self.hint_dynamic(); +@@ -1775,7 +1812,13 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} ++ fn set_output_kind( ++ &mut self, ++ _output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ _out_filename: &Path, ++ ) { ++ } + + fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) { + panic!("staticlibs not supported") +@@ -1841,7 +1884,13 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} ++ fn set_output_kind( ++ &mut self, ++ _output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ _out_filename: &Path, ++ ) { ++ } + + fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) { + panic!("staticlibs not supported") +@@ -1912,7 +1961,13 @@ fn cmd(&mut self) -> &mut Command { + &mut self.cmd + } + +- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} ++ fn set_output_kind( ++ &mut self, ++ _output_kind: LinkOutputKind, ++ _crate_type: CrateType, ++ _out_filename: &Path, ++ ) { ++ } + + fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) { + panic!("staticlibs not supported") +diff --git a/tests/run-make/dylib-soname/rmake.rs b/tests/run-make/dylib-soname/rmake.rs +index cec0d4638424..714997cbc1a1 100644 +--- a/tests/run-make/dylib-soname/rmake.rs ++++ b/tests/run-make/dylib-soname/rmake.rs +@@ -7,12 +7,16 @@ + use run_make_support::{cmd, run_in_tmpdir, rustc}; + + fn main() { ++ let check = |ty: &str| { ++ rustc().crate_name("foo").crate_type(ty).input("foo.rs").run(); ++ cmd("readelf").arg("-d").arg("libfoo.so").run() ++ }; + run_in_tmpdir(|| { +- rustc().crate_name("foo").crate_type("dylib").input("foo.rs").run(); +- cmd("readelf") +- .arg("-d") +- .arg("libfoo.so") +- .run() +- .assert_stdout_contains("Library soname: [libfoo.so]"); ++ // Rust dylibs should get a relative SONAME ++ check("dylib").assert_stdout_contains("Library soname: [libfoo.so]"); ++ }); ++ run_in_tmpdir(|| { ++ // C dylibs should not implicitly get any SONAME ++ check("cdylib").assert_stdout_not_contains("Library soname:"); + }); + } +-- +2.46.1 + diff --git a/rust.spec b/rust.spec index 29c67ef..6ae4bfc 100644 --- a/rust.spec +++ b/rust.spec @@ -162,6 +162,9 @@ Patch6: rustc-1.81.0-unbundle-sqlite.patch # https://github.com/rust-lang/rust/pull/128182 Patch7: 0001-handle-no_std-targets-on-std-builds.patch +# https://github.com/rust-lang/rust/pull/130960 +Patch8: 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -666,6 +669,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 +%patch -P8 -p1 %if %with disabled_libssh2 %patch -P100 -p1 From 5dab1210ebd7063bb6bc3e673fd83f68c15eb622 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 30 Sep 2024 11:57:52 -0700 Subject: [PATCH 02/48] Apply patches for LLVM 19 --- rust.spec | 4 + rustc-1.81.0-Update-to-LLVM-19.patch | 560 +++++++++++++++++++++++++++ 2 files changed, 564 insertions(+) create mode 100644 rustc-1.81.0-Update-to-LLVM-19.patch diff --git a/rust.spec b/rust.spec index 6ae4bfc..e17968b 100644 --- a/rust.spec +++ b/rust.spec @@ -165,6 +165,9 @@ Patch7: 0001-handle-no_std-targets-on-std-builds.patch # https://github.com/rust-lang/rust/pull/130960 Patch8: 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch +# https://github.com/rust-lang/rust/pull/127513 +Patch9: rustc-1.81.0-Update-to-LLVM-19.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -670,6 +673,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %endif %patch -P7 -p1 %patch -P8 -p1 +%patch -P9 -p1 %if %with disabled_libssh2 %patch -P100 -p1 diff --git a/rustc-1.81.0-Update-to-LLVM-19.patch b/rustc-1.81.0-Update-to-LLVM-19.patch new file mode 100644 index 0000000..cd8145a --- /dev/null +++ b/rustc-1.81.0-Update-to-LLVM-19.patch @@ -0,0 +1,560 @@ +From 83f32e189ad59109a162a61d7844545c4eda48e7 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Tue, 9 Jul 2024 09:34:59 +0200 +Subject: [PATCH 1/4] Update to LLVM 19 + +(cherry picked from commit 579ab05e76f1434f3074195c7291895f1257bc97) +--- + .gitmodules | 2 +- + src/llvm-project | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/.gitmodules b/.gitmodules +index 9ad207a0d522..b5250d493864 100644 +--- a/.gitmodules ++++ b/.gitmodules +@@ -33,7 +33,7 @@ + [submodule "src/llvm-project"] + path = src/llvm-project + url = https://github.com/rust-lang/llvm-project.git +- branch = rustc/18.1-2024-05-19 ++ branch = rustc/19.1-2024-07-30 + shallow = true + [submodule "src/doc/embedded-book"] + path = src/doc/embedded-book +-- +2.46.1 + + +From 3bdb9f55ed61e1984e9b2ac23c328a4792e41b6e Mon Sep 17 00:00:00 2001 +From: Krasimir Georgiev +Date: Mon, 17 Jun 2024 09:35:38 +0000 +Subject: [PATCH 2/4] Disable MC/DC tests on LLVM 19 + +Disable the tests and generate an error if MC/DC is used on LLVM 19. +The support will be ported separately, as it is substantially +different on LLVM 19, and there are no plans to support both +versions. + +(cherry picked from commit 00bfd702dc8c3b760b4f965fd059a5f1db8bb2b1) +--- + compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 +- + tests/coverage/mcdc/condition-limit.rs | 1 + + tests/coverage/mcdc/if.rs | 1 + + tests/coverage/mcdc/inlined_expressions.rs | 1 + + tests/coverage/mcdc/nested_if.rs | 1 + + tests/coverage/mcdc/non_control_flow.rs | 1 + + 6 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +index 14757b27a375..493cfbcec2cf 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +@@ -1557,7 +1557,7 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) { + + extern "C" LLVMValueRef + LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) { +-#if LLVM_VERSION_GE(18, 0) ++#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0) + return wrap(llvm::Intrinsic::getDeclaration( + unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update)); + #else +diff --git a/tests/coverage/mcdc/condition-limit.rs b/tests/coverage/mcdc/condition-limit.rs +index 571c600ebd09..2ff46b11a168 100644 +--- a/tests/coverage/mcdc/condition-limit.rs ++++ b/tests/coverage/mcdc/condition-limit.rs +@@ -1,6 +1,7 @@ + #![feature(coverage_attribute)] + //@ edition: 2021 + //@ min-llvm-version: 18 ++//@ ignore-llvm-version: 19 - 99 + //@ compile-flags: -Zcoverage-options=mcdc + //@ llvm-cov-flags: --show-branches=count --show-mcdc + +diff --git a/tests/coverage/mcdc/if.rs b/tests/coverage/mcdc/if.rs +index d8e6b61a9d59..6f589659a3d7 100644 +--- a/tests/coverage/mcdc/if.rs ++++ b/tests/coverage/mcdc/if.rs +@@ -1,6 +1,7 @@ + #![feature(coverage_attribute)] + //@ edition: 2021 + //@ min-llvm-version: 18 ++//@ ignore-llvm-version: 19 - 99 + //@ compile-flags: -Zcoverage-options=mcdc + //@ llvm-cov-flags: --show-branches=count --show-mcdc + +diff --git a/tests/coverage/mcdc/inlined_expressions.rs b/tests/coverage/mcdc/inlined_expressions.rs +index 65f7ee66f399..fc1e4dae37c7 100644 +--- a/tests/coverage/mcdc/inlined_expressions.rs ++++ b/tests/coverage/mcdc/inlined_expressions.rs +@@ -1,6 +1,7 @@ + #![feature(coverage_attribute)] + //@ edition: 2021 + //@ min-llvm-version: 18 ++//@ ignore-llvm-version: 19 - 99 + //@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0 + //@ llvm-cov-flags: --show-branches=count --show-mcdc + +diff --git a/tests/coverage/mcdc/nested_if.rs b/tests/coverage/mcdc/nested_if.rs +index f5068b5dcc23..f9ce7a0bc254 100644 +--- a/tests/coverage/mcdc/nested_if.rs ++++ b/tests/coverage/mcdc/nested_if.rs +@@ -1,6 +1,7 @@ + #![feature(coverage_attribute)] + //@ edition: 2021 + //@ min-llvm-version: 18 ++//@ ignore-llvm-version: 19 - 99 + //@ compile-flags: -Zcoverage-options=mcdc + //@ llvm-cov-flags: --show-branches=count --show-mcdc + +diff --git a/tests/coverage/mcdc/non_control_flow.rs b/tests/coverage/mcdc/non_control_flow.rs +index 77e64e6625b2..633d381a1aaf 100644 +--- a/tests/coverage/mcdc/non_control_flow.rs ++++ b/tests/coverage/mcdc/non_control_flow.rs +@@ -1,6 +1,7 @@ + #![feature(coverage_attribute)] + //@ edition: 2021 + //@ min-llvm-version: 18 ++//@ ignore-llvm-version: 19 - 99 + //@ compile-flags: -Zcoverage-options=mcdc + //@ llvm-cov-flags: --show-branches=count --show-mcdc + +-- +2.46.1 + + +From d9476247415418ec6cc3478636ada38cf28feb69 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 24 Jul 2024 16:03:36 +0200 +Subject: [PATCH 3/4] Crash test for issue 121444 has been fixed + +(cherry picked from commit b960390548b373bd80b5d9fe590ae3b577e8e8f2) +--- + tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + rename tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} (68%) + +diff --git a/tests/crashes/121444.rs b/tests/ui/abi/large-byval-align.rs +similarity index 68% +rename from tests/crashes/121444.rs +rename to tests/ui/abi/large-byval-align.rs +index a6373a58c426..e39170df72b4 100644 +--- a/tests/crashes/121444.rs ++++ b/tests/ui/abi/large-byval-align.rs +@@ -1,11 +1,13 @@ +-//@ known-bug: #121444 + //@ compile-flags: -Copt-level=0 +-//@ edition:2021 + //@ only-x86_64 + //@ ignore-windows ++//@ min-llvm-version: 19 ++//@ build-pass ++ + #[repr(align(536870912))] + pub struct A(i64); + ++#[allow(improper_ctypes_definitions)] + pub extern "C" fn foo(x: A) {} + + fn main() { +-- +2.46.1 + + +From 05f84c2aa8853263b650b21637f689255413b923 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 30 Jul 2024 18:25:05 -0700 +Subject: [PATCH 4/4] Bless coverage/mcdc for line number changes + +(cherry picked from commit 33a36ea43851a767d8182938161b0dad4f9ae68c) +--- + tests/coverage/mcdc/condition-limit.cov-map | 8 +++--- + tests/coverage/mcdc/if.cov-map | 28 +++++++++---------- + .../coverage/mcdc/inlined_expressions.cov-map | 4 +-- + tests/coverage/mcdc/nested_if.cov-map | 16 +++++------ + tests/coverage/mcdc/non_control_flow.cov-map | 28 +++++++++---------- + 5 files changed, 42 insertions(+), 42 deletions(-) + +diff --git a/tests/coverage/mcdc/condition-limit.cov-map b/tests/coverage/mcdc/condition-limit.cov-map +index b4447a33691a..b565353572a7 100644 +--- a/tests/coverage/mcdc/condition-limit.cov-map ++++ b/tests/coverage/mcdc/condition-limit.cov-map +@@ -1,5 +1,5 @@ + Function name: condition_limit::bad +-Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 14, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02] ++Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 15, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 44 +@@ -48,7 +48,7 @@ Number of expressions: 44 + - expression 42 operands: lhs = Expression(43, Add), rhs = Counter(4) + - expression 43 operands: lhs = Counter(2), rhs = Counter(3) + Number of file 0 mappings: 17 +-- Code(Counter(0)) at (prev + 20, 1) to (start + 3, 9) ++- Code(Counter(0)) at (prev + 21, 1) to (start + 3, 9) + - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 3, 8) to (start + 0, 9) + true = c1 + false = (c0 - c1) +@@ -88,7 +88,7 @@ Number of file 0 mappings: 17 + = (c8 + ((((((c2 + c3) + c4) + c5) + c6) + c7) + (c0 - c1))) + + Function name: condition_limit::good +-Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0c, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02] ++Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0d, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 32 +@@ -125,7 +125,7 @@ Number of expressions: 32 + - expression 30 operands: lhs = Expression(31, Add), rhs = Counter(4) + - expression 31 operands: lhs = Counter(2), rhs = Counter(3) + Number of file 0 mappings: 16 +-- Code(Counter(0)) at (prev + 12, 1) to (start + 3, 9) ++- Code(Counter(0)) at (prev + 13, 1) to (start + 3, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 6 } at (prev + 3, 8) to (start + 0, 34) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 6, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +diff --git a/tests/coverage/mcdc/if.cov-map b/tests/coverage/mcdc/if.cov-map +index 9a7d15f700df..ea8dedb0ac36 100644 +--- a/tests/coverage/mcdc/if.cov-map ++++ b/tests/coverage/mcdc/if.cov-map +@@ -1,5 +1,5 @@ + Function name: if::mcdc_check_a +-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] ++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 10, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 4 +@@ -8,7 +8,7 @@ Number of expressions: 4 + - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) + - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 8 +-- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -24,7 +24,7 @@ Number of file 0 mappings: 8 + = (c3 + (c2 + (c0 - c1))) + + Function name: if::mcdc_check_b +-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] ++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 18, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 4 +@@ -33,7 +33,7 @@ Number of expressions: 4 + - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) + - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 8 +-- Code(Counter(0)) at (prev + 23, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 24, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -49,7 +49,7 @@ Number of file 0 mappings: 8 + = (c3 + (c2 + (c0 - c1))) + + Function name: if::mcdc_check_both +-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] ++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 20, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 4 +@@ -58,7 +58,7 @@ Number of expressions: 4 + - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) + - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 8 +-- Code(Counter(0)) at (prev + 31, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 32, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -74,7 +74,7 @@ Number of file 0 mappings: 8 + = (c3 + (c2 + (c0 - c1))) + + Function name: if::mcdc_check_neither +-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] ++Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 08, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 4 +@@ -83,7 +83,7 @@ Number of expressions: 4 + - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) + - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 8 +-- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -99,7 +99,7 @@ Number of file 0 mappings: 8 + = (c3 + (c2 + (c0 - c1))) + + Function name: if::mcdc_check_not_tree_decision +-Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02] ++Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 32, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 8 +@@ -112,7 +112,7 @@ Number of expressions: 8 + - expression 6 operands: lhs = Counter(3), rhs = Expression(7, Sub) + - expression 7 operands: lhs = Expression(0, Sub), rhs = Counter(2) + Number of file 0 mappings: 10 +-- Code(Counter(0)) at (prev + 49, 1) to (start + 3, 10) ++- Code(Counter(0)) at (prev + 50, 1) to (start + 3, 10) + - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 3 } at (prev + 0, 9) to (start + 0, 10) + true = c1 +@@ -134,7 +134,7 @@ Number of file 0 mappings: 10 + = (c4 + (c3 + ((c0 - c1) - c2))) + + Function name: if::mcdc_check_tree_decision +-Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02] ++Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 28, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 8 +@@ -147,7 +147,7 @@ Number of expressions: 8 + - expression 6 operands: lhs = Counter(3), rhs = Counter(4) + - expression 7 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 10 +-- Code(Counter(0)) at (prev + 39, 1) to (start + 3, 9) ++- Code(Counter(0)) at (prev + 40, 1) to (start + 3, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -169,7 +169,7 @@ Number of file 0 mappings: 10 + = ((c3 + c4) + (c2 + (c0 - c1))) + + Function name: if::mcdc_nested_if +-Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02] ++Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3c, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 13 +@@ -187,7 +187,7 @@ Number of expressions: 13 + - expression 11 operands: lhs = Counter(4), rhs = Counter(5) + - expression 12 operands: lhs = Expression(0, Sub), rhs = Counter(2) + Number of file 0 mappings: 14 +-- Code(Counter(0)) at (prev + 59, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 60, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +diff --git a/tests/coverage/mcdc/inlined_expressions.cov-map b/tests/coverage/mcdc/inlined_expressions.cov-map +index 09b7291c9649..8bb488c0dc07 100644 +--- a/tests/coverage/mcdc/inlined_expressions.cov-map ++++ b/tests/coverage/mcdc/inlined_expressions.cov-map +@@ -1,5 +1,5 @@ + Function name: inlined_expressions::inlined_instance +-Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 08, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02] ++Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 09, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 3 +@@ -7,7 +7,7 @@ Number of expressions: 3 + - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub) + - expression 2 operands: lhs = Counter(2), rhs = Counter(3) + Number of file 0 mappings: 6 +-- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 6) ++- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 6) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 5) to (start + 0, 11) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 5) to (start + 0, 6) + true = c1 +diff --git a/tests/coverage/mcdc/nested_if.cov-map b/tests/coverage/mcdc/nested_if.cov-map +index adeb6cbc1fb8..0bd2aef814c2 100644 +--- a/tests/coverage/mcdc/nested_if.cov-map ++++ b/tests/coverage/mcdc/nested_if.cov-map +@@ -1,5 +1,5 @@ + Function name: nested_if::doubly_nested_if_in_condition +-Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02] ++Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 10, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 14 +@@ -18,7 +18,7 @@ Number of expressions: 14 + - expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add) + - expression 13 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 20 +-- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -58,7 +58,7 @@ Number of file 0 mappings: 20 + = (c3 + (c2 + (c0 - c1))) + + Function name: nested_if::nested_if_in_condition +-Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02] ++Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 08, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 11 +@@ -74,7 +74,7 @@ Number of expressions: 11 + - expression 9 operands: lhs = Counter(3), rhs = Expression(10, Add) + - expression 10 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 14 +-- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -103,7 +103,7 @@ Number of file 0 mappings: 14 + = (c3 + (c2 + (c0 - c1))) + + Function name: nested_if::nested_in_then_block_in_condition +-Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02] ++Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 23, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 18 +@@ -126,7 +126,7 @@ Number of expressions: 18 + - expression 16 operands: lhs = Counter(3), rhs = Expression(17, Add) + - expression 17 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 20 +-- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9) ++- Code(Counter(0)) at (prev + 35, 1) to (start + 1, 9) + - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +@@ -167,7 +167,7 @@ Number of file 0 mappings: 20 + = (c3 + (c2 + (c0 - c1))) + + Function name: nested_if::nested_single_condition_decision +-Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02] ++Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 18, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 6 +@@ -178,7 +178,7 @@ Number of expressions: 6 + - expression 4 operands: lhs = Counter(3), rhs = Expression(5, Add) + - expression 5 operands: lhs = Counter(2), rhs = Expression(0, Sub) + Number of file 0 mappings: 11 +-- Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9) ++- Code(Counter(0)) at (prev + 24, 1) to (start + 4, 9) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) + true = c1 +diff --git a/tests/coverage/mcdc/non_control_flow.cov-map b/tests/coverage/mcdc/non_control_flow.cov-map +index f8576831e75f..0c6928b684d6 100644 +--- a/tests/coverage/mcdc/non_control_flow.cov-map ++++ b/tests/coverage/mcdc/non_control_flow.cov-map +@@ -1,5 +1,5 @@ + Function name: non_control_flow::assign_3 +-Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 16, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] ++Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 17, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 9 +@@ -13,7 +13,7 @@ Number of expressions: 9 + - expression 7 operands: lhs = Expression(8, Sub), rhs = Counter(4) + - expression 8 operands: lhs = Counter(0), rhs = Counter(1) + Number of file 0 mappings: 10 +-- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 40) ++- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 40) + - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) + = (c1 + ((c2 + c3) + c4)) + - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +@@ -35,7 +35,7 @@ Number of file 0 mappings: 10 + = (c1 + ((c2 + c3) + c4)) + + Function name: non_control_flow::assign_3_bis +-Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1b, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] ++Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1c, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 7 +@@ -47,7 +47,7 @@ Number of expressions: 7 + - expression 5 operands: lhs = Counter(1), rhs = Counter(2) + - expression 6 operands: lhs = Counter(0), rhs = Counter(1) + Number of file 0 mappings: 10 +-- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 44) ++- Code(Counter(0)) at (prev + 28, 1) to (start + 0, 44) + - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) + = ((c2 + c3) + c4) + - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +@@ -68,7 +68,7 @@ Number of file 0 mappings: 10 + = ((c2 + c3) + c4) + + Function name: non_control_flow::assign_and +-Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0c, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] ++Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0d, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 4 +@@ -77,7 +77,7 @@ Number of expressions: 4 + - expression 2 operands: lhs = Counter(0), rhs = Counter(1) + - expression 3 operands: lhs = Counter(0), rhs = Counter(1) + Number of file 0 mappings: 8 +-- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 33) ++- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 33) + - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) + = ((c2 + c3) + (c0 - c1)) + - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +@@ -93,7 +93,7 @@ Number of file 0 mappings: 8 + = ((c2 + c3) + (c0 - c1)) + + Function name: non_control_flow::assign_or +-Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 11, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] ++Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 12, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 4 +@@ -102,7 +102,7 @@ Number of expressions: 4 + - expression 2 operands: lhs = Counter(0), rhs = Counter(1) + - expression 3 operands: lhs = Counter(0), rhs = Counter(1) + Number of file 0 mappings: 8 +-- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 32) ++- Code(Counter(0)) at (prev + 18, 1) to (start + 0, 32) + - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) + = ((c1 + c2) + c3) + - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +@@ -119,15 +119,15 @@ Number of file 0 mappings: 8 + = ((c1 + c2) + c3) + + Function name: non_control_flow::foo +-Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 02, 02] ++Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 02, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 0 + Number of file 0 mappings: 1 +-- Code(Counter(0)) at (prev + 37, 1) to (start + 2, 2) ++- Code(Counter(0)) at (prev + 38, 1) to (start + 2, 2) + + Function name: non_control_flow::func_call +-Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 29, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02] ++Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 2a, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 3 +@@ -135,7 +135,7 @@ Number of expressions: 3 + - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub) + - expression 2 operands: lhs = Counter(2), rhs = Counter(3) + Number of file 0 mappings: 6 +-- Code(Counter(0)) at (prev + 41, 1) to (start + 1, 10) ++- Code(Counter(0)) at (prev + 42, 1) to (start + 1, 10) + - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 9) to (start + 0, 15) + - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 9) to (start + 0, 10) + true = c1 +@@ -148,7 +148,7 @@ Number of file 0 mappings: 6 + = ((c2 + c3) + (c0 - c1)) + + Function name: non_control_flow::right_comb_tree +-Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 20, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02] ++Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 21, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02] + Number of files: 1 + - file 0 => global file 1 + Number of expressions: 19 +@@ -172,7 +172,7 @@ Number of expressions: 19 + - expression 17 operands: lhs = Expression(18, Sub), rhs = Counter(5) + - expression 18 operands: lhs = Counter(1), rhs = Counter(6) + Number of file 0 mappings: 14 +-- Code(Counter(0)) at (prev + 32, 1) to (start + 0, 65) ++- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 65) + - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) + = (((((c2 + c3) + c4) + c5) + c6) + (c0 - c1)) + - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +-- +2.46.1 + From 04388f6e65312d834c3c26dc8e1bf6650057d292 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 1 Oct 2024 10:39:20 -0700 Subject: [PATCH 03/48] Skip crash tests [skip changelog] --- rust.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rust.spec b/rust.spec index e17968b..b3daf12 100644 --- a/rust.spec +++ b/rust.spec @@ -1006,9 +1006,12 @@ rm -rf "$TMP_HELLO" # The results are not stable on koji, so mask errors and just log it. # Some of the larger test artifacts are manually cleaned to save space. -# Bootstrap is excluded because it's not something we ship, and a lot of its -# tests are geared toward the upstream CI environment. -%{__x} test --no-fail-fast --skip src/bootstrap || : +# - Bootstrap is excluded because it's not something we ship, and a lot of its +# tests are geared toward the upstream CI environment. +# - Crashes are excluded because they are less reliable, especially stuff like +# SIGSEGV across different arches -- UB can do all kinds of weird things. +# They're only meant to notice "accidental" fixes anyway, not *should* crash. +%{__x} test --no-fail-fast --skip={src/bootstrap,tests/crashes} || : rm -rf "./build/%{rust_triple}/test/" %ifarch aarch64 From 06c0e45816d0f35409da9b8ee11bc05f28659b85 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 2 Oct 2024 10:41:49 -0700 Subject: [PATCH 04/48] [eln] Upgrade wasi-libc for clang-19 --- .gitignore | 1 + rust.spec | 4 ++-- sources | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f306e10..33e1c00 100644 --- a/.gitignore +++ b/.gitignore @@ -441,3 +441,4 @@ /rustc-1.80.1-src.tar.xz /wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz /rustc-1.81.0-src.tar.xz +/wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz diff --git a/rust.spec b/rust.spec index b3daf12..1a2ee8c 100644 --- a/rust.spec +++ b/rust.spec @@ -55,8 +55,8 @@ ExclusiveArch: %{rust_arches} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -#global wasi_libc_ref wasi-sdk-23 -%global wasi_libc_ref 3f43ea9abb24ed8d24d760989e1d87ea385f8eaa +#global wasi_libc_ref wasi-sdk-24 +%global wasi_libc_ref b9ef79d7dbd47c6c5bafdae760823467c2f60b70 %global wasi_libc_name wasi-libc-%{wasi_libc_ref} %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz %global wasi_libc_dir %{_builddir}/%{wasi_libc_name} diff --git a/sources b/sources index 6e100e8..140bdf7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (rustc-1.81.0-src.tar.xz) = b8a837ced521d2ca2c7f228a0640da591384519e4dbc1ae768524d50616da6abbd2f7bdae3777caebc0447dac91bf76481282ce5a2264d7f30e173caa6321a51 -SHA512 (wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz) = 845380a421bd002f0ccbbbf49cb16f36b4fb6401f98c9ccfa54d3a75832ca547f2823eedc3788be0a99cd582d9eb8ef5f16d828a6116ded133908ec9a7f20cf7 +SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e From 57f6a22eeaa0aab106739e427ed42a27573e0109 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 8 Oct 2024 12:44:32 -0700 Subject: [PATCH 05/48] Require rust libraries for rust-analyzer; Fixes RHBZ#2316529 --- rust.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust.spec b/rust.spec index 1a2ee8c..63e6097 100644 --- a/rust.spec +++ b/rust.spec @@ -572,6 +572,9 @@ A tool for formatting Rust code according to style guidelines. %package analyzer Summary: Rust implementation of the Language Server Protocol +# /usr/bin/rust-analyzer is dynamically linked against internal rustc libs +Requires: %{name}%{?_isa} = %{version}-%{release} + # The standard library sources are needed for most functionality. Recommends: %{name}-src From f737b8c4dddc2d64481479aec6c85bead138c1af Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Mon, 7 Oct 2024 20:32:16 -0700 Subject: [PATCH 06/48] Reenable the aarch64-unknown-none-softfloat target on RHEL This was dropped in https://gitlab.com/redhat/centos-stream/rpms/rust/-/commit/bdc2be1e01cc1b9cd63a34a0a4940b450a482863 but it's needed for EPEL 10, so adding it back. Resolves: RHEL-60808 Signed-off-by: Davide Cavalca (cherry picked from commit 175d35473cf8885da93bc888f7f4a54a369c84cd) --- rust.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust.spec b/rust.spec index 63e6097..b237757 100644 --- a/rust.spec +++ b/rust.spec @@ -46,6 +46,9 @@ ExclusiveArch: %{rust_arches} %if 0%{?fedora} %global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi %endif +%if 0%{?rhel} >= 10 +%global extra_targets aarch64-unknown-none-softfloat +%endif %endif %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets} %define target_enabled() %{lua: From 5b4a0fd51abd7fb5a0c8ab893ada0b1788adc615 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 17 Oct 2024 10:23:39 -0700 Subject: [PATCH 07/48] Update to Rust 1.82.0 --- .gitignore | 1 + ...sm-component-ld-to-match-other-tools.patch | 147 +++++ ...-an-automatic-SONAME-for-Rust-dylibs.patch | 234 -------- ...llow-disabling-target-self-contained.patch | 24 +- ...-handle-no_std-targets-on-std-builds.patch | 103 ---- ...xternal-library-path-for-wasm32-wasi.patch | 39 +- rust.spec | 37 +- rustc-1.81.0-Update-to-LLVM-19.patch | 560 ------------------ rustc-1.81.0-unbundle-sqlite.patch | 23 - ...atch => rustc-1.82.0-disable-libssh2.patch | 14 +- rustc-1.82.0-unbundle-sqlite.patch | 23 + sources | 2 +- 12 files changed, 225 insertions(+), 982 deletions(-) create mode 100644 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch delete mode 100644 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch delete mode 100644 0001-handle-no_std-targets-on-std-builds.patch delete mode 100644 rustc-1.81.0-Update-to-LLVM-19.patch delete mode 100644 rustc-1.81.0-unbundle-sqlite.patch rename rustc-1.81.0-disable-libssh2.patch => rustc-1.82.0-disable-libssh2.patch (69%) create mode 100644 rustc-1.82.0-unbundle-sqlite.patch diff --git a/.gitignore b/.gitignore index 33e1c00..61d9a93 100644 --- a/.gitignore +++ b/.gitignore @@ -442,3 +442,4 @@ /wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz /rustc-1.81.0-src.tar.xz /wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz +/rustc-1.82.0-src.tar.xz diff --git a/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch b/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch new file mode 100644 index 0000000..5364012 --- /dev/null +++ b/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch @@ -0,0 +1,147 @@ +From c15469a7fec811d1a4f69ff26e18c6f383df41d2 Mon Sep 17 00:00:00 2001 +From: Alex Crichton +Date: Fri, 6 Sep 2024 09:21:33 -0700 +Subject: [PATCH] Fix enabling wasm-component-ld to match other tools + +It was [pointed out recently][comment] that enabling `wasm-component-ld` +as a host tool is different from other host tools. This commit refactors +the logic to match by deduplicating selection of when to build other +tools and then using the same logic for `wasm-component-ld`. + +[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720 +--- + src/bootstrap/src/core/build_steps/compile.rs | 2 +- + src/bootstrap/src/core/build_steps/dist.rs | 2 +- + src/bootstrap/src/core/build_steps/tool.rs | 38 +++---------------- + src/bootstrap/src/lib.rs | 17 +++++---- + 4 files changed, 17 insertions(+), 42 deletions(-) + +diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs +index 1936c91ef83c..102c9fd25543 100644 +--- a/src/bootstrap/src/core/build_steps/compile.rs ++++ b/src/bootstrap/src/core/build_steps/compile.rs +@@ -1912,7 +1912,7 @@ fn run(self, builder: &Builder<'_>) -> Compiler { + // delegates to the `rust-lld` binary for linking and then runs + // logic to create the final binary. This is used by the + // `wasm32-wasip2` target of Rust. +- if builder.build_wasm_component_ld() { ++ if builder.tool_enabled("wasm-component-ld") { + let wasm_component_ld_exe = + builder.ensure(crate::core::build_steps::tool::WasmComponentLd { + compiler: build_compiler, +diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs +index 4957de2e1b79..ccb5656d6716 100644 +--- a/src/bootstrap/src/core/build_steps/dist.rs ++++ b/src/bootstrap/src/core/build_steps/dist.rs +@@ -473,7 +473,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { + ); + } + } +- if builder.build_wasm_component_ld() { ++ if builder.tool_enabled("wasm-component-ld") { + let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin"); + let ld = exe("wasm-component-ld", compiler.host); + builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld)); +diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs +index 3a1eb43b801f..3c2d791c2090 100644 +--- a/src/bootstrap/src/core/build_steps/tool.rs ++++ b/src/bootstrap/src/core/build_steps/tool.rs +@@ -693,14 +693,7 @@ impl Step for Cargo { + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + let builder = run.builder; +- run.path("src/tools/cargo").default_condition( +- builder.config.extended +- && builder.config.tools.as_ref().map_or( +- true, +- // If `tools` is set, search list for this tool. +- |tools| tools.iter().any(|tool| tool == "cargo"), +- ), +- ) ++ run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo")) + } + + fn make_run(run: RunConfig<'_>) { +@@ -772,14 +765,7 @@ impl Step for RustAnalyzer { + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + let builder = run.builder; +- run.path("src/tools/rust-analyzer").default_condition( +- builder.config.extended +- && builder +- .config +- .tools +- .as_ref() +- .map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")), +- ) ++ run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer")) + } + + fn make_run(run: RunConfig<'_>) { +@@ -821,12 +807,8 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/tools/rust-analyzer") + .path("src/tools/rust-analyzer/crates/proc-macro-srv-cli") + .default_condition( +- builder.config.extended +- && builder.config.tools.as_ref().map_or(true, |tools| { +- tools.iter().any(|tool| { +- tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv" +- }) +- }), ++ builder.tool_enabled("rust-analyzer") ++ || builder.tool_enabled("rust-analyzer-proc-macro-srv"), + ) + } + +@@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker { + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + let builder = run.builder; +- run.path("src/tools/llvm-bitcode-linker").default_condition( +- builder.config.extended +- && builder +- .config +- .tools +- .as_ref() +- .map_or(builder.build.unstable_features(), |tools| { +- tools.iter().any(|tool| tool == "llvm-bitcode-linker") +- }), +- ) ++ run.path("src/tools/llvm-bitcode-linker") ++ .default_condition(builder.tool_enabled("llvm-bitcode-linker")) + } + + fn make_run(run: RunConfig<'_>) { +diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs +index c76ce3409562..780024e307ed 100644 +--- a/src/bootstrap/src/lib.rs ++++ b/src/bootstrap/src/lib.rs +@@ -1407,16 +1407,17 @@ fn default_wasi_runner(&self) -> Option { + None + } + +- /// Returns whether it's requested that `wasm-component-ld` is built as part +- /// of the sysroot. This is done either with the `extended` key in +- /// `config.toml` or with the `tools` set. +- fn build_wasm_component_ld(&self) -> bool { +- if self.config.extended { +- return true; ++ /// Returns whether the specified tool is configured as part of this build. ++ /// ++ /// This requires that both the `extended` key is set and the `tools` key is ++ /// either unset or specifically contains the specified tool. ++ fn tool_enabled(&self, tool: &str) -> bool { ++ if !self.config.extended { ++ return false; + } + match &self.config.tools { +- Some(set) => set.contains("wasm-component-ld"), +- None => false, ++ Some(set) => set.contains(tool), ++ None => true, + } + } + +-- +2.46.0 + diff --git a/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch b/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch deleted file mode 100644 index 80970d1..0000000 --- a/0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch +++ /dev/null @@ -1,234 +0,0 @@ -From f46057bf1cc0dc24a0ecd7d87c9c93872e685253 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 27 Sep 2024 15:53:26 -0700 -Subject: [PATCH] Only add an automatic SONAME for Rust dylibs - ---- - compiler/rustc_codegen_ssa/src/back/link.rs | 2 +- - compiler/rustc_codegen_ssa/src/back/linker.rs | 83 +++++++++++++++---- - tests/run-make/dylib-soname/rmake.rs | 16 ++-- - 3 files changed, 80 insertions(+), 21 deletions(-) - -diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 80e8111516ee..a23cc5129261 100644 ---- a/compiler/rustc_codegen_ssa/src/back/link.rs -+++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -2490,7 +2490,7 @@ fn add_order_independent_options( - } - } - -- cmd.set_output_kind(link_output_kind, out_filename); -+ cmd.set_output_kind(link_output_kind, crate_type, out_filename); - - add_relro_args(cmd, sess); - -diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs -index a73ec83ee62c..3f3d305da014 100644 ---- a/compiler/rustc_codegen_ssa/src/back/linker.rs -+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs -@@ -275,7 +275,12 @@ pub(crate) trait Linker { - fn is_cc(&self) -> bool { - false - } -- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path); -+ fn set_output_kind( -+ &mut self, -+ output_kind: LinkOutputKind, -+ crate_type: CrateType, -+ out_filename: &Path, -+ ); - fn link_dylib_by_name(&mut self, _name: &str, _verbatim: bool, _as_needed: bool) { - bug!("dylib linked with unsupported linker") - } -@@ -396,7 +401,7 @@ fn push_linker_plugin_lto_args(&mut self, plugin_path: Option<&OsStr>) { - ]); - } - -- fn build_dylib(&mut self, out_filename: &Path) { -+ fn build_dylib(&mut self, crate_type: CrateType, out_filename: &Path) { - // On mac we need to tell the linker to let this library be rpathed - if self.sess.target.is_like_osx { - if !self.is_ld { -@@ -427,7 +432,7 @@ fn build_dylib(&mut self, out_filename: &Path) { - let mut out_implib = OsString::from("--out-implib="); - out_implib.push(out_filename.with_file_name(implib_name)); - self.link_arg(out_implib); -- } else { -+ } else if crate_type == CrateType::Dylib { - // When dylibs are linked by a full path this value will get into `DT_NEEDED` - // instead of the full path, so the library can be later found in some other - // location than that specific path. -@@ -474,7 +479,12 @@ fn is_cc(&self) -> bool { - !self.is_ld - } - -- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) { -+ fn set_output_kind( -+ &mut self, -+ output_kind: LinkOutputKind, -+ crate_type: CrateType, -+ out_filename: &Path, -+ ) { - match output_kind { - LinkOutputKind::DynamicNoPicExe => { - if !self.is_ld && self.is_gnu { -@@ -509,10 +519,10 @@ fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) - self.link_args(&["-static", "-pie", "--no-dynamic-linker", "-z", "text"]); - } - } -- LinkOutputKind::DynamicDylib => self.build_dylib(out_filename), -+ LinkOutputKind::DynamicDylib => self.build_dylib(crate_type, out_filename), - LinkOutputKind::StaticDylib => { - self.link_or_cc_arg("-static"); -- self.build_dylib(out_filename); -+ self.build_dylib(crate_type, out_filename); - } - LinkOutputKind::WasiReactorExe => { - self.link_args(&["--entry", "_initialize"]); -@@ -866,7 +876,12 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) { -+ fn set_output_kind( -+ &mut self, -+ output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ out_filename: &Path, -+ ) { - match output_kind { - LinkOutputKind::DynamicNoPicExe - | LinkOutputKind::DynamicPicExe -@@ -1124,7 +1139,13 @@ fn is_cc(&self) -> bool { - true - } - -- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} -+ fn set_output_kind( -+ &mut self, -+ _output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ _out_filename: &Path, -+ ) { -+ } - - fn link_dylib_by_name(&mut self, name: &str, _verbatim: bool, _as_needed: bool) { - // Emscripten always links statically -@@ -1273,7 +1294,12 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, output_kind: LinkOutputKind, _out_filename: &Path) { -+ fn set_output_kind( -+ &mut self, -+ output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ _out_filename: &Path, -+ ) { - match output_kind { - LinkOutputKind::DynamicNoPicExe - | LinkOutputKind::DynamicPicExe -@@ -1422,7 +1448,13 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} -+ fn set_output_kind( -+ &mut self, -+ _output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ _out_filename: &Path, -+ ) { -+ } - - fn link_staticlib_by_name(&mut self, name: &str, _verbatim: bool, whole_archive: bool) { - self.hint_static(); -@@ -1568,7 +1600,12 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) { -+ fn set_output_kind( -+ &mut self, -+ output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ out_filename: &Path, -+ ) { - match output_kind { - LinkOutputKind::DynamicDylib => { - self.hint_dynamic(); -@@ -1775,7 +1812,13 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} -+ fn set_output_kind( -+ &mut self, -+ _output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ _out_filename: &Path, -+ ) { -+ } - - fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) { - panic!("staticlibs not supported") -@@ -1841,7 +1884,13 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} -+ fn set_output_kind( -+ &mut self, -+ _output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ _out_filename: &Path, -+ ) { -+ } - - fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) { - panic!("staticlibs not supported") -@@ -1912,7 +1961,13 @@ fn cmd(&mut self) -> &mut Command { - &mut self.cmd - } - -- fn set_output_kind(&mut self, _output_kind: LinkOutputKind, _out_filename: &Path) {} -+ fn set_output_kind( -+ &mut self, -+ _output_kind: LinkOutputKind, -+ _crate_type: CrateType, -+ _out_filename: &Path, -+ ) { -+ } - - fn link_staticlib_by_name(&mut self, _name: &str, _verbatim: bool, _whole_archive: bool) { - panic!("staticlibs not supported") -diff --git a/tests/run-make/dylib-soname/rmake.rs b/tests/run-make/dylib-soname/rmake.rs -index cec0d4638424..714997cbc1a1 100644 ---- a/tests/run-make/dylib-soname/rmake.rs -+++ b/tests/run-make/dylib-soname/rmake.rs -@@ -7,12 +7,16 @@ - use run_make_support::{cmd, run_in_tmpdir, rustc}; - - fn main() { -+ let check = |ty: &str| { -+ rustc().crate_name("foo").crate_type(ty).input("foo.rs").run(); -+ cmd("readelf").arg("-d").arg("libfoo.so").run() -+ }; - run_in_tmpdir(|| { -- rustc().crate_name("foo").crate_type("dylib").input("foo.rs").run(); -- cmd("readelf") -- .arg("-d") -- .arg("libfoo.so") -- .run() -- .assert_stdout_contains("Library soname: [libfoo.so]"); -+ // Rust dylibs should get a relative SONAME -+ check("dylib").assert_stdout_contains("Library soname: [libfoo.so]"); -+ }); -+ run_in_tmpdir(|| { -+ // C dylibs should not implicitly get any SONAME -+ check("cdylib").assert_stdout_not_contains("Library soname:"); - }); - } --- -2.46.1 - diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index 4913cd8..428f354 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From 937b23ef51b1d2f3d12adc9bd90dfd27936326dd Mon Sep 17 00:00:00 2001 +From babdaf8354098399ec98c96eb3a3627664d6ba03 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:14:28 -0700 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained @@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index 26687bcfb370..381a23f9cead 100644 +index f1dc32234ccf..82207f19d471 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -872,6 +872,11 @@ +@@ -880,6 +880,11 @@ # argument as the test binary. #runner = (string) @@ -27,10 +27,10 @@ index 26687bcfb370..381a23f9cead 100644 # Distribution options # diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index 3e79acad1c4b..525b6e956405 100644 +index edf18e2ebf33..d48d027f329c 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -357,6 +357,10 @@ fn copy_self_contained_objects( +@@ -367,6 +367,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -42,10 +42,10 @@ index 3e79acad1c4b..525b6e956405 100644 t!(fs::create_dir_all(&libdir_self_contained)); let mut target_deps = vec![]; diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index 9d5aa795c6c0..720dc53514d3 100644 +index bdfee55d8d18..47fcd50e7e03 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -565,6 +565,7 @@ pub struct Target { +@@ -589,6 +589,7 @@ pub struct Target { pub runner: Option, pub no_std: bool, pub codegen_backends: Option>, @@ -53,7 +53,7 @@ index 9d5aa795c6c0..720dc53514d3 100644 } impl Target { -@@ -573,6 +574,9 @@ pub fn from_triple(triple: &str) -> Self { +@@ -597,6 +598,9 @@ pub fn from_triple(triple: &str) -> Self { if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") { target.no_std = true; } @@ -63,7 +63,7 @@ index 9d5aa795c6c0..720dc53514d3 100644 target } } -@@ -1140,6 +1144,7 @@ struct TomlTarget { +@@ -1165,6 +1169,7 @@ struct TomlTarget { no_std: Option = "no-std", codegen_backends: Option> = "codegen-backends", runner: Option = "runner", @@ -71,7 +71,7 @@ index 9d5aa795c6c0..720dc53514d3 100644 } } -@@ -1900,6 +1905,9 @@ fn get_table(option: &str) -> Result { +@@ -1967,6 +1972,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index 9d5aa795c6c0..720dc53514d3 100644 target.cxx = cfg.cxx.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index a8555b2c3673..70c41b51eb96 100644 +index 82b640f54234..f724aba50241 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1361,6 +1361,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1326,6 +1326,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } diff --git a/0001-handle-no_std-targets-on-std-builds.patch b/0001-handle-no_std-targets-on-std-builds.patch deleted file mode 100644 index 964b030..0000000 --- a/0001-handle-no_std-targets-on-std-builds.patch +++ /dev/null @@ -1,103 +0,0 @@ -From c41f254ad192a4ab402b40f8bdad169a8163140a Mon Sep 17 00:00:00 2001 -From: onur-ozkan -Date: Thu, 25 Jul 2024 15:59:25 +0300 -Subject: [PATCH] handle no_std targets on std builds - -This change unifies the `Step::run_make` logic and improves it by skipping -std specific crates for no_std targets. - -Signed-off-by: onur-ozkan -(cherry picked from commit 6e247195c644aa924a10c98cc8eb3a28e1a87929) ---- - src/bootstrap/src/core/build_steps/check.rs | 4 ++-- - src/bootstrap/src/core/build_steps/clippy.rs | 3 ++- - src/bootstrap/src/core/build_steps/compile.rs | 23 +++++++++++++++---- - 3 files changed, 22 insertions(+), 8 deletions(-) - -diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs -index 8235d4634b75..bbad3f179ac7 100644 ---- a/src/bootstrap/src/core/build_steps/check.rs -+++ b/src/bootstrap/src/core/build_steps/check.rs -@@ -1,7 +1,7 @@ - //! Implementation of compiling the compiler and standard library, in "check"-based modes. - - use crate::core::build_steps::compile::{ -- add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, -+ add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make, - }; - use crate::core::build_steps::tool::{prepare_tool_cargo, SourceType}; - use crate::core::builder::{ -@@ -47,7 +47,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - } - - fn make_run(run: RunConfig<'_>) { -- let crates = run.make_run_crates(Alias::Library); -+ let crates = std_crates_for_run_make(&run); - run.builder.ensure(Std { target: run.target, crates }); - } - -diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs -index 40a2112b1925..a3ab094d799d 100644 ---- a/src/bootstrap/src/core/build_steps/clippy.rs -+++ b/src/bootstrap/src/core/build_steps/clippy.rs -@@ -4,6 +4,7 @@ - - use crate::builder::Builder; - use crate::builder::ShouldRun; -+use crate::core::build_steps::compile::std_crates_for_run_make; - use crate::core::builder; - use crate::core::builder::crate_description; - use crate::core::builder::Alias; -@@ -122,7 +123,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - } - - fn make_run(run: RunConfig<'_>) { -- let crates = run.make_run_crates(Alias::Library); -+ let crates = std_crates_for_run_make(&run); - run.builder.ensure(Std { target: run.target, crates }); - } - -diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index 525b6e956405..19c8cbc54080 100644 ---- a/src/bootstrap/src/core/build_steps/compile.rs -+++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -127,11 +127,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - } - - fn make_run(run: RunConfig<'_>) { -- // If the paths include "library", build the entire standard library. -- let has_alias = -- run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library")); -- let crates = if has_alias { Default::default() } else { run.cargo_crates_in_set() }; -- -+ let crates = std_crates_for_run_make(&run); - run.builder.ensure(Std { - compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()), - target: run.target, -@@ -428,6 +424,23 @@ fn copy_self_contained_objects( - target_deps - } - -+/// Resolves standard library crates for `Std::run_make` for any build kind (like check, build, clippy, etc.). -+pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec { -+ let has_alias = run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library")); -+ let target_is_no_std = run.builder.no_std(run.target).unwrap_or(false); -+ -+ // For no_std targets, do not add any additional crates to the compilation other than what `compile::std_cargo` already adds for no_std targets. -+ if target_is_no_std { -+ vec![] -+ } -+ // If the paths include "library", build the entire standard library. -+ else if has_alias { -+ run.make_run_crates(builder::Alias::Library) -+ } else { -+ run.cargo_crates_in_set() -+ } -+} -+ - /// Configure cargo to compile the standard library, adding appropriate env vars - /// and such. - pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) { --- -2.46.0 - diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index 5d8c836..feeb0f3 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,19 +1,19 @@ -From 348b03695d916ab23a9d66c4ceed2ecbecfc68e7 Mon Sep 17 00:00:00 2001 +From 3fdce19416e80a48c5b2b77b2cdec697d0b5e225 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:18:16 -0700 Subject: [PATCH 2/2] set an external library path for wasm32-wasi --- - compiler/rustc_codegen_ssa/src/back/link.rs | 9 +++++++++ - compiler/rustc_target/src/spec/mod.rs | 4 ++++ - compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++--- - 3 files changed, 17 insertions(+), 3 deletions(-) + compiler/rustc_codegen_ssa/src/back/link.rs | 10 ++++++++++ + compiler/rustc_target/src/spec/mod.rs | 4 ++++ + .../rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++--- + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 8c582fac0d82..169d86cd6224 100644 +index e8143b9a5f38..5a928a18b3ea 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1586,6 +1586,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1621,6 +1621,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -23,13 +23,14 @@ index 8c582fac0d82..169d86cd6224 100644 + return file_path; + } + } - for search_path in fs.search_paths() { + for search_path in sess.target_filesearch(PathKind::Native).search_paths() { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -2076,6 +2082,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: - let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path(); - cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path)); - } +@@ -2123,6 +2129,10 @@ fn add_library_search_dirs( + ControlFlow::<()>::Continue(()) + }, + ); ++ + if let Some(lib_path) = &sess.target.options.external_lib_path { + cmd.include_path(Path::new(lib_path.as_ref())); + } @@ -37,10 +38,10 @@ index 8c582fac0d82..169d86cd6224 100644 /// Add options making relocation sections in the produced ELF files read-only diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 607eeac7ccdc..63070622502e 100644 +index d5f227a84a4c..54c22c8ebed6 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -2033,6 +2033,7 @@ pub struct TargetOptions { +@@ -2053,6 +2053,7 @@ pub struct TargetOptions { /// Objects to link before and after all other object code. pub pre_link_objects: CrtObjects, pub post_link_objects: CrtObjects, @@ -48,7 +49,7 @@ index 607eeac7ccdc..63070622502e 100644 /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. pub pre_link_objects_self_contained: CrtObjects, pub post_link_objects_self_contained: CrtObjects, -@@ -2520,6 +2521,7 @@ fn default() -> TargetOptions { +@@ -2540,6 +2541,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), @@ -56,7 +57,7 @@ index 607eeac7ccdc..63070622502e 100644 pre_link_objects_self_contained: Default::default(), post_link_objects_self_contained: Default::default(), link_self_contained: LinkSelfContainedDefault::False, -@@ -3202,6 +3204,7 @@ macro_rules! key { +@@ -3221,6 +3223,7 @@ macro_rules! key { key!(linker_is_gnu_json = "linker-is-gnu", bool); key!(pre_link_objects = "pre-link-objects", link_objects); key!(post_link_objects = "post-link-objects", link_objects); @@ -64,7 +65,7 @@ index 607eeac7ccdc..63070622502e 100644 key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects); key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects); // Deserializes the backwards-compatible variants of `-Clink-self-contained` -@@ -3464,6 +3467,7 @@ macro_rules! target_option_val { +@@ -3482,6 +3485,7 @@ macro_rules! target_option_val { target_option_val!(linker_is_gnu_json, "linker-is-gnu"); target_option_val!(pre_link_objects); target_option_val!(post_link_objects); @@ -73,10 +74,10 @@ index 607eeac7ccdc..63070622502e 100644 target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback"); target_option_val!(link_args - pre_link_args_json, "pre-link-args"); diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -index a8e7f22c0689..55949557d6bb 100644 +index 29e6dff2068f..dbe021ef064c 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -@@ -21,11 +21,12 @@ pub fn target() -> Target { +@@ -19,11 +19,12 @@ pub fn target() -> Target { options.env = "p1".into(); options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]); diff --git a/rust.spec b/rust.spec index b237757..f67def5 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.81.0 +Version: 1.82.0 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.80.1 -%global bootstrap_channel 1.80.1 -%global bootstrap_date 2024-08-08 +%global bootstrap_version 1.81.0 +%global bootstrap_channel 1.81.0 +%global bootstrap_date 2024-09-05 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -75,17 +75,17 @@ ExclusiveArch: %{rust_arches} # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 17.0+. %global min_llvm_version 17.0.0 -%global bundled_llvm_version 18.1.7 +%global bundled_llvm_version 19.1.1 #global llvm_compat_version 17 %global llvm llvm%{?llvm_compat_version} %bcond_with bundled_llvm -# Requires stable libgit2 1.7, and not the next minor soname change. +# Requires stable libgit2 1.8, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. %global min_libgit2_version 1.8.1 %global next_libgit2_version 1.9.0~ %global bundled_libgit2_version 1.8.1 -%if 0%{?fedora} >= 42 +%if 0%{?fedora} >= 41 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -93,7 +93,7 @@ ExclusiveArch: %{rust_arches} # Cargo uses UPSERTs with omitted conflict targets %global min_sqlite3_version 3.35 -%global bundled_sqlite3_version 3.45.0 +%global bundled_sqlite3_version 3.46.0 %if 0%{?rhel} && 0%{?rhel} < 10 %bcond_without bundled_sqlite3 %else @@ -159,17 +159,10 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.81.0-unbundle-sqlite.patch +Patch6: rustc-1.82.0-unbundle-sqlite.patch -# handle no_std targets on std builds -# https://github.com/rust-lang/rust/pull/128182 -Patch7: 0001-handle-no_std-targets-on-std-builds.patch - -# https://github.com/rust-lang/rust/pull/130960 -Patch8: 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch - -# https://github.com/rust-lang/rust/pull/127513 -Patch9: rustc-1.81.0-Update-to-LLVM-19.patch +# https://github.com/rust-lang/rust/pull/130034 +Patch7: 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch ### RHEL-specific patches below ### @@ -180,7 +173,7 @@ Source102: cargo_vendor.attr Source103: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.81.0-disable-libssh2.patch +Patch100: rustc-1.82.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -678,8 +671,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 -%patch -P8 -p1 -%patch -P9 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -775,9 +766,9 @@ end} %{export_rust_env} # Some builders have relatively little memory for their CPU count. -# At least 2GB per CPU is a good rule of thumb for building rustc. +# At least 4GB per CPU is a good rule of thumb for building rustc. ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) -max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 )) +max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 4 )) if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then ncpus="$max_cpus" fi diff --git a/rustc-1.81.0-Update-to-LLVM-19.patch b/rustc-1.81.0-Update-to-LLVM-19.patch deleted file mode 100644 index cd8145a..0000000 --- a/rustc-1.81.0-Update-to-LLVM-19.patch +++ /dev/null @@ -1,560 +0,0 @@ -From 83f32e189ad59109a162a61d7844545c4eda48e7 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Tue, 9 Jul 2024 09:34:59 +0200 -Subject: [PATCH 1/4] Update to LLVM 19 - -(cherry picked from commit 579ab05e76f1434f3074195c7291895f1257bc97) ---- - .gitmodules | 2 +- - src/llvm-project | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/.gitmodules b/.gitmodules -index 9ad207a0d522..b5250d493864 100644 ---- a/.gitmodules -+++ b/.gitmodules -@@ -33,7 +33,7 @@ - [submodule "src/llvm-project"] - path = src/llvm-project - url = https://github.com/rust-lang/llvm-project.git -- branch = rustc/18.1-2024-05-19 -+ branch = rustc/19.1-2024-07-30 - shallow = true - [submodule "src/doc/embedded-book"] - path = src/doc/embedded-book --- -2.46.1 - - -From 3bdb9f55ed61e1984e9b2ac23c328a4792e41b6e Mon Sep 17 00:00:00 2001 -From: Krasimir Georgiev -Date: Mon, 17 Jun 2024 09:35:38 +0000 -Subject: [PATCH 2/4] Disable MC/DC tests on LLVM 19 - -Disable the tests and generate an error if MC/DC is used on LLVM 19. -The support will be ported separately, as it is substantially -different on LLVM 19, and there are no plans to support both -versions. - -(cherry picked from commit 00bfd702dc8c3b760b4f965fd059a5f1db8bb2b1) ---- - compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 +- - tests/coverage/mcdc/condition-limit.rs | 1 + - tests/coverage/mcdc/if.rs | 1 + - tests/coverage/mcdc/inlined_expressions.rs | 1 + - tests/coverage/mcdc/nested_if.rs | 1 + - tests/coverage/mcdc/non_control_flow.rs | 1 + - 6 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -index 14757b27a375..493cfbcec2cf 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -@@ -1557,7 +1557,7 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) { - - extern "C" LLVMValueRef - LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) { --#if LLVM_VERSION_GE(18, 0) -+#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0) - return wrap(llvm::Intrinsic::getDeclaration( - unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update)); - #else -diff --git a/tests/coverage/mcdc/condition-limit.rs b/tests/coverage/mcdc/condition-limit.rs -index 571c600ebd09..2ff46b11a168 100644 ---- a/tests/coverage/mcdc/condition-limit.rs -+++ b/tests/coverage/mcdc/condition-limit.rs -@@ -1,6 +1,7 @@ - #![feature(coverage_attribute)] - //@ edition: 2021 - //@ min-llvm-version: 18 -+//@ ignore-llvm-version: 19 - 99 - //@ compile-flags: -Zcoverage-options=mcdc - //@ llvm-cov-flags: --show-branches=count --show-mcdc - -diff --git a/tests/coverage/mcdc/if.rs b/tests/coverage/mcdc/if.rs -index d8e6b61a9d59..6f589659a3d7 100644 ---- a/tests/coverage/mcdc/if.rs -+++ b/tests/coverage/mcdc/if.rs -@@ -1,6 +1,7 @@ - #![feature(coverage_attribute)] - //@ edition: 2021 - //@ min-llvm-version: 18 -+//@ ignore-llvm-version: 19 - 99 - //@ compile-flags: -Zcoverage-options=mcdc - //@ llvm-cov-flags: --show-branches=count --show-mcdc - -diff --git a/tests/coverage/mcdc/inlined_expressions.rs b/tests/coverage/mcdc/inlined_expressions.rs -index 65f7ee66f399..fc1e4dae37c7 100644 ---- a/tests/coverage/mcdc/inlined_expressions.rs -+++ b/tests/coverage/mcdc/inlined_expressions.rs -@@ -1,6 +1,7 @@ - #![feature(coverage_attribute)] - //@ edition: 2021 - //@ min-llvm-version: 18 -+//@ ignore-llvm-version: 19 - 99 - //@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0 - //@ llvm-cov-flags: --show-branches=count --show-mcdc - -diff --git a/tests/coverage/mcdc/nested_if.rs b/tests/coverage/mcdc/nested_if.rs -index f5068b5dcc23..f9ce7a0bc254 100644 ---- a/tests/coverage/mcdc/nested_if.rs -+++ b/tests/coverage/mcdc/nested_if.rs -@@ -1,6 +1,7 @@ - #![feature(coverage_attribute)] - //@ edition: 2021 - //@ min-llvm-version: 18 -+//@ ignore-llvm-version: 19 - 99 - //@ compile-flags: -Zcoverage-options=mcdc - //@ llvm-cov-flags: --show-branches=count --show-mcdc - -diff --git a/tests/coverage/mcdc/non_control_flow.rs b/tests/coverage/mcdc/non_control_flow.rs -index 77e64e6625b2..633d381a1aaf 100644 ---- a/tests/coverage/mcdc/non_control_flow.rs -+++ b/tests/coverage/mcdc/non_control_flow.rs -@@ -1,6 +1,7 @@ - #![feature(coverage_attribute)] - //@ edition: 2021 - //@ min-llvm-version: 18 -+//@ ignore-llvm-version: 19 - 99 - //@ compile-flags: -Zcoverage-options=mcdc - //@ llvm-cov-flags: --show-branches=count --show-mcdc - --- -2.46.1 - - -From d9476247415418ec6cc3478636ada38cf28feb69 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Wed, 24 Jul 2024 16:03:36 +0200 -Subject: [PATCH 3/4] Crash test for issue 121444 has been fixed - -(cherry picked from commit b960390548b373bd80b5d9fe590ae3b577e8e8f2) ---- - tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - rename tests/{crashes/121444.rs => ui/abi/large-byval-align.rs} (68%) - -diff --git a/tests/crashes/121444.rs b/tests/ui/abi/large-byval-align.rs -similarity index 68% -rename from tests/crashes/121444.rs -rename to tests/ui/abi/large-byval-align.rs -index a6373a58c426..e39170df72b4 100644 ---- a/tests/crashes/121444.rs -+++ b/tests/ui/abi/large-byval-align.rs -@@ -1,11 +1,13 @@ --//@ known-bug: #121444 - //@ compile-flags: -Copt-level=0 --//@ edition:2021 - //@ only-x86_64 - //@ ignore-windows -+//@ min-llvm-version: 19 -+//@ build-pass -+ - #[repr(align(536870912))] - pub struct A(i64); - -+#[allow(improper_ctypes_definitions)] - pub extern "C" fn foo(x: A) {} - - fn main() { --- -2.46.1 - - -From 05f84c2aa8853263b650b21637f689255413b923 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 30 Jul 2024 18:25:05 -0700 -Subject: [PATCH 4/4] Bless coverage/mcdc for line number changes - -(cherry picked from commit 33a36ea43851a767d8182938161b0dad4f9ae68c) ---- - tests/coverage/mcdc/condition-limit.cov-map | 8 +++--- - tests/coverage/mcdc/if.cov-map | 28 +++++++++---------- - .../coverage/mcdc/inlined_expressions.cov-map | 4 +-- - tests/coverage/mcdc/nested_if.cov-map | 16 +++++------ - tests/coverage/mcdc/non_control_flow.cov-map | 28 +++++++++---------- - 5 files changed, 42 insertions(+), 42 deletions(-) - -diff --git a/tests/coverage/mcdc/condition-limit.cov-map b/tests/coverage/mcdc/condition-limit.cov-map -index b4447a33691a..b565353572a7 100644 ---- a/tests/coverage/mcdc/condition-limit.cov-map -+++ b/tests/coverage/mcdc/condition-limit.cov-map -@@ -1,5 +1,5 @@ - Function name: condition_limit::bad --Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 14, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02] -+Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 15, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 44 -@@ -48,7 +48,7 @@ Number of expressions: 44 - - expression 42 operands: lhs = Expression(43, Add), rhs = Counter(4) - - expression 43 operands: lhs = Counter(2), rhs = Counter(3) - Number of file 0 mappings: 17 --- Code(Counter(0)) at (prev + 20, 1) to (start + 3, 9) -+- Code(Counter(0)) at (prev + 21, 1) to (start + 3, 9) - - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 3, 8) to (start + 0, 9) - true = c1 - false = (c0 - c1) -@@ -88,7 +88,7 @@ Number of file 0 mappings: 17 - = (c8 + ((((((c2 + c3) + c4) + c5) + c6) + c7) + (c0 - c1))) - - Function name: condition_limit::good --Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0c, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02] -+Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0d, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 32 -@@ -125,7 +125,7 @@ Number of expressions: 32 - - expression 30 operands: lhs = Expression(31, Add), rhs = Counter(4) - - expression 31 operands: lhs = Counter(2), rhs = Counter(3) - Number of file 0 mappings: 16 --- Code(Counter(0)) at (prev + 12, 1) to (start + 3, 9) -+- Code(Counter(0)) at (prev + 13, 1) to (start + 3, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 6 } at (prev + 3, 8) to (start + 0, 34) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 6, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -diff --git a/tests/coverage/mcdc/if.cov-map b/tests/coverage/mcdc/if.cov-map -index 9a7d15f700df..ea8dedb0ac36 100644 ---- a/tests/coverage/mcdc/if.cov-map -+++ b/tests/coverage/mcdc/if.cov-map -@@ -1,5 +1,5 @@ - Function name: if::mcdc_check_a --Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] -+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 10, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 4 -@@ -8,7 +8,7 @@ Number of expressions: 4 - - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) - - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 8 --- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -24,7 +24,7 @@ Number of file 0 mappings: 8 - = (c3 + (c2 + (c0 - c1))) - - Function name: if::mcdc_check_b --Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] -+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 18, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 4 -@@ -33,7 +33,7 @@ Number of expressions: 4 - - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) - - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 8 --- Code(Counter(0)) at (prev + 23, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 24, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -49,7 +49,7 @@ Number of file 0 mappings: 8 - = (c3 + (c2 + (c0 - c1))) - - Function name: if::mcdc_check_both --Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] -+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 20, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 4 -@@ -58,7 +58,7 @@ Number of expressions: 4 - - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) - - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 8 --- Code(Counter(0)) at (prev + 31, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 32, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -74,7 +74,7 @@ Number of file 0 mappings: 8 - = (c3 + (c2 + (c0 - c1))) - - Function name: if::mcdc_check_neither --Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] -+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 08, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 4 -@@ -83,7 +83,7 @@ Number of expressions: 4 - - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add) - - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 8 --- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -99,7 +99,7 @@ Number of file 0 mappings: 8 - = (c3 + (c2 + (c0 - c1))) - - Function name: if::mcdc_check_not_tree_decision --Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02] -+Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 32, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 8 -@@ -112,7 +112,7 @@ Number of expressions: 8 - - expression 6 operands: lhs = Counter(3), rhs = Expression(7, Sub) - - expression 7 operands: lhs = Expression(0, Sub), rhs = Counter(2) - Number of file 0 mappings: 10 --- Code(Counter(0)) at (prev + 49, 1) to (start + 3, 10) -+- Code(Counter(0)) at (prev + 50, 1) to (start + 3, 10) - - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 3 } at (prev + 0, 9) to (start + 0, 10) - true = c1 -@@ -134,7 +134,7 @@ Number of file 0 mappings: 10 - = (c4 + (c3 + ((c0 - c1) - c2))) - - Function name: if::mcdc_check_tree_decision --Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02] -+Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 28, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 8 -@@ -147,7 +147,7 @@ Number of expressions: 8 - - expression 6 operands: lhs = Counter(3), rhs = Counter(4) - - expression 7 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 10 --- Code(Counter(0)) at (prev + 39, 1) to (start + 3, 9) -+- Code(Counter(0)) at (prev + 40, 1) to (start + 3, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -169,7 +169,7 @@ Number of file 0 mappings: 10 - = ((c3 + c4) + (c2 + (c0 - c1))) - - Function name: if::mcdc_nested_if --Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02] -+Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3c, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 13 -@@ -187,7 +187,7 @@ Number of expressions: 13 - - expression 11 operands: lhs = Counter(4), rhs = Counter(5) - - expression 12 operands: lhs = Expression(0, Sub), rhs = Counter(2) - Number of file 0 mappings: 14 --- Code(Counter(0)) at (prev + 59, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 60, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -diff --git a/tests/coverage/mcdc/inlined_expressions.cov-map b/tests/coverage/mcdc/inlined_expressions.cov-map -index 09b7291c9649..8bb488c0dc07 100644 ---- a/tests/coverage/mcdc/inlined_expressions.cov-map -+++ b/tests/coverage/mcdc/inlined_expressions.cov-map -@@ -1,5 +1,5 @@ - Function name: inlined_expressions::inlined_instance --Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 08, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02] -+Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 09, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 3 -@@ -7,7 +7,7 @@ Number of expressions: 3 - - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub) - - expression 2 operands: lhs = Counter(2), rhs = Counter(3) - Number of file 0 mappings: 6 --- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 6) -+- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 6) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 5) to (start + 0, 11) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 5) to (start + 0, 6) - true = c1 -diff --git a/tests/coverage/mcdc/nested_if.cov-map b/tests/coverage/mcdc/nested_if.cov-map -index adeb6cbc1fb8..0bd2aef814c2 100644 ---- a/tests/coverage/mcdc/nested_if.cov-map -+++ b/tests/coverage/mcdc/nested_if.cov-map -@@ -1,5 +1,5 @@ - Function name: nested_if::doubly_nested_if_in_condition --Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02] -+Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 10, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 14 -@@ -18,7 +18,7 @@ Number of expressions: 14 - - expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add) - - expression 13 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 20 --- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -58,7 +58,7 @@ Number of file 0 mappings: 20 - = (c3 + (c2 + (c0 - c1))) - - Function name: nested_if::nested_if_in_condition --Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02] -+Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 08, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 11 -@@ -74,7 +74,7 @@ Number of expressions: 11 - - expression 9 operands: lhs = Counter(3), rhs = Expression(10, Add) - - expression 10 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 14 --- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -103,7 +103,7 @@ Number of file 0 mappings: 14 - = (c3 + (c2 + (c0 - c1))) - - Function name: nested_if::nested_in_then_block_in_condition --Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02] -+Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 23, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 18 -@@ -126,7 +126,7 @@ Number of expressions: 18 - - expression 16 operands: lhs = Counter(3), rhs = Expression(17, Add) - - expression 17 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 20 --- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9) -+- Code(Counter(0)) at (prev + 35, 1) to (start + 1, 9) - - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -@@ -167,7 +167,7 @@ Number of file 0 mappings: 20 - = (c3 + (c2 + (c0 - c1))) - - Function name: nested_if::nested_single_condition_decision --Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02] -+Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 18, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 6 -@@ -178,7 +178,7 @@ Number of expressions: 6 - - expression 4 operands: lhs = Counter(3), rhs = Expression(5, Add) - - expression 5 operands: lhs = Counter(2), rhs = Expression(0, Sub) - Number of file 0 mappings: 11 --- Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9) -+- Code(Counter(0)) at (prev + 24, 1) to (start + 4, 9) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) - true = c1 -diff --git a/tests/coverage/mcdc/non_control_flow.cov-map b/tests/coverage/mcdc/non_control_flow.cov-map -index f8576831e75f..0c6928b684d6 100644 ---- a/tests/coverage/mcdc/non_control_flow.cov-map -+++ b/tests/coverage/mcdc/non_control_flow.cov-map -@@ -1,5 +1,5 @@ - Function name: non_control_flow::assign_3 --Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 16, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] -+Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 17, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 9 -@@ -13,7 +13,7 @@ Number of expressions: 9 - - expression 7 operands: lhs = Expression(8, Sub), rhs = Counter(4) - - expression 8 operands: lhs = Counter(0), rhs = Counter(1) - Number of file 0 mappings: 10 --- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 40) -+- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 40) - - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) - = (c1 + ((c2 + c3) + c4)) - - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) -@@ -35,7 +35,7 @@ Number of file 0 mappings: 10 - = (c1 + ((c2 + c3) + c4)) - - Function name: non_control_flow::assign_3_bis --Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1b, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] -+Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1c, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 7 -@@ -47,7 +47,7 @@ Number of expressions: 7 - - expression 5 operands: lhs = Counter(1), rhs = Counter(2) - - expression 6 operands: lhs = Counter(0), rhs = Counter(1) - Number of file 0 mappings: 10 --- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 44) -+- Code(Counter(0)) at (prev + 28, 1) to (start + 0, 44) - - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) - = ((c2 + c3) + c4) - - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) -@@ -68,7 +68,7 @@ Number of file 0 mappings: 10 - = ((c2 + c3) + c4) - - Function name: non_control_flow::assign_and --Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0c, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] -+Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0d, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 4 -@@ -77,7 +77,7 @@ Number of expressions: 4 - - expression 2 operands: lhs = Counter(0), rhs = Counter(1) - - expression 3 operands: lhs = Counter(0), rhs = Counter(1) - Number of file 0 mappings: 8 --- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 33) -+- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 33) - - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) - = ((c2 + c3) + (c0 - c1)) - - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) -@@ -93,7 +93,7 @@ Number of file 0 mappings: 8 - = ((c2 + c3) + (c0 - c1)) - - Function name: non_control_flow::assign_or --Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 11, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] -+Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 12, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 4 -@@ -102,7 +102,7 @@ Number of expressions: 4 - - expression 2 operands: lhs = Counter(0), rhs = Counter(1) - - expression 3 operands: lhs = Counter(0), rhs = Counter(1) - Number of file 0 mappings: 8 --- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 32) -+- Code(Counter(0)) at (prev + 18, 1) to (start + 0, 32) - - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) - = ((c1 + c2) + c3) - - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) -@@ -119,15 +119,15 @@ Number of file 0 mappings: 8 - = ((c1 + c2) + c3) - - Function name: non_control_flow::foo --Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 02, 02] -+Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 02, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 0 - Number of file 0 mappings: 1 --- Code(Counter(0)) at (prev + 37, 1) to (start + 2, 2) -+- Code(Counter(0)) at (prev + 38, 1) to (start + 2, 2) - - Function name: non_control_flow::func_call --Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 29, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02] -+Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 2a, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 3 -@@ -135,7 +135,7 @@ Number of expressions: 3 - - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub) - - expression 2 operands: lhs = Counter(2), rhs = Counter(3) - Number of file 0 mappings: 6 --- Code(Counter(0)) at (prev + 41, 1) to (start + 1, 10) -+- Code(Counter(0)) at (prev + 42, 1) to (start + 1, 10) - - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 9) to (start + 0, 15) - - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 9) to (start + 0, 10) - true = c1 -@@ -148,7 +148,7 @@ Number of file 0 mappings: 6 - = ((c2 + c3) + (c0 - c1)) - - Function name: non_control_flow::right_comb_tree --Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 20, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02] -+Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 21, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02] - Number of files: 1 - - file 0 => global file 1 - Number of expressions: 19 -@@ -172,7 +172,7 @@ Number of expressions: 19 - - expression 17 operands: lhs = Expression(18, Sub), rhs = Counter(5) - - expression 18 operands: lhs = Counter(1), rhs = Counter(6) - Number of file 0 mappings: 14 --- Code(Counter(0)) at (prev + 32, 1) to (start + 0, 65) -+- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 65) - - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10) - = (((((c2 + c3) + c4) + c5) + c6) + (c0 - c1)) - - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) --- -2.46.1 - diff --git a/rustc-1.81.0-unbundle-sqlite.patch b/rustc-1.81.0-unbundle-sqlite.patch deleted file mode 100644 index ec3ed1e..0000000 --- a/rustc-1.81.0-unbundle-sqlite.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-08-15 09:53:53.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-08-16 10:20:52.394575295 -0700 -@@ -2195,7 +2195,6 @@ version = "0.28.0" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" - dependencies = [ -- "cc", - "pkg-config", - "vcpkg", - ] -diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-08-16 10:20:52.394575295 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-08-16 10:21:50.535122479 -0700 -@@ -77,7 +77,7 @@ proptest = "1.4.0" - pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] } - rand = "0.8.5" - regex = "1.10.4" --rusqlite = { version = "0.31.0", features = ["bundled"] } -+rusqlite = { version = "0.31.0", features = [] } - rustfix = { version = "0.8.2", path = "crates/rustfix" } - same-file = "1.0.6" - security-framework = "2.10.0" diff --git a/rustc-1.81.0-disable-libssh2.patch b/rustc-1.82.0-disable-libssh2.patch similarity index 69% rename from rustc-1.81.0-disable-libssh2.patch rename to rustc-1.82.0-disable-libssh2.patch index abee3c3..69f5704 100644 --- a/rustc-1.81.0-disable-libssh2.patch +++ b/rustc-1.82.0-disable-libssh2.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-08-26 09:03:52.769956890 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-08-26 09:03:52.773956573 -0700 -@@ -2155,7 +2155,6 @@ checksum = "10472326a8a6477c3c20a64547b0 +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-09-06 10:36:55.743405666 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-09-06 10:36:55.745405652 -0700 +@@ -2156,7 +2156,6 @@ checksum = "10472326a8a6477c3c20a64547b0 dependencies = [ "cc", "libc", @@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "libz-sys", "openssl-sys", "pkg-config", -@@ -2196,20 +2195,6 @@ dependencies = [ +@@ -2197,20 +2196,6 @@ dependencies = [ "pkg-config", "vcpkg", ] @@ -31,10 +31,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools [[package]] name = "libz-sys" diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-08-26 09:03:52.773956573 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-08-26 09:05:08.595934397 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-09-06 10:36:55.746405645 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-09-06 10:37:13.849280464 -0700 @@ -44,7 +44,7 @@ curl = "0.4.46" - curl-sys = "0.4.72" + curl-sys = "0.4.73" filetime = "0.2.23" flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] } -git2 = "0.19.0" diff --git a/rustc-1.82.0-unbundle-sqlite.patch b/rustc-1.82.0-unbundle-sqlite.patch new file mode 100644 index 0000000..f01397a --- /dev/null +++ b/rustc-1.82.0-unbundle-sqlite.patch @@ -0,0 +1,23 @@ +diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-09-06 10:30:29.435107742 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-09-06 10:31:57.168492758 -0700 +@@ -2194,7 +2194,6 @@ version = "0.30.1" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" + dependencies = [ +- "cc", + "pkg-config", + "vcpkg", + ] +diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-09-06 10:30:29.435107742 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-09-06 10:31:27.942697616 -0700 +@@ -77,7 +77,7 @@ proptest = "1.5.0" + pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] } + rand = "0.8.5" + regex = "1.10.5" +-rusqlite = { version = "0.32.0", features = ["bundled"] } ++rusqlite = { version = "0.32.0", features = [] } + rustfix = { version = "0.8.2", path = "crates/rustfix" } + same-file = "1.0.6" + security-framework = "2.11.1" diff --git a/sources b/sources index 140bdf7..2f35a76 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.81.0-src.tar.xz) = b8a837ced521d2ca2c7f228a0640da591384519e4dbc1ae768524d50616da6abbd2f7bdae3777caebc0447dac91bf76481282ce5a2264d7f30e173caa6321a51 +SHA512 (rustc-1.82.0-src.tar.xz) = d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0 SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e From 8ee619724008c9bf207ad03693b60b9f08a112b7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 29 Oct 2024 11:05:54 -0700 Subject: [PATCH 08/48] Set build.jobs for everything --- ...ap-allow-setting-jobs-in-config.toml.patch | 163 ++++++++++++++++++ rust.spec | 30 +++- 2 files changed, 186 insertions(+), 7 deletions(-) create mode 100644 0001-bootstrap-allow-setting-jobs-in-config.toml.patch diff --git a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch new file mode 100644 index 0000000..20f61c5 --- /dev/null +++ b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch @@ -0,0 +1,163 @@ +From 5d3e8210feabae1d80a9f21c18c9173b1fdc43ca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= + <39484203+jieyouxu@users.noreply.github.com> +Date: Thu, 17 Oct 2024 22:58:45 +0800 +Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml + +(cherry picked from commit 65458aed68fe6786068bab00e5a46d7ecdd2a072) +--- + config.example.toml | 5 ++ + src/bootstrap/src/core/config/config.rs | 5 +- + src/bootstrap/src/core/config/flags.rs | 3 +- + src/bootstrap/src/core/config/tests.rs | 58 +++++++++++++++++++++++ + src/bootstrap/src/utils/change_tracker.rs | 5 ++ + 5 files changed, 73 insertions(+), 3 deletions(-) + +diff --git a/config.example.toml b/config.example.toml +index f1dc32234ccf..40c7ac9f5023 100644 +--- a/config.example.toml ++++ b/config.example.toml +@@ -401,6 +401,11 @@ + # Specify the location of the Android NDK. Used when targeting Android. + #android-ndk = "/path/to/android-ndk-r26d" + ++# Number of parallel jobs to be used for building and testing. If set to `0` or ++# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag ++# passed to cargo invocations. ++#jobs = 0 ++ + # ============================================================================= + # General install configuration options + # ============================================================================= +diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs +index bdfee55d8d18..c1e0f8c6b338 100644 +--- a/src/bootstrap/src/core/config/config.rs ++++ b/src/bootstrap/src/core/config/config.rs +@@ -872,6 +872,7 @@ struct Build { + metrics: Option = "metrics", + android_ndk: Option = "android-ndk", + optimized_compiler_builtins: Option = "optimized-compiler-builtins", ++ jobs: Option = "jobs", + } + } + +@@ -1256,7 +1257,6 @@ pub(crate) fn parse_inner( + config.rustc_error_format = flags.rustc_error_format; + config.json_output = flags.json_output; + config.on_fail = flags.on_fail; +- config.jobs = Some(threads_from_config(flags.jobs as u32)); + config.cmd = flags.cmd; + config.incremental = flags.incremental; + config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled }; +@@ -1477,8 +1477,11 @@ fn get_table(option: &str) -> Result { + metrics: _, + android_ndk, + optimized_compiler_builtins, ++ jobs, + } = toml.build.unwrap_or_default(); + ++ config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0)))); ++ + if let Some(file_build) = build { + config.build = TargetSelection::from_user(&file_build); + }; +diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs +index c3f174028149..7fdd5f8b8cae 100644 +--- a/src/bootstrap/src/core/config/flags.rs ++++ b/src/bootstrap/src/core/config/flags.rs +@@ -110,11 +110,10 @@ pub struct Flags { + short, + long, + value_hint = clap::ValueHint::Other, +- default_value_t = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get), + value_name = "JOBS" + )] + /// number of jobs to run in parallel +- pub jobs: usize, ++ pub jobs: Option, + // This overrides the deny-warnings configuration option, + // which passes -Dwarnings to the compiler invocations. + #[arg(global = true, long)] +diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs +index 219c5a6ec914..bc49074fa316 100644 +--- a/src/bootstrap/src/core/config/tests.rs ++++ b/src/bootstrap/src/core/config/tests.rs +@@ -317,3 +317,61 @@ fn order_of_clippy_rules() { + + assert_eq!(expected, actual); + } ++ ++#[test] ++fn parse_jobs() { ++ assert_eq!(parse("build.jobs = 1").jobs, Some(1)); ++} ++ ++#[test] ++fn jobs_precedence() { ++ // `--jobs` should take precedence over using `--set build.jobs`. ++ ++ let config = Config::parse_inner( ++ Flags::parse(&[ ++ "check".to_owned(), ++ "--config=/does/not/exist".to_owned(), ++ "--jobs=67890".to_owned(), ++ "--set=build.jobs=12345".to_owned(), ++ ]), ++ |&_| toml::from_str(""), ++ ); ++ assert_eq!(config.jobs, Some(67890)); ++ ++ // `--set build.jobs` should take precedence over `config.toml`. ++ let config = Config::parse_inner( ++ Flags::parse(&[ ++ "check".to_owned(), ++ "--config=/does/not/exist".to_owned(), ++ "--set=build.jobs=12345".to_owned(), ++ ]), ++ |&_| { ++ toml::from_str( ++ r#" ++ [build] ++ jobs = 67890 ++ "#, ++ ) ++ }, ++ ); ++ assert_eq!(config.jobs, Some(12345)); ++ ++ // `--jobs` > `--set build.jobs` > `config.toml` ++ let config = Config::parse_inner( ++ Flags::parse(&[ ++ "check".to_owned(), ++ "--jobs=123".to_owned(), ++ "--config=/does/not/exist".to_owned(), ++ "--set=build.jobs=456".to_owned(), ++ ]), ++ |&_| { ++ toml::from_str( ++ r#" ++ [build] ++ jobs = 789 ++ "#, ++ ) ++ }, ++ ); ++ assert_eq!(config.jobs, Some(123)); ++} +diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs +index 51a25104e4cf..1f6a1064a5dc 100644 +--- a/src/bootstrap/src/utils/change_tracker.rs ++++ b/src/bootstrap/src/utils/change_tracker.rs +@@ -235,4 +235,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String { + severity: ChangeSeverity::Info, + summary: "The `build.profiler` option now tries to use source code from `download-ci-llvm` if possible, instead of checking out the `src/llvm-project` submodule.", + }, ++ ChangeInfo { ++ change_id: 131838, ++ severity: ChangeSeverity::Info, ++ summary: "Allow setting `--jobs` in config.toml with `build.jobs`.", ++ }, + ]; +-- +2.47.0 + diff --git a/rust.spec b/rust.spec index f67def5..4717bda 100644 --- a/rust.spec +++ b/rust.spec @@ -164,6 +164,9 @@ Patch6: rustc-1.82.0-unbundle-sqlite.patch # https://github.com/rust-lang/rust/pull/130034 Patch7: 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch +# https://github.com/rust-lang/rust/pull/131838 +Patch8: 0001-bootstrap-allow-setting-jobs-in-config.toml.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -671,6 +674,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 +%patch -P8 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -767,11 +771,22 @@ end} # Some builders have relatively little memory for their CPU count. # At least 4GB per CPU is a good rule of thumb for building rustc. -ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) -max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 4 )) -if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then - ncpus="$max_cpus" -fi +%if ! %defined constrain_build +%define constrain_build(m:) %{lua: + for l in io.lines('/proc/meminfo') do + if l:sub(1, 9) == "MemTotal:" then + local opt_m = math.tointeger(rpm.expand("%{-m*}")) + local mem_total = math.tointeger(string.match(l, "MemTotal:%s+(%d+)")) + local cpu_limit = math.max(1, mem_total // (opt_m * 1024)) + if cpu_limit < math.tointeger(rpm.expand("%_smp_build_ncpus")) then + rpm.define("_smp_build_ncpus " .. cpu_limit) + end + break + end + end +} +%endif +%constrain_build -m 4096 %if %defined mingw_targets %define mingw_target_config %{shrink: @@ -845,6 +860,7 @@ test -r "%{profiler}" --disable-rpath \ %{enable_debuginfo} \ %{enable_rust_opts} \ + --set build.jobs=%_smp_build_ncpus \ --set build.build-stage=2 \ --set build.doc-stage=2 \ --set build.install-stage=2 \ @@ -864,7 +880,7 @@ test -r "%{profiler}" %define profraw $PWD/build/profiles %define profdata $PWD/build/rustc.profdata mkdir -p "%{profraw}" -%{__x} build -j "$ncpus" sysroot --rust-profile-generate="%{profraw}" +%{__x} build sysroot --rust-profile-generate="%{profraw}" # Build cargo as a workload to generate compiler profiles env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \ %{__x} --keep-stage=0 --keep-stage=1 build cargo @@ -876,7 +892,7 @@ rm -r "%{profraw}" build/%{rust_triple}/stage2*/ %endif # Build the compiler normally (with or without PGO) -%{__x} build -j "$ncpus" sysroot +%{__x} build sysroot # Build everything else normally %{__x} build From 9d72a7a9c3e78752dd961cda81b8aec4961825a2 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Wed, 30 Oct 2024 17:06:19 +0100 Subject: [PATCH 09/48] Add unicode exception rules for rpminpect --- rpminspect.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rpminspect.yaml b/rpminspect.yaml index 15b680b..ac238da 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -6,3 +6,19 @@ debuginfo: # https://github.com/rust-lang/rust/issues/45854 - /usr/lib/debug/usr/bin/rustc-*.i386.debug +unicode: + ignore: + # These files are known to contain forbidden unicode chars as + # they are tests for those. + - rustc-*-src/tests/ui/lint/issue-90614-accept-allow-text-direction-codepoint-in-comment-lint.rs + - rustc-*-src/tests/ui/parser/unicode-control-codepoints.rs + - rustc-*-src/compiler/rustc_lint/src/hidden_unicode_codepoints.rs + - rustc-*-src/compiler/rustc_lint_defs/src/builtin.rs + - rustc-*-src/vendor/idna/tests/IdnaTestV2.txt + - rustc-*-src/vendor/idna-*/tests/IdnaTestV2.txt + - rustc-*-src/vendor/mdbook*/tests/dummy_book/src/first/unicode.md + - rustc-*-src/vendor/mdbook*/tests/searchindex_fixture.json + - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-string?.wat + - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-block-comment?.wat + - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-line-comment?.wat + - rustc-*-src/src/llvm-project/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst From 1338df248ac8ffbf796d8d279f24c89abcddec50 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 12 Nov 2024 13:20:32 -0800 Subject: [PATCH 10/48] [eln] update to wasi-libc-24 --- .gitignore | 1 + rust.spec | 3 +-- sources | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 61d9a93..4ae8e3f 100644 --- a/.gitignore +++ b/.gitignore @@ -443,3 +443,4 @@ /rustc-1.81.0-src.tar.xz /wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz /rustc-1.82.0-src.tar.xz +/wasi-libc-wasi-sdk-24.tar.gz diff --git a/rust.spec b/rust.spec index 4717bda..6e01ad2 100644 --- a/rust.spec +++ b/rust.spec @@ -58,8 +58,7 @@ ExclusiveArch: %{rust_arches} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -#global wasi_libc_ref wasi-sdk-24 -%global wasi_libc_ref b9ef79d7dbd47c6c5bafdae760823467c2f60b70 +%global wasi_libc_ref wasi-sdk-24 %global wasi_libc_name wasi-libc-%{wasi_libc_ref} %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz %global wasi_libc_dir %{_builddir}/%{wasi_libc_name} diff --git a/sources b/sources index 2f35a76..86b3e08 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (rustc-1.82.0-src.tar.xz) = d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0 -SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e +SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21 From 64ec772902aea5ef1212ce43e76c213b2d8211d9 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Nov 2024 06:52:10 -0800 Subject: [PATCH 11/48] Update to Rust 1.83.0 --- .gitignore | 1 + ...sm-component-ld-to-match-other-tools.patch | 147 ------------------ ...variables-override-some-default-CPUs.patch | 22 +-- ...ap-allow-setting-jobs-in-config.toml.patch | 31 ++-- rust.spec | 18 +-- sources | 2 +- 6 files changed, 35 insertions(+), 186 deletions(-) delete mode 100644 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch diff --git a/.gitignore b/.gitignore index 4ae8e3f..ed7c95b 100644 --- a/.gitignore +++ b/.gitignore @@ -444,3 +444,4 @@ /wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz /rustc-1.82.0-src.tar.xz /wasi-libc-wasi-sdk-24.tar.gz +/rustc-1.83.0-src.tar.xz diff --git a/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch b/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch deleted file mode 100644 index 5364012..0000000 --- a/0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch +++ /dev/null @@ -1,147 +0,0 @@ -From c15469a7fec811d1a4f69ff26e18c6f383df41d2 Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Fri, 6 Sep 2024 09:21:33 -0700 -Subject: [PATCH] Fix enabling wasm-component-ld to match other tools - -It was [pointed out recently][comment] that enabling `wasm-component-ld` -as a host tool is different from other host tools. This commit refactors -the logic to match by deduplicating selection of when to build other -tools and then using the same logic for `wasm-component-ld`. - -[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720 ---- - src/bootstrap/src/core/build_steps/compile.rs | 2 +- - src/bootstrap/src/core/build_steps/dist.rs | 2 +- - src/bootstrap/src/core/build_steps/tool.rs | 38 +++---------------- - src/bootstrap/src/lib.rs | 17 +++++---- - 4 files changed, 17 insertions(+), 42 deletions(-) - -diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index 1936c91ef83c..102c9fd25543 100644 ---- a/src/bootstrap/src/core/build_steps/compile.rs -+++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -1912,7 +1912,7 @@ fn run(self, builder: &Builder<'_>) -> Compiler { - // delegates to the `rust-lld` binary for linking and then runs - // logic to create the final binary. This is used by the - // `wasm32-wasip2` target of Rust. -- if builder.build_wasm_component_ld() { -+ if builder.tool_enabled("wasm-component-ld") { - let wasm_component_ld_exe = - builder.ensure(crate::core::build_steps::tool::WasmComponentLd { - compiler: build_compiler, -diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs -index 4957de2e1b79..ccb5656d6716 100644 ---- a/src/bootstrap/src/core/build_steps/dist.rs -+++ b/src/bootstrap/src/core/build_steps/dist.rs -@@ -473,7 +473,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { - ); - } - } -- if builder.build_wasm_component_ld() { -+ if builder.tool_enabled("wasm-component-ld") { - let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin"); - let ld = exe("wasm-component-ld", compiler.host); - builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld)); -diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs -index 3a1eb43b801f..3c2d791c2090 100644 ---- a/src/bootstrap/src/core/build_steps/tool.rs -+++ b/src/bootstrap/src/core/build_steps/tool.rs -@@ -693,14 +693,7 @@ impl Step for Cargo { - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; -- run.path("src/tools/cargo").default_condition( -- builder.config.extended -- && builder.config.tools.as_ref().map_or( -- true, -- // If `tools` is set, search list for this tool. -- |tools| tools.iter().any(|tool| tool == "cargo"), -- ), -- ) -+ run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo")) - } - - fn make_run(run: RunConfig<'_>) { -@@ -772,14 +765,7 @@ impl Step for RustAnalyzer { - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; -- run.path("src/tools/rust-analyzer").default_condition( -- builder.config.extended -- && builder -- .config -- .tools -- .as_ref() -- .map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")), -- ) -+ run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer")) - } - - fn make_run(run: RunConfig<'_>) { -@@ -821,12 +807,8 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/tools/rust-analyzer") - .path("src/tools/rust-analyzer/crates/proc-macro-srv-cli") - .default_condition( -- builder.config.extended -- && builder.config.tools.as_ref().map_or(true, |tools| { -- tools.iter().any(|tool| { -- tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv" -- }) -- }), -+ builder.tool_enabled("rust-analyzer") -+ || builder.tool_enabled("rust-analyzer-proc-macro-srv"), - ) - } - -@@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker { - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; -- run.path("src/tools/llvm-bitcode-linker").default_condition( -- builder.config.extended -- && builder -- .config -- .tools -- .as_ref() -- .map_or(builder.build.unstable_features(), |tools| { -- tools.iter().any(|tool| tool == "llvm-bitcode-linker") -- }), -- ) -+ run.path("src/tools/llvm-bitcode-linker") -+ .default_condition(builder.tool_enabled("llvm-bitcode-linker")) - } - - fn make_run(run: RunConfig<'_>) { -diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index c76ce3409562..780024e307ed 100644 ---- a/src/bootstrap/src/lib.rs -+++ b/src/bootstrap/src/lib.rs -@@ -1407,16 +1407,17 @@ fn default_wasi_runner(&self) -> Option { - None - } - -- /// Returns whether it's requested that `wasm-component-ld` is built as part -- /// of the sysroot. This is done either with the `extended` key in -- /// `config.toml` or with the `tools` set. -- fn build_wasm_component_ld(&self) -> bool { -- if self.config.extended { -- return true; -+ /// Returns whether the specified tool is configured as part of this build. -+ /// -+ /// This requires that both the `extended` key is set and the `tools` key is -+ /// either unset or specifically contains the specified tool. -+ fn tool_enabled(&self, tool: &str) -> bool { -+ if !self.config.extended { -+ return false; - } - match &self.config.tools { -- Some(set) => set.contains("wasm-component-ld"), -- None => false, -+ Some(set) => set.contains(tool), -+ None => true, - } - } - --- -2.46.0 - diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch index dc8be55..a590c54 100644 --- a/0001-Let-environment-variables-override-some-default-CPUs.patch +++ b/0001-Let-environment-variables-override-some-default-CPUs.patch @@ -1,4 +1,4 @@ -From 184d61d2c12aa2db01de9a14ccb2be0cfae5039b Mon Sep 17 00:00:00 2001 +From e12de251f8513f660bbfbc1c71883383bd1037f4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 9 Jun 2023 15:23:08 -0700 Subject: [PATCH] Let environment variables override some default CPUs @@ -10,12 +10,12 @@ Subject: [PATCH] Let environment variables override some default CPUs 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs -index 194c3170e683..9806ca78297c 100644 +index 23913687a1fd..3253fbc84c74 100644 --- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs @@ -2,7 +2,7 @@ - pub fn target() -> Target { + pub(crate) fn target() -> Target { let mut base = base::linux_gnu::opts(); - base.cpu = "ppc64le".into(); + base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into(); @@ -23,25 +23,25 @@ index 194c3170e683..9806ca78297c 100644 base.max_atomic_width = Some(64); base.stack_probes = StackProbeType::Inline; diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs -index 6fc410eb2235..c8f84edb9715 100644 +index 3efbb4648361..bcdaa5b8276d 100644 --- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs -@@ -5,7 +5,7 @@ pub fn target() -> Target { +@@ -5,7 +5,7 @@ pub(crate) fn target() -> Target { let mut base = base::linux_gnu::opts(); base.endian = Endian::Big; // z10 is the oldest CPU supported by LLVM - base.cpu = "z10".into(); + base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into(); - // FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector - // ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we - // also strip v128 from the data_layout below to match the older LLVM's expectation. + // FIXME: The ABI implementation in abi/call/s390x.rs is for now hard-coded to assume the no-vector + // ABI. Pass the -vector feature string to LLVM to respect this assumption. + base.features = "-vector".into(); diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs -index 80e267c163fa..8436a00e66d5 100644 +index 59ec6c7f9d5f..b6f1be890b20 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs @@ -2,7 +2,7 @@ - pub fn target() -> Target { + pub(crate) fn target() -> Target { let mut base = base::linux_gnu::opts(); - base.cpu = "x86-64".into(); + base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into(); @@ -49,5 +49,5 @@ index 80e267c163fa..8436a00e66d5 100644 base.max_atomic_width = Some(64); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); -- -2.41.0 +2.47.0 diff --git a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch index 20f61c5..577539e 100644 --- a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch +++ b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch @@ -1,10 +1,9 @@ -From 5d3e8210feabae1d80a9f21c18c9173b1fdc43ca Mon Sep 17 00:00:00 2001 +From 65458aed68fe6786068bab00e5a46d7ecdd2a072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:58:45 +0800 Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml -(cherry picked from commit 65458aed68fe6786068bab00e5a46d7ecdd2a072) --- config.example.toml | 5 ++ src/bootstrap/src/core/config/config.rs | 5 +- @@ -14,10 +13,10 @@ Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/config.example.toml b/config.example.toml -index f1dc32234ccf..40c7ac9f5023 100644 +index 4b591b949b36..168ac353cff7 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -401,6 +401,11 @@ +@@ -414,6 +414,11 @@ # Specify the location of the Android NDK. Used when targeting Android. #android-ndk = "/path/to/android-ndk-r26d" @@ -30,10 +29,10 @@ index f1dc32234ccf..40c7ac9f5023 100644 # General install configuration options # ============================================================================= diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index bdfee55d8d18..c1e0f8c6b338 100644 +index c2ab439891ea..aeb81b146382 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -872,6 +872,7 @@ struct Build { +@@ -891,6 +891,7 @@ struct Build { metrics: Option = "metrics", android_ndk: Option = "android-ndk", optimized_compiler_builtins: Option = "optimized-compiler-builtins", @@ -41,7 +40,7 @@ index bdfee55d8d18..c1e0f8c6b338 100644 } } -@@ -1256,7 +1257,6 @@ pub(crate) fn parse_inner( +@@ -1289,7 +1290,6 @@ pub(crate) fn parse_inner( config.rustc_error_format = flags.rustc_error_format; config.json_output = flags.json_output; config.on_fail = flags.on_fail; @@ -49,7 +48,7 @@ index bdfee55d8d18..c1e0f8c6b338 100644 config.cmd = flags.cmd; config.incremental = flags.incremental; config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled }; -@@ -1477,8 +1477,11 @@ fn get_table(option: &str) -> Result { +@@ -1511,8 +1511,11 @@ fn get_table(option: &str) -> Result { metrics: _, android_ndk, optimized_compiler_builtins, @@ -62,7 +61,7 @@ index bdfee55d8d18..c1e0f8c6b338 100644 config.build = TargetSelection::from_user(&file_build); }; diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs -index c3f174028149..7fdd5f8b8cae 100644 +index 3aefe517a5be..bfeb811508c0 100644 --- a/src/bootstrap/src/core/config/flags.rs +++ b/src/bootstrap/src/core/config/flags.rs @@ -110,11 +110,10 @@ pub struct Flags { @@ -79,12 +78,12 @@ index c3f174028149..7fdd5f8b8cae 100644 // which passes -Dwarnings to the compiler invocations. #[arg(global = true, long)] diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs -index 219c5a6ec914..bc49074fa316 100644 +index 2611b6cf51bb..1f02757682c2 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs -@@ -317,3 +317,61 @@ fn order_of_clippy_rules() { - - assert_eq!(expected, actual); +@@ -352,3 +352,61 @@ fn parse_rust_std_features_empty() { + fn parse_rust_std_features_invalid() { + parse("rust.std-features = \"backtrace\""); } + +#[test] @@ -145,12 +144,12 @@ index 219c5a6ec914..bc49074fa316 100644 + assert_eq!(config.jobs, Some(123)); +} diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs -index 51a25104e4cf..1f6a1064a5dc 100644 +index b37786496cb5..9169bc90a45d 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs -@@ -235,4 +235,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String { +@@ -275,4 +275,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String { severity: ChangeSeverity::Info, - summary: "The `build.profiler` option now tries to use source code from `download-ci-llvm` if possible, instead of checking out the `src/llvm-project` submodule.", + summary: "New option `./x setup editor` added, replacing `./x setup vscode` and adding support for vim, emacs and helix.", }, + ChangeInfo { + change_id: 131838, diff --git a/rust.spec b/rust.spec index 6e01ad2..91323ed 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.82.0 +Version: 1.83.0 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.81.0 -%global bootstrap_channel 1.81.0 -%global bootstrap_date 2024-09-05 +%global bootstrap_version 1.82.0 +%global bootstrap_channel 1.82.0 +%global bootstrap_date 2024-10-17 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -72,8 +72,8 @@ ExclusiveArch: %{rust_arches} %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 17.0+. -%global min_llvm_version 17.0.0 +# is insufficient. Rust currently requires LLVM 18.0+. +%global min_llvm_version 18.0.0 %global bundled_llvm_version 19.1.1 #global llvm_compat_version 17 %global llvm llvm%{?llvm_compat_version} @@ -160,11 +160,8 @@ Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys Patch6: rustc-1.82.0-unbundle-sqlite.patch -# https://github.com/rust-lang/rust/pull/130034 -Patch7: 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch - # https://github.com/rust-lang/rust/pull/131838 -Patch8: 0001-bootstrap-allow-setting-jobs-in-config.toml.patch +Patch7: 0001-bootstrap-allow-setting-jobs-in-config.toml.patch ### RHEL-specific patches below ### @@ -673,7 +670,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 -%patch -P8 -p1 %if %with disabled_libssh2 %patch -P100 -p1 diff --git a/sources b/sources index 86b3e08..41e5bf7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.82.0-src.tar.xz) = d158c7c71c1814bde2a3ec3cbeabe34949bd3201b730c0d7ec6baad4158bb28dd13696c430a6b99dc38b9d23ad7ddf8dde7d2487cbfbbbe9c3473016994210f0 +SHA512 (rustc-1.83.0-src.tar.xz) = 64db57949c6ac1df6a3f4c6bd0938685a5fb1bc3d318b34ccfcfccb0f9eff1cffd4d8a53a190ef0409eeca9ad12bc6234c2c1de69196cc74ae02d6afa20d0ce6 SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21 From 0f308eb7723e0f2b87103b9aee3842ce7e46143c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 2 Dec 2024 16:55:24 -0800 Subject: [PATCH 12/48] Exclude target shared libraries Now that the compiler is linking `std` statically, we don't really need that shared library for anything at all, so now it's excluded. --- rust.spec | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/rust.spec b/rust.spec index 91323ed..42f6746 100644 --- a/rust.spec +++ b/rust.spec @@ -929,19 +929,6 @@ find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ -exec chmod -v +x '{}' '+' -# The libdir libraries are identical to those under rustlib/. It's easier on -# library loading if we keep them in libdir, but we do need them in rustlib/ -# to support dynamic linking for compiler plugins, so we'll symlink. -find %{buildroot}%{rustlibdir}/%{rust_triple}/lib/ -maxdepth 1 -type f -name '*.so' | -while read lib; do - lib2="%{buildroot}%{_libdir}/${lib##*/}" - if [ -f "$lib2" ]; then - # make sure they're actually identical! - cmp "$lib" "$lib2" - ln -v -f -r -s -T "$lib2" "$lib" - fi -done - # Remove installer artifacts (manifests, uninstall scripts, etc.) find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' @@ -1048,10 +1035,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_libexecdir}/rust-analyzer-proc-macro-srv %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* -%dir %{rustlibdir} -%dir %{rustlibdir}/%{rust_triple} -%dir %{rustlibdir}/%{rust_triple}/lib -%{rustlibdir}/%{rust_triple}/lib/*.so %files std-static @@ -1059,6 +1042,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib +%exclude %{rustlibdir}/%{rust_triple}/lib/*.so %global target_files() \ %files std-static-%1 \ From ed69793c2f23d478f2c886a89deaf8ab824dbf6b Mon Sep 17 00:00:00 2001 From: David Michael Date: Sun, 24 Nov 2024 11:29:33 -0500 Subject: [PATCH 13/48] Move the target list definition after the rust_triple function This has no functional effect, it is just to be nice to downstreams for adding additional ABIs to the target list with minimal changes. It makes macros parametric to pass parameters to the Lua function, but this is still unused in this spec. Also clean up the ppc64 architecture from the list since it's not being build by ExclusiveArch anymore. [skip changelog] --- rust.spec | 81 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/rust.spec b/rust.spec index 42f6746..e716faa 100644 --- a/rust.spec +++ b/rust.spec @@ -25,36 +25,6 @@ ExclusiveArch: %{rust_arches} # add them to sources. Remember to remove them again after the bootstrap build! #global bootstrap_arches %%{rust_arches} -# Define a space-separated list of targets to ship rust-std-static-$triple for -# cross-compilation. The packages are noarch, but they're not fully -# reproducible between hosts, so only x86_64 actually builds it. -%ifarch x86_64 -%if 0%{?fedora} -%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu -%endif -# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1 -# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html -%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1 -%if 0%{?fedora} -%global extra_targets x86_64-unknown-none x86_64-unknown-uefi -%endif -%if 0%{?rhel} >= 10 -%global extra_targets x86_64-unknown-none -%endif -%endif -%ifarch aarch64 -%if 0%{?fedora} -%global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi -%endif -%if 0%{?rhel} >= 10 -%global extra_targets aarch64-unknown-none-softfloat -%endif -%endif -%global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets} -%define target_enabled() %{lua: - print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0) -} - # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc @@ -174,14 +144,12 @@ Source103: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) Patch100: rustc-1.82.0-disable-libssh2.patch -# Get the Rust triple for any arch. -%{lua: function rust_triple(arch) - local abi = "gnu" +# Get the Rust triple for any architecture and ABI. +%{lua: function rust_triple(arch, abi) + abi = abi or "gnu" if arch == "armv7hl" then arch = "armv7" - abi = "gnueabihf" - elseif arch == "ppc64" then - arch = "powerpc64" + abi = abi.."eabihf" elseif arch == "ppc64le" then arch = "powerpc64le" elseif arch == "riscv64" then @@ -190,11 +158,44 @@ Patch100: rustc-1.82.0-disable-libssh2.patch return arch.."-unknown-linux-"..abi end} -%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} +%define rust_triple() %{lua: print(rust_triple( + rpm.expand("%{?1}%{!?1:%{_target_cpu}}"), + rpm.expand("%{?2}%{!?2:gnu}") +))} -# Get the environment form of the Rust triple -%global rust_triple_env %{lua: - print(string.upper(string.gsub(rpm.expand("%{rust_triple}"), "-", "_"))) +# Get the environment variable form of the Rust triple. +%define rust_triple_env() %{lua: + print(rpm.expand("%{rust_triple %*}"):gsub("-", "_"):upper()) +} + +# Define a space-separated list of targets to ship rust-std-static-$triple for +# cross-compilation. The packages are noarch, but they're not fully +# reproducible between hosts, so only x86_64 actually builds it. +%ifarch x86_64 +%if 0%{?fedora} +%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu +%endif +# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1 +# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html +%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1 +%if 0%{?fedora} +%global extra_targets x86_64-unknown-none x86_64-unknown-uefi +%endif +%if 0%{?rhel} >= 10 +%global extra_targets x86_64-unknown-none +%endif +%endif +%ifarch aarch64 +%if 0%{?fedora} +%global extra_targets aarch64-unknown-none-softfloat aarch64-unknown-uefi +%endif +%if 0%{?rhel} >= 10 +%global extra_targets aarch64-unknown-none-softfloat +%endif +%endif +%global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets} +%define target_enabled() %{lua: + print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0) } %if %defined bootstrap_arches From 0e396642758c76268ff8962145993ae709882c36 Mon Sep 17 00:00:00 2001 From: David Michael Date: Sun, 24 Nov 2024 11:35:23 -0500 Subject: [PATCH 14/48] Put an upper bound on the cargo requirement as well Rebuilding a previous SRPM version will fail because cargo has the same version requirement as Rust, e.g.: Unexpected cargo version: 1.82.0, we should use 1.79.x/1.80.1 to build source with 1.80.1 --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index e716faa..119ca1d 100644 --- a/rust.spec +++ b/rust.spec @@ -229,7 +229,7 @@ end} %global local_rust_root %{_builddir}/rust-%{bootstrap_suffix} Provides: bundled(%{name}-bootstrap) = %{bootstrap_version} %else -BuildRequires: cargo >= %{bootstrap_version} +BuildRequires: (cargo >= %{bootstrap_version} with cargo <= %{version}) BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) %global local_rust_root %{_prefix} %endif From deb8dc4f03a679dcff6a7ca5e3dd118e802ece1d Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Fri, 13 Dec 2024 11:41:46 +0100 Subject: [PATCH 15/48] Update rpminspect unicode exceptions rust 1.83.0 ships gcc source, which includes some tests for unicode characters. This commit blacklists those tests so they won't raise false positives in rpminspect testing. --- rpminspect.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/rpminspect.yaml b/rpminspect.yaml index ac238da..2a29d4a 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -22,3 +22,4 @@ unicode: - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-block-comment?.wat - rustc-*-src/vendor/wast-*/tests/parse-fail/confusing-line-comment?.wat - rustc-*-src/src/llvm-project/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-bidirectional.rst + - rustc-*-src/src/gcc/gcc/testsuite/c-c++-common/*Wbidi*.c From 86da954d70596006dd60b2d540898e029473393d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 18 Dec 2024 14:02:30 -0800 Subject: [PATCH 16/48] prep: Remove submodules we don't need. --- rust.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust.spec b/rust.spec index 119ca1d..52c82c8 100644 --- a/rust.spec +++ b/rust.spec @@ -687,6 +687,10 @@ rm -rf src/llvm-project/ mkdir -p src/llvm-project/libunwind/ %endif +# Remove submodules we don't need. +rm -rf src/gcc +rm -rf src/tools/enzyme +rm -rf src/tools/rustc-perf # Remove other unused vendored libraries. This leaves the directory in place, # because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl". From 27d88bb597e6693a16177439de90f5abada12a7e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Jan 2025 08:39:49 -0800 Subject: [PATCH 17/48] Update to Rust 1.84.0 --- .gitignore | 2 + ...variables-override-some-default-CPUs.patch | 12 +- ...vm-objcopy-if-llvm-tools-are-enabled.patch | 25 +++ ...llow-disabling-target-self-contained.patch | 34 ++-- ...ap-allow-setting-jobs-in-config.toml.patch | 162 ------------------ ...xternal-library-path-for-wasm32-wasi.patch | 28 +-- rust.spec | 57 ++---- ...atch => rustc-1.84.0-disable-libssh2.patch | 16 +- ...atch => rustc-1.84.0-unbundle-sqlite.patch | 18 +- sources | 4 +- 10 files changed, 100 insertions(+), 258 deletions(-) create mode 100644 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch delete mode 100644 0001-bootstrap-allow-setting-jobs-in-config.toml.patch rename rustc-1.82.0-disable-libssh2.patch => rustc-1.84.0-disable-libssh2.patch (64%) rename rustc-1.82.0-unbundle-sqlite.patch => rustc-1.84.0-unbundle-sqlite.patch (50%) diff --git a/.gitignore b/.gitignore index ed7c95b..b0a96e9 100644 --- a/.gitignore +++ b/.gitignore @@ -445,3 +445,5 @@ /rustc-1.82.0-src.tar.xz /wasi-libc-wasi-sdk-24.tar.gz /rustc-1.83.0-src.tar.xz +/rustc-1.84.0-src.tar.xz +/wasi-libc-wasi-sdk-25.tar.gz diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch index a590c54..302c7fd 100644 --- a/0001-Let-environment-variables-override-some-default-CPUs.patch +++ b/0001-Let-environment-variables-override-some-default-CPUs.patch @@ -1,4 +1,4 @@ -From e12de251f8513f660bbfbc1c71883383bd1037f4 Mon Sep 17 00:00:00 2001 +From 5273432acfae75d6e509bbebcf8d28b0f3d820d0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 9 Jun 2023 15:23:08 -0700 Subject: [PATCH] Let environment variables override some default CPUs @@ -23,7 +23,7 @@ index 23913687a1fd..3253fbc84c74 100644 base.max_atomic_width = Some(64); base.stack_probes = StackProbeType::Inline; diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs -index 3efbb4648361..bcdaa5b8276d 100644 +index a84a18a433ff..441af1018ff3 100644 --- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs @@ -5,7 +5,7 @@ pub(crate) fn target() -> Target { @@ -32,9 +32,9 @@ index 3efbb4648361..bcdaa5b8276d 100644 // z10 is the oldest CPU supported by LLVM - base.cpu = "z10".into(); + base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into(); - // FIXME: The ABI implementation in abi/call/s390x.rs is for now hard-coded to assume the no-vector - // ABI. Pass the -vector feature string to LLVM to respect this assumption. - base.features = "-vector".into(); + base.max_atomic_width = Some(128); + base.min_global_align = Some(16); + base.stack_probes = StackProbeType::Inline; diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs index 59ec6c7f9d5f..b6f1be890b20 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs @@ -49,5 +49,5 @@ index 59ec6c7f9d5f..b6f1be890b20 100644 base.max_atomic_width = Some(64); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); -- -2.47.0 +2.47.1 diff --git a/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch b/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch new file mode 100644 index 0000000..ff57217 --- /dev/null +++ b/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch @@ -0,0 +1,25 @@ +From 4c6d793c66993a0f5455f35e73a1549d232c3ae5 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 12 Dec 2024 17:06:03 -0800 +Subject: [PATCH] Only dist `llvm-objcopy` if llvm tools are enabled + +--- + src/bootstrap/src/core/build_steps/dist.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs +index 0c739115165e..89b2d73f74a8 100644 +--- a/src/bootstrap/src/core/build_steps/dist.rs ++++ b/src/bootstrap/src/core/build_steps/dist.rs +@@ -471,7 +471,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { + } + } + +- { ++ if builder.config.llvm_enabled(compiler.host) && builder.config.llvm_tools_enabled { + let src_dir = builder.sysroot_target_bindir(compiler, host); + let llvm_objcopy = exe("llvm-objcopy", compiler.host); + let rust_objcopy = exe("rust-objcopy", compiler.host); +-- +2.47.1 + diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index 428f354..34d735d 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From babdaf8354098399ec98c96eb3a3627664d6ba03 Mon Sep 17 00:00:00 2001 +From 8d4d52446347872816ab51958e9f3162cf722ee6 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:14:28 -0700 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained @@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index f1dc32234ccf..82207f19d471 100644 +index d3233ad17b51..6a1f097c20cb 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -880,6 +880,11 @@ +@@ -916,6 +916,11 @@ # argument as the test binary. #runner = (string) @@ -27,10 +27,10 @@ index f1dc32234ccf..82207f19d471 100644 # Distribution options # diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index edf18e2ebf33..d48d027f329c 100644 +index 8e088682f92d..843b7123b120 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -367,6 +367,10 @@ fn copy_self_contained_objects( +@@ -346,6 +346,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -38,14 +38,14 @@ index edf18e2ebf33..d48d027f329c 100644 + return vec![]; + } + - let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained"); + let libdir_self_contained = + builder.sysroot_target_libdir(*compiler, target).join("self-contained"); t!(fs::create_dir_all(&libdir_self_contained)); - let mut target_deps = vec![]; diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index bdfee55d8d18..47fcd50e7e03 100644 +index e706aba977b6..a55d98e94dd8 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -589,6 +589,7 @@ pub struct Target { +@@ -627,6 +627,7 @@ pub struct Target { pub runner: Option, pub no_std: bool, pub codegen_backends: Option>, @@ -53,9 +53,9 @@ index bdfee55d8d18..47fcd50e7e03 100644 } impl Target { -@@ -597,6 +598,9 @@ pub fn from_triple(triple: &str) -> Self { - if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") { - target.no_std = true; +@@ -638,6 +639,9 @@ pub fn from_triple(triple: &str) -> Self { + if triple.contains("emscripten") { + target.runner = Some("node".into()); } + if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") { + target.self_contained = true; @@ -63,7 +63,7 @@ index bdfee55d8d18..47fcd50e7e03 100644 target } } -@@ -1165,6 +1169,7 @@ struct TomlTarget { +@@ -1213,6 +1217,7 @@ struct TomlTarget { no_std: Option = "no-std", codegen_backends: Option> = "codegen-backends", runner: Option = "runner", @@ -71,7 +71,7 @@ index bdfee55d8d18..47fcd50e7e03 100644 } } -@@ -1967,6 +1972,9 @@ fn get_table(option: &str) -> Result { +@@ -2038,6 +2043,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index bdfee55d8d18..47fcd50e7e03 100644 target.cxx = cfg.cxx.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 82b640f54234..f724aba50241 100644 +index c384fd6bf435..a101c010b740 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1326,6 +1326,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1351,6 +1351,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } @@ -98,5 +98,5 @@ index 82b640f54234..f724aba50241 100644 /// and `remote-test-server` binaries. fn remote_tested(&self, target: TargetSelection) -> bool { -- -2.46.0 +2.47.1 diff --git a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch b/0001-bootstrap-allow-setting-jobs-in-config.toml.patch deleted file mode 100644 index 577539e..0000000 --- a/0001-bootstrap-allow-setting-jobs-in-config.toml.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 65458aed68fe6786068bab00e5a46d7ecdd2a072 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= - <39484203+jieyouxu@users.noreply.github.com> -Date: Thu, 17 Oct 2024 22:58:45 +0800 -Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml - ---- - config.example.toml | 5 ++ - src/bootstrap/src/core/config/config.rs | 5 +- - src/bootstrap/src/core/config/flags.rs | 3 +- - src/bootstrap/src/core/config/tests.rs | 58 +++++++++++++++++++++++ - src/bootstrap/src/utils/change_tracker.rs | 5 ++ - 5 files changed, 73 insertions(+), 3 deletions(-) - -diff --git a/config.example.toml b/config.example.toml -index 4b591b949b36..168ac353cff7 100644 ---- a/config.example.toml -+++ b/config.example.toml -@@ -414,6 +414,11 @@ - # Specify the location of the Android NDK. Used when targeting Android. - #android-ndk = "/path/to/android-ndk-r26d" - -+# Number of parallel jobs to be used for building and testing. If set to `0` or -+# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag -+# passed to cargo invocations. -+#jobs = 0 -+ - # ============================================================================= - # General install configuration options - # ============================================================================= -diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index c2ab439891ea..aeb81b146382 100644 ---- a/src/bootstrap/src/core/config/config.rs -+++ b/src/bootstrap/src/core/config/config.rs -@@ -891,6 +891,7 @@ struct Build { - metrics: Option = "metrics", - android_ndk: Option = "android-ndk", - optimized_compiler_builtins: Option = "optimized-compiler-builtins", -+ jobs: Option = "jobs", - } - } - -@@ -1289,7 +1290,6 @@ pub(crate) fn parse_inner( - config.rustc_error_format = flags.rustc_error_format; - config.json_output = flags.json_output; - config.on_fail = flags.on_fail; -- config.jobs = Some(threads_from_config(flags.jobs as u32)); - config.cmd = flags.cmd; - config.incremental = flags.incremental; - config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled }; -@@ -1511,8 +1511,11 @@ fn get_table(option: &str) -> Result { - metrics: _, - android_ndk, - optimized_compiler_builtins, -+ jobs, - } = toml.build.unwrap_or_default(); - -+ config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0)))); -+ - if let Some(file_build) = build { - config.build = TargetSelection::from_user(&file_build); - }; -diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs -index 3aefe517a5be..bfeb811508c0 100644 ---- a/src/bootstrap/src/core/config/flags.rs -+++ b/src/bootstrap/src/core/config/flags.rs -@@ -110,11 +110,10 @@ pub struct Flags { - short, - long, - value_hint = clap::ValueHint::Other, -- default_value_t = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get), - value_name = "JOBS" - )] - /// number of jobs to run in parallel -- pub jobs: usize, -+ pub jobs: Option, - // This overrides the deny-warnings configuration option, - // which passes -Dwarnings to the compiler invocations. - #[arg(global = true, long)] -diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs -index 2611b6cf51bb..1f02757682c2 100644 ---- a/src/bootstrap/src/core/config/tests.rs -+++ b/src/bootstrap/src/core/config/tests.rs -@@ -352,3 +352,61 @@ fn parse_rust_std_features_empty() { - fn parse_rust_std_features_invalid() { - parse("rust.std-features = \"backtrace\""); - } -+ -+#[test] -+fn parse_jobs() { -+ assert_eq!(parse("build.jobs = 1").jobs, Some(1)); -+} -+ -+#[test] -+fn jobs_precedence() { -+ // `--jobs` should take precedence over using `--set build.jobs`. -+ -+ let config = Config::parse_inner( -+ Flags::parse(&[ -+ "check".to_owned(), -+ "--config=/does/not/exist".to_owned(), -+ "--jobs=67890".to_owned(), -+ "--set=build.jobs=12345".to_owned(), -+ ]), -+ |&_| toml::from_str(""), -+ ); -+ assert_eq!(config.jobs, Some(67890)); -+ -+ // `--set build.jobs` should take precedence over `config.toml`. -+ let config = Config::parse_inner( -+ Flags::parse(&[ -+ "check".to_owned(), -+ "--config=/does/not/exist".to_owned(), -+ "--set=build.jobs=12345".to_owned(), -+ ]), -+ |&_| { -+ toml::from_str( -+ r#" -+ [build] -+ jobs = 67890 -+ "#, -+ ) -+ }, -+ ); -+ assert_eq!(config.jobs, Some(12345)); -+ -+ // `--jobs` > `--set build.jobs` > `config.toml` -+ let config = Config::parse_inner( -+ Flags::parse(&[ -+ "check".to_owned(), -+ "--jobs=123".to_owned(), -+ "--config=/does/not/exist".to_owned(), -+ "--set=build.jobs=456".to_owned(), -+ ]), -+ |&_| { -+ toml::from_str( -+ r#" -+ [build] -+ jobs = 789 -+ "#, -+ ) -+ }, -+ ); -+ assert_eq!(config.jobs, Some(123)); -+} -diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs -index b37786496cb5..9169bc90a45d 100644 ---- a/src/bootstrap/src/utils/change_tracker.rs -+++ b/src/bootstrap/src/utils/change_tracker.rs -@@ -275,4 +275,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String { - severity: ChangeSeverity::Info, - summary: "New option `./x setup editor` added, replacing `./x setup vscode` and adding support for vim, emacs and helix.", - }, -+ ChangeInfo { -+ change_id: 131838, -+ severity: ChangeSeverity::Info, -+ summary: "Allow setting `--jobs` in config.toml with `build.jobs`.", -+ }, - ]; --- -2.47.0 - diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index feeb0f3..3a05424 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,4 +1,4 @@ -From 3fdce19416e80a48c5b2b77b2cdec697d0b5e225 Mon Sep 17 00:00:00 2001 +From 21d53eca2af5f04c0aa6b898f99f58e0e093cfdd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:18:16 -0700 Subject: [PATCH 2/2] set an external library path for wasm32-wasi @@ -10,10 +10,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index e8143b9a5f38..5a928a18b3ea 100644 +index 5149e3a12f23..cf62fbdc7f59 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1621,6 +1621,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1663,6 +1663,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -23,10 +23,10 @@ index e8143b9a5f38..5a928a18b3ea 100644 + return file_path; + } + } - for search_path in sess.target_filesearch(PathKind::Native).search_paths() { + for search_path in sess.target_filesearch().search_paths(PathKind::Native) { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -2123,6 +2129,10 @@ fn add_library_search_dirs( +@@ -2163,6 +2169,10 @@ fn add_library_search_dirs( ControlFlow::<()>::Continue(()) }, ); @@ -38,10 +38,10 @@ index e8143b9a5f38..5a928a18b3ea 100644 /// Add options making relocation sections in the produced ELF files read-only diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index d5f227a84a4c..54c22c8ebed6 100644 +index 321ab40403a3..54791c8892d8 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -2053,6 +2053,7 @@ pub struct TargetOptions { +@@ -2155,6 +2155,7 @@ pub struct TargetOptions { /// Objects to link before and after all other object code. pub pre_link_objects: CrtObjects, pub post_link_objects: CrtObjects, @@ -49,7 +49,7 @@ index d5f227a84a4c..54c22c8ebed6 100644 /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. pub pre_link_objects_self_contained: CrtObjects, pub post_link_objects_self_contained: CrtObjects, -@@ -2540,6 +2541,7 @@ fn default() -> TargetOptions { +@@ -2651,6 +2652,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), @@ -57,7 +57,7 @@ index d5f227a84a4c..54c22c8ebed6 100644 pre_link_objects_self_contained: Default::default(), post_link_objects_self_contained: Default::default(), link_self_contained: LinkSelfContainedDefault::False, -@@ -3221,6 +3223,7 @@ macro_rules! key { +@@ -3355,6 +3357,7 @@ macro_rules! key { key!(linker_is_gnu_json = "linker-is-gnu", bool); key!(pre_link_objects = "pre-link-objects", link_objects); key!(post_link_objects = "post-link-objects", link_objects); @@ -65,7 +65,7 @@ index d5f227a84a4c..54c22c8ebed6 100644 key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects); key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects); // Deserializes the backwards-compatible variants of `-Clink-self-contained` -@@ -3482,6 +3485,7 @@ macro_rules! target_option_val { +@@ -3636,6 +3639,7 @@ macro_rules! target_option_val { target_option_val!(linker_is_gnu_json, "linker-is-gnu"); target_option_val!(pre_link_objects); target_option_val!(post_link_objects); @@ -74,12 +74,12 @@ index d5f227a84a4c..54c22c8ebed6 100644 target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback"); target_option_val!(link_args - pre_link_args_json, "pre-link-args"); diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -index 29e6dff2068f..dbe021ef064c 100644 +index 1cd30f21bec1..9a752d5712a6 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -@@ -19,11 +19,12 @@ pub fn target() -> Target { +@@ -19,11 +19,12 @@ pub(crate) fn target() -> Target { options.env = "p1".into(); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]); + options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasip1"]); - options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained(); - options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained(); @@ -94,5 +94,5 @@ index 29e6dff2068f..dbe021ef064c 100644 // Right now this is a bit of a workaround but we're currently saying that // the target by default has a static crt which we're taking as a signal -- -2.46.0 +2.47.1 diff --git a/rust.spec b/rust.spec index 52c82c8..601e0fc 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.83.0 +Version: 1.84.0 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.82.0 -%global bootstrap_channel 1.82.0 -%global bootstrap_date 2024-10-17 +%global bootstrap_version 1.83.0 +%global bootstrap_channel 1.83.0 +%global bootstrap_date 2024-11-28 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -28,7 +28,7 @@ ExclusiveArch: %{rust_arches} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_ref wasi-sdk-24 +%global wasi_libc_ref wasi-sdk-25 %global wasi_libc_name wasi-libc-%{wasi_libc_ref} %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz %global wasi_libc_dir %{_builddir}/%{wasi_libc_name} @@ -44,7 +44,7 @@ ExclusiveArch: %{rust_arches} # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 18.0+. %global min_llvm_version 18.0.0 -%global bundled_llvm_version 19.1.1 +%global bundled_llvm_version 19.1.5 #global llvm_compat_version 17 %global llvm llvm%{?llvm_compat_version} %bcond_with bundled_llvm @@ -128,10 +128,10 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.82.0-unbundle-sqlite.patch +Patch6: rustc-1.84.0-unbundle-sqlite.patch -# https://github.com/rust-lang/rust/pull/131838 -Patch7: 0001-bootstrap-allow-setting-jobs-in-config.toml.patch +# https://github.com/rust-lang/rust/pull/134240 +Patch7: 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch ### RHEL-specific patches below ### @@ -142,7 +142,7 @@ Source102: cargo_vendor.attr Source103: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.82.0-disable-libssh2.patch +Patch100: rustc-1.84.0-disable-libssh2.patch # Get the Rust triple for any architecture and ABI. %{lua: function rust_triple(arch, abi) @@ -175,9 +175,7 @@ end} %if 0%{?fedora} %global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu %endif -# NB: wasm32-wasi is being gradually replaced by wasm32-wasip1 -# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html -%global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1 +%global wasm_targets wasm32-unknown-unknown wasm32-wasip1 %if 0%{?fedora} %global extra_targets x86_64-unknown-none x86_64-unknown-uefi %endif @@ -234,9 +232,10 @@ BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) %global local_rust_root %{_prefix} %endif +%global toolchain clang + BuildRequires: make -BuildRequires: gcc -BuildRequires: gcc-c++ +BuildRequires: clang BuildRequires: ncurses-devel # explicit curl-devel to avoid httpd24-curl (rhbz1540167) BuildRequires: curl-devel @@ -429,18 +428,6 @@ BuildArch: noarch %target_description wasm32-unknown-unknown WebAssembly %endif -%if %target_enabled wasm32-wasi -%target_package wasm32-wasi -Requires: lld >= 8.0 -%if %with bundled_wasi_libc -Provides: bundled(wasi-libc) -%else -Requires: wasi-libc-static -%endif -BuildArch: noarch -%target_description wasm32-wasi WebAssembly -%endif - %if %target_enabled wasm32-wasip1 %target_package wasm32-wasip1 Requires: lld >= 8.0 @@ -450,6 +437,8 @@ Provides: bundled(wasi-libc) Requires: wasi-libc-static %endif BuildArch: noarch +# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html +Obsoletes: %{name}-std-static-wasm32-wasi < 1.84.0~ %target_description wasm32-wasip1 WebAssembly %endif @@ -806,16 +795,12 @@ end} %if %defined wasm_targets %if %with bundled_wasi_libc %define wasi_libc_flags MALLOC_IMPL=emmalloc CC=clang AR=llvm-ar NM=llvm-nm -%make_build --quiet -C %{wasi_libc_dir} %{wasi_libc_flags} TARGET_TRIPLE=wasm32-wasi %make_build --quiet -C %{wasi_libc_dir} %{wasi_libc_flags} TARGET_TRIPLE=wasm32-wasip1 %define wasm_target_config %{shrink: - --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot --set target.wasm32-wasip1.wasi-root=%{wasi_libc_dir}/sysroot } %else %define wasm_target_config %{shrink: - --set target.wasm32-wasi.wasi-root=%{_prefix}/wasm32-wasi - --set target.wasm32-wasi.self-contained=false --set target.wasm32-wasip1.wasi-root=%{_prefix}/wasm32-wasi --set target.wasm32-wasip1.self-contained=false } @@ -866,6 +851,7 @@ test -r "%{profiler}" --set build.install-stage=2 \ --set build.test-stage=2 \ --set build.optimized-compiler-builtins=false \ + --set rust.llvm-tools=false \ --enable-extended \ --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \ --enable-vendor \ @@ -1074,15 +1060,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %target_files wasm32-unknown-unknown %endif -%if %target_enabled wasm32-wasi -%target_files wasm32-wasi -%if %with bundled_wasi_libc -%dir %{rustlibdir}/wasm32-wasi/lib/self-contained -%{rustlibdir}/wasm32-wasi/lib/self-contained/crt*.o -%{rustlibdir}/wasm32-wasi/lib/self-contained/libc.a -%endif -%endif - %if %target_enabled wasm32-wasip1 %target_files wasm32-wasip1 %if %with bundled_wasi_libc diff --git a/rustc-1.82.0-disable-libssh2.patch b/rustc-1.84.0-disable-libssh2.patch similarity index 64% rename from rustc-1.82.0-disable-libssh2.patch rename to rustc-1.84.0-disable-libssh2.patch index 69f5704..267bc3c 100644 --- a/rustc-1.82.0-disable-libssh2.patch +++ b/rustc-1.84.0-disable-libssh2.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-09-06 10:36:55.743405666 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-09-06 10:36:55.745405652 -0700 -@@ -2156,7 +2156,6 @@ checksum = "10472326a8a6477c3c20a64547b0 +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-12-12 14:07:10.755481543 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-12-12 14:07:10.756481534 -0800 +@@ -2272,7 +2272,6 @@ checksum = "10472326a8a6477c3c20a64547b0 dependencies = [ "cc", "libc", @@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "libz-sys", "openssl-sys", "pkg-config", -@@ -2197,20 +2196,6 @@ dependencies = [ +@@ -2313,20 +2312,6 @@ dependencies = [ "pkg-config", "vcpkg", ] @@ -31,14 +31,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools [[package]] name = "libz-sys" diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-09-06 10:36:55.746405645 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-09-06 10:37:13.849280464 -0700 -@@ -44,7 +44,7 @@ curl = "0.4.46" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-12-12 14:07:10.756481534 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-12-12 14:07:56.866087428 -0800 +@@ -47,7 +47,7 @@ curl = "0.4.46" curl-sys = "0.4.73" filetime = "0.2.23" flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] } -git2 = "0.19.0" +git2 = { version = "0.19.0", default-features = false, features = ["https"] } git2-curl = "0.20.0" - gix = { version = "0.64.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } + gix = { version = "0.67.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } glob = "0.3.1" diff --git a/rustc-1.82.0-unbundle-sqlite.patch b/rustc-1.84.0-unbundle-sqlite.patch similarity index 50% rename from rustc-1.82.0-unbundle-sqlite.patch rename to rustc-1.84.0-unbundle-sqlite.patch index f01397a..2e3ecc3 100644 --- a/rustc-1.82.0-unbundle-sqlite.patch +++ b/rustc-1.84.0-unbundle-sqlite.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-09-06 10:30:29.435107742 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-09-06 10:31:57.168492758 -0700 -@@ -2194,7 +2194,6 @@ version = "0.30.1" +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-12-07 06:47:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-12-12 14:02:54.412672539 -0800 +@@ -2310,7 +2310,6 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ @@ -10,14 +10,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "vcpkg", ] diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-09-06 10:30:29.435107742 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-09-06 10:31:27.942697616 -0700 -@@ -77,7 +77,7 @@ proptest = "1.5.0" - pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] } +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-12-12 14:02:54.412672539 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-12-12 14:03:25.665405417 -0800 +@@ -80,7 +80,7 @@ proptest = "1.5.0" + pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] } rand = "0.8.5" regex = "1.10.5" -rusqlite = { version = "0.32.0", features = ["bundled"] } +rusqlite = { version = "0.32.0", features = [] } - rustfix = { version = "0.8.2", path = "crates/rustfix" } + rustc-hash = "2.0.0" + rustfix = { version = "0.9.0", path = "crates/rustfix" } same-file = "1.0.6" - security-framework = "2.11.1" diff --git a/sources b/sources index 41e5bf7..5215bc2 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.83.0-src.tar.xz) = 64db57949c6ac1df6a3f4c6bd0938685a5fb1bc3d318b34ccfcfccb0f9eff1cffd4d8a53a190ef0409eeca9ad12bc6234c2c1de69196cc74ae02d6afa20d0ce6 -SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21 +SHA512 (rustc-1.84.0-src.tar.xz) = 9e964c1b964e74083a9002fa04b072fa8fe7a520b24ad55e88a89bb2a2a2cd5727c5438d6db425b824ae7502ab215c2dd3f49777efd65f76bae09965df2e070a +SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea From 74986e8d9c6619541b23e6ba2919a7530f1c7556 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Jan 2025 15:04:14 -0800 Subject: [PATCH 18/48] Use lld when building the compiler --- rust.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 601e0fc..4e916d8 100644 --- a/rust.spec +++ b/rust.spec @@ -236,6 +236,7 @@ BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) BuildRequires: make BuildRequires: clang +BuildRequires: lld BuildRequires: ncurses-devel # explicit curl-devel to avoid httpd24-curl (rhbz1540167) BuildRequires: curl-devel @@ -732,6 +733,9 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %global build_rustflags %{nil} %endif +# This is mostly needed for lld < 19 which defaulted to a short --build-id=fast. +%global rustflags -Clink-arg=%{?_build_id_flags}%{!?_build_id_flags:-Wl,--build-id=sha1} + # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros %global rustc_target_cpus %{lua: do local fedora = tonumber(rpm.expand("0%{?fedora}")) @@ -841,7 +845,7 @@ test -r "%{profiler}" %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-llvm-static-stdcpp \ --disable-llvm-bitcode-linker \ - --disable-lld \ + --disable-lld --set rust.use-lld=true \ --disable-rpath \ %{enable_debuginfo} \ %{enable_rust_opts} \ From 81b4dce86424edc03f64a1b9878fd18671e850c3 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Jan 2025 17:24:50 -0800 Subject: [PATCH 19/48] Revert use of clang/lld; patch cc-rs#1354 instead --- ...ly-translate-profile-flags-for-Clang.patch | 39 +++++++++++++++++++ rust.spec | 20 ++++------ 2 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 0001-Only-translate-profile-flags-for-Clang.patch diff --git a/0001-Only-translate-profile-flags-for-Clang.patch b/0001-Only-translate-profile-flags-for-Clang.patch new file mode 100644 index 0000000..3353c10 --- /dev/null +++ b/0001-Only-translate-profile-flags-for-Clang.patch @@ -0,0 +1,39 @@ +From e4e678eb9cbd90acf2ba51e9ec0209b05c4403b5 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 9 Jan 2025 16:47:10 -0800 +Subject: [PATCH] Only translate profile flags for Clang + +--- + src/flags.rs | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/src/flags.rs b/src/flags.rs +index 81834cf625f7..1a53c1b2345c 100644 +--- a/src/flags.rs ++++ b/src/flags.rs +@@ -201,13 +201,15 @@ impl<'this> RustcCodegenFlags<'this> { + if self.no_vectorize_slp { + push_if_supported("-fno-slp-vectorize".into()); + } +- // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate +- if let Some(value) = self.profile_generate { +- push_if_supported(format!("-fprofile-generate={value}").into()); +- } +- // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use +- if let Some(value) = self.profile_use { +- push_if_supported(format!("-fprofile-use={value}").into()); ++ if let ToolFamily::Clang { .. } = family { ++ // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate ++ if let Some(value) = self.profile_generate { ++ push_if_supported(format!("-fprofile-generate={value}").into()); ++ } ++ // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use ++ if let Some(value) = self.profile_use { ++ push_if_supported(format!("-fprofile-use={value}").into()); ++ } + } + // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mguard + if let Some(value) = self.control_flow_guard { +-- +2.47.1 + diff --git a/rust.spec b/rust.spec index 4e916d8..431b02d 100644 --- a/rust.spec +++ b/rust.spec @@ -133,6 +133,9 @@ Patch6: rustc-1.84.0-unbundle-sqlite.patch # https://github.com/rust-lang/rust/pull/134240 Patch7: 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch +# https://github.com/rust-lang/cc-rs/issues/1354 +Patch8: 0001-Only-translate-profile-flags-for-Clang.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -232,11 +235,9 @@ BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) %global local_rust_root %{_prefix} %endif -%global toolchain clang - BuildRequires: make -BuildRequires: clang -BuildRequires: lld +BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: ncurses-devel # explicit curl-devel to avoid httpd24-curl (rhbz1540167) BuildRequires: curl-devel @@ -661,6 +662,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 +%patch -P8 -p1 -d vendor/cc-1.2.5 %if %with disabled_libssh2 %patch -P100 -p1 @@ -733,9 +735,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %global build_rustflags %{nil} %endif -# This is mostly needed for lld < 19 which defaulted to a short --build-id=fast. -%global rustflags -Clink-arg=%{?_build_id_flags}%{!?_build_id_flags:-Wl,--build-id=sha1} - # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros %global rustc_target_cpus %{lua: do local fedora = tonumber(rpm.expand("0%{?fedora}")) @@ -816,12 +815,7 @@ end} # clang_resource_dir is not defined for compat builds. %define profiler /usr/lib/clang/%{llvm_compat_version}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a %else -%if 0%{?clang_major_version} >= 17 %define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a -%else -# The exact profiler path is version dependent.. -%define profiler %(echo %{_libdir}/clang/??/lib/libclang_rt.profile-*.a) -%endif %endif test -r "%{profiler}" @@ -845,7 +839,7 @@ test -r "%{profiler}" %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-llvm-static-stdcpp \ --disable-llvm-bitcode-linker \ - --disable-lld --set rust.use-lld=true \ + --disable-lld \ --disable-rpath \ %{enable_debuginfo} \ %{enable_rust_opts} \ From 17a60f7317d03ec0c9d0562d0b8ee267b08fe39b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 14 Jan 2025 10:03:14 -0800 Subject: [PATCH 20/48] Fully remove the shared standard library --- rust.spec | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rust.spec b/rust.spec index 431b02d..1976ad8 100644 --- a/rust.spec +++ b/rust.spec @@ -907,7 +907,13 @@ rm -rf ./build/dist/ ./build/tmp/ # Some of the components duplicate-install binaries, leaving backups we don't want rm -f %{buildroot}%{_bindir}/*.old -# Make sure the shared libraries are in the proper libdir +# We don't want to ship the shared standard library, because it has no stable ABI. +# (and if we merely %%exclude these, then rpmbuild still packages build-id links) +find %{buildroot}%{rustlibdir} -type f \ + '(' -name '*.so' -o -name '*.dll' -o -name '*.dll.a' ')' \ + -exec rm -v '{}' '+' + +# Make sure the compiler's shared libraries are in the proper libdir %if "%{_libdir}" != "%{common_libdir}" mkdir -p %{buildroot}%{_libdir} find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \ @@ -1031,7 +1037,6 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib -%exclude %{rustlibdir}/%{rust_triple}/lib/*.so %global target_files() \ %files std-static-%1 \ @@ -1043,15 +1048,11 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %if %target_enabled i686-pc-windows-gnu %target_files i686-pc-windows-gnu %{rustlibdir}/i686-pc-windows-gnu/lib/rs*.o -%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll -%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll.a %endif %if %target_enabled x86_64-pc-windows-gnu %target_files x86_64-pc-windows-gnu %{rustlibdir}/x86_64-pc-windows-gnu/lib/rs*.o -%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll -%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll.a %endif %if %target_enabled wasm32-unknown-unknown From b9d8811f3bdfae301c41fbee11cca14ddbf99e2a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 00:20:25 +0000 Subject: [PATCH 21/48] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 780493632fea05247f03578714fdf3b4343b060c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 20 Jan 2025 09:45:34 -0800 Subject: [PATCH 22/48] Use system oniguruma for building rust-docs --- rust.spec | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rust.spec b/rust.spec index 1976ad8..8fe3f68 100644 --- a/rust.spec +++ b/rust.spec @@ -60,6 +60,15 @@ ExclusiveArch: %{rust_arches} %bcond_without bundled_libgit2 %endif +# Try to use system oniguruma (only used at build time for rust-docs) +# src/tools/rustbook -> ... -> onig_sys v69.8.1 needs at least 6.9.3 +%global min_oniguruma_version 6.9.3 +%if 0%{?rhel} && 0%{?rhel} < 9 +%bcond_without bundled_oniguruma +%else +%bcond_with bundled_oniguruma +%endif + # Cargo uses UPSERTs with omitted conflict targets %global min_sqlite3_version 3.35 %global bundled_sqlite3_version 3.46.0 @@ -250,6 +259,10 @@ BuildRequires: pkgconfig(zlib) BuildRequires: (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(libgit2) < %{next_libgit2_version}) %endif +%if %{without bundled_oniguruma} +BuildRequires: pkgconfig(oniguruma) >= %{min_oniguruma_version} +%endif + %if %{without bundled_sqlite3} BuildRequires: pkgconfig(sqlite3) >= %{min_sqlite3_version} %endif @@ -701,6 +714,10 @@ rm -rf src/tools/rustc-perf %clear_dir vendor/libgit2-sys*/libgit2/ %endif +%if %without bundled_oniguruma +%clear_dir vendor/onig_sys*/oniguruma/ +%endif + %if %without bundled_sqlite3 %clear_dir vendor/libsqlite3-sys*/sqlite3/ %endif @@ -753,6 +770,7 @@ end} %global rust_env %{shrink: %{?rustflags:RUSTFLAGS="%{rustflags}"} %{rustc_target_cpus} + %{!?with_bundled_oniguruma:RUSTONIG_SYSTEM_LIBONIG=1} %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1} %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1} } From 1013e8f026cd2b9d11be2b2bdf9ccea7d083bd86 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 27 Jan 2025 12:19:36 -0800 Subject: [PATCH 23/48] Restore libstd.so for uses like evcxr Ref: https://github.com/evcxr/evcxr/issues/394 --- rust.spec | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/rust.spec b/rust.spec index 8fe3f68..3f1f1dd 100644 --- a/rust.spec +++ b/rust.spec @@ -925,12 +925,6 @@ rm -rf ./build/dist/ ./build/tmp/ # Some of the components duplicate-install binaries, leaving backups we don't want rm -f %{buildroot}%{_bindir}/*.old -# We don't want to ship the shared standard library, because it has no stable ABI. -# (and if we merely %%exclude these, then rpmbuild still packages build-id links) -find %{buildroot}%{rustlibdir} -type f \ - '(' -name '*.so' -o -name '*.dll' -o -name '*.dll.a' ')' \ - -exec rm -v '{}' '+' - # Make sure the compiler's shared libraries are in the proper libdir %if "%{_libdir}" != "%{common_libdir}" mkdir -p %{buildroot}%{_libdir} @@ -942,6 +936,13 @@ find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ -exec chmod -v +x '{}' '+' +# The shared standard library is excluded from Provides, because it has no +# stable ABI. However, we still ship it alongside the static target libraries +# to enable some niche local use-cases, like the `evcxr` REPL. +# Make sure those libraries are also executable for debuginfo extraction. +find %{buildroot}%{rustlibdir} -type f -name '*.so' \ + -exec chmod -v +x '{}' '+' + # Remove installer artifacts (manifests, uninstall scripts, etc.) find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' @@ -1044,7 +1045,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc -%{_libdir}/*.so +%{_libdir}/librustc_driver-*.so %{_libexecdir}/rust-analyzer-proc-macro-srv %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* @@ -1055,6 +1056,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib +%{rustlibdir}/%{rust_triple}/lib/*.so %global target_files() \ %files std-static-%1 \ @@ -1066,11 +1068,15 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %if %target_enabled i686-pc-windows-gnu %target_files i686-pc-windows-gnu %{rustlibdir}/i686-pc-windows-gnu/lib/rs*.o +%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll +%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll.a %endif %if %target_enabled x86_64-pc-windows-gnu %target_files x86_64-pc-windows-gnu %{rustlibdir}/x86_64-pc-windows-gnu/lib/rs*.o +%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll +%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll.a %endif %if %target_enabled wasm32-unknown-unknown From 8e04e725bbf4eb9213dde7af6750b8fed9fdaa01 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 30 Jan 2025 12:00:33 -0800 Subject: [PATCH 24/48] Update to Rust 1.84.1 --- .gitignore | 1 + ...vm-objcopy-if-llvm-tools-are-enabled.patch | 25 ------------------- rust.spec | 10 +++----- sources | 2 +- 4 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch diff --git a/.gitignore b/.gitignore index b0a96e9..ef946c2 100644 --- a/.gitignore +++ b/.gitignore @@ -447,3 +447,4 @@ /rustc-1.83.0-src.tar.xz /rustc-1.84.0-src.tar.xz /wasi-libc-wasi-sdk-25.tar.gz +/rustc-1.84.1-src.tar.xz diff --git a/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch b/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch deleted file mode 100644 index ff57217..0000000 --- a/0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4c6d793c66993a0f5455f35e73a1549d232c3ae5 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 12 Dec 2024 17:06:03 -0800 -Subject: [PATCH] Only dist `llvm-objcopy` if llvm tools are enabled - ---- - src/bootstrap/src/core/build_steps/dist.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs -index 0c739115165e..89b2d73f74a8 100644 ---- a/src/bootstrap/src/core/build_steps/dist.rs -+++ b/src/bootstrap/src/core/build_steps/dist.rs -@@ -471,7 +471,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { - } - } - -- { -+ if builder.config.llvm_enabled(compiler.host) && builder.config.llvm_tools_enabled { - let src_dir = builder.sysroot_target_bindir(compiler, host); - let llvm_objcopy = exe("llvm-objcopy", compiler.host); - let rust_objcopy = exe("rust-objcopy", compiler.host); --- -2.47.1 - diff --git a/rust.spec b/rust.spec index 3f1f1dd..c03e245 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.84.0 +Version: 1.84.1 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -139,11 +139,8 @@ Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys Patch6: rustc-1.84.0-unbundle-sqlite.patch -# https://github.com/rust-lang/rust/pull/134240 -Patch7: 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch - # https://github.com/rust-lang/cc-rs/issues/1354 -Patch8: 0001-Only-translate-profile-flags-for-Clang.patch +Patch7: 0001-Only-translate-profile-flags-for-Clang.patch ### RHEL-specific patches below ### @@ -674,8 +671,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %if %without bundled_sqlite3 %patch -P6 -p1 %endif -%patch -P7 -p1 -%patch -P8 -p1 -d vendor/cc-1.2.5 +%patch -P7 -p1 -d vendor/cc-1.2.5 %if %with disabled_libssh2 %patch -P100 -p1 diff --git a/sources b/sources index 5215bc2..24d06bc 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.84.0-src.tar.xz) = 9e964c1b964e74083a9002fa04b072fa8fe7a520b24ad55e88a89bb2a2a2cd5727c5438d6db425b824ae7502ab215c2dd3f49777efd65f76bae09965df2e070a +SHA512 (rustc-1.84.1-src.tar.xz) = f1cc4765736551508408126e44086988e8ddc30c1a929bf7b61c6be85ad0d65928dd5fb1041cfaeee8eb37d2208f2c1917e276aef2bc9a8e40e34f6713b349e1 SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea From ad5a8095c85ce34e4faac6fb39d184c443e9b0c8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 20 Feb 2025 09:16:51 -0800 Subject: [PATCH 25/48] Update to Rust 1.85.0 --- .gitignore | 1 + ...llow-disabling-target-self-contained.patch | 24 +++---- ...xternal-library-path-for-wasm32-wasi.patch | 63 ++++++++++--------- rust.spec | 26 ++++---- ...atch => rustc-1.85.0-disable-libssh2.patch | 14 ++--- ...atch => rustc-1.85.0-unbundle-sqlite.patch | 12 ++-- sources | 2 +- 7 files changed, 74 insertions(+), 68 deletions(-) rename rustc-1.84.0-disable-libssh2.patch => rustc-1.85.0-disable-libssh2.patch (66%) rename rustc-1.84.0-unbundle-sqlite.patch => rustc-1.85.0-unbundle-sqlite.patch (64%) diff --git a/.gitignore b/.gitignore index ef946c2..771739a 100644 --- a/.gitignore +++ b/.gitignore @@ -448,3 +448,4 @@ /rustc-1.84.0-src.tar.xz /wasi-libc-wasi-sdk-25.tar.gz /rustc-1.84.1-src.tar.xz +/rustc-1.85.0-src.tar.xz diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index 34d735d..bd6d0ed 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From 8d4d52446347872816ab51958e9f3162cf722ee6 Mon Sep 17 00:00:00 2001 +From eeb171e5de6da8790d01135754cbb9b6c248c476 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:14:28 -0700 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained @@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index d3233ad17b51..6a1f097c20cb 100644 +index 5ea6774ce035..ec08a319e77f 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -916,6 +916,11 @@ +@@ -922,6 +922,11 @@ # argument as the test binary. #runner = (string) @@ -27,10 +27,10 @@ index d3233ad17b51..6a1f097c20cb 100644 # Distribution options # diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index 8e088682f92d..843b7123b120 100644 +index ca337aa9f4c3..6175f93e50ed 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -346,6 +346,10 @@ fn copy_self_contained_objects( +@@ -325,6 +325,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -42,10 +42,10 @@ index 8e088682f92d..843b7123b120 100644 builder.sysroot_target_libdir(*compiler, target).join("self-contained"); t!(fs::create_dir_all(&libdir_self_contained)); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index e706aba977b6..a55d98e94dd8 100644 +index dd2f11ad4690..e10ed666099c 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -627,6 +627,7 @@ pub struct Target { +@@ -634,6 +634,7 @@ pub struct Target { pub runner: Option, pub no_std: bool, pub codegen_backends: Option>, @@ -53,7 +53,7 @@ index e706aba977b6..a55d98e94dd8 100644 } impl Target { -@@ -638,6 +639,9 @@ pub fn from_triple(triple: &str) -> Self { +@@ -645,6 +646,9 @@ pub fn from_triple(triple: &str) -> Self { if triple.contains("emscripten") { target.runner = Some("node".into()); } @@ -63,7 +63,7 @@ index e706aba977b6..a55d98e94dd8 100644 target } } -@@ -1213,6 +1217,7 @@ struct TomlTarget { +@@ -1219,6 +1223,7 @@ struct TomlTarget { no_std: Option = "no-std", codegen_backends: Option> = "codegen-backends", runner: Option = "runner", @@ -71,7 +71,7 @@ index e706aba977b6..a55d98e94dd8 100644 } } -@@ -2038,6 +2043,9 @@ fn get_table(option: &str) -> Result { +@@ -2082,6 +2087,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index e706aba977b6..a55d98e94dd8 100644 target.cxx = cfg.cxx.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index c384fd6bf435..a101c010b740 100644 +index 8405c22aff08..7e1582207b8a 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1351,6 +1351,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1327,6 +1327,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index 3a05424..3534abb 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,19 +1,20 @@ -From 21d53eca2af5f04c0aa6b898f99f58e0e093cfdd Mon Sep 17 00:00:00 2001 +From e8e50258df70b39d2425dacf90c3d5f6d0720bc0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:18:16 -0700 Subject: [PATCH 2/2] set an external library path for wasm32-wasi --- compiler/rustc_codegen_ssa/src/back/link.rs | 10 ++++++++++ - compiler/rustc_target/src/spec/mod.rs | 4 ++++ + compiler/rustc_target/src/spec/json.rs | 2 ++ + compiler/rustc_target/src/spec/mod.rs | 2 ++ .../rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++--- - 3 files changed, 18 insertions(+), 3 deletions(-) + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 5149e3a12f23..cf62fbdc7f59 100644 +index e2081ad75633..a308bae8b644 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1663,6 +1663,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1639,6 +1639,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -26,7 +27,7 @@ index 5149e3a12f23..cf62fbdc7f59 100644 for search_path in sess.target_filesearch().search_paths(PathKind::Native) { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -2163,6 +2169,10 @@ fn add_library_search_dirs( +@@ -2139,6 +2145,10 @@ fn add_library_search_dirs( ControlFlow::<()>::Continue(()) }, ); @@ -37,27 +38,11 @@ index 5149e3a12f23..cf62fbdc7f59 100644 } /// Add options making relocation sections in the produced ELF files read-only -diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 321ab40403a3..54791c8892d8 100644 ---- a/compiler/rustc_target/src/spec/mod.rs -+++ b/compiler/rustc_target/src/spec/mod.rs -@@ -2155,6 +2155,7 @@ pub struct TargetOptions { - /// Objects to link before and after all other object code. - pub pre_link_objects: CrtObjects, - pub post_link_objects: CrtObjects, -+ pub external_lib_path: Option>, - /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. - pub pre_link_objects_self_contained: CrtObjects, - pub post_link_objects_self_contained: CrtObjects, -@@ -2651,6 +2652,7 @@ fn default() -> TargetOptions { - relro_level: RelroLevel::None, - pre_link_objects: Default::default(), - post_link_objects: Default::default(), -+ external_lib_path: None, - pre_link_objects_self_contained: Default::default(), - post_link_objects_self_contained: Default::default(), - link_self_contained: LinkSelfContainedDefault::False, -@@ -3355,6 +3357,7 @@ macro_rules! key { +diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs +index 9cdc0801b1f0..70fe8396b353 100644 +--- a/compiler/rustc_target/src/spec/json.rs ++++ b/compiler/rustc_target/src/spec/json.rs +@@ -527,6 +527,7 @@ macro_rules! key { key!(linker_is_gnu_json = "linker-is-gnu", bool); key!(pre_link_objects = "pre-link-objects", link_objects); key!(post_link_objects = "post-link-objects", link_objects); @@ -65,7 +50,7 @@ index 321ab40403a3..54791c8892d8 100644 key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects); key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects); // Deserializes the backwards-compatible variants of `-Clink-self-contained` -@@ -3636,6 +3639,7 @@ macro_rules! target_option_val { +@@ -708,6 +709,7 @@ macro_rules! target_option_val { target_option_val!(linker_is_gnu_json, "linker-is-gnu"); target_option_val!(pre_link_objects); target_option_val!(post_link_objects); @@ -73,8 +58,28 @@ index 321ab40403a3..54791c8892d8 100644 target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback"); target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback"); target_option_val!(link_args - pre_link_args_json, "pre-link-args"); +diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs +index 02962d55a60e..169f5a74bbfd 100644 +--- a/compiler/rustc_target/src/spec/mod.rs ++++ b/compiler/rustc_target/src/spec/mod.rs +@@ -2197,6 +2197,7 @@ pub struct TargetOptions { + /// Objects to link before and after all other object code. + pub pre_link_objects: CrtObjects, + pub post_link_objects: CrtObjects, ++ pub external_lib_path: Option>, + /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. + pub pre_link_objects_self_contained: CrtObjects, + pub post_link_objects_self_contained: CrtObjects, +@@ -2712,6 +2713,7 @@ fn default() -> TargetOptions { + relro_level: RelroLevel::None, + pre_link_objects: Default::default(), + post_link_objects: Default::default(), ++ external_lib_path: None, + pre_link_objects_self_contained: Default::default(), + post_link_objects_self_contained: Default::default(), + link_self_contained: LinkSelfContainedDefault::False, diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -index 1cd30f21bec1..9a752d5712a6 100644 +index 0862958d05da..b1e736d68627 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs @@ -19,11 +19,12 @@ pub(crate) fn target() -> Target { diff --git a/rust.spec b/rust.spec index c03e245..5b3727f 100644 --- a/rust.spec +++ b/rust.spec @@ -1,8 +1,8 @@ Name: rust -Version: 1.84.1 +Version: 1.85.0 Release: %autorelease Summary: The Rust Programming Language -License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) +License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0) # ^ written as: (rust itself) and (bundled libraries) URL: https://www.rust-lang.org @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.83.0 -%global bootstrap_channel 1.83.0 -%global bootstrap_date 2024-11-28 +%global bootstrap_version 1.84.0 +%global bootstrap_channel 1.84.0 +%global bootstrap_date 2025-01-09 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -44,8 +44,8 @@ ExclusiveArch: %{rust_arches} # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 18.0+. %global min_llvm_version 18.0.0 -%global bundled_llvm_version 19.1.5 -#global llvm_compat_version 17 +%global bundled_llvm_version 19.1.7 +#global llvm_compat_version 18 %global llvm llvm%{?llvm_compat_version} %bcond_with bundled_llvm @@ -112,7 +112,7 @@ ExclusiveArch: %{rust_arches} # Detect non-stable channels from the version, like 1.74.0~beta.1 %{lua: do local version = rpm.expand("%{version}") - local version_channel, subs = string.gsub(version, "^.*~(%w+).*$", "%1", 1) + local version_channel, subs = version:gsub("^.*~(%w+).*$", "%1", 1) rpm.define("channel " .. (subs ~= 0 and version_channel or "stable")) rpm.define("rustc_package rustc-" .. version_channel .. "-src") end} @@ -137,7 +137,7 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.84.0-unbundle-sqlite.patch +Patch6: rustc-1.85.0-unbundle-sqlite.patch # https://github.com/rust-lang/cc-rs/issues/1354 Patch7: 0001-Only-translate-profile-flags-for-Clang.patch @@ -151,7 +151,7 @@ Source102: cargo_vendor.attr Source103: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.84.0-disable-libssh2.patch +Patch100: rustc-1.85.0-disable-libssh2.patch # Get the Rust triple for any architecture and ABI. %{lua: function rust_triple(arch, abi) @@ -202,7 +202,7 @@ end} %endif %global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets} %define target_enabled() %{lua: - print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0) + print(rpm.expand(" %{all_targets} "):find(rpm.expand(" %1 "), 1, true) or 0) } %if %defined bootstrap_arches @@ -210,7 +210,7 @@ end} # Also define bootstrap_source just for the current target. %{lua: do local bootstrap_arches = {} - for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do + for arch in rpm.expand("%{bootstrap_arches}"):gmatch("%S+") do table.insert(bootstrap_arches, arch) end local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}") @@ -671,7 +671,7 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %if %without bundled_sqlite3 %patch -P6 -p1 %endif -%patch -P7 -p1 -d vendor/cc-1.2.5 +%patch -P7 -p1 -d vendor/cc-1.2.6 %if %with disabled_libssh2 %patch -P100 -p1 diff --git a/rustc-1.84.0-disable-libssh2.patch b/rustc-1.85.0-disable-libssh2.patch similarity index 66% rename from rustc-1.84.0-disable-libssh2.patch rename to rustc-1.85.0-disable-libssh2.patch index 267bc3c..09be945 100644 --- a/rustc-1.84.0-disable-libssh2.patch +++ b/rustc-1.85.0-disable-libssh2.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-12-12 14:07:10.755481543 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-12-12 14:07:10.756481534 -0800 -@@ -2272,7 +2272,6 @@ checksum = "10472326a8a6477c3c20a64547b0 +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-01-17 14:26:49.845587361 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-01-17 14:26:49.848587324 -0800 +@@ -2296,7 +2296,6 @@ checksum = "10472326a8a6477c3c20a64547b0 dependencies = [ "cc", "libc", @@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "libz-sys", "openssl-sys", "pkg-config", -@@ -2313,20 +2312,6 @@ dependencies = [ +@@ -2337,20 +2336,6 @@ dependencies = [ "pkg-config", "vcpkg", ] @@ -31,8 +31,8 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools [[package]] name = "libz-sys" diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-12-12 14:07:10.756481534 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-12-12 14:07:56.866087428 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-01-17 14:26:49.848587324 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-01-17 14:27:49.035844397 -0800 @@ -47,7 +47,7 @@ curl = "0.4.46" curl-sys = "0.4.73" filetime = "0.2.23" @@ -40,5 +40,5 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools -git2 = "0.19.0" +git2 = { version = "0.19.0", default-features = false, features = ["https"] } git2-curl = "0.20.0" - gix = { version = "0.67.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } + gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } glob = "0.3.1" diff --git a/rustc-1.84.0-unbundle-sqlite.patch b/rustc-1.85.0-unbundle-sqlite.patch similarity index 64% rename from rustc-1.84.0-unbundle-sqlite.patch rename to rustc-1.85.0-unbundle-sqlite.patch index 2e3ecc3..08c395f 100644 --- a/rustc-1.84.0-unbundle-sqlite.patch +++ b/rustc-1.85.0-unbundle-sqlite.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-12-07 06:47:38.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-12-12 14:02:54.412672539 -0800 -@@ -2310,7 +2310,6 @@ version = "0.30.1" +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-01-11 07:18:58.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-01-17 14:14:33.072839703 -0800 +@@ -2334,7 +2334,6 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ @@ -10,8 +10,8 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "vcpkg", ] diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-12-12 14:02:54.412672539 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-12-12 14:03:25.665405417 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-01-17 14:14:33.072839703 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-01-17 14:15:48.497891366 -0800 @@ -80,7 +80,7 @@ proptest = "1.5.0" pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] } rand = "0.8.5" @@ -19,5 +19,5 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools -rusqlite = { version = "0.32.0", features = ["bundled"] } +rusqlite = { version = "0.32.0", features = [] } rustc-hash = "2.0.0" + rustc-stable-hash = "0.1.1" rustfix = { version = "0.9.0", path = "crates/rustfix" } - same-file = "1.0.6" diff --git a/sources b/sources index 24d06bc..b0e42b4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.84.1-src.tar.xz) = f1cc4765736551508408126e44086988e8ddc30c1a929bf7b61c6be85ad0d65928dd5fb1041cfaeee8eb37d2208f2c1917e276aef2bc9a8e40e34f6713b349e1 +SHA512 (rustc-1.85.0-src.tar.xz) = 3e9c933d1d9b6e5fb081837cf07eb1638b1a6b4fd1cb607dd860c5021ba7b521edbaf8ba0fa8f182f62178b72a3e1a3e6b26675e8fb6530871137852a074443c SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea From 36704d2c57e82abbbf99fb4085ad766ed523c951 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 26 Feb 2025 12:51:03 -0800 Subject: [PATCH 26/48] ld.gold isn't needed for tests anymore --- rust.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rust.spec b/rust.spec index 5b3727f..737e46c 100644 --- a/rust.spec +++ b/rust.spec @@ -306,12 +306,6 @@ BuildRequires: python3-rpm # For src/test/run-make/static-pie BuildRequires: glibc-static -# For tests/run-make/pgo-branch-weights -# riscv64 does not support binutils-gold yet -%ifnarch riscv64 -BuildRequires: binutils-gold -%endif - # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} Provides: rustc%{?_isa} = %{version}-%{release} From f0deba825b02f122953290b8c806ea0c44f241da Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 7 Mar 2025 16:45:09 -0800 Subject: [PATCH 27/48] Add `Provides: bundled(crate(_))` for vendored dependencies --- rust.spec | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 737e46c..a3813fe 100644 --- a/rust.spec +++ b/rust.spec @@ -45,7 +45,9 @@ ExclusiveArch: %{rust_arches} # is insufficient. Rust currently requires LLVM 18.0+. %global min_llvm_version 18.0.0 %global bundled_llvm_version 19.1.7 -#global llvm_compat_version 18 +%if 0%{?fedora} >= 42 +%global llvm_compat_version 19 +%endif %global llvm llvm%{?llvm_compat_version} %bcond_with bundled_llvm @@ -378,6 +380,29 @@ BuildRequires: compiler-rt%{?llvm_compat_version} # https://github.com/rust-lang/rust/pull/101841 Obsoletes: %{name}-analysis < 1.69.0~ +# Experimenting with a fine-grained version of %%cargo_vendor_manifest, +# so we can have different bundled provides for each tool subpackage. +%define cargo_tree_manifest(n:m:f:t:) ( \ + %{!-n:%{error:must specify a tool name}} \ + set -euo pipefail \ + mkdir -p build/manifests/%{-n*} \ + %{shrink: \ + env RUSTC_BOOTSTRAP=1 \ + %{local_rust_root}/bin/cargo tree \ + --offline --edges normal,build \ + --prefix none --format "{p}" \ + %{-m:--manifest-path %{-m*}/Cargo.toml} \ + %{-f:--features %{-f*}} \ + %{-t:--target %{-t*}} \ + %* \ + | sed '/([*/]/d; s/ (proc-macro)$//' \ + | sort -u \ + >build/manifests/%{-n*}/cargo-vendor.txt \ + } \ +) +%{?fedora:BuildRequires: cargo-rpm-macros} +%{?rhel:BuildRequires: rust-toolset} + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -894,6 +919,21 @@ for triple in %{?all_targets} ; do %{__x} build --target=$triple std done +# Collect cargo-vendor.txt for each tool and std +%{cargo_tree_manifest -n rustc -- -p rustc-main -p rustdoc} +%{cargo_tree_manifest -n cargo -m src/tools/cargo} +%{cargo_tree_manifest -n clippy -m src/tools/clippy} +%{cargo_tree_manifest -n rust-analyzer -m src/tools/rust-analyzer} +%{cargo_tree_manifest -n rustfmt -m src/tools/rustfmt} + +%{cargo_tree_manifest -n std -m library -f backtrace} +for triple in %{?all_targets} ; do + case $triple in + *-none*) %{cargo_tree_manifest -n std-$triple -m library/alloc -t $triple} ;; + *) %{cargo_tree_manifest -n std-$triple -m library -f backtrace -t $triple} ;; + esac +done + %install %if 0%{?rhel} && 0%{?rhel} <= 9 %{?set_build_flags} @@ -1039,6 +1079,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_libexecdir}/rust-analyzer-proc-macro-srv %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* +%license build/manifests/rustc/cargo-vendor.txt %files std-static @@ -1047,13 +1088,15 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib %{rustlibdir}/%{rust_triple}/lib/*.so +%license build/manifests/std/cargo-vendor.txt %global target_files() \ %files std-static-%1 \ %dir %{rustlibdir} \ %dir %{rustlibdir}/%1 \ %dir %{rustlibdir}/%1/lib \ -%{rustlibdir}/%1/lib/*.rlib +%{rustlibdir}/%1/lib/*.rlib \ +%license build/manifests/std-%1/cargo-vendor.txt %if %target_enabled i686-pc-windows-gnu %target_files i686-pc-windows-gnu @@ -1135,6 +1178,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_datadir}/zsh/site-functions/_cargo %dir %{_datadir}/cargo %dir %{_datadir}/cargo/registry +%license build/manifests/cargo/cargo-vendor.txt %files -n rustfmt @@ -1142,6 +1186,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_bindir}/cargo-fmt %doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md %license src/tools/rustfmt/LICENSE-{APACHE,MIT} +%license build/manifests/rustfmt/cargo-vendor.txt %files analyzer @@ -1149,6 +1194,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_bindir}/rust-analyzer %doc src/tools/rust-analyzer/README.md %license src/tools/rust-analyzer/LICENSE-{APACHE,MIT} +%license build/manifests/rust-analyzer/cargo-vendor.txt %files -n clippy @@ -1156,6 +1202,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_bindir}/clippy-driver %doc src/tools/clippy/{README.md,CHANGELOG.md} %license src/tools/clippy/LICENSE-{APACHE,MIT} +%license build/manifests/clippy/cargo-vendor.txt %files src From 53b3e13ae57ce1e53a442ee333127dafaa1ebe6d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 7 Mar 2025 17:34:12 -0800 Subject: [PATCH 28/48] Lock cargo to the matching rust version --- rust.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index a3813fe..d98229b 100644 --- a/rust.spec +++ b/rust.spec @@ -557,8 +557,9 @@ Provides: bundled(sqlite) = %{bundled_sqlite3_version} %endif # For tests: BuildRequires: git-core -# Cargo is not much use without Rust -Requires: %{name} +# Cargo is not much use without Rust, and it's worth keeping the versions +# in sync since some feature development depends on them together. +Requires: %{name} = %{version}-%{release} # "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and # Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too From 5f24112b8e3119ab0e2535022ba3247473e46ff2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 10 Mar 2025 16:47:09 -0700 Subject: [PATCH 29/48] Clean up LLVM-compat and enable it on ELN --- rust.spec | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/rust.spec b/rust.spec index d98229b..9ff4cc9 100644 --- a/rust.spec +++ b/rust.spec @@ -45,7 +45,7 @@ ExclusiveArch: %{rust_arches} # is insufficient. Rust currently requires LLVM 18.0+. %global min_llvm_version 18.0.0 %global bundled_llvm_version 19.1.7 -%if 0%{?fedora} >= 42 +%if 0%{?fedora} >= 42 || 0%{?rhel} > 10 %global llvm_compat_version 19 %endif %global llvm llvm%{?llvm_compat_version} @@ -285,6 +285,7 @@ Provides: bundled(llvm) = %{bundled_llvm_version} BuildRequires: cmake >= 3.5.1 %if %defined llvm_compat_version %global llvm_root %{_libdir}/%{llvm} +%global llvm_path %{llvm_root}/bin %else %global llvm_root %{_prefix} %endif @@ -342,12 +343,6 @@ Requires: /usr/bin/cc %global __brp_strip_static_archive %{nil} %global __brp_strip_lto %{nil} -%if %{without bundled_llvm} -%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} -%global llvm_has_filecheck 1 -%endif -%endif - # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. %global common_libdir %{_prefix}/lib @@ -366,11 +361,11 @@ BuildRequires: mingw64-winpthreads-static %if %defined wasm_targets %if %with bundled_wasi_libc -BuildRequires: clang +BuildRequires: clang%{?llvm_compat_version} %else BuildRequires: wasi-libc-static %endif -BuildRequires: lld +BuildRequires: lld%{?llvm_compat_version} %endif # For profiler_builtins @@ -789,6 +784,7 @@ end} %{!?with_bundled_oniguruma:RUSTONIG_SYSTEM_LIBONIG=1} %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1} %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1} + %{?llvm_path:PATH="%{llvm_path}:$PATH"} } %global export_rust_env export %{rust_env} @@ -845,12 +841,8 @@ end} %endif # Find the compiler-rt library for the Rust profiler_builtins crate. -%if %defined llvm_compat_version -# clang_resource_dir is not defined for compat builds. -%define profiler /usr/lib/clang/%{llvm_compat_version}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a -%else -%define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a -%endif +%define clang_lib %{expand:%%clang%{?llvm_compat_version}_resource_dir}/lib +%define profiler %{clang_lib}/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a test -r "%{profiler}" %configure --disable-option-checking \ @@ -869,7 +861,6 @@ test -r "%{profiler}" --local-rust-root=%{local_rust_root} \ --set build.rustfmt=/bin/true \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ - %{!?llvm_has_filecheck: --disable-codegen-tests} \ %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-llvm-static-stdcpp \ --disable-llvm-bitcode-linker \ @@ -903,7 +894,7 @@ mkdir -p "%{profraw}" env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \ %{__x} --keep-stage=0 --keep-stage=1 build cargo # Finalize the profile data and clean up the raw files -%{llvm_root}/bin/llvm-profdata merge -o "%{profdata}" "%{profraw}" +llvm-profdata merge -o "%{profdata}" "%{profraw}" rm -r "%{profraw}" build/%{rust_triple}/stage2*/ # Redefine the macro to use that profile data from now on %global __x %{__x} --rust-profile-use="%{profdata}" From 956ba8047c40bd91123ae44bb66db181e16fb511 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 18 Mar 2025 12:45:47 -0700 Subject: [PATCH 30/48] Update to Rust 1.85.1 --- .gitignore | 1 + rust.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 771739a..b2f69fd 100644 --- a/.gitignore +++ b/.gitignore @@ -449,3 +449,4 @@ /wasi-libc-wasi-sdk-25.tar.gz /rustc-1.84.1-src.tar.xz /rustc-1.85.0-src.tar.xz +/rustc-1.85.1-src.tar.xz diff --git a/rust.spec b/rust.spec index 9ff4cc9..877e560 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.85.0 +Version: 1.85.1 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0) diff --git a/sources b/sources index b0e42b4..e45937b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.85.0-src.tar.xz) = 3e9c933d1d9b6e5fb081837cf07eb1638b1a6b4fd1cb607dd860c5021ba7b521edbaf8ba0fa8f182f62178b72a3e1a3e6b26675e8fb6530871137852a074443c +SHA512 (rustc-1.85.1-src.tar.xz) = d61afb4f00d0c63eef132e10ca5369202064ecad8ab5bcf4fbd62e9a20b2bd71840b2a769dadcf43452fc0448865975c9de1c129752caa9928d2757027bacf7c SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea From 3436f8c99bd742015560fadea6d2b0e02e631145 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 3 Apr 2025 08:59:19 -0700 Subject: [PATCH 31/48] Update to Rust 1.86.0 --- .gitignore | 2 + ...ly-translate-profile-flags-for-Clang.patch | 39 ---------------- 0001-Use-lld-provided-by-system.patch | 24 +++++----- ...llow-disabling-target-self-contained.patch | 34 +++++++------- ...xternal-library-path-for-wasm32-wasi.patch | 22 +++++----- rust.spec | 38 ++++++++-------- rustc-1.85.0-disable-libssh2.patch | 44 ------------------- rustc-1.85.0-unbundle-sqlite.patch | 23 ---------- rustc-1.86.0-disable-libssh2.patch | 44 +++++++++++++++++++ rustc-1.86.0-unbundle-sqlite.patch | 23 ++++++++++ sources | 4 +- 11 files changed, 129 insertions(+), 168 deletions(-) delete mode 100644 0001-Only-translate-profile-flags-for-Clang.patch delete mode 100644 rustc-1.85.0-disable-libssh2.patch delete mode 100644 rustc-1.85.0-unbundle-sqlite.patch create mode 100644 rustc-1.86.0-disable-libssh2.patch create mode 100644 rustc-1.86.0-unbundle-sqlite.patch diff --git a/.gitignore b/.gitignore index b2f69fd..999f79e 100644 --- a/.gitignore +++ b/.gitignore @@ -450,3 +450,5 @@ /rustc-1.84.1-src.tar.xz /rustc-1.85.0-src.tar.xz /rustc-1.85.1-src.tar.xz +/rustc-1.86.0-src.tar.xz +/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz diff --git a/0001-Only-translate-profile-flags-for-Clang.patch b/0001-Only-translate-profile-flags-for-Clang.patch deleted file mode 100644 index 3353c10..0000000 --- a/0001-Only-translate-profile-flags-for-Clang.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e4e678eb9cbd90acf2ba51e9ec0209b05c4403b5 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 9 Jan 2025 16:47:10 -0800 -Subject: [PATCH] Only translate profile flags for Clang - ---- - src/flags.rs | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/src/flags.rs b/src/flags.rs -index 81834cf625f7..1a53c1b2345c 100644 ---- a/src/flags.rs -+++ b/src/flags.rs -@@ -201,13 +201,15 @@ impl<'this> RustcCodegenFlags<'this> { - if self.no_vectorize_slp { - push_if_supported("-fno-slp-vectorize".into()); - } -- // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate -- if let Some(value) = self.profile_generate { -- push_if_supported(format!("-fprofile-generate={value}").into()); -- } -- // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use -- if let Some(value) = self.profile_use { -- push_if_supported(format!("-fprofile-use={value}").into()); -+ if let ToolFamily::Clang { .. } = family { -+ // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate -+ if let Some(value) = self.profile_generate { -+ push_if_supported(format!("-fprofile-generate={value}").into()); -+ } -+ // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use -+ if let Some(value) = self.profile_use { -+ push_if_supported(format!("-fprofile-use={value}").into()); -+ } - } - // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mguard - if let Some(value) = self.control_flow_guard { --- -2.47.1 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index 063d66a..63c9b14 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -1,4 +1,4 @@ -From 3d8c6d095581e8d7585f3772cfd16f6367f3c008 Mon Sep 17 00:00:00 2001 +From 687112c89c9058ef1e79f1c3a974940b1ae43ea3 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 16 Aug 2024 10:12:58 -0700 Subject: [PATCH] Use lld provided by system @@ -12,7 +12,7 @@ Subject: [PATCH] Use lld provided by system 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs -index f237391016e7..08bcd9699b4a 100644 +index 81b96cd39ffa..4c9916af826b 100644 --- a/compiler/rustc_target/src/spec/base/wasm.rs +++ b/compiler/rustc_target/src/spec/base/wasm.rs @@ -85,8 +85,7 @@ macro_rules! args { @@ -26,10 +26,10 @@ index f237391016e7..08bcd9699b4a 100644 pre_link_args, diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs -index 222d5651b521..4b780bc8a8e7 100644 +index 3b719ebaf07e..8b4fecee68f0 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs -@@ -14,7 +14,7 @@ pub fn target() -> Target { +@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target { let opts = TargetOptions { abi: "softfloat".into(), linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), @@ -39,10 +39,10 @@ index 222d5651b521..4b780bc8a8e7 100644 relocation_model: RelocModel::Static, disable_redzone: true, diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs -index 429303170b6b..19d4ec53f6d8 100644 +index 9656024ddaa1..2099fa17229f 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs -@@ -9,6 +9,7 @@ pub fn target() -> Target { +@@ -9,6 +9,7 @@ pub(crate) fn target() -> Target { base.max_atomic_width = Some(128); base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]); base.features = "+v8a".into(); @@ -51,23 +51,23 @@ index 429303170b6b..19d4ec53f6d8 100644 Target { llvm_target: "aarch64-unknown-windows".into(), diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs -index 549706998d46..b7e9158ddef5 100644 +index e14a36735894..b493d7d98b46 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs -@@ -17,7 +17,7 @@ pub fn target() -> Target { +@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target { static_position_independent_executables: true, relro_level: RelroLevel::Full, linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), - linker: Some("rust-lld".into()), + linker: Some("lld".into()), + rustc_abi: Some(RustcAbi::X86Softfloat), features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(), supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, - disable_redzone: true, diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs -index 6da1fcca58c8..c84ae44576d4 100644 +index bce6aa0ebc6b..7fa1148a1de7 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs -@@ -16,6 +16,7 @@ pub fn target() -> Target { +@@ -14,6 +14,7 @@ pub(crate) fn target() -> Target { base.plt_by_default = false; base.max_atomic_width = Some(64); base.entry_abi = Conv::X86_64Win64; @@ -76,5 +76,5 @@ index 6da1fcca58c8..c84ae44576d4 100644 // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to // enable these CPU features explicitly before their first use, otherwise their instructions -- -2.46.0 +2.48.1 diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index bd6d0ed..9ee7b78 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From eeb171e5de6da8790d01135754cbb9b6c248c476 Mon Sep 17 00:00:00 2001 +From c3307f4e1826cabd8e7e4a54636b0e79afb97835 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:14:28 -0700 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained @@ -11,12 +11,12 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index 5ea6774ce035..ec08a319e77f 100644 +index f5395375afe4..a96368ae4ef2 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -922,6 +922,11 @@ - # argument as the test binary. - #runner = (string) +@@ -927,6 +927,11 @@ + # order to run `x check`. + #optimized-compiler-builtins = build.optimized-compiler-builtins (bool) +# Copy libc and CRT objects into the target lib/self-contained/ directory. +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other @@ -27,10 +27,10 @@ index 5ea6774ce035..ec08a319e77f 100644 # Distribution options # diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index ca337aa9f4c3..6175f93e50ed 100644 +index 479327d63695..97d2bf2df8bb 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -325,6 +325,10 @@ fn copy_self_contained_objects( +@@ -327,6 +327,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -42,18 +42,18 @@ index ca337aa9f4c3..6175f93e50ed 100644 builder.sysroot_target_libdir(*compiler, target).join("self-contained"); t!(fs::create_dir_all(&libdir_self_contained)); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index dd2f11ad4690..e10ed666099c 100644 +index 65f286a05bd5..dc4d6f741bcf 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -634,6 +634,7 @@ pub struct Target { - pub runner: Option, +@@ -643,6 +643,7 @@ pub struct Target { pub no_std: bool, pub codegen_backends: Option>, + pub optimized_compiler_builtins: Option, + pub self_contained: bool, } impl Target { -@@ -645,6 +646,9 @@ pub fn from_triple(triple: &str) -> Self { +@@ -654,6 +655,9 @@ pub fn from_triple(triple: &str) -> Self { if triple.contains("emscripten") { target.runner = Some("node".into()); } @@ -63,15 +63,15 @@ index dd2f11ad4690..e10ed666099c 100644 target } } -@@ -1219,6 +1223,7 @@ struct TomlTarget { - no_std: Option = "no-std", +@@ -1234,6 +1238,7 @@ struct TomlTarget { codegen_backends: Option> = "codegen-backends", runner: Option = "runner", + optimized_compiler_builtins: Option = "optimized-compiler-builtins", + self_contained: Option = "self-contained", } } -@@ -2082,6 +2087,9 @@ fn get_table(option: &str) -> Result { +@@ -2146,6 +2151,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index dd2f11ad4690..e10ed666099c 100644 target.cxx = cfg.cxx.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 8405c22aff08..7e1582207b8a 100644 +index 21b02a3b541a..6b98c67457e8 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1327,6 +1327,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1366,6 +1366,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } @@ -98,5 +98,5 @@ index 8405c22aff08..7e1582207b8a 100644 /// and `remote-test-server` binaries. fn remote_tested(&self, target: TargetSelection) -> bool { -- -2.47.1 +2.48.1 diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index 3534abb..2441d07 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,4 +1,4 @@ -From e8e50258df70b39d2425dacf90c3d5f6d0720bc0 Mon Sep 17 00:00:00 2001 +From 9551ffded09131ac225261ab55a7b3c9d09ad3bb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:18:16 -0700 Subject: [PATCH 2/2] set an external library path for wasm32-wasi @@ -11,10 +11,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index e2081ad75633..a308bae8b644 100644 +index 105a4cb81f0d..21bd626842c7 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1639,6 +1639,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1686,6 +1686,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -27,7 +27,7 @@ index e2081ad75633..a308bae8b644 100644 for search_path in sess.target_filesearch().search_paths(PathKind::Native) { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -2139,6 +2145,10 @@ fn add_library_search_dirs( +@@ -2186,6 +2192,10 @@ fn add_library_search_dirs( ControlFlow::<()>::Continue(()) }, ); @@ -39,10 +39,10 @@ index e2081ad75633..a308bae8b644 100644 /// Add options making relocation sections in the produced ELF files read-only diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs -index 9cdc0801b1f0..70fe8396b353 100644 +index f703132e51f0..c4821be7d12e 100644 --- a/compiler/rustc_target/src/spec/json.rs +++ b/compiler/rustc_target/src/spec/json.rs -@@ -527,6 +527,7 @@ macro_rules! key { +@@ -540,6 +540,7 @@ macro_rules! key { key!(linker_is_gnu_json = "linker-is-gnu", bool); key!(pre_link_objects = "pre-link-objects", link_objects); key!(post_link_objects = "post-link-objects", link_objects); @@ -50,7 +50,7 @@ index 9cdc0801b1f0..70fe8396b353 100644 key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects); key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects); // Deserializes the backwards-compatible variants of `-Clink-self-contained` -@@ -708,6 +709,7 @@ macro_rules! target_option_val { +@@ -723,6 +724,7 @@ macro_rules! target_option_val { target_option_val!(linker_is_gnu_json, "linker-is-gnu"); target_option_val!(pre_link_objects); target_option_val!(post_link_objects); @@ -59,10 +59,10 @@ index 9cdc0801b1f0..70fe8396b353 100644 target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback"); target_option_val!(link_args - pre_link_args_json, "pre-link-args"); diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 02962d55a60e..169f5a74bbfd 100644 +index 794d6457cb78..b2d88a14bb57 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -2197,6 +2197,7 @@ pub struct TargetOptions { +@@ -2237,6 +2237,7 @@ pub struct TargetOptions { /// Objects to link before and after all other object code. pub pre_link_objects: CrtObjects, pub post_link_objects: CrtObjects, @@ -70,7 +70,7 @@ index 02962d55a60e..169f5a74bbfd 100644 /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. pub pre_link_objects_self_contained: CrtObjects, pub post_link_objects_self_contained: CrtObjects, -@@ -2712,6 +2713,7 @@ fn default() -> TargetOptions { +@@ -2754,6 +2755,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), @@ -99,5 +99,5 @@ index 0862958d05da..b1e736d68627 100644 // Right now this is a bit of a workaround but we're currently saying that // the target by default has a static crt which we're taking as a signal -- -2.47.1 +2.48.1 diff --git a/rust.spec b/rust.spec index 877e560..370fbb1 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.85.1 +Version: 1.86.0 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.84.0 -%global bootstrap_channel 1.84.0 -%global bootstrap_date 2025-01-09 +%global bootstrap_version 1.85.0 +%global bootstrap_channel 1.85.0 +%global bootstrap_date 2025-02-20 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -28,7 +28,8 @@ ExclusiveArch: %{rust_arches} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_ref wasi-sdk-25 +#global wasi_libc_ref wasi-sdk-25 +%global wasi_libc_ref 640c0cfc19a96b099e0791824be5ef0105ce2084 %global wasi_libc_name wasi-libc-%{wasi_libc_ref} %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz %global wasi_libc_dir %{_builddir}/%{wasi_libc_name} @@ -45,17 +46,15 @@ ExclusiveArch: %{rust_arches} # is insufficient. Rust currently requires LLVM 18.0+. %global min_llvm_version 18.0.0 %global bundled_llvm_version 19.1.7 -%if 0%{?fedora} >= 42 || 0%{?rhel} > 10 -%global llvm_compat_version 19 -%endif +#global llvm_compat_version 19 %global llvm llvm%{?llvm_compat_version} %bcond_with bundled_llvm -# Requires stable libgit2 1.8, and not the next minor soname change. +# Requires stable libgit2 1.9, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.8.1 -%global next_libgit2_version 1.9.0~ -%global bundled_libgit2_version 1.8.1 +%global min_libgit2_version 1.9.0 +%global next_libgit2_version 1.10.0~ +%global bundled_libgit2_version 1.9.0 %if 0%{?fedora} >= 41 %bcond_with bundled_libgit2 %else @@ -73,7 +72,7 @@ ExclusiveArch: %{rust_arches} # Cargo uses UPSERTs with omitted conflict targets %global min_sqlite3_version 3.35 -%global bundled_sqlite3_version 3.46.0 +%global bundled_sqlite3_version 3.48.0 %if 0%{?rhel} && 0%{?rhel} < 10 %bcond_without bundled_sqlite3 %else @@ -139,10 +138,7 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.85.0-unbundle-sqlite.patch - -# https://github.com/rust-lang/cc-rs/issues/1354 -Patch7: 0001-Only-translate-profile-flags-for-Clang.patch +Patch6: rustc-1.86.0-unbundle-sqlite.patch ### RHEL-specific patches below ### @@ -153,7 +149,7 @@ Source102: cargo_vendor.attr Source103: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.85.0-disable-libssh2.patch +Patch100: rustc-1.86.0-disable-libssh2.patch # Get the Rust triple for any architecture and ABI. %{lua: function rust_triple(arch, abi) @@ -686,7 +682,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %if %without bundled_sqlite3 %patch -P6 -p1 %endif -%patch -P7 -p1 -d vendor/cc-1.2.6 %if %with disabled_libssh2 %patch -P100 -p1 @@ -706,7 +701,7 @@ mkdir -p src/llvm-project/libunwind/ # Remove submodules we don't need. rm -rf src/gcc rm -rf src/tools/enzyme -rm -rf src/tools/rustc-perf +rm -rf src/tools/rustc-perf/collector/*-benchmarks/ # Remove other unused vendored libraries. This leaves the directory in place, # because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl". @@ -1072,6 +1067,8 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* %license build/manifests/rustc/cargo-vendor.txt +%license %{_pkgdocdir}/COPYRIGHT.html +%license %{_pkgdocdir}/licenses/ %files std-static @@ -1081,6 +1078,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{rustlibdir}/%{rust_triple}/lib/*.rlib %{rustlibdir}/%{rust_triple}/lib/*.so %license build/manifests/std/cargo-vendor.txt +%license %{_pkgdocdir}/COPYRIGHT-library.html %global target_files() \ %files std-static-%1 \ diff --git a/rustc-1.85.0-disable-libssh2.patch b/rustc-1.85.0-disable-libssh2.patch deleted file mode 100644 index 09be945..0000000 --- a/rustc-1.85.0-disable-libssh2.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-01-17 14:26:49.845587361 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-01-17 14:26:49.848587324 -0800 -@@ -2296,7 +2296,6 @@ checksum = "10472326a8a6477c3c20a64547b0 - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -2337,20 +2336,6 @@ dependencies = [ - "pkg-config", - "vcpkg", - ] -- --[[package]] --name = "libssh2-sys" --version = "0.3.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" --dependencies = [ -- "cc", -- "libc", -- "libz-sys", -- "openssl-sys", -- "pkg-config", -- "vcpkg", --] - - [[package]] - name = "libz-sys" -diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-01-17 14:26:49.848587324 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-01-17 14:27:49.035844397 -0800 -@@ -47,7 +47,7 @@ curl = "0.4.46" - curl-sys = "0.4.73" - filetime = "0.2.23" - flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] } --git2 = "0.19.0" -+git2 = { version = "0.19.0", default-features = false, features = ["https"] } - git2-curl = "0.20.0" - gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } - glob = "0.3.1" diff --git a/rustc-1.85.0-unbundle-sqlite.patch b/rustc-1.85.0-unbundle-sqlite.patch deleted file mode 100644 index 08c395f..0000000 --- a/rustc-1.85.0-unbundle-sqlite.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-01-11 07:18:58.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-01-17 14:14:33.072839703 -0800 -@@ -2334,7 +2334,6 @@ version = "0.30.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" - dependencies = [ -- "cc", - "pkg-config", - "vcpkg", - ] -diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-01-17 14:14:33.072839703 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-01-17 14:15:48.497891366 -0800 -@@ -80,7 +80,7 @@ proptest = "1.5.0" - pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] } - rand = "0.8.5" - regex = "1.10.5" --rusqlite = { version = "0.32.0", features = ["bundled"] } -+rusqlite = { version = "0.32.0", features = [] } - rustc-hash = "2.0.0" - rustc-stable-hash = "0.1.1" - rustfix = { version = "0.9.0", path = "crates/rustfix" } diff --git a/rustc-1.86.0-disable-libssh2.patch b/rustc-1.86.0-disable-libssh2.patch new file mode 100644 index 0000000..8b07bde --- /dev/null +++ b/rustc-1.86.0-disable-libssh2.patch @@ -0,0 +1,44 @@ +diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-03-11 15:36:38.387335541 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-03-11 15:39:27.491711044 -0700 +@@ -2528,7 +2528,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -2574,20 +2573,6 @@ dependencies = [ + "pkg-config", + "vcpkg", + ] +- +-[[package]] +-name = "libssh2-sys" +-version = "0.3.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] + + [[package]] + name = "libz-sys" +diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-03-11 15:36:38.389045348 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-03-11 15:38:36.948228456 -0700 +@@ -47,7 +47,7 @@ curl = "0.4.47" + curl-sys = "0.4.79" + filetime = "0.2.25" + flate2 = { version = "1.0.35", default-features = false, features = ["zlib"] } +-git2 = "0.20.0" ++git2 = { version = "0.20.0", default-features = false, features = ["https"] } + git2-curl = "0.21.0" + gix = { version = "0.70.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } + glob = "0.3.2" diff --git a/rustc-1.86.0-unbundle-sqlite.patch b/rustc-1.86.0-unbundle-sqlite.patch new file mode 100644 index 0000000..19f5fce --- /dev/null +++ b/rustc-1.86.0-unbundle-sqlite.patch @@ -0,0 +1,23 @@ +diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-03-11 15:30:39.383119717 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-03-11 15:32:12.486164705 -0700 +@@ -2571,7 +2571,6 @@ version = "0.31.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "ad8935b44e7c13394a179a438e0cebba0fe08fe01b54f152e29a93b5cf993fd4" + dependencies = [ +- "cc", + "pkg-config", + "vcpkg", + ] +diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-03-11 15:30:39.384466481 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-03-11 15:32:05.989298381 -0700 +@@ -80,7 +80,7 @@ proptest = "1.6.0" + pulldown-cmark = { version = "0.12.2", default-features = false, features = ["html"] } + rand = "0.9.0" + regex = "1.11.1" +-rusqlite = { version = "0.33.0", features = ["bundled"] } ++rusqlite = { version = "0.33.0", features = [] } + rustc-hash = "2.1.1" + rustc-stable-hash = "0.1.1" + rustfix = { version = "0.9.0", path = "crates/rustfix" } diff --git a/sources b/sources index e45937b..583e27d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.85.1-src.tar.xz) = d61afb4f00d0c63eef132e10ca5369202064ecad8ab5bcf4fbd62e9a20b2bd71840b2a769dadcf43452fc0448865975c9de1c129752caa9928d2757027bacf7c -SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea +SHA512 (rustc-1.86.0-src.tar.xz) = 9ce195e24a03765f7163de16271e3d19d731d4b80fcc2bfd919106c9d42543eade018f712f6947ea3c6e57c6cb2e6841596aa668d608b8da15101a7da14f3097 +SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e From c9224a07d6f58b431bab887fa7b6446fbfe265ea Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Apr 2025 14:15:58 -0700 Subject: [PATCH 32/48] 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 33/48] 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 34/48] 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 35/48] 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 36/48] 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 37/48] 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 38/48] 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 39/48] 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 40/48] 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 41/48] 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 42/48] 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 43/48] 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 44/48] 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 45/48] 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 46/48] 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 47/48] 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 48/48] 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})"