From c384eaba2ce9a721bd7cdcc2dd18642d03d7fa49 Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Tue, 21 Apr 2026 15:00:47 -0500 Subject: [PATCH] Update to Rust 1.95.0 wasi-libc is also updated to version 32. Related: RHEL-169830 Resolves: RHEL-140425 Assisted-by: Jesus Checa Hidalgo --- .gitignore | 3 + 0001-Update-amdgpu-data-layout.patch | 44 --------- 0001-Use-lld-provided-by-system.patch | 10 +-- ...-propagate-CARGO_TARGET_-host-_LINKE.patch | 67 -------------- ...addrspacecast-to-lifetime-intrinsics.patch | 89 ------------------- 0003-Don-t-use-evex512-with-LLVM-22.patch | 35 -------- rpminspect.yaml | 1 + rust.spec | 66 ++++++-------- ...atch => rustc-1.95.0-disable-libssh2.patch | 24 ++--- ...atch => rustc-1.95.0-unbundle-sqlite.patch | 14 +-- sources | 6 +- wasi-no-link-builtins.patch | 31 ------- 12 files changed, 59 insertions(+), 331 deletions(-) delete mode 100644 0001-Update-amdgpu-data-layout.patch delete mode 100644 0001-bootstrap-always-propagate-CARGO_TARGET_-host-_LINKE.patch delete mode 100644 0002-Avoid-passing-addrspacecast-to-lifetime-intrinsics.patch delete mode 100644 0003-Don-t-use-evex512-with-LLVM-22.patch rename rustc-1.94.1-disable-libssh2.patch => rustc-1.95.0-disable-libssh2.patch (78%) rename rustc-1.94.0-unbundle-sqlite.patch => rustc-1.95.0-unbundle-sqlite.patch (58%) delete mode 100644 wasi-no-link-builtins.patch diff --git a/.gitignore b/.gitignore index 5735953..feca551 100644 --- a/.gitignore +++ b/.gitignore @@ -445,3 +445,6 @@ /wasi-libc-wasi-sdk-29.tar.gz /rustc-1.94.1-src.tar.xz /rustc-1.94.1-src.tar.xz.asc +/rustc-1.95.0-src.tar.xz +/rustc-1.95.0-src.tar.xz.asc +/wasi-libc-wasi-sdk-32.tar.gz diff --git a/0001-Update-amdgpu-data-layout.patch b/0001-Update-amdgpu-data-layout.patch deleted file mode 100644 index 70e9a1b..0000000 --- a/0001-Update-amdgpu-data-layout.patch +++ /dev/null @@ -1,44 +0,0 @@ -From bf3ac98d6930ba4e258cf33240c2fe7c99d19eae Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Tue, 6 Jan 2026 11:51:33 +0100 -Subject: [PATCH 1/3] Update amdgpu data layout - -This changed in: -https://github.com/llvm/llvm-project/commit/853760bca6aa7a960b154cef8c61f87271870b8a ---- - compiler/rustc_codegen_llvm/src/context.rs | 5 +++++ - compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs | 2 +- - 2 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs -index 4b2544b7efdf..4328b15c73f3 100644 ---- a/compiler/rustc_codegen_llvm/src/context.rs -+++ b/compiler/rustc_codegen_llvm/src/context.rs -@@ -215,6 +215,11 @@ pub(crate) unsafe fn create_module<'ll>( - // LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673 - target_data_layout = target_data_layout.replace("-f64:32:64", ""); - } -+ if sess.target.arch == Arch::AmdGpu { -+ // LLVM 22 specified ELF mangling in the amdgpu data layout: -+ // https://github.com/llvm/llvm-project/pull/163011 -+ target_data_layout = target_data_layout.replace("-m:e", ""); -+ } - } - - // Ensure the data-layout values hardcoded remain the defaults. -diff --git a/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs b/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs -index 828d853ac65e..d6a2cfc2aab5 100644 ---- a/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs -+++ b/compiler/rustc_target/src/spec/targets/amdgcn_amd_amdhsa.rs -@@ -5,7 +5,7 @@ - pub(crate) fn target() -> Target { - Target { - arch: Arch::AmdGpu, -- data_layout: "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9".into(), -+ data_layout: "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9".into(), - llvm_target: "amdgcn-amd-amdhsa".into(), - metadata: TargetMetadata { - description: Some("AMD GPU".into()), --- -2.53.0 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index 71c55ed..c3c36a4 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -1,4 +1,4 @@ -From d2fa68624463426e82f2ba19703159a46867384b Mon Sep 17 00:00:00 2001 +From d8b00ced0429722016cd35c2c5f392cd2b19d440 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 16 Aug 2024 10:12:58 -0700 Subject: [PATCH] Use lld provided by system @@ -50,7 +50,7 @@ index e2c1888e408..4869f85d1e6 100644 Target { llvm_target: "aarch64-unknown-windows".into(), diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs -index 520a59d6a6f..1606618b683 100644 +index 0afe7a0b68b..4671032a437 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target { @@ -59,11 +59,11 @@ index 520a59d6a6f..1606618b683 100644 linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), - linker: Some("rust-lld".into()), + linker: Some("lld".into()), - rustc_abi: Some(RustcAbi::X86Softfloat), + rustc_abi: Some(RustcAbi::Softfloat), features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(), supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs -index 8a494d0e56d..d2f4f3f42b4 100644 +index 333e20bd0ac..16bea38887b 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 @@ -15,6 +15,7 @@ pub(crate) fn target() -> Target { @@ -75,5 +75,5 @@ index 8a494d0e56d..d2f4f3f42b4 100644 // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to // enable these CPU features explicitly before their first use, otherwise their instructions -- -2.51.1 +2.53.0 diff --git a/0001-bootstrap-always-propagate-CARGO_TARGET_-host-_LINKE.patch b/0001-bootstrap-always-propagate-CARGO_TARGET_-host-_LINKE.patch deleted file mode 100644 index b8e1ac0..0000000 --- a/0001-bootstrap-always-propagate-CARGO_TARGET_-host-_LINKE.patch +++ /dev/null @@ -1,67 +0,0 @@ -From cdd0ede64037938b5ef89da2b5ac3c77ea7c6375 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 3 Feb 2026 16:09:21 -0800 -Subject: [PATCH] bootstrap: always propagate `CARGO_TARGET_{host}_LINKER` - -We were already setting `CARGO_TARGET_{target}_LINKER` when there is a -setting in `bootstrap.toml`, and when the host and target are the same, -this is also used for build scripts and proc-macros. - -However, the host value wasn't set when building for any other target, -and Cargo would see that as a fingerprint change for those build -artifacts, rebuilding them. - -If we always set the `CARGO_TARGET_{host}_LINKER`, then those build -scripts will keep a consistent Cargo fingerprint, so they'll remain -cached no matter how we're alternating targets. ---- - src/bootstrap/src/core/builder/cargo.rs | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs -index 7150b2b0d59f..488125863ee0 100644 ---- a/src/bootstrap/src/core/builder/cargo.rs -+++ b/src/bootstrap/src/core/builder/cargo.rs -@@ -10,7 +10,7 @@ - use crate::core::config::SplitDebuginfo; - use crate::core::config::flags::Color; - use crate::utils::build_stamp; --use crate::utils::helpers::{self, LldThreads, check_cfg_arg, linker_args, linker_flags}; -+use crate::utils::helpers::{self, LldThreads, check_cfg_arg, linker_flags}; - use crate::{ - BootstrapCommand, CLang, Compiler, Config, DryRun, EXTRA_CHECK_CFGS, GitRepo, Mode, - RemapScheme, TargetSelection, command, prepare_behaviour_dump_dir, t, -@@ -310,7 +310,15 @@ fn configure_linker(&mut self, builder: &Builder<'_>) -> &mut Cargo { - } - } - -- for arg in linker_args(builder, compiler.host, LldThreads::Yes) { -+ // We need to set host linker flags for compiling build scripts and proc-macros. -+ // This is done the same way as the target linker flags below, so cargo won't see -+ // any fingerprint difference between host==target versus cross-compiled targets -+ // when it comes to those host build artifacts. -+ if let Some(host_linker) = builder.linker(compiler.host) { -+ let host = crate::envify(&compiler.host.triple); -+ self.command.env(format!("CARGO_TARGET_{host}_LINKER"), host_linker); -+ } -+ for arg in linker_flags(builder, compiler.host, LldThreads::Yes) { - self.hostflags.arg(&arg); - } - -@@ -319,11 +327,11 @@ fn configure_linker(&mut self, builder: &Builder<'_>) -> &mut Cargo { - self.command.env(format!("CARGO_TARGET_{target}_LINKER"), target_linker); - } - // We want to set -Clinker using Cargo, therefore we only call `linker_flags` and not -- // `linker_args` here. -+ // `linker_args` here. Cargo will pass that to both rustc and rustdoc invocations. - for flag in linker_flags(builder, target, LldThreads::Yes) { - self.rustflags.arg(&flag); - } -- for arg in linker_args(builder, target, LldThreads::Yes) { -+ for arg in linker_flags(builder, target, LldThreads::Yes) { - self.rustdocflags.arg(&arg); - } - --- -2.52.0 - diff --git a/0002-Avoid-passing-addrspacecast-to-lifetime-intrinsics.patch b/0002-Avoid-passing-addrspacecast-to-lifetime-intrinsics.patch deleted file mode 100644 index 93cb498..0000000 --- a/0002-Avoid-passing-addrspacecast-to-lifetime-intrinsics.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 0be66603ac37474fe884ad1b384510d1ddc37417 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Tue, 6 Jan 2026 12:14:36 +0100 -Subject: [PATCH 2/3] Avoid passing addrspacecast to lifetime intrinsics - -Since LLVM 22 the alloca must be passed directly. Do this by -stripping the addrspacecast if it exists. ---- - compiler/rustc_codegen_llvm/src/builder.rs | 3 +++ - compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 1 + - compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 4 ++++ - tests/codegen-llvm/amdgpu-addrspacecast.rs | 11 ++++++++++- - 4 files changed, 18 insertions(+), 1 deletion(-) - -diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs -index 557ae7b0333e..9379faf1156f 100644 ---- a/compiler/rustc_codegen_llvm/src/builder.rs -+++ b/compiler/rustc_codegen_llvm/src/builder.rs -@@ -1788,6 +1788,9 @@ fn call_lifetime_intrinsic(&mut self, intrinsic: &'static str, ptr: &'ll Value, - } - - if crate::llvm_util::get_version() >= (22, 0, 0) { -+ // LLVM 22 requires the lifetime intrinsic to act directly on the alloca, -+ // there can't be an addrspacecast in between. -+ let ptr = unsafe { llvm::LLVMRustStripPointerCasts(ptr) }; - self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]); - } else { - self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]); -diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -index c535fade9c04..a3d4e9f9d32a 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -@@ -1967,6 +1967,7 @@ pub(crate) fn LLVMRustGlobalAddMetadata<'a>( - Metadata: &'a Metadata, - ); - pub(crate) fn LLVMRustIsNonGVFunctionPointerTy(Val: &Value) -> bool; -+ pub(crate) fn LLVMRustStripPointerCasts<'a>(Val: &'a Value) -> &'a Value; - - // Operations on scalar constants - pub(crate) fn LLVMRustConstIntGetZExtValue(ConstantVal: &ConstantInt, Value: &mut u64) -> bool; -diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -index 336d58974036..599f79d01198 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -@@ -1760,6 +1760,10 @@ extern "C" bool LLVMRustIsNonGVFunctionPointerTy(LLVMValueRef V) { - return false; - } - -+extern "C" LLVMValueRef LLVMRustStripPointerCasts(LLVMValueRef V) { -+ return wrap(unwrap(V)->stripPointerCasts()); -+} -+ - extern "C" bool LLVMRustLLVMHasZlibCompression() { - return llvm::compression::zlib::isAvailable(); - } -diff --git a/tests/codegen-llvm/amdgpu-addrspacecast.rs b/tests/codegen-llvm/amdgpu-addrspacecast.rs -index 16a0c276ac0e..144565f7e28c 100644 ---- a/tests/codegen-llvm/amdgpu-addrspacecast.rs -+++ b/tests/codegen-llvm/amdgpu-addrspacecast.rs -@@ -1,16 +1,25 @@ - // Check that pointers are casted to addrspace(0) before they are used - --//@ compile-flags: --crate-type=rlib --target=amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 -+//@ compile-flags: --crate-type=rlib --target=amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 -O - //@ needs-llvm-components: amdgpu - //@ add-minicore -+//@ revisions: LLVM21 LLVM22 -+//@ [LLVM21] max-llvm-major-version: 21 -+//@ [LLVM22] min-llvm-version: 22 - #![feature(no_core)] - #![no_core] - - extern crate minicore; - -+// Make sure that on LLVM 22, the alloca is passed directly to the lifetime intrinsics, -+// not the addrspacecast. -+ - // CHECK-LABEL: @ref_of_local - // CHECK: [[alloca:%[0-9]]] = alloca - // CHECK: %i = addrspacecast ptr addrspace(5) [[alloca]] to ptr -+// LLVM22: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[alloca]]) -+// CHECK: call void %f(ptr{{.*}}%i) -+// LLVM22: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[alloca]]) - #[no_mangle] - pub fn ref_of_local(f: fn(&i32)) { - let i = 0; --- -2.53.0 - diff --git a/0003-Don-t-use-evex512-with-LLVM-22.patch b/0003-Don-t-use-evex512-with-LLVM-22.patch deleted file mode 100644 index 9b11c2a..0000000 --- a/0003-Don-t-use-evex512-with-LLVM-22.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 08da3685eddca11092fecab35c053843e02df0aa Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Fri, 9 Jan 2026 14:56:11 +0100 -Subject: [PATCH 3/3] Don't use evex512 with LLVM 22 - -As Intel has walked back on the existence of AVX 10.1-256, LLVM -no longer uses evex512 and avx-10.n-512 are now avx-10.n instead, -so we can skip all the special handling on LLVM 22. ---- - compiler/rustc_codegen_llvm/src/llvm_util.rs | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs -index 63f820dc2918..fbb582fe8601 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm_util.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs -@@ -287,12 +287,12 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option Some(LLVMFeature::new("cx16")), - "lahfsahf" => Some(LLVMFeature::new("sahf")), - // Enable the evex512 target feature if an avx512 target feature is enabled. -- s if s.starts_with("avx512") => Some(LLVMFeature::with_dependencies( -+ s if s.starts_with("avx512") && major < 22 => Some(LLVMFeature::with_dependencies( - s, - smallvec![TargetFeatureFoldStrength::EnableOnly("evex512")], - )), -- "avx10.1" => Some(LLVMFeature::new("avx10.1-512")), -- "avx10.2" => Some(LLVMFeature::new("avx10.2-512")), -+ "avx10.1" if major < 22 => Some(LLVMFeature::new("avx10.1-512")), -+ "avx10.2" if major < 22 => Some(LLVMFeature::new("avx10.2-512")), - "apxf" => Some(LLVMFeature::with_dependencies( - "egpr", - smallvec![ --- -2.53.0 - diff --git a/rpminspect.yaml b/rpminspect.yaml index 8e1205b..6729717 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -5,6 +5,7 @@ debuginfo: # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 - /usr/lib/debug/usr/bin/rustc-*.i386.debug + - /usr/lib/debug/usr/libexec/rust-analyzer-proc-macro-srv-*.i386.debug doc: # Doc inspection generates massive output which crash RHEL CI diff --git a/rust.spec b/rust.spec index 9f5d1bf..c4db618 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.94.1 +Version: 1.95.0 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # To bootstrap from scratch, set the channel and date from src/stage0 # e.g. 1.89.0 wants rustc: 1.88.0-2025-06-26 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.93.0 -%global bootstrap_channel 1.93.0 -%global bootstrap_date 2026-01-22 +%global bootstrap_version 1.94.0 +%global bootstrap_channel 1.94.0 +%global bootstrap_date 2026-03-05 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -28,7 +28,7 @@ ExclusiveArch: %{rust_arches} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_ref wasi-sdk-29 +%global wasi_libc_ref wasi-sdk-32 %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} @@ -134,21 +134,11 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.94.0-unbundle-sqlite.patch +Patch6: rustc-1.95.0-unbundle-sqlite.patch # stage0 tries to copy all of /usr/lib, sometimes unsuccessfully, see #143735 Patch7: 0001-only-copy-rustlib-into-stage0-sysroot.patch -# bootstrap: always propagate `CARGO_TARGET_{host}_LINKER` -# https://github.com/rust-lang/rust/pull/152077 -Patch8: 0001-bootstrap-always-propagate-CARGO_TARGET_-host-_LINKE.patch - -# Fixes for LLVM 22 compatibility -# https://github.com/rust-lang/rust/pull/151410 -Patch9: 0001-Update-amdgpu-data-layout.patch -Patch10: 0002-Avoid-passing-addrspacecast-to-lifetime-intrinsics.patch -Patch11: 0003-Don-t-use-evex512-with-LLVM-22.patch - ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -157,10 +147,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.94.1-disable-libssh2.patch - -# When building wasi, prevent linking a compiler-rt builtins library we don't have. -Patch1000: wasi-no-link-builtins.patch +Patch100: rustc-1.95.0-disable-libssh2.patch # Get the Rust triple for any architecture and ABI. %{lua: function rust_triple(arch, abi) @@ -270,7 +257,11 @@ BuildRequires: ncurses-devel BuildRequires: curl-devel BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(liblzma) -BuildRequires: pkgconfig(openssl) + +# Only specific versions of openssl are supported. They are 1.0.2 - 1.1.1, or 3 +# The openssl-sys crate will also verify the release is supported. +BuildRequires: pkgconfig(openssl) < 4 + BuildRequires: pkgconfig(zlib) %if %{without bundled_libgit2} @@ -378,6 +369,7 @@ BuildRequires: mingw64-winpthreads-static %if %defined wasm_targets %if %with bundled_wasi_libc BuildRequires: clang%{?llvm_compat_version} +BuildRequires: cmake >= 3.26 %else BuildRequires: wasi-libc-static %endif @@ -684,9 +676,9 @@ test -f '%{local_rust_root}/bin/rustc' %if %{defined wasm_targets} && %{with bundled_wasi_libc} %setup -q -n %{wasi_libc_name} -T -b 10 -rm -rf %{wasi_libc_dir}/dlmalloc/ - -%patch -P1000 -p1 +# We want to make sure we use emmalloc instead of CC0 dlmalloc. +# The cmake files need the sources to exist, so just truncate instead. +truncate --no-create --size=0 %{wasi_libc_dir}/dlmalloc/src/*.c %endif %setup -q -n %{rustc_package} @@ -702,10 +694,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %patch -P6 -p1 %endif %patch -P7 -p1 -%patch -P8 -p1 -%patch -P9 -p1 -%patch -P10 -p1 -%patch -P11 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -801,13 +789,6 @@ end} %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1} %{?llvm_path:PATH="%{llvm_path}:$PATH"} } -%ifarch s390x -# The 1.93 bootstrap compiler is hitting inconsistent segfaults, but for -# whatever reason this only seems to affect z15 builders, and this malloc flag -# somehow avoids the problem -- though it's doubtful malloc is the root cause. -# See also https://redhat.atlassian.net/browse/RHEL-158406 -%global rust_env %{rust_env} MALLOC_MMAP_MAX_=0 -%endif %global export_rust_env export %{rust_env} %build @@ -849,10 +830,19 @@ 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-wasip1 +# Note that we don't want host CFLAGS here! +env -u CFLAGS %__cmake \ + -S "%{wasi_libc_dir}" \ + -B "%{wasi_libc_dir}/%{__cmake_builddir}" \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_C_FLAGS_RELEASE="-O2 -fstack-protector" \ + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ + -DBUILD_SHARED=OFF \ + -DMALLOC=emmalloc \ + -DTARGET_TRIPLE=wasm32-wasip1 +%__cmake --build "%{wasi_libc_dir}/%{__cmake_builddir}" %{?_smp_mflags} %define wasm_target_config %{shrink: - --set target.wasm32-wasip1.wasi-root=%{wasi_libc_dir}/sysroot + --set target.wasm32-wasip1.wasi-root=%{wasi_libc_dir}/%{__cmake_builddir}/sysroot } %else %define wasm_target_config %{shrink: diff --git a/rustc-1.94.1-disable-libssh2.patch b/rustc-1.95.0-disable-libssh2.patch similarity index 78% rename from rustc-1.94.1-disable-libssh2.patch rename to rustc-1.95.0-disable-libssh2.patch index a06473a..2c9d1c4 100644 --- a/rustc-1.94.1-disable-libssh2.patch +++ b/rustc-1.95.0-disable-libssh2.patch @@ -9,12 +9,10 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools "libz-sys", "openssl-sys", "pkg-config", -@@ -2810,20 +2809,6 @@ dependencies = [ - "pkg-config", - "vcpkg", +@@ -2828,20 +2828,6 @@ dependencies = [ ] -- --[[package]] + + [[package]] -name = "libssh2-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" @@ -27,18 +25,20 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools - "pkg-config", - "vcpkg", -] - - [[package]] - name = "libz-rs-sys" +- +-[[package]] + name = "libz-sys" + version = "1.1.23" + source = "registry+https://github.com/rust-lang/crates.io-index" 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 2026-01-27 13:27:00.716725971 -0800 +++ rustc-beta-src/src/tools/cargo/Cargo.toml 2026-01-27 13:29:24.709692974 -0800 @@ -48,7 +48,7 @@ curl = "0.4.49" curl-sys = "=0.4.83" filetime = "0.2.26" - flate2 = { version = "1.1.5", default-features = false, features = ["zlib-rs"] } --git2 = "0.20.3" -+git2 = { version = "0.20.3", default-features = false, features = ["https"] } + flate2 = { version = "1.1.9", default-features = false, features = ["zlib-rs"] } +-git2 = "0.20.4" ++git2 = { version = "0.20.4", default-features = false, features = ["https"] } git2-curl = "0.21.0" # When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail. - gix = { version = "0.77.0", default-features = false, features = ["progress-tree", "parallel", "dirwalk", "status"] } + gix = { version = "0.79.0", default-features = false, features = ["progress-tree", "parallel", "dirwalk", "status"] } diff --git a/rustc-1.94.0-unbundle-sqlite.patch b/rustc-1.95.0-unbundle-sqlite.patch similarity index 58% rename from rustc-1.94.0-unbundle-sqlite.patch rename to rustc-1.95.0-unbundle-sqlite.patch index 4445e35..53750f4 100644 --- a/rustc-1.94.0-unbundle-sqlite.patch +++ b/rustc-1.95.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 2026-01-24 22:38:02.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2026-01-27 13:20:44.594573906 -0800 -@@ -2807,7 +2807,6 @@ version = "0.36.0" +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2026-03-25 08:58:07.789728719 -0500 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2026-03-24 17:34:11.025842497 -0500 +@@ -2824,7 +2824,6 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a" dependencies = [ @@ -10,9 +10,9 @@ 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 2026-01-24 22:38:02.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2026-01-27 13:20:38.024949181 -0800 -@@ -82,7 +82,7 @@ proptest = "1.9.0" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2026-03-25 08:54:36.103702972 -0500 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2026-03-25 08:56:07.916420965 -0500 +@@ -83,7 +83,7 @@ proptest = "1.9.0" pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] } rand = "0.9.2" regex = "1.12.2" @@ -20,4 +20,4 @@ diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools +rusqlite = { version = "0.38.0", features = [] } rustc-hash = "2.1.1" rustc-stable-hash = "0.1.2" - rustfix = { version = "0.9.2", path = "crates/rustfix" } + rustfix = { version = "0.9.5", path = "crates/rustfix" } diff --git a/sources b/sources index fde172b..b4b6a68 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (rustc-1.94.1-src.tar.xz) = 4d20f5b2df042517b14aa4d1a7e4b149b7490ac6be9977d9273f5f81b70ca110b35c554693e1c8a8e4722bdb06532d3972a88c0cb7a8081d3d1bdb23e01e1546 -SHA512 (rustc-1.94.1-src.tar.xz.asc) = 6176d98acf9367e13afaef1c90ebca555f3ad08c44504f5cf23b7963959ee01ace1e99bf56aaf4f629bfb320eaca01b1940ba1819ce523d0cf336c97a69b21b7 -SHA512 (wasi-libc-wasi-sdk-29.tar.gz) = ee803c0eb6c5dab119660926cb2d3ce044cc6f1f32b7cc266d89c25c031480f34c27ab2638df34e192321add629699c6a473438b94f899a28ae9e806ab07d87b +SHA512 (rustc-1.95.0-src.tar.xz) = 685912ffff97063e55c85b2d15d06ba734980cef4b6e104caae1ea433958b12a8d651b757eef7b9f5b06dad3c246d819a5ee5574a26e05007ecdd378f0f041d0 +SHA512 (rustc-1.95.0-src.tar.xz.asc) = f70ed8071eff3470d4c288b83951e05f2ced52052a2f796113eb18db2c1f4bf81796f61434c322772dda879146d63569fd545d94d17e478a9588a333159c389c +SHA512 (wasi-libc-wasi-sdk-32.tar.gz) = 5a07d2d21789c7ad8669d87a33bd0d397b2c64ebb11de81ee3c1c027754a9a88e06c524526b4b7170fa4dfd7e1bfec0a5f58757103a6fe1a8ab136abc7e8a190 diff --git a/wasi-no-link-builtins.patch b/wasi-no-link-builtins.patch deleted file mode 100644 index 77a4c66..0000000 --- a/wasi-no-link-builtins.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- wasi-libc-wasi-sdk-29/Makefile.orig 2026-01-08 16:43:58.310813769 -0600 -+++ wasi-libc-wasi-sdk-29/Makefile 2026-01-08 16:49:21.516204812 -0600 -@@ -643,17 +643,15 @@ builtins: $(BUILTINS_LIB_PATH) - - # Note: libc.so is special because it shouldn't link to libc.so, and the - # -nodefaultlibs flag here disables the default `-lc` logic that clang --# has. Note though that this also disables linking of compiler-rt --# libraries so that is explicitly passed in via `$(BUILTINS_LIB_PATH)` -+# has. - # - # Note: --allow-undefined-file=linker-provided-symbols.txt is - # a workaround for https://github.com/llvm/llvm-project/issues/103592 --$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a $(BUILTINS_LIB_PATH) -+$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a - $(CC) --target=${TARGET_TRIPLE} -nodefaultlibs \ - -shared --sysroot=$(SYSROOT) \ - -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive \ - -Wl,--allow-undefined-file=linker-provided-symbols.txt \ -- $(BUILTINS_LIB_PATH) \ - $(EXTRA_CFLAGS) $(LDFLAGS) - - # Note that unlike `libc.so` above this rule does not pass `-nodefaultlibs` -@@ -865,7 +863,7 @@ STATIC_LIBS += \ - $(SYSROOT_LIB)/libsetjmp.a - endif - --libc: $(INCLUDE_DIRS) $(STATIC_LIBS) builtins -+libc: $(INCLUDE_DIRS) $(STATIC_LIBS) - - DUMMY := m rt pthread crypt util xnet resolv - DUMMY_LIBS := $(patsubst %,$(SYSROOT_LIB)/lib%.a,$(DUMMY))