From 32b375c6f304606218da15ea4eb33649985dc5dd Mon Sep 17 00:00:00 2001 From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org> Date: Tue, 6 Feb 2024 12:51:01 +0000 Subject: [PATCH] main/rust: upgrade to 1.74.1 align patches --- main/rust/APKBUILD | 22 ++-- main/rust/alpine-target.patch | 2 +- .../do-not-install-libunwind-source.patch | 2 +- main/rust/gcc-eh-libunwind.patch | 2 +- main/rust/install-template-shebang.patch | 2 +- main/rust/lfs64-rust.patch | 95 +++++++------- main/rust/need-ssp_nonshared.patch | 4 +- main/rust/no-export-ld-library-path.patch | 2 +- main/rust/revert-pr-114382.patch | 117 ------------------ 9 files changed, 66 insertions(+), 182 deletions(-) delete mode 100644 main/rust/revert-pr-114382.patch diff --git a/main/rust/APKBUILD b/main/rust/APKBUILD index 49ed577ff64..72b474c7312 100644 --- a/main/rust/APKBUILD +++ b/main/rust/APKBUILD @@ -5,10 +5,10 @@ # Contributor: Ariadne Conill # Maintainer: pkgname=rust -pkgver=1.73.0 +pkgver=1.74.1 _llvmver=17 _bootver=1.73.0 -pkgrel=1 +pkgrel=0 pkgdesc="Rust Programming Language toolchain" url="https://www.rust-lang.org/" arch="all" @@ -95,7 +95,6 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.xz need-rpath.patch need-ssp_nonshared.patch no-export-ld-library-path.patch - revert-pr-114382.patch system-wasm-ld.patch check-rustc " @@ -454,20 +453,19 @@ _mv() { } sha512sums=" -75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c rustc-1.73.0-src.tar.xz +14c7e7ed2f38ab60299d8c7d41d78f042b6b57ef822d577b5138e60bdde31cf141eccd4332a25bc5da3d58eb5313d63c1448b5dfe9e11b8055bb8ea133a9038d rustc-1.74.1-src.tar.xz 9de9d7ad05584e3cafddedcac409a4605a1d67e82260220deb3efd965603ee3148062b081c0cd736e50d82daad3a723fb6a7493fdf4dddfe36288645425a7946 alpine-move-py-scripts-to-share.patch -a97bc511a8fd5f71ea7095efa4cf97048badc4ba46d1bde1b7d5ede2879f099157b8b6f5a03278c9f5766d809ea5d6a1affadce7ceb47d0cc134fde8bc70d51d alpine-target.patch -7af23c34096f7a03c5a1b40aa07e00dd6193743c872881018a9baa900f240c6e44918e481ab5ed7787a70ef361e4aeec2a7719bcd695f52988262e23271b44e5 do-not-install-libunwind-source.patch -92916225c21742941aaf415d75d330fe2baf77a8226c076e862f4413068d5dee7b08c4b3182f69957ea9a51a0dcde145031565289015b6e3c31894fb396e4eb1 gcc-eh-libunwind.patch -c9d6008612c693536a4064545c02fe5261f10ee4021f856d058f6235cb80931eb8cec97f75d0f7075aa9333c8fbb4fd715d5d53be9e2e1e77db7365de8da717e install-template-shebang.patch +07d4a390f7f18c144559d27045d9f0848fdebe51519876a24254c1265ccb15779cc287149e5d31b7c2c4a77e43f0d3f8f25c569f50fbd7bff03b9c10cd42bf29 alpine-target.patch +fc57b45d3067cbd26b977a0f1d426fa3a09e318ee38d975c79b57aa10741024bd7b8ab041dccf2d6f787653cd368669bb9f4bb17bd64d95c208906f728d125ee do-not-install-libunwind-source.patch +c030838b3106e764e737a69ea19aa3a4dc2d1b0f7b77158c3b0ccb51ad1b2f94cb53663de3a9dc83865bb7d2ae7589f6d77bd8584d30e45e891dd8986c3b1b10 gcc-eh-libunwind.patch +b283d31cc8d6559aa639d44f776e97c2a1e0f23c717b6784e549861b881555bd467fa6023180866aae81a9a58c5f83e306940ee645f3c6733a1bdef6130036c9 install-template-shebang.patch 8d7236bfe583915be81c28b8b6296d69a7dda0246bd0d294298659825fbffcb4fa21c5ad01c351d358f269a620f3c59b9e7be77cd73a5214cc32ba15efa2fb0d lfs64-libc.patch.noauto -6a15ea16acaa15a57e8c0f6ae4ccf3e91c6f395249fb2186766642131ee5d37ecf04ade829e1712dce77684b77a54caa6b4356416dd1d3a6832187332531381f lfs64-rust.patch +871075cf272558f43b7100420e540bfe722780af85765f1f50ffd78b9ec4ff1df6044cbd7d992089b5ff844e441096c61b9e60e6aefbc40bc5c547b5a318ca2d lfs64-rust.patch aa81a1202a0ab45cb3e52c6caa9acf1fae592affaa925cff79601a65396a81f1e40715872c0d19a12edbf841282b6f263e986b566e3860d7e78ffa9bf49b8bc5 libc-s390x-olargefile.patch.noauto 47d070ccac8d2260b2aa46758aad263e8c7dc4ecc68fcee4619e89089f300c49a050524a241b5c3b32711823fcc062a793aca80e669d7d79395782d1823dba8a musl-fix-linux_musl_base.patch 2d401a01d2c2db92624d672018342907a41aa4a3842708c0a2ab694af0396d568aca4835d1075f244d77c0a4c45e67f893fd175fd97cd7f758090eba9972eba6 need-rpath.patch -bceb500942913d1a01a764dc7ee35437e83b9aec3f945c9186396264df240f465e5ac4d1f70e7252ca4ec346ffaf7c79747ba1a53ff4123cbd408cfa5effa214 need-ssp_nonshared.patch -cbdb38a2701e079d362e76ff16a2549230f80bcb4dfd3561d240df331fb21d202cb720e18b97fe9b166db1f79b46fab949ce5de5e37af2ed78a10c7fe1dfcfc9 no-export-ld-library-path.patch -7de0be96be55be934e3238d040d8dbab92339aaf0521cbbfa32dd75d2336084e88698d7026fe6df81a0ce38d8e86df903bb293fdfaa482dbd1ff47fdd4e8e578 revert-pr-114382.patch +ecae40990b22a8631ceeb1188f99fcefb388a0be675c7122052d6d831d926d3cc916120d5afa17f8eae60fd27f80b0f513d43cbd5b62ea720eafa55c9f3170a1 need-ssp_nonshared.patch +61899e60f9c874572b335ff83bd8c06e288eb85eae441399c604286f1d0f56981437c67c543f7573d94404ad35fc64a41cc9508be37079d7d6a997e4cd93eba6 no-export-ld-library-path.patch 4ea59b28fa238b8bb0cb24847e5884b65beec5168e55fe41a1ff50e272f1cf49186ffaa71d133cebfdcb70901ea18b477d7618a1dd330ff6c08bed5af0e2bb78 system-wasm-ld.patch c31fdfe8a9b3411576c75da46645cf0465b9053000a2ab49cf9b2f2733f679d6d33acbf236d67a20e14935d094a685453b7f1840180249f39d610fd0902c3125 check-rustc " diff --git a/main/rust/alpine-target.patch b/main/rust/alpine-target.patch index 237b7d98983..aa1ad88807b 100644 --- a/main/rust/alpine-target.patch +++ b/main/rust/alpine-target.patch @@ -77,7 +77,7 @@ and distribution-specific quirks instead of polluting the main musl target of +} --- rustc-1.48.0-src.orig/compiler/rustc_target/src/spec/mod.rs +++ rustc-1.48.0-src/compiler/rustc_target/src/spec/mod.rs -@@ -490,6 +490,16 @@ +@@ -1272,6 +1272,16 @@ } supported_targets! { diff --git a/main/rust/do-not-install-libunwind-source.patch b/main/rust/do-not-install-libunwind-source.patch index e8ff8b7e3ad..6e330d856e8 100644 --- a/main/rust/do-not-install-libunwind-source.patch +++ b/main/rust/do-not-install-libunwind-source.patch @@ -8,7 +8,7 @@ dependencies prior to building. diff -Naur rustc-1.48.0-src.orig/src/bootstrap/dist.rs rustc-1.48.0-src/src/bootstrap/dist.rs --- rustc-1.48.0-src.orig/src/bootstrap/dist.rs 2020-12-22 16:39:30.504249113 +0100 +++ rustc-1.48.0-src/src/bootstrap/dist.rs 2020-12-22 16:42:08.663006830 +0100 -@@ -1016,7 +1016,7 @@ +@@ -921,7 +921,7 @@ copy_src_dirs( builder, &builder.src, diff --git a/main/rust/gcc-eh-libunwind.patch b/main/rust/gcc-eh-libunwind.patch index 159d45717f5..6d8f9fd72f9 100644 --- a/main/rust/gcc-eh-libunwind.patch +++ b/main/rust/gcc-eh-libunwind.patch @@ -23,7 +23,7 @@ error: aborting due to previous error --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs -@@ -51,7 +51,10 @@ +@@ -49,7 +49,10 @@ #[link(name = "unwind", cfg(not(target_feature = "crt-static")))] extern "C" {} } else { diff --git a/main/rust/install-template-shebang.patch b/main/rust/install-template-shebang.patch index 89cc16eb81d..db77ee9e5cf 100644 --- a/main/rust/install-template-shebang.patch +++ b/main/rust/install-template-shebang.patch @@ -4,7 +4,7 @@ The script seems to be POSIX-sh (+ local) compatible. +++ b/src/tools/rust-installer/install-template.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash -+#!/usr/bin/env sh ++#!/bin/sh # No undefined variables set -u diff --git a/main/rust/lfs64-rust.patch b/main/rust/lfs64-rust.patch index 669a5b8e7e0..a4cc2fd5fda 100644 --- a/main/rust/lfs64-rust.patch +++ b/main/rust/lfs64-rust.patch @@ -44,33 +44,33 @@ diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs index cb630eede6da0..c1e0c05213ac2 100644 --- a/library/std/src/sys/unix/fd.rs +++ b/library/std/src/sys/unix/fd.rs -@@ -122,9 +122,12 @@ impl FileDesc { +@@ -126,9 +126,12 @@ impl FileDesc { } pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result { -- #[cfg(not(any(target_os = "linux", target_os = "android")))] +- #[cfg(not(any(target_os = "linux", target_os = "android", target_os = "hurd")))] + #[cfg(not(any( + all(target_os = "linux", not(target_env = "musl")), -+ target_os = "android" ++ target_os = "android", target_os = "hurd" + )))] use libc::pread as pread64; -- #[cfg(any(target_os = "linux", target_os = "android"))] -+ #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +- #[cfg(any(target_os = "linux", target_os = "android", target_os = "hurd"))] ++ #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android", target_os = "hurd"))] use libc::pread64; unsafe { -@@ -277,9 +280,12 @@ impl FileDesc { +@@ -285,9 +288,12 @@ impl FileDesc { } pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result { -- #[cfg(not(any(target_os = "linux", target_os = "android")))] +- #[cfg(not(any(target_os = "linux", target_os = "android", target_os = "hurd")))] + #[cfg(not(any( + all(target_os = "linux", not(target_env = "musl")), -+ target_os = "android" ++ target_os = "android", target_os = "hurd" + )))] use libc::pwrite as pwrite64; -- #[cfg(any(target_os = "linux", target_os = "android"))] -+ #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +- #[cfg(any(target_os = "linux", target_os = "android", target_os = "hurd"))] ++ #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android", target_os = "hurd"))] use libc::pwrite64; unsafe { @@ -78,35 +78,38 @@ diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index fbc7f04ce9a..3d9ee5849dd 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs -@@ -50,11 +50,16 @@ - all(target_os = "linux", target_env = "gnu") +@@ -40,15 +40,16 @@ ))] use libc::c_char; --#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "android"))] -+#[cfg(any( + #[cfg(any( +- target_os = "linux", + all(target_os = "linux", not(target_env = "musl")), -+ target_os = "emscripten", -+ target_os = "android" -+))] + target_os = "emscripten", + target_os = "android", + target_os = "hurd", + ))] use libc::dirfd; --#[cfg(any(target_os = "linux", target_os = "emscripten"))] -+#[cfg(any(not(target_env = "musl"), target_os = "emscripten"))] +-#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "hurd"))] ++#[cfg(any(not(target_env = "musl"), target_os = "emscripten", target_os = "hurd"))] use libc::fstatat64; #[cfg(any( + target_env = "musl", target_os = "android", target_os = "solaris", target_os = "fuchsia", -@@ -64,7 +69,7 @@ +@@ -58,7 +59,10 @@ target_os = "vita", ))] use libc::readdir as readdir64; --#[cfg(target_os = "linux")] -+#[cfg(all(target_os = "linux", not(target_env = "musl")))] +-#[cfg(any(target_os = "linux", target_os = "hurd"))] ++#[cfg(any( ++ all(target_os = "linux", not(target_env = "musl")), ++ target_os = "hurd" ++))] use libc::readdir64; #[cfg(any(target_os = "emscripten", target_os = "l4re"))] use libc::readdir64_r; -@@ -81,7 +86,13 @@ use libc::{ +@@ -81,7 +85,13 @@ dirent as dirent64, fstat as fstat64, fstatat as fstatat64, ftruncate64, lseek64, lstat as lstat64, off64_t, open as open64, stat as stat64, }; @@ -120,16 +123,16 @@ index fbc7f04ce9a..3d9ee5849dd 100644 target_os = "linux", target_os = "emscripten", target_os = "l4re", -@@ -91,7 +102,7 @@ use libc::{ - dirent as dirent64, fstat as fstat64, ftruncate as ftruncate64, lseek as lseek64, +@@ -93,7 +103,7 @@ lstat as lstat64, off_t as off64_t, open as open64, stat as stat64, }; --#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "l4re"))] -+#[cfg(any(not(target_env = "musl"), target_os = "emscripten", target_os = "l4re"))] - use libc::{dirent64, fstat64, ftruncate64, lseek64, lstat64, off64_t, open64, stat64}; - - pub use crate::sys_common::fs::try_exists; -@@ -278,6 +289,7 @@ unsafe impl Sync for Dir {} + #[cfg(any( +- target_os = "linux", ++ not(target_env = "musl"), + target_os = "emscripten", + target_os = "l4re", + target_os = "hurd" +@@ -284,6 +294,7 @@ #[cfg(any( target_os = "android", target_os = "linux", @@ -137,7 +140,7 @@ index fbc7f04ce9a..3d9ee5849dd 100644 target_os = "solaris", target_os = "illumos", target_os = "fuchsia", -@@ -312,6 +324,7 @@ struct dirent64_min { +@@ -327,6 +338,7 @@ } #[cfg(not(any( @@ -145,21 +148,21 @@ index fbc7f04ce9a..3d9ee5849dd 100644 target_os = "android", target_os = "linux", target_os = "solaris", -@@ -798,7 +811,7 @@ impl DirEntry { - } +@@ -829,7 +841,7 @@ #[cfg(all( -- any(target_os = "linux", target_os = "emscripten", target_os = "android"), -+ any(not(target_env = "musl"), target_os = "emscripten", target_os = "android"), - not(miri) - ))] - pub fn metadata(&self) -> io::Result { -@@ -822,7 +835,7 @@ impl DirEntry { - } + any( +- target_os = "linux", ++ not(target_env = "musl"), + target_os = "emscripten", + target_os = "android", + target_os = "hurd", +@@ -858,7 +870,7 @@ #[cfg(any( -- not(any(target_os = "linux", target_os = "emscripten", target_os = "android")), -+ not(any(not(target_env = "musl"), target_os = "emscripten", target_os = "android")), - miri - ))] - pub fn metadata(&self) -> io::Result { + not(any( +- target_os = "linux", ++ not(target_env = "musl"), + target_os = "emscripten", + target_os = "android", + target_os = "hurd", diff --git a/main/rust/need-ssp_nonshared.patch b/main/rust/need-ssp_nonshared.patch index ab6b2f7d49b..27fa4c9f096 100644 --- a/main/rust/need-ssp_nonshared.patch +++ b/main/rust/need-ssp_nonshared.patch @@ -6,7 +6,7 @@ diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 68c9520..63f8a48 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs -@@ -357,6 +357,9 @@ cfg_if::cfg_if! { +@@ -381,6 +381,9 @@ cfg_if::cfg_if! { #[link(name = "dl", cfg(not(target_feature = "crt-static")))] #[link(name = "log", cfg(not(target_feature = "crt-static")))] extern "C" {} @@ -18,7 +18,7 @@ index 68c9520..63f8a48 100644 #[link(name = "pthread")] --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs -@@ -108,6 +108,8 @@ +@@ -110,6 +110,8 @@ return; } diff --git a/main/rust/no-export-ld-library-path.patch b/main/rust/no-export-ld-library-path.patch index cd8c87c269b..1c6bf64015c 100644 --- a/main/rust/no-export-ld-library-path.patch +++ b/main/rust/no-export-ld-library-path.patch @@ -12,7 +12,7 @@ diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 7c36bb264..b4f9b7066 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -987,12 +987,6 @@ class RustBuild(object): +@@ -909,12 +909,6 @@ class RustBuild(object): del env["CARGO_BUILD_TARGET"] env["CARGO_TARGET_DIR"] = build_dir env["RUSTC"] = self.rustc() diff --git a/main/rust/revert-pr-114382.patch b/main/rust/revert-pr-114382.patch deleted file mode 100644 index 69f58c75aec..00000000000 --- a/main/rust/revert-pr-114382.patch +++ /dev/null @@ -1,117 +0,0 @@ -This reverts some of https://github.com/rust-lang/rust/pull/114382 -which was previously completely reverted to allow Rust 1.73.0 to build -successfully on 32-bit ARM, we need to do this to move forward - - ---- a/library/core/src/intrinsics.rs -+++ b/library/core/src/intrinsics.rs -@@ -2385,25 +2385,6 @@ - #[rustc_nounwind] - pub fn raw_eq(a: &T, b: &T) -> bool; - -- /// Lexicographically compare `[left, left + bytes)` and `[right, right + bytes)` -- /// as unsigned bytes, returning negative if `left` is less, zero if all the -- /// bytes match, or positive if `right` is greater. -- /// -- /// This underlies things like `<[u8]>::cmp`, and will usually lower to `memcmp`. -- /// -- /// # Safety -- /// -- /// `left` and `right` must each be [valid] for reads of `bytes` bytes. -- /// -- /// Note that this applies to the whole range, not just until the first byte -- /// that differs. That allows optimizations that can read in large chunks. -- /// -- /// [valid]: crate::ptr#safety -- #[cfg(not(bootstrap))] -- #[rustc_const_unstable(feature = "const_intrinsic_compare_bytes", issue = "none")] -- #[rustc_nounwind] -- pub fn compare_bytes(left: *const u8, right: *const u8, bytes: usize) -> i32; -- - /// See documentation of [`std::hint::black_box`] for details. - /// - /// [`std::hint::black_box`]: crate::hint::black_box -@@ -2842,20 +2823,5 @@ - [T](dst: *mut T) => is_aligned_and_not_null(dst) - ); - write_bytes(dst, val, count) -- } --} -- --/// Backfill for bootstrap --#[cfg(bootstrap)] --pub unsafe fn compare_bytes(left: *const u8, right: *const u8, bytes: usize) -> i32 { -- extern "C" { -- fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> crate::ffi::c_int; -- } -- -- if bytes != 0 { -- // SAFETY: Since bytes is non-zero, the caller has met `memcmp`'s requirements. -- unsafe { memcmp(left, right, bytes).into() } -- } else { -- 0 - } - } ---- a/library/core/src/slice/cmp.rs -+++ b/library/core/src/slice/cmp.rs -@@ -1,12 +1,22 @@ - //! Comparison traits for `[T]`. - - use crate::cmp::{self, BytewiseEq, Ordering}; --use crate::intrinsics::compare_bytes; -+use crate::ffi; - use crate::mem; - - use super::from_raw_parts; - use super::memchr; - -+extern "C" { -+ /// Calls implementation provided memcmp. -+ /// -+ /// Interprets the data as u8. -+ /// -+ /// Returns 0 for equal, < 0 for less than and > 0 for greater -+ /// than. -+ fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> ffi::c_int; -+} -+ - #[stable(feature = "rust1", since = "1.0.0")] - impl PartialEq<[B]> for [A] - where -@@ -64,8 +74,7 @@ - } - } - --// When each element can be compared byte-wise, we can compare all the bytes --// from the whole size in one call to the intrinsics. -+// Use memcmp for bytewise equality when the types allow - impl SlicePartialEq for [A] - where - A: BytewiseEq, -@@ -79,7 +88,7 @@ - // The two slices have been checked to have the same size above. - unsafe { - let size = mem::size_of_val(self); -- compare_bytes(self.as_ptr() as *const u8, other.as_ptr() as *const u8, size) == 0 -+ memcmp(self.as_ptr() as *const u8, other.as_ptr() as *const u8, size) == 0 - } - } - } -@@ -174,7 +183,7 @@ - } - } - --// `compare_bytes` compares a sequence of unsigned bytes lexicographically. -+// memcmp compares a sequence of unsigned bytes lexicographically. - // this matches the order we want for [u8], but no others (not even [i8]). - impl SliceOrd for u8 { - #[inline] -@@ -186,7 +195,7 @@ - // SAFETY: `left` and `right` are references and are thus guaranteed to be valid. - // We use the minimum of both lengths which guarantees that both regions are - // valid for reads in that interval. -- let mut order = unsafe { compare_bytes(left.as_ptr(), right.as_ptr(), len) as isize }; -+ let mut order = unsafe { memcmp(left.as_ptr(), right.as_ptr(), len) as isize }; - if order == 0 { - order = diff; - }