From 45b7fb8bac24bcf916c5bc077f1aedf313791582 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 12 Nov 2024 11:44:29 -0800 Subject: [PATCH 1/6] Update to Rust 1.80.1 Resolves: RHEL-61966 Related: RHEL-61979 --- .gitignore | 2 + ...ble-jump-threading-of-float-equality.patch | 212 -------------- ...x86-64-cpu-in-tests-that-are-sensiti.patch | 264 ------------------ 0001-Use-lld-provided-by-system.patch | 10 + rust.spec | 47 ++-- ...atch => rustc-1.80.0-disable-libssh2.patch | 18 +- ...atch => rustc-1.80.0-unbundle-sqlite.patch | 12 +- sources | 2 +- 8 files changed, 57 insertions(+), 510 deletions(-) delete mode 100644 0001-Disable-jump-threading-of-float-equality.patch delete mode 100644 0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch rename rustc-1.79.0-disable-libssh2.patch => rustc-1.80.0-disable-libssh2.patch (53%) rename rustc-1.79.0-unbundle-sqlite.patch => rustc-1.80.0-unbundle-sqlite.patch (61%) diff --git a/.gitignore b/.gitignore index 6cd3e83..4271d73 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz /rustc-1.78.0-src.tar.xz /rustc-1.79.0-src.tar.xz /wasi-libc-wasi-sdk-22.tar.gz +/rustc-1.80.0-src.tar.xz +/rustc-1.80.1-src.tar.xz diff --git a/0001-Disable-jump-threading-of-float-equality.patch b/0001-Disable-jump-threading-of-float-equality.patch deleted file mode 100644 index 29093bd..0000000 --- a/0001-Disable-jump-threading-of-float-equality.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 49166c7dd925244f631277b4aa9ae4233f300884 Mon Sep 17 00:00:00 2001 -From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> -Date: Sat, 27 Jul 2024 15:08:11 +0200 -Subject: [PATCH] Disable jump threading of float equality - -Jump threading stores values as `u128` (`ScalarInt`) and does its -comparisons for equality as integer comparisons. -This works great for integers. Sadly, not everything is an integer. - -Floats famously have wonky equality semantcs, with `NaN!=NaN` and -`0.0 == -0.0`. This does not match our beautiful integer bitpattern -equality and therefore causes things to go horribly wrong. - -While jump threading could be extended to support floats by remembering -that they're floats in the value state and handling them properly, -it's signficantly easier to just disable it for now. - -(cherry picked from commit eca0a7e72346ba123ace318a0f9c28c57d990aeb) ---- - .../rustc_mir_transform/src/jump_threading.rs | 7 +++ - ...ding.floats.JumpThreading.panic-abort.diff | 59 +++++++++++++++++++ - ...ing.floats.JumpThreading.panic-unwind.diff | 59 +++++++++++++++++++ - tests/mir-opt/jump_threading.rs | 12 ++++ - 4 files changed, 137 insertions(+) - create mode 100644 tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff - create mode 100644 tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff - -diff --git a/compiler/rustc_mir_transform/src/jump_threading.rs b/compiler/rustc_mir_transform/src/jump_threading.rs -index a458297210db..e2d2864ad2a0 100644 ---- a/compiler/rustc_mir_transform/src/jump_threading.rs -+++ b/compiler/rustc_mir_transform/src/jump_threading.rs -@@ -493,6 +493,13 @@ fn process_assign( - BinOp::Ne => ScalarInt::FALSE, - _ => return None, - }; -+ if value.const_.ty().is_floating_point() { -+ // Floating point equality does not follow bit-patterns. -+ // -0.0 and NaN both have special rules for equality, -+ // and therefore we cannot use integer comparisons for them. -+ // Avoid handling them, though this could be extended in the future. -+ return None; -+ } - let value = value.const_.normalize(self.tcx, self.param_env).try_to_scalar_int()?; - let conds = conditions.map(self.arena, |c| Condition { - value, -diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff -new file mode 100644 -index 000000000000..6ca37e96d297 ---- /dev/null -+++ b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff -@@ -0,0 +1,59 @@ -+- // MIR for `floats` before JumpThreading -++ // MIR for `floats` after JumpThreading -+ -+ fn floats() -> u32 { -+ let mut _0: u32; -+ let _1: f64; -+ let mut _2: bool; -+ let mut _3: bool; -+ let mut _4: f64; -+ scope 1 { -+ debug x => _1; -+ } -+ -+ bb0: { -+ StorageLive(_1); -+ StorageLive(_2); -+ _2 = const true; -+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -++ goto -> bb1; -+ } -+ -+ bb1: { -+ _1 = const -0f64; -+ goto -> bb3; -+ } -+ -+ bb2: { -+ _1 = const 1f64; -+ goto -> bb3; -+ } -+ -+ bb3: { -+ StorageDead(_2); -+ StorageLive(_3); -+ StorageLive(_4); -+ _4 = _1; -+ _3 = Eq(move _4, const 0f64); -+ switchInt(move _3) -> [0: bb5, otherwise: bb4]; -+ } -+ -+ bb4: { -+ StorageDead(_4); -+ _0 = const 0_u32; -+ goto -> bb6; -+ } -+ -+ bb5: { -+ StorageDead(_4); -+ _0 = const 1_u32; -+ goto -> bb6; -+ } -+ -+ bb6: { -+ StorageDead(_3); -+ StorageDead(_1); -+ return; -+ } -+ } -+ -diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff -new file mode 100644 -index 000000000000..6ca37e96d297 ---- /dev/null -+++ b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff -@@ -0,0 +1,59 @@ -+- // MIR for `floats` before JumpThreading -++ // MIR for `floats` after JumpThreading -+ -+ fn floats() -> u32 { -+ let mut _0: u32; -+ let _1: f64; -+ let mut _2: bool; -+ let mut _3: bool; -+ let mut _4: f64; -+ scope 1 { -+ debug x => _1; -+ } -+ -+ bb0: { -+ StorageLive(_1); -+ StorageLive(_2); -+ _2 = const true; -+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -++ goto -> bb1; -+ } -+ -+ bb1: { -+ _1 = const -0f64; -+ goto -> bb3; -+ } -+ -+ bb2: { -+ _1 = const 1f64; -+ goto -> bb3; -+ } -+ -+ bb3: { -+ StorageDead(_2); -+ StorageLive(_3); -+ StorageLive(_4); -+ _4 = _1; -+ _3 = Eq(move _4, const 0f64); -+ switchInt(move _3) -> [0: bb5, otherwise: bb4]; -+ } -+ -+ bb4: { -+ StorageDead(_4); -+ _0 = const 0_u32; -+ goto -> bb6; -+ } -+ -+ bb5: { -+ StorageDead(_4); -+ _0 = const 1_u32; -+ goto -> bb6; -+ } -+ -+ bb6: { -+ StorageDead(_3); -+ StorageDead(_1); -+ return; -+ } -+ } -+ -diff --git a/tests/mir-opt/jump_threading.rs b/tests/mir-opt/jump_threading.rs -index 57f4e4a2654f..3e7e8995f1a3 100644 ---- a/tests/mir-opt/jump_threading.rs -+++ b/tests/mir-opt/jump_threading.rs -@@ -514,6 +514,16 @@ fn assume(a: u8, b: bool) -> u8 { - ) - } - -+fn floats() -> u32 { -+ // CHECK-LABEL: fn floats( -+ // CHECK: switchInt( -+ -+ // Test for issue #128243, where float equality was assumed to be bitwise. -+ // When adding float support, it must be ensured that this continues working properly. -+ let x = if true { -0.0 } else { 1.0 }; -+ if x == 0.0 { 0 } else { 1 } -+} -+ - fn main() { - // CHECK-LABEL: fn main( - too_complex(Ok(0)); -@@ -528,6 +538,7 @@ fn main() { - disappearing_bb(7); - aggregate(7); - assume(7, false); -+ floats(); - } - - // EMIT_MIR jump_threading.too_complex.JumpThreading.diff -@@ -542,3 +553,4 @@ fn main() { - // EMIT_MIR jump_threading.disappearing_bb.JumpThreading.diff - // EMIT_MIR jump_threading.aggregate.JumpThreading.diff - // EMIT_MIR jump_threading.assume.JumpThreading.diff -+// EMIT_MIR jump_threading.floats.JumpThreading.diff --- -2.46.0 - diff --git a/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch b/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch deleted file mode 100644 index c427d51..0000000 --- a/0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch +++ /dev/null @@ -1,264 +0,0 @@ -From 706f06c39a9e08a4708a53722429d13ae4069c2f Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 1 May 2024 15:25:26 -0700 -Subject: [PATCH] Use an explicit x86-64 cpu in tests that are sensitive to it - -There are a few tests that depend on some target features **not** being -enabled by default, and usually they are correct with the default x86-64 -target CPU. However, in downstream builds we have modified the default -to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10 --- and the latter especially trips tests that expect not to have AVX. - -These cases are few enough that we can just set them back explicitly. ---- - tests/assembly/simd-intrinsic-mask-reduce.rs | 1 + - tests/assembly/x86_64-floating-point-clamp.rs | 2 +- - .../codegen/target-feature-inline-closure.rs | 2 +- - tests/ui/asm/x86_64/target-feature-attr.rs | 1 + - .../ui/asm/x86_64/target-feature-attr.stderr | 8 +++--- - .../const-eval/const_fn_target_feature.rs | 2 +- - .../rfc-2396-target_feature-11/safe-calls.rs | 1 + - .../safe-calls.stderr | 28 +++++++++---------- - tests/ui/sse2.rs | 4 +-- - 9 files changed, 26 insertions(+), 23 deletions(-) - -diff --git a/tests/assembly/simd-intrinsic-mask-reduce.rs b/tests/assembly/simd-intrinsic-mask-reduce.rs -index 763401755fad..0d77fc410511 100644 ---- a/tests/assembly/simd-intrinsic-mask-reduce.rs -+++ b/tests/assembly/simd-intrinsic-mask-reduce.rs -@@ -1,6 +1,7 @@ - // verify that simd mask reductions do not introduce additional bit shift operations - //@ revisions: x86 aarch64 - //@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel -+//@ [x86] compile-flags: -C target-cpu=x86-64 - //@ [x86] needs-llvm-components: x86 - //@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu - //@ [aarch64] needs-llvm-components: aarch64 -diff --git a/tests/assembly/x86_64-floating-point-clamp.rs b/tests/assembly/x86_64-floating-point-clamp.rs -index 4a72a7f44fa0..b963aee35590 100644 ---- a/tests/assembly/x86_64-floating-point-clamp.rs -+++ b/tests/assembly/x86_64-floating-point-clamp.rs -@@ -2,7 +2,7 @@ - // so check to make sure that's what it's actually emitting. - - //@ assembly-output: emit-asm --//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -+//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -C target-cpu=x86-64 - //@ only-x86_64 - //@ ignore-sgx - -diff --git a/tests/codegen/target-feature-inline-closure.rs b/tests/codegen/target-feature-inline-closure.rs -index 88bd413a8707..20bb4e66ff21 100644 ---- a/tests/codegen/target-feature-inline-closure.rs -+++ b/tests/codegen/target-feature-inline-closure.rs -@@ -1,5 +1,5 @@ - //@ only-x86_64 --//@ compile-flags: -Copt-level=3 -+//@ compile-flags: -Copt-level=3 -Ctarget-cpu=x86-64 - - #![crate_type = "lib"] - #![feature(target_feature_11)] -diff --git a/tests/ui/asm/x86_64/target-feature-attr.rs b/tests/ui/asm/x86_64/target-feature-attr.rs -index 820be132ef79..51829be15065 100644 ---- a/tests/ui/asm/x86_64/target-feature-attr.rs -+++ b/tests/ui/asm/x86_64/target-feature-attr.rs -@@ -1,4 +1,5 @@ - //@ only-x86_64 -+//@ compile-flags: -C target-cpu=x86-64 - - #![feature(avx512_target_feature)] - -diff --git a/tests/ui/asm/x86_64/target-feature-attr.stderr b/tests/ui/asm/x86_64/target-feature-attr.stderr -index c852726ee7ff..1a9962732cfb 100644 ---- a/tests/ui/asm/x86_64/target-feature-attr.stderr -+++ b/tests/ui/asm/x86_64/target-feature-attr.stderr -@@ -1,23 +1,23 @@ - error: register class `ymm_reg` requires the `avx` target feature -- --> $DIR/target-feature-attr.rs:18:40 -+ --> $DIR/target-feature-attr.rs:19:40 - | - LL | asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x); - | ^^^^^^^^^^^^^ - - error: register class `ymm_reg` requires the `avx` target feature -- --> $DIR/target-feature-attr.rs:18:55 -+ --> $DIR/target-feature-attr.rs:19:55 - | - LL | asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x); - | ^^^^^^^^^^^^^ - - error: register class `ymm_reg` requires the `avx` target feature -- --> $DIR/target-feature-attr.rs:18:70 -+ --> $DIR/target-feature-attr.rs:19:70 - | - LL | asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x); - | ^^^^^^^^^^^^^^^^^^ - - error: register class `kreg` requires at least one of the following target features: avx512bw, avx512f -- --> $DIR/target-feature-attr.rs:33:23 -+ --> $DIR/target-feature-attr.rs:34:23 - | - LL | asm!("/* {0} */", in(kreg) x); - | ^^^^^^^^^^ -diff --git a/tests/ui/consts/const-eval/const_fn_target_feature.rs b/tests/ui/consts/const-eval/const_fn_target_feature.rs -index b56b68a57958..d0de9d8d7a34 100644 ---- a/tests/ui/consts/const-eval/const_fn_target_feature.rs -+++ b/tests/ui/consts/const-eval/const_fn_target_feature.rs -@@ -1,5 +1,5 @@ - //@ only-x86_64 --//@ compile-flags:-C target-feature=+ssse3 -+//@ compile-flags: -C target-cpu=x86-64 -C target-feature=+ssse3 - - #![crate_type = "lib"] - -diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs -index c73b8d7e4d29..6fb0688008e6 100644 ---- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs -+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs -@@ -1,4 +1,5 @@ - //@ only-x86_64 -+//@ compile-flags: -C target-cpu=x86-64 - - #![feature(target_feature_11)] - -diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr -index d9d7e297f8e9..fed3da6594cb 100644 ---- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr -+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr -@@ -1,5 +1,5 @@ - error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:25:5 -+ --> $DIR/safe-calls.rs:26:5 - | - LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` -@@ -8,7 +8,7 @@ LL | sse2(); - = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` - - error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:27:5 -+ --> $DIR/safe-calls.rs:28:5 - | - LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` -@@ -16,7 +16,7 @@ LL | avx_bmi2(); - = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 - - error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:29:5 -+ --> $DIR/safe-calls.rs:30:5 - | - LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` -@@ -24,7 +24,7 @@ LL | Quux.avx_bmi2(); - = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 - - error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:35:5 -+ --> $DIR/safe-calls.rs:36:5 - | - LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` -@@ -32,7 +32,7 @@ LL | avx_bmi2(); - = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 - - error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:37:5 -+ --> $DIR/safe-calls.rs:38:5 - | - LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` -@@ -40,7 +40,7 @@ LL | Quux.avx_bmi2(); - = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 - - error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:43:5 -+ --> $DIR/safe-calls.rs:44:5 - | - LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` -@@ -49,7 +49,7 @@ LL | sse2(); - = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` - - error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:45:5 -+ --> $DIR/safe-calls.rs:46:5 - | - LL | avx_bmi2(); - | ^^^^^^^^^^ call to function with `#[target_feature]` -@@ -57,7 +57,7 @@ LL | avx_bmi2(); - = help: in order for the call to be safe, the context requires the following additional target feature: bmi2 - - error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:47:5 -+ --> $DIR/safe-calls.rs:48:5 - | - LL | Quux.avx_bmi2(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` -@@ -65,7 +65,7 @@ LL | Quux.avx_bmi2(); - = help: in order for the call to be safe, the context requires the following additional target feature: bmi2 - - error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:54:5 -+ --> $DIR/safe-calls.rs:55:5 - | - LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` -@@ -74,7 +74,7 @@ LL | sse2(); - = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` - - error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:58:15 -+ --> $DIR/safe-calls.rs:59:15 - | - LL | const _: () = sse2(); - | ^^^^^^ call to function with `#[target_feature]` -@@ -83,7 +83,7 @@ LL | const _: () = sse2(); - = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` - - error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block -- --> $DIR/safe-calls.rs:61:15 -+ --> $DIR/safe-calls.rs:62:15 - | - LL | const _: () = sse2_and_fxsr(); - | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` -@@ -92,7 +92,7 @@ LL | const _: () = sse2_and_fxsr(); - = note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]` - - error: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block (error E0133) -- --> $DIR/safe-calls.rs:68:5 -+ --> $DIR/safe-calls.rs:69:5 - | - LL | sse2(); - | ^^^^^^ call to function with `#[target_feature]` -@@ -101,12 +101,12 @@ LL | sse2(); - = help: in order for the call to be safe, the context requires the following additional target feature: sse2 - = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` - note: an unsafe function restricts its caller, but its body is safe by default -- --> $DIR/safe-calls.rs:67:1 -+ --> $DIR/safe-calls.rs:68:1 - | - LL | unsafe fn needs_unsafe_block() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - note: the lint level is defined here -- --> $DIR/safe-calls.rs:64:8 -+ --> $DIR/safe-calls.rs:65:8 - | - LL | #[deny(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ -diff --git a/tests/ui/sse2.rs b/tests/ui/sse2.rs -index fa6d79713b4b..c203ca2716ff 100644 ---- a/tests/ui/sse2.rs -+++ b/tests/ui/sse2.rs -@@ -20,6 +20,6 @@ fn main() { - "SSE2 was not detected as available on an x86 platform"); - } - // check a negative case too -- allowed on x86, but not enabled by default -- assert!(cfg!(not(target_feature = "avx2")), -- "AVX2 shouldn't be detected as available by default on any platform"); -+ assert!(cfg!(not(target_feature = "avx512f")), -+ "AVX512 shouldn't be detected as available by default on any platform"); - } --- -2.44.0 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index 8fcf4dc..d5970bd 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -63,3 +63,13 @@ diff -Naur a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softflo -- 2.41.0 +--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs 2024-04-09 19:20:09.000000000 +0200 ++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs 2024-04-26 11:22:31.988601550 +0200 +@@ -9,6 +9,7 @@ pub fn target() -> Target { + base.max_atomic_width = Some(128); + base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]); + base.features = "+v8a".into(); ++ base.linker = Some("lld".into()); + + Target { + llvm_target: "aarch64-unknown-windows".into(), diff --git a/rust.spec b/rust.spec index c9b0ed8..2af282d 100644 --- a/rust.spec +++ b/rust.spec @@ -1,6 +1,6 @@ Name: rust -Version: 1.79.0 -Release: 2%{?dist} +Version: 1.80.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) # ^ written as: (rust itself) and (bundled libraries) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.78.0 -%global bootstrap_channel 1.78.0 -%global bootstrap_date 2024-05-02 +%global bootstrap_version 1.79.0 +%global bootstrap_channel 1.79.0 +%global bootstrap_date 2024-06-13 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -35,12 +35,18 @@ ExclusiveArch: %{rust_arches} # NB: wasm32-wasi is being gradually replaced by wasm32-wasip1 # https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html %global wasm_targets wasm32-unknown-unknown wasm32-wasi wasm32-wasip1 -%if 0%{?fedora} || 0%{?rhel} >= 10 +%if 0%{?fedora} %global extra_targets x86_64-unknown-none x86_64-unknown-uefi %endif +%if 0%{?rhel} >= 10 +%global extra_targets x86_64-unknown-none +%endif %endif %ifarch aarch64 -%if 0%{?fedora} || 0%{?rhel} >= 10 +%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 @@ -152,16 +158,10 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.79.0-unbundle-sqlite.patch - -# https://github.com/rust-lang/rust/pull/124597 -Patch7: 0001-Use-an-explicit-x86-64-cpu-in-tests-that-are-sensiti.patch +Patch6: rustc-1.80.0-unbundle-sqlite.patch # Fix codegen test failure on big endian: https://github.com/rust-lang/rust/pull/126263 -Patch8: 0001-Make-issue-122805.rs-big-endian-compatible.patch - -# https://github.com/rust-lang/rust/pull/128271 -Patch9: 0001-Disable-jump-threading-of-float-equality.patch +Patch7: 0001-Make-issue-122805.rs-big-endian-compatible.patch ### RHEL-specific patches below ### @@ -171,7 +171,7 @@ Source101: cargo_vendor.attr Source102: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.79.0-disable-libssh2.patch +Patch100: rustc-1.80.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -447,6 +447,12 @@ Requires: lld %target_description x86_64-unknown-none embedded %endif +%if %target_enabled aarch64-unknown-uefi +%target_package aarch64-unknown-uefi +Requires: lld +%target_description aarch64-unknown-uefi embedded +%endif + %if %target_enabled x86_64-unknown-uefi %target_package x86_64-unknown-uefi Requires: lld @@ -636,8 +642,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 @@ -1057,6 +1061,10 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %target_files x86_64-unknown-none %endif +%if %target_enabled aarch64-unknown-uefi +%target_files aarch64-unknown-uefi +%endif + %if %target_enabled x86_64-unknown-uefi %target_files x86_64-unknown-uefi %endif @@ -1139,6 +1147,9 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %changelog +* Tue Oct 22 2024 Josh Stone - 1.80.1-1 +- Update to 1.80.1 + * Tue Aug 13 2024 Josh Stone - 1.79.0-2 - Disable jump threading of float equality diff --git a/rustc-1.79.0-disable-libssh2.patch b/rustc-1.80.0-disable-libssh2.patch similarity index 53% rename from rustc-1.79.0-disable-libssh2.patch rename to rustc-1.80.0-disable-libssh2.patch index 6b3c90c..85061b4 100644 --- a/rustc-1.79.0-disable-libssh2.patch +++ b/rustc-1.80.0-disable-libssh2.patch @@ -1,7 +1,7 @@ -diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/tools/cargo/Cargo.lock ---- rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig 2024-06-13 16:37:16.640599290 -0700 -+++ rustc-1.79.0-src/src/tools/cargo/Cargo.lock 2024-06-13 16:37:16.646599231 -0700 -@@ -2150,7 +2150,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c +diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-07-05 18:14:51.101370053 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-07-05 18:14:51.104370020 -0700 +@@ -2151,7 +2151,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c dependencies = [ "cc", "libc", @@ -9,7 +9,7 @@ diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/t "libz-sys", "openssl-sys", "pkg-config", -@@ -2191,20 +2190,6 @@ dependencies = [ +@@ -2192,20 +2191,6 @@ dependencies = [ "pkg-config", "vcpkg", ] @@ -30,13 +30,13 @@ diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.lock.orig rustc-1.79.0-src/src/t [[package]] name = "libz-sys" -diff -up rustc-1.79.0-src/src/tools/cargo/Cargo.toml.orig rustc-1.79.0-src/src/tools/cargo/Cargo.toml ---- rustc-1.79.0-src/src/tools/cargo/Cargo.toml.orig 2024-06-13 16:37:16.646599231 -0700 -+++ rustc-1.79.0-src/src/tools/cargo/Cargo.toml 2024-06-13 16:39:06.040526596 -0700 +diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-07-05 18:14:51.104370020 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-07-05 18:15:36.584867840 -0700 @@ -44,7 +44,7 @@ curl = "0.4.46" curl-sys = "0.4.72" filetime = "0.2.23" - flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] } + flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] } -git2 = "0.18.3" +git2 = { version = "0.18.3", default-features = false, features = ["https"] } git2-curl = "0.19.0" diff --git a/rustc-1.79.0-unbundle-sqlite.patch b/rustc-1.80.0-unbundle-sqlite.patch similarity index 61% rename from rustc-1.79.0-unbundle-sqlite.patch rename to rustc-1.80.0-unbundle-sqlite.patch index 8101227..d38128d 100644 --- a/rustc-1.79.0-unbundle-sqlite.patch +++ b/rustc-1.80.0-unbundle-sqlite.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2006-07-24 10:21:28.000000000 +0900 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-05-06 14:13:00.172595245 +0900 -@@ -2191,7 +2191,6 @@ version = "0.28.0" +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2006-07-23 18:21:28.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-07-05 18:09:20.585019493 -0700 +@@ -2189,7 +2189,6 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" dependencies = [ @@ -10,10 +10,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "vcpkg", ] diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-05-06 14:13:00.173595257 +0900 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-05-06 14:13:54.089275003 +0900 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-07-05 18:09:20.585019493 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-07-05 18:10:13.753432408 -0700 @@ -77,7 +77,7 @@ proptest = "1.4.0" - pulldown-cmark = { version = "0.10.2", default-features = false, features = ["html"] } + pulldown-cmark = { version = "0.10.3", default-features = false, features = ["html"] } rand = "0.8.5" regex = "1.10.4" -rusqlite = { version = "0.31.0", features = ["bundled"] } diff --git a/sources b/sources index e0e1f32..c7d3d82 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.79.0-src.tar.xz) = 99d7f276292e5c270648473ff73e9888413a3325ef3a4d7a45f8ce77a42ac87996905f1d875888ce084b621f642017bc9e31a00da1439108dbe19b85d0eab085 +SHA512 (rustc-1.80.1-src.tar.xz) = 3c746108a86eeb734c1a8c8f63ba1a45e2cb03a8cb553395a167d07dc3ce5d8d9ea365ddd95533b6952d915069b86cad7ad218d27861e0889f8e878136bd32ab SHA512 (wasi-libc-wasi-sdk-22.tar.gz) = 3fcd5d6c0e09d824702165d8f1236e400b1d5e95fad14f1821d40de05340a044f0ec8a587d8478854252cc938a663aa9f854e6a5e683ef8f8349c60dc6c628ed From 4a25b3b52404da360e5d4e459f8e6774f2c47299 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 12 Nov 2024 13:22:22 -0800 Subject: [PATCH 2/6] Update to Rust 1.81.0 Resolves: RHEL-61966 Related: RHEL-61980 --- .gitignore | 3 + ...ssue-122805.rs-big-endian-compatible.patch | 49 -- ...-an-automatic-SONAME-for-Rust-dylibs.patch | 234 ++++++++ 0001-Use-lld-provided-by-system.patch | 77 +-- ...llow-disabling-target-self-contained.patch | 26 +- ...-handle-no_std-targets-on-std-builds.patch | 103 ++++ ...xternal-library-path-for-wasm32-wasi.patch | 26 +- rpminspect.yaml | 17 + rust.spec | 53 +- rustc-1.81.0-Update-to-LLVM-19.patch | 560 ++++++++++++++++++ ...atch => rustc-1.81.0-disable-libssh2.patch | 20 +- ...atch => rustc-1.81.0-unbundle-sqlite.patch | 12 +- sources | 4 +- 13 files changed, 1039 insertions(+), 145 deletions(-) delete mode 100644 0001-Make-issue-122805.rs-big-endian-compatible.patch create mode 100644 0001-Only-add-an-automatic-SONAME-for-Rust-dylibs.patch create mode 100644 0001-handle-no_std-targets-on-std-builds.patch create mode 100644 rustc-1.81.0-Update-to-LLVM-19.patch rename rustc-1.80.0-disable-libssh2.patch => rustc-1.81.0-disable-libssh2.patch (54%) rename rustc-1.80.0-unbundle-sqlite.patch => rustc-1.81.0-unbundle-sqlite.patch (61%) diff --git a/.gitignore b/.gitignore index 4271d73..249ccea 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz /wasi-libc-wasi-sdk-22.tar.gz /rustc-1.80.0-src.tar.xz /rustc-1.80.1-src.tar.xz +/wasi-libc-3f43ea9abb24ed8d24d760989e1d87ea385f8eaa.tar.gz +/rustc-1.81.0-src.tar.xz +/wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz diff --git a/0001-Make-issue-122805.rs-big-endian-compatible.patch b/0001-Make-issue-122805.rs-big-endian-compatible.patch deleted file mode 100644 index 23d9a86..0000000 --- a/0001-Make-issue-122805.rs-big-endian-compatible.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 26fa5c2c300f3c3a3ee3109c009bd4a6803a2a4c Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Tue, 11 Jun 2024 10:13:07 +0200 -Subject: [PATCH] Make issue-122805.rs big endian compatible - -Instead of not generating the function at all on big endian (which -makes the CHECK lines fail), instead use to_le() on big endian, -so that we essentially perform a bswap for both endiannesses. ---- - tests/codegen/issues/issue-122805.rs | 21 ++++++++++++--------- - 1 file changed, 12 insertions(+), 9 deletions(-) - -diff --git a/tests/codegen/issues/issue-122805.rs b/tests/codegen/issues/issue-122805.rs -index 6d108ada6dd..8e03c6c8884 100644 ---- a/tests/codegen/issues/issue-122805.rs -+++ b/tests/codegen/issues/issue-122805.rs -@@ -39,17 +39,20 @@ - // OPT3WINX64-NEXT: store <8 x i16> - // CHECK-NEXT: ret void - #[no_mangle] --#[cfg(target_endian = "little")] - pub fn convert(value: [u16; 8]) -> [u8; 16] { -+ #[cfg(target_endian = "little")] -+ let bswap = u16::to_be; -+ #[cfg(target_endian = "big")] -+ let bswap = u16::to_le; - let addr16 = [ -- value[0].to_be(), -- value[1].to_be(), -- value[2].to_be(), -- value[3].to_be(), -- value[4].to_be(), -- value[5].to_be(), -- value[6].to_be(), -- value[7].to_be(), -+ bswap(value[0]), -+ bswap(value[1]), -+ bswap(value[2]), -+ bswap(value[3]), -+ bswap(value[4]), -+ bswap(value[5]), -+ bswap(value[6]), -+ bswap(value[7]), - ]; - unsafe { core::mem::transmute::<_, [u8; 16]>(addr16) } - } --- -2.45.1 - diff --git a/0001-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/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index d5970bd..063d66a 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -1,19 +1,21 @@ -From 61b5cc96337da2121221dd1bcdb63fd36551d065 Mon Sep 17 00:00:00 2001 +From 3d8c6d095581e8d7585f3772cfd16f6367f3c008 Mon Sep 17 00:00:00 2001 From: Josh Stone -Date: Wed, 1 Nov 2023 15:21:15 -0700 +Date: Fri, 16 Aug 2024 10:12:58 -0700 Subject: [PATCH] Use lld provided by system --- - compiler/rustc_target/src/spec/base/wasm.rs | 3 +-- - compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +- - compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 + - 3 files changed, 3 insertions(+), 3 deletions(-) + compiler/rustc_target/src/spec/base/wasm.rs | 3 +-- + .../src/spec/targets/aarch64_unknown_none_softfloat.rs | 2 +- + compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs | 1 + + compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +- + compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 + + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs -index 87ade9e58cf4..2ddff95febab 100644 +index f237391016e7..08bcd9699b4a 100644 --- a/compiler/rustc_target/src/spec/base/wasm.rs +++ b/compiler/rustc_target/src/spec/base/wasm.rs -@@ -91,8 +91,7 @@ macro_rules! args { +@@ -85,8 +85,7 @@ macro_rules! args { // arguments just yet limit_rdylib_exports: false, @@ -23,8 +25,33 @@ index 87ade9e58cf4..2ddff95febab 100644 linker_flavor: LinkerFlavor::WasmLld(Cc::No), pre_link_args, +diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs +index 222d5651b521..4b780bc8a8e7 100644 +--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs ++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs +@@ -14,7 +14,7 @@ pub fn target() -> Target { + let opts = TargetOptions { + abi: "softfloat".into(), + linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), +- linker: Some("rust-lld".into()), ++ linker: Some("lld".into()), + features: "+v8a,+strict-align,-neon,-fp-armv8".into(), + relocation_model: RelocModel::Static, + disable_redzone: true, +diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs +index 429303170b6b..19d4ec53f6d8 100644 +--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs ++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs +@@ -9,6 +9,7 @@ pub fn target() -> Target { + base.max_atomic_width = Some(128); + base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]); + base.features = "+v8a".into(); ++ base.linker = Some("lld".into()); + + Target { + llvm_target: "aarch64-unknown-windows".into(), diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs -index 9aa95a35f8e5..a9172f9441b7 100644 +index 549706998d46..b7e9158ddef5 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs @@ -17,7 +17,7 @@ pub fn target() -> Target { @@ -33,11 +60,11 @@ index 9aa95a35f8e5..a9172f9441b7 100644 linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), - linker: Some("rust-lld".into()), + linker: Some("lld".into()), - features: - "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float" - .into(), + features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(), + supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, + disable_redzone: true, diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs -index 5abfb8162f70..13cb43bda1a4 100644 +index 6da1fcca58c8..c84ae44576d4 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs @@ -16,6 +16,7 @@ pub fn target() -> Target { @@ -48,28 +75,6 @@ index 5abfb8162f70..13cb43bda1a4 100644 // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to // enable these CPU features explicitly before their first use, otherwise their instructions -diff -Naur a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs ---- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs 2024-03-17 12:03:00.000000000 -0700 -+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs 2024-03-22 10:02:17.742806274 -0700 -@@ -14,7 +14,7 @@ - let opts = TargetOptions { - abi: "softfloat".into(), - linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), -- linker: Some("rust-lld".into()), -+ linker: Some("lld".into()), - features: "+v8a,+strict-align,-neon,-fp-armv8".into(), - relocation_model: RelocModel::Static, - disable_redzone: true, -- -2.41.0 +2.46.0 ---- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs 2024-04-09 19:20:09.000000000 +0200 -+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs 2024-04-26 11:22:31.988601550 +0200 -@@ -9,6 +9,7 @@ pub fn target() -> Target { - base.max_atomic_width = Some(128); - base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]); - base.features = "+v8a".into(); -+ base.linker = Some("lld".into()); - - Target { - llvm_target: "aarch64-unknown-windows".into(), diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index a168218..4913cd8 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From 2b99134e2884fa56bcab6d360885ec5421048e66 Mon Sep 17 00:00:00 2001 +From 937b23ef51b1d2f3d12adc9bd90dfd27936326dd Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:14:28 -0700 Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained @@ -11,10 +11,10 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index f94553dd63f7..5ec969c80a37 100644 +index 26687bcfb370..381a23f9cead 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -869,6 +869,11 @@ +@@ -872,6 +872,11 @@ # argument as the test binary. #runner = (string) @@ -27,10 +27,10 @@ index f94553dd63f7..5ec969c80a37 100644 # Distribution options # diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index e927b491c71e..69a80d01d6b9 100644 +index 3e79acad1c4b..525b6e956405 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -356,6 +356,10 @@ fn copy_self_contained_objects( +@@ -357,6 +357,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -42,10 +42,10 @@ index e927b491c71e..69a80d01d6b9 100644 t!(fs::create_dir_all(&libdir_self_contained)); let mut target_deps = vec![]; diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index 3e1bc9a9acdd..5e24a9cc4f60 100644 +index 9d5aa795c6c0..720dc53514d3 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -586,6 +586,7 @@ pub struct Target { +@@ -565,6 +565,7 @@ pub struct Target { pub runner: Option, pub no_std: bool, pub codegen_backends: Option>, @@ -53,7 +53,7 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644 } impl Target { -@@ -594,6 +595,9 @@ pub fn from_triple(triple: &str) -> Self { +@@ -573,6 +574,9 @@ pub fn from_triple(triple: &str) -> Self { if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") { target.no_std = true; } @@ -63,7 +63,7 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644 target } } -@@ -1150,6 +1154,7 @@ struct TomlTarget { +@@ -1140,6 +1144,7 @@ struct TomlTarget { no_std: Option = "no-std", codegen_backends: Option> = "codegen-backends", runner: Option = "runner", @@ -71,7 +71,7 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644 } } -@@ -1870,6 +1875,9 @@ fn get_table(option: &str) -> Result { +@@ -1900,6 +1905,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index 3e1bc9a9acdd..5e24a9cc4f60 100644 target.cxx = cfg.cxx.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 5ed6b357e20a..c23b21d65713 100644 +index a8555b2c3673..70c41b51eb96 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1348,6 +1348,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1361,6 +1361,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } @@ -98,5 +98,5 @@ index 5ed6b357e20a..c23b21d65713 100644 /// and `remote-test-server` binaries. fn remote_tested(&self, target: TargetSelection) -> bool { -- -2.44.0 +2.46.0 diff --git a/0001-handle-no_std-targets-on-std-builds.patch b/0001-handle-no_std-targets-on-std-builds.patch new file mode 100644 index 0000000..964b030 --- /dev/null +++ b/0001-handle-no_std-targets-on-std-builds.patch @@ -0,0 +1,103 @@ +From c41f254ad192a4ab402b40f8bdad169a8163140a Mon Sep 17 00:00:00 2001 +From: onur-ozkan +Date: Thu, 25 Jul 2024 15:59:25 +0300 +Subject: [PATCH] handle no_std targets on std builds + +This change unifies the `Step::run_make` logic and improves it by skipping +std specific crates for no_std targets. + +Signed-off-by: onur-ozkan +(cherry picked from commit 6e247195c644aa924a10c98cc8eb3a28e1a87929) +--- + src/bootstrap/src/core/build_steps/check.rs | 4 ++-- + src/bootstrap/src/core/build_steps/clippy.rs | 3 ++- + src/bootstrap/src/core/build_steps/compile.rs | 23 +++++++++++++++---- + 3 files changed, 22 insertions(+), 8 deletions(-) + +diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs +index 8235d4634b75..bbad3f179ac7 100644 +--- a/src/bootstrap/src/core/build_steps/check.rs ++++ b/src/bootstrap/src/core/build_steps/check.rs +@@ -1,7 +1,7 @@ + //! Implementation of compiling the compiler and standard library, in "check"-based modes. + + use crate::core::build_steps::compile::{ +- add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, ++ add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make, + }; + use crate::core::build_steps::tool::{prepare_tool_cargo, SourceType}; + use crate::core::builder::{ +@@ -47,7 +47,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + } + + fn make_run(run: RunConfig<'_>) { +- let crates = run.make_run_crates(Alias::Library); ++ let crates = std_crates_for_run_make(&run); + run.builder.ensure(Std { target: run.target, crates }); + } + +diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs +index 40a2112b1925..a3ab094d799d 100644 +--- a/src/bootstrap/src/core/build_steps/clippy.rs ++++ b/src/bootstrap/src/core/build_steps/clippy.rs +@@ -4,6 +4,7 @@ + + use crate::builder::Builder; + use crate::builder::ShouldRun; ++use crate::core::build_steps::compile::std_crates_for_run_make; + use crate::core::builder; + use crate::core::builder::crate_description; + use crate::core::builder::Alias; +@@ -122,7 +123,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + } + + fn make_run(run: RunConfig<'_>) { +- let crates = run.make_run_crates(Alias::Library); ++ let crates = std_crates_for_run_make(&run); + run.builder.ensure(Std { target: run.target, crates }); + } + +diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs +index 525b6e956405..19c8cbc54080 100644 +--- a/src/bootstrap/src/core/build_steps/compile.rs ++++ b/src/bootstrap/src/core/build_steps/compile.rs +@@ -127,11 +127,7 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + } + + fn make_run(run: RunConfig<'_>) { +- // If the paths include "library", build the entire standard library. +- let has_alias = +- run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library")); +- let crates = if has_alias { Default::default() } else { run.cargo_crates_in_set() }; +- ++ let crates = std_crates_for_run_make(&run); + run.builder.ensure(Std { + compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()), + target: run.target, +@@ -428,6 +424,23 @@ fn copy_self_contained_objects( + target_deps + } + ++/// Resolves standard library crates for `Std::run_make` for any build kind (like check, build, clippy, etc.). ++pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec { ++ let has_alias = run.paths.iter().any(|set| set.assert_single_path().path.ends_with("library")); ++ let target_is_no_std = run.builder.no_std(run.target).unwrap_or(false); ++ ++ // For no_std targets, do not add any additional crates to the compilation other than what `compile::std_cargo` already adds for no_std targets. ++ if target_is_no_std { ++ vec![] ++ } ++ // If the paths include "library", build the entire standard library. ++ else if has_alias { ++ run.make_run_crates(builder::Alias::Library) ++ } else { ++ run.cargo_crates_in_set() ++ } ++} ++ + /// Configure cargo to compile the standard library, adding appropriate env vars + /// and such. + pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) { +-- +2.46.0 + diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index 34ab22a..5d8c836 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,4 +1,4 @@ -From e3b7d2e3d3b4fcbc6591de606957c0fd59b5e547 Mon Sep 17 00:00:00 2001 +From 348b03695d916ab23a9d66c4ceed2ecbecfc68e7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 28 Sep 2023 18:18:16 -0700 Subject: [PATCH 2/2] set an external library path for wasm32-wasi @@ -10,10 +10,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index f5e8d5fc92a9..f4ad3f725427 100644 +index 8c582fac0d82..169d86cd6224 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1563,6 +1563,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1586,6 +1586,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -26,7 +26,7 @@ index f5e8d5fc92a9..f4ad3f725427 100644 for search_path in fs.search_paths() { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -2049,6 +2055,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: +@@ -2076,6 +2082,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path(); cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path)); } @@ -37,10 +37,10 @@ index f5e8d5fc92a9..f4ad3f725427 100644 /// Add options making relocation sections in the produced ELF files read-only diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 941d767b850d..cd0a2ce51989 100644 +index 607eeac7ccdc..63070622502e 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -1881,6 +1881,7 @@ pub struct TargetOptions { +@@ -2033,6 +2033,7 @@ pub struct TargetOptions { /// Objects to link before and after all other object code. pub pre_link_objects: CrtObjects, pub post_link_objects: CrtObjects, @@ -48,7 +48,7 @@ index 941d767b850d..cd0a2ce51989 100644 /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. pub pre_link_objects_self_contained: CrtObjects, pub post_link_objects_self_contained: CrtObjects, -@@ -2368,6 +2369,7 @@ fn default() -> TargetOptions { +@@ -2520,6 +2521,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), @@ -56,7 +56,7 @@ index 941d767b850d..cd0a2ce51989 100644 pre_link_objects_self_contained: Default::default(), post_link_objects_self_contained: Default::default(), link_self_contained: LinkSelfContainedDefault::False, -@@ -3064,6 +3066,7 @@ macro_rules! key { +@@ -3202,6 +3204,7 @@ macro_rules! key { key!(linker_is_gnu_json = "linker-is-gnu", bool); key!(pre_link_objects = "pre-link-objects", link_objects); key!(post_link_objects = "post-link-objects", link_objects); @@ -64,7 +64,7 @@ index 941d767b850d..cd0a2ce51989 100644 key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects); key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects); // Deserializes the backwards-compatible variants of `-Clink-self-contained` -@@ -3327,6 +3330,7 @@ macro_rules! target_option_val { +@@ -3464,6 +3467,7 @@ macro_rules! target_option_val { target_option_val!(linker_is_gnu_json, "linker-is-gnu"); target_option_val!(pre_link_objects); target_option_val!(post_link_objects); @@ -73,11 +73,11 @@ index 941d767b850d..cd0a2ce51989 100644 target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback"); target_option_val!(link_args - pre_link_args_json, "pre-link-args"); diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -index 7cbe9f09e6ca..b524890c2ec5 100644 +index a8e7f22c0689..55949557d6bb 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs -@@ -20,11 +20,12 @@ pub fn target() -> Target { - options.os = "wasi".into(); +@@ -21,11 +21,12 @@ pub fn target() -> Target { + options.env = "p1".into(); options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]); - options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained(); @@ -93,5 +93,5 @@ index 7cbe9f09e6ca..b524890c2ec5 100644 // Right now this is a bit of a workaround but we're currently saying that // the target by default has a static crt which we're taking as a signal -- -2.44.0 +2.46.0 diff --git a/rpminspect.yaml b/rpminspect.yaml index 3567b3f..b439426 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -10,3 +10,20 @@ doc: # Doc inspection generates massive output which crash RHEL CI ignore: - /usr/share/doc/rust/html/* + +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 diff --git a/rust.spec b/rust.spec index 2af282d..d766401 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.80.1 +Version: 1.81.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.79.0 -%global bootstrap_channel 1.79.0 -%global bootstrap_date 2024-06-13 +%global bootstrap_version 1.80.1 +%global bootstrap_channel 1.80.1 +%global bootstrap_date 2024-08-08 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -58,7 +58,8 @@ ExclusiveArch: %{rust_arches} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_ref wasi-sdk-22 +#global wasi_libc_ref wasi-sdk-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} @@ -81,10 +82,10 @@ ExclusiveArch: %{rust_arches} # Requires stable libgit2 1.7, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.7.2 -%global next_libgit2_version 1.8.0~ -%global bundled_libgit2_version 1.7.2 -%if 0%{?fedora} >= 39 +%global min_libgit2_version 1.8.1 +%global next_libgit2_version 1.9.0~ +%global bundled_libgit2_version 1.8.1 +%if 0%{?fedora} >= 42 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -158,10 +159,17 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.80.0-unbundle-sqlite.patch +Patch6: rustc-1.81.0-unbundle-sqlite.patch -# Fix codegen test failure on big endian: https://github.com/rust-lang/rust/pull/126263 -Patch7: 0001-Make-issue-122805.rs-big-endian-compatible.patch +# handle no_std targets on std builds +# https://github.com/rust-lang/rust/pull/128182 +Patch7: 0001-handle-no_std-targets-on-std-builds.patch + +# 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 ### @@ -171,7 +179,7 @@ Source101: cargo_vendor.attr Source102: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.80.0-disable-libssh2.patch +Patch100: rustc-1.81.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -556,6 +564,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 @@ -642,6 +653,8 @@ 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 @@ -811,6 +824,8 @@ test -r "%{profiler}" %{!?llvm_has_filecheck: --disable-codegen-tests} \ %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-llvm-static-stdcpp \ + --disable-llvm-bitcode-linker \ + --disable-lld \ --disable-rpath \ %{enable_debuginfo} \ %{enable_rust_opts} \ @@ -971,9 +986,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. -timeout -v 90m %{__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. +timeout -v 90m %{__x} test --no-fail-fast --skip={src/bootstrap,tests/crashes} || : rm -rf "./build/%{rust_triple}/test/" %ifarch aarch64 @@ -1147,6 +1165,9 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %changelog +* Fri Oct 25 2024 Josh Stone - 1.81.0-1 +- Update to 1.81.0 + * Tue Oct 22 2024 Josh Stone - 1.80.1-1 - Update to 1.80.1 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 + diff --git a/rustc-1.80.0-disable-libssh2.patch b/rustc-1.81.0-disable-libssh2.patch similarity index 54% rename from rustc-1.80.0-disable-libssh2.patch rename to rustc-1.81.0-disable-libssh2.patch index 85061b4..abee3c3 100644 --- a/rustc-1.80.0-disable-libssh2.patch +++ b/rustc-1.81.0-disable-libssh2.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-07-05 18:14:51.101370053 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-07-05 18:14:51.104370020 -0700 -@@ -2151,7 +2151,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-08-26 09:03:52.769956890 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-08-26 09:03:52.773956573 -0700 +@@ -2155,7 +2155,6 @@ checksum = "10472326a8a6477c3c20a64547b0 dependencies = [ "cc", "libc", @@ -9,7 +9,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "libz-sys", "openssl-sys", "pkg-config", -@@ -2192,20 +2191,6 @@ dependencies = [ +@@ -2196,20 +2195,6 @@ dependencies = [ "pkg-config", "vcpkg", ] @@ -31,14 +31,14 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools [[package]] name = "libz-sys" diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-07-05 18:14:51.104370020 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-07-05 18:15:36.584867840 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-08-26 09:03:52.773956573 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-08-26 09:05:08.595934397 -0700 @@ -44,7 +44,7 @@ curl = "0.4.46" curl-sys = "0.4.72" filetime = "0.2.23" flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] } --git2 = "0.18.3" -+git2 = { version = "0.18.3", default-features = false, features = ["https"] } - git2-curl = "0.19.0" - gix = { version = "0.63.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision", "parallel", "dirwalk"] } +-git2 = "0.19.0" ++git2 = { version = "0.19.0", default-features = false, features = ["https"] } + git2-curl = "0.20.0" + gix = { version = "0.64.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } glob = "0.3.1" diff --git a/rustc-1.80.0-unbundle-sqlite.patch b/rustc-1.81.0-unbundle-sqlite.patch similarity index 61% rename from rustc-1.80.0-unbundle-sqlite.patch rename to rustc-1.81.0-unbundle-sqlite.patch index d38128d..ec3ed1e 100644 --- a/rustc-1.80.0-unbundle-sqlite.patch +++ b/rustc-1.81.0-unbundle-sqlite.patch @@ -1,7 +1,7 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2006-07-23 18:21:28.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-07-05 18:09:20.585019493 -0700 -@@ -2189,7 +2189,6 @@ version = "0.28.0" +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-08-15 09:53:53.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-08-16 10:20:52.394575295 -0700 +@@ -2195,7 +2195,6 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" dependencies = [ @@ -10,10 +10,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "vcpkg", ] diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-07-05 18:09:20.585019493 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-07-05 18:10:13.753432408 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-08-16 10:20:52.394575295 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-08-16 10:21:50.535122479 -0700 @@ -77,7 +77,7 @@ proptest = "1.4.0" - pulldown-cmark = { version = "0.10.3", default-features = false, features = ["html"] } + pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] } rand = "0.8.5" regex = "1.10.4" -rusqlite = { version = "0.31.0", features = ["bundled"] } diff --git a/sources b/sources index c7d3d82..140bdf7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.80.1-src.tar.xz) = 3c746108a86eeb734c1a8c8f63ba1a45e2cb03a8cb553395a167d07dc3ce5d8d9ea365ddd95533b6952d915069b86cad7ad218d27861e0889f8e878136bd32ab -SHA512 (wasi-libc-wasi-sdk-22.tar.gz) = 3fcd5d6c0e09d824702165d8f1236e400b1d5e95fad14f1821d40de05340a044f0ec8a587d8478854252cc938a663aa9f854e6a5e683ef8f8349c60dc6c628ed +SHA512 (rustc-1.81.0-src.tar.xz) = b8a837ced521d2ca2c7f228a0640da591384519e4dbc1ae768524d50616da6abbd2f7bdae3777caebc0447dac91bf76481282ce5a2264d7f30e173caa6321a51 +SHA512 (wasi-libc-b9ef79d7dbd47c6c5bafdae760823467c2f60b70.tar.gz) = 089ee1f9faeccae85697823d415e34aac56df28cd9db99952a148cb9f91532edbae4ea78f8cd9a223903caadeeb17cbc31d55ea65b020692e4841ddf3914821e From 0e84ccd3a7ba77ab1fdbd5a6f5ea2448394a32c9 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 9 Dec 2024 14:29:36 -0800 Subject: [PATCH 3/6] Update to Rust 1.82.0 Resolves: RHEL-61966 Resolves: RHEL-61981 --- .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 +- ...ap-allow-setting-jobs-in-config.toml.patch | 163 +++++ ...-handle-no_std-targets-on-std-builds.patch | 103 ---- ...xternal-library-path-for-wasm32-wasi.patch | 39 +- rust.spec | 64 +- 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 +- 13 files changed, 411 insertions(+), 986 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 create mode 100644 0001-bootstrap-allow-setting-jobs-in-config.toml.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 249ccea..84c9728 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz /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-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/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 d766401..495bc81 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.81.0 +Version: 1.82.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.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,13 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.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/130034 +Patch7: 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.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/131838 +Patch8: 0001-bootstrap-allow-setting-jobs-in-config.toml.patch ### RHEL-specific patches below ### @@ -179,7 +175,7 @@ Source101: cargo_vendor.attr Source102: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.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) @@ -654,7 +650,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %endif %patch -P7 -p1 %patch -P8 -p1 -%patch -P9 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -750,12 +745,23 @@ 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. -ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) -max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 )) -if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then - ncpus="$max_cpus" -fi +# At least 4GB per CPU is a good rule of thumb for building rustc. +%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: @@ -829,6 +835,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 \ @@ -848,7 +855,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 @@ -860,7 +867,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 @@ -1165,6 +1172,9 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %changelog +* Tue Nov 05 2024 Josh Stone - 1.82.0-1 +- Update to 1.82.0 + * Fri Oct 25 2024 Josh Stone - 1.81.0-1 - Update to 1.81.0 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 7f86a9ecede04dad5ef2026ea88460aef50b3161 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 9 Dec 2024 16:50:43 -0800 Subject: [PATCH 4/6] Update to Rust 1.83.0 Resolves: RHEL-61966 Resolves: RHEL-61982 --- .gitignore | 2 + ...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 ++-- macros.rust-toolset | 17 +- rust.spec | 43 ++--- sources | 4 +- 7 files changed, 50 insertions(+), 216 deletions(-) delete mode 100644 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch diff --git a/.gitignore b/.gitignore index 84c9728..12c71cc 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz /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 +/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/macros.rust-toolset b/macros.rust-toolset index be5a2c9..3f75b70 100644 --- a/macros.rust-toolset +++ b/macros.rust-toolset @@ -154,16 +154,13 @@ EOF}\ # of a specific binary has been installed, but which conflicts between builds # of different Rust applications and is not needed when building RPM packages. %cargo_install\ -(\ -set -euo pipefail \ - %{shrink: \ - %{__cargo} install \ - %{__cargo_common_opts} \ - --profile rpm \ - --no-track \ - --path . \ - } \ -) +%{shrink: \ + %{__cargo} install \ + %{__cargo_common_opts} \ + --profile rpm \ + --no-track \ + --path . \ +} # cargo_license: print license information for all crate dependencies # diff --git a/rust.spec b/rust.spec index 495bc81..f24f8a2 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.82.0 +Version: 1.83.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.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 @@ -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} @@ -73,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} @@ -161,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 ### @@ -649,7 +645,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 -%patch -P8 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -909,19 +904,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 '{}' '+' @@ -1027,10 +1009,6 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %{_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 @@ -1038,6 +1016,7 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %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 \ @@ -1172,6 +1151,10 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %changelog +* Thu Dec 05 2024 Josh Stone - 1.83.0-1 +- Update to 1.83.0 +- Remove the subshell in the cargo_install macro + * Tue Nov 05 2024 Josh Stone - 1.82.0-1 - Update to 1.82.0 diff --git a/sources b/sources index 2f35a76..41e5bf7 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 (rustc-1.83.0-src.tar.xz) = 64db57949c6ac1df6a3f4c6bd0938685a5fb1bc3d318b34ccfcfccb0f9eff1cffd4d8a53a190ef0409eeca9ad12bc6234c2c1de69196cc74ae02d6afa20d0ce6 +SHA512 (wasi-libc-wasi-sdk-24.tar.gz) = ab9322dbcd0bb151ba3f5a8b722e04d39ea5d7632d0322257c3b67e4193d0de1b0820dd4db84923e7967f24189d02dd242693ea95ad184a309eec4d27df8ba21 From de10ec2dd8a270a013c17172c27e993f8e056b2a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 Jan 2025 18:22:10 -0800 Subject: [PATCH 5/6] Update to Rust 1.84.0 Resolves: RHEL-61966 Resolves: RHEL-61983 --- .gitignore | 2 + ...variables-override-some-default-CPUs.patch | 12 +- ...vm-objcopy-if-llvm-tools-are-enabled.patch | 25 +++ ...ly-translate-profile-flags-for-Clang.patch | 39 ++++ ...llow-disabling-target-self-contained.patch | 34 ++-- ...ap-allow-setting-jobs-in-config.toml.patch | 162 ----------------- ...xternal-library-path-for-wasm32-wasi.patch | 28 +-- rpminspect.yaml | 1 + rust.spec | 166 ++++++++---------- ...atch => rustc-1.84.0-disable-libssh2.patch | 16 +- ...atch => rustc-1.84.0-unbundle-sqlite.patch | 18 +- sources | 4 +- 12 files changed, 199 insertions(+), 308 deletions(-) create mode 100644 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch create mode 100644 0001-Only-translate-profile-flags-for-Clang.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 12c71cc..bbe0a15 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz /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-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/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/rpminspect.yaml b/rpminspect.yaml index b439426..b9008c7 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -27,3 +27,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 diff --git a/rust.spec b/rust.spec index f24f8a2..0039235 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.83.0 +Version: 1.84.0 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.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 @@ -25,40 +25,10 @@ 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 -%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} @@ -74,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 @@ -158,10 +128,13 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.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 + +# https://github.com/rust-lang/cc-rs/issues/1354 +Patch8: 0001-Only-translate-profile-flags-for-Clang.patch ### RHEL-specific patches below ### @@ -171,16 +144,14 @@ Source101: cargo_vendor.attr Source102: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.82.0-disable-libssh2.patch +Patch100: rustc-1.84.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 @@ -189,11 +160,42 @@ 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 +%global wasm_targets wasm32-unknown-unknown 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 @@ -227,14 +229,16 @@ 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 BuildRequires: make -BuildRequires: gcc -BuildRequires: gcc-c++ +BuildRequires: gcc-toolset-14-annobin-plugin-gcc +BuildRequires: gcc-toolset-14-binutils +BuildRequires: gcc-toolset-14-gcc +BuildRequires: gcc-toolset-14-gcc-c++ BuildRequires: ncurses-devel # explicit curl-devel to avoid httpd24-curl (rhbz1540167) BuildRequires: curl-devel @@ -417,18 +421,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 @@ -438,6 +430,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 @@ -645,6 +639,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 @@ -661,6 +656,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". @@ -734,7 +733,7 @@ end} %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1} %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1} } -%global export_rust_env export %{rust_env} +%global export_rust_env export %{rust_env} ; source /opt/rh/gcc-toolset-14/enable %build %{export_rust_env} @@ -776,16 +775,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 } @@ -797,12 +792,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}" @@ -836,6 +826,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 \ @@ -893,7 +884,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' \ @@ -1016,7 +1013,6 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %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 \ @@ -1028,30 +1024,17 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %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 %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 @@ -1151,6 +1134,9 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %changelog +* Wed Jan 15 2025 Josh Stone - 1.84.0-1 +- Update to 1.84.0 + * Thu Dec 05 2024 Josh Stone - 1.83.0-1 - Update to 1.83.0 - Remove the subshell in the cargo_install macro 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 8dbbe1dd16cf175c3d875a419aa3b94bc5bbdfe1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 4 Feb 2025 15:44:11 -0800 Subject: [PATCH 6/6] Update to Rust 1.84.1 Resolves: RHEL-61966 Resolves: RHEL-77259 --- .gitignore | 1 + ...vm-objcopy-if-llvm-tools-are-enabled.patch | 25 --------- rust.spec | 51 ++++++++++++++----- sources | 2 +- 4 files changed, 39 insertions(+), 40 deletions(-) delete mode 100644 0001-Only-dist-llvm-objcopy-if-llvm-tools-are-enabled.patch diff --git a/.gitignore b/.gitignore index bbe0a15..3e27193 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz /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 0039235..ce22a3e 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.84.0 +Version: 1.84.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) @@ -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 @@ -130,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 ### @@ -251,6 +257,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 @@ -638,8 +648,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 @@ -678,6 +687,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 @@ -730,6 +743,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} } @@ -884,12 +898,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} @@ -901,6 +909,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 '{}' '+' @@ -1002,7 +1017,7 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %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* @@ -1013,6 +1028,7 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %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 \ @@ -1024,11 +1040,15 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %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 @@ -1134,6 +1154,9 @@ timeout -v 30m %{__x} test --no-fail-fast rustfmt || : %changelog +* Tue Feb 04 2025 Josh Stone - 1.84.1-1 +- Update to 1.84.1 + * Wed Jan 15 2025 Josh Stone - 1.84.0-1 - Update to 1.84.0 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