From 8fd396bc3dc18101bc0e9cc34b7ed25d24b6cfea Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Fri, 29 Dec 2023 11:44:34 +0000 Subject: rust: Upgrade 1.73.0 -> 1.74.0 Replace musl fixes with backports from upstream. Add sysconfdir to config.toml to fix: | thread 'main' panicked at install.rs:92:9: | User doesn't have write access on `install.sysconfdir` path in `config.toml`. https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html (From OE-Core rev: 84f46dd2503bb0ef238fef0097c66fda88f6cbda) Signed-off-by: Alex Kiernan Signed-off-by: Richard Purdie --- .../0001-Do-not-use-LFS64-on-linux-with-musl.patch | 169 --------------------- 1 file changed, 169 deletions(-) delete mode 100644 meta/recipes-devtools/rust/files/0001-Do-not-use-LFS64-on-linux-with-musl.patch (limited to 'meta/recipes-devtools/rust/files/0001-Do-not-use-LFS64-on-linux-with-musl.patch') diff --git a/meta/recipes-devtools/rust/files/0001-Do-not-use-LFS64-on-linux-with-musl.patch b/meta/recipes-devtools/rust/files/0001-Do-not-use-LFS64-on-linux-with-musl.patch deleted file mode 100644 index 794ad804f0..0000000000 --- a/meta/recipes-devtools/rust/files/0001-Do-not-use-LFS64-on-linux-with-musl.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 3ecce665198e3420d70139d86ed22e74804c9379 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 28 Dec 2022 22:35:55 -0800 -Subject: [PATCH] Do not use LFS64 on linux with musl - -glibc is providing open64 and other lfs64 functions but musl aliases -them to normal equivalents since off_t is always 64-bit on musl, -therefore check for target env along when target OS is linux before -using open64, this is more available. Latest Musl has made these -namespace changes [1] - -[1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4 - -Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/106246] -Signed-off-by: Khem Raj ---- - library/std/src/os/linux/fs.rs | 9 ++++++++- - library/std/src/sys/unix/fd.rs | 14 ++++++++++---- - library/std/src/sys/unix/fs.rs | 27 ++++++++++++++++++++------- - 3 files changed, 38 insertions(+), 12 deletions(-) - -Index: rustc-1.73.0-src/library/std/src/os/linux/fs.rs -=================================================================== ---- rustc-1.73.0-src.orig/library/std/src/os/linux/fs.rs -+++ rustc-1.73.0-src/library/std/src/os/linux/fs.rs -@@ -329,7 +329,14 @@ pub trait MetadataExt { - impl MetadataExt for Metadata { - #[allow(deprecated)] - fn as_raw_stat(&self) -> &raw::stat { -- unsafe { &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) } -+ #[cfg(target_env = "musl")] -+ unsafe { -+ &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) -+ } -+ #[cfg(not(target_env = "musl"))] -+ unsafe { -+ &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) -+ } - } - fn st_dev(&self) -> u64 { - self.as_inner().as_inner().st_dev as u64 -Index: rustc-1.73.0-src/library/std/src/sys/unix/fd.rs -=================================================================== ---- rustc-1.73.0-src.orig/library/std/src/sys/unix/fd.rs -+++ rustc-1.73.0-src/library/std/src/sys/unix/fd.rs -@@ -124,9 +124,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( -+ all(target_os = "linux", not(target_env = "musl")), -+ target_os = "android" -+ )))] - 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"))] - use libc::pread64; - - unsafe { -@@ -281,9 +284,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( -+ all(target_os = "linux", not(target_env = "musl")), -+ target_os = "android" -+ )))] - 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"))] - use libc::pwrite64; - - unsafe { -Index: rustc-1.73.0-src/library/std/src/sys/unix/fs.rs -=================================================================== ---- rustc-1.73.0-src.orig/library/std/src/sys/unix/fs.rs -+++ rustc-1.73.0-src/library/std/src/sys/unix/fs.rs -@@ -39,9 +39,13 @@ use libc::{c_int, mode_t}; - all(target_os = "linux", target_env = "gnu") - ))] - use libc::c_char; --#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "android"))] -+#[cfg(any( -+ all(target_os = "linux", not(target_env = "musl")), -+ target_os = "emscripten", -+ target_os = "android" -+))] - use libc::dirfd; --#[cfg(any(target_os = "linux", target_os = "emscripten"))] -+#[cfg(any(not(target_env = "musl"), target_os = "emscripten"))] - use libc::fstatat64; - #[cfg(any( - target_os = "android", -@@ -53,7 +57,7 @@ use libc::fstatat64; - target_os = "vita", - ))] - use libc::readdir as readdir64; --#[cfg(target_os = "linux")] -+#[cfg(all(target_os = "linux", not(target_env = "musl")))] - use libc::readdir64; - #[cfg(any(target_os = "emscripten", target_os = "l4re"))] - use libc::readdir64_r; -@@ -68,6 +72,7 @@ use libc::readdir64_r; - target_os = "redox", - target_os = "nto", - target_os = "vita", -+ target_env = "musl", - )))] - use libc::readdir_r as readdir64_r; - #[cfg(target_os = "android")] -@@ -75,7 +80,13 @@ use libc::{ - dirent as dirent64, fstat as fstat64, fstatat as fstatat64, ftruncate64, lseek64, - lstat as lstat64, off64_t, open as open64, stat as stat64, - }; -+#[cfg(target_env = "musl")] -+use libc::{ -+ dirent as dirent64, fstat as fstat64, ftruncate as ftruncate64, lseek as lseek64, -+ lstat as lstat64, off_t as off64_t, open as open64, stat as stat64, -+}; - #[cfg(not(any( -+ target_env = "musl", - target_os = "linux", - target_os = "emscripten", - target_os = "l4re", -@@ -85,7 +96,7 @@ use libc::{ - dirent as dirent64, fstat as fstat64, ftruncate as ftruncate64, lseek as lseek64, - 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; -@@ -272,6 +283,7 @@ unsafe impl Sync for Dir {} - #[cfg(any( - target_os = "android", - target_os = "linux", -+ not(target_env = "musl"), - target_os = "solaris", - target_os = "illumos", - target_os = "fuchsia", -@@ -313,6 +325,7 @@ struct dirent64_min { - } - - #[cfg(not(any( -+ target_env = "musl", - target_os = "android", - target_os = "linux", - target_os = "solaris", -@@ -809,7 +822,7 @@ impl DirEntry { - } - - #[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 { -@@ -833,7 +846,7 @@ impl DirEntry { - } - - #[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 { -- cgit v1.2.3-54-g00ecf