From 7300bd5c2306cbb0e8a8893a9f5ccf7617e70b45 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Fri, 14 Jun 2024 11:09:59 +0300 Subject: [PATCH 1/4] [rust] Remove unneeded patches due to updated GCC and SB2 statx support --- ...sable-statx-for-all-builds.-JB-50106.patch | 80 ------ ...able-aarch64-outline-atomics-for-now.patch | 31 --- ...x-s-64-bit-times-on-32-bit-linux-gnu.patch | 256 ------------------ rust.spec | 3 - 4 files changed, 370 deletions(-) delete mode 100644 0002-Disable-statx-for-all-builds.-JB-50106.patch delete mode 100644 0007-Disable-aarch64-outline-atomics-for-now.patch delete mode 100644 0008-Revert-Use-statx-s-64-bit-times-on-32-bit-linux-gnu.patch diff --git a/0002-Disable-statx-for-all-builds.-JB-50106.patch b/0002-Disable-statx-for-all-builds.-JB-50106.patch deleted file mode 100644 index cb2de22..0000000 --- a/0002-Disable-statx-for-all-builds.-JB-50106.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Niels Breet -Date: Tue, 11 May 2021 13:03:55 +0300 -Subject: [PATCH] Disable statx for all builds. JB#50106 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -libstd implements statx using syscall and thus it will not work on -scratchbox2. Moreover as it is supported only by Linux 4.11 and newer -it's little use for us at the moment. It can be disabled and which means -that optional extra information is set to None. Software should handle -that gracefully without issues thanks to rust's type system. - -Signed-off-by: Tomi Leppänen -Signed-off-by: Ruben De Smet ---- - library/std/src/sys/unix/fs.rs | 32 ++------------------------------ - 1 file changed, 2 insertions(+), 30 deletions(-) - -diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs -index 40eb910fdc3..8798aa7061c 100644 ---- a/library/std/src/sys/unix/fs.rs -+++ b/library/std/src/sys/unix/fs.rs -@@ -17,28 +17,11 @@ - use crate::sys::{cvt, cvt_r}; - use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner}; - --#[cfg(any( -- all(target_os = "linux", target_env = "gnu"), -- target_os = "macos", -- target_os = "ios", -- target_os = "tvos", -- target_os = "watchos", --))] --use crate::sys::weak::syscall; - #[cfg(any(target_os = "android", target_os = "macos", target_os = "solaris"))] - use crate::sys::weak::weak; - - use libc::{c_int, mode_t}; - --#[cfg(any( -- target_os = "macos", -- target_os = "ios", -- target_os = "tvos", -- target_os = "watchos", -- target_os = "solaris", -- all(target_os = "linux", target_env = "gnu") --))] --use libc::c_char; - #[cfg(any( - all(target_os = "linux", not(target_env = "musl")), - target_os = "emscripten", -@@ -117,20 +100,9 @@ - // https://github.com/rust-lang/rust/pull/67774 - macro_rules! cfg_has_statx { - ({ $($then_tt:tt)* } else { $($else_tt:tt)* }) => { -- cfg_if::cfg_if! { -- if #[cfg(all(target_os = "linux", target_env = "gnu"))] { -- $($then_tt)* -- } else { -- $($else_tt)* -- } -- } -- }; -- ($($block_inner:tt)*) => { -- #[cfg(all(target_os = "linux", target_env = "gnu"))] -- { -- $($block_inner)* -- } -+ $($else_tt)* - }; -+ ($($block_inner:tt)*) => {}; - } - - cfg_has_statx! {{ --- -2.43.0 - diff --git a/0007-Disable-aarch64-outline-atomics-for-now.patch b/0007-Disable-aarch64-outline-atomics-for-now.patch deleted file mode 100644 index bf5d1b0..0000000 --- a/0007-Disable-aarch64-outline-atomics-for-now.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Matti=20Lehtim=C3=A4ki?= -Date: Wed, 18 Jan 2023 20:13:21 +0200 -Subject: [PATCH] Disable aarch64 outline atomics for now. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The feature causes linking problems. - -Signed-off-by: Matti Lehtimäki ---- - .../rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs -index c0b07db3818..b8f240295be 100644 ---- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs -+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs -@@ -7,7 +7,7 @@ pub fn target() -> Target { - data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(), - arch: "aarch64".into(), - options: TargetOptions { -- features: "+v8a,+outline-atomics".into(), -+ features: "+v8a".into(), - mcount: "\u{1}_mcount".into(), - max_atomic_width: Some(128), - supported_sanitizers: SanitizerSet::ADDRESS --- -2.43.0 - diff --git a/0008-Revert-Use-statx-s-64-bit-times-on-32-bit-linux-gnu.patch b/0008-Revert-Use-statx-s-64-bit-times-on-32-bit-linux-gnu.patch deleted file mode 100644 index 2b143b2..0000000 --- a/0008-Revert-Use-statx-s-64-bit-times-on-32-bit-linux-gnu.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ruben De Smet -Date: Mon, 23 Oct 2023 20:39:13 +0200 -Subject: [PATCH] Revert "Use statx's 64-bit times on 32-bit linux-gnu" - -Additionally adds a `dead_code` lint supression on SystemTime::new. - -This reverts commit fec4818fdb40c82679f57fa7f26fcddc1a874c13. ---- - library/std/src/os/linux/fs.rs | 21 +----- - library/std/src/sys/unix/fs.rs | 109 +++++++++++-------------------- - library/std/src/sys/unix/time.rs | 1 + - 3 files changed, 42 insertions(+), 89 deletions(-) - -diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs -index ab0b2a3eda3..4ac9ae4fd04 100644 ---- a/library/std/src/os/linux/fs.rs -+++ b/library/std/src/os/linux/fs.rs -@@ -363,34 +363,19 @@ fn st_size(&self) -> u64 { - self.as_inner().as_inner().st_size as u64 - } - fn st_atime(&self) -> i64 { -- let file_attr = self.as_inner(); -- #[cfg(all(target_env = "gnu", target_pointer_width = "32"))] -- if let Some(atime) = file_attr.stx_atime() { -- return atime.tv_sec; -- } -- file_attr.as_inner().st_atime as i64 -+ self.as_inner().as_inner().st_atime as i64 - } - fn st_atime_nsec(&self) -> i64 { - self.as_inner().as_inner().st_atime_nsec as i64 - } - fn st_mtime(&self) -> i64 { -- let file_attr = self.as_inner(); -- #[cfg(all(target_env = "gnu", target_pointer_width = "32"))] -- if let Some(mtime) = file_attr.stx_mtime() { -- return mtime.tv_sec; -- } -- file_attr.as_inner().st_mtime as i64 -+ self.as_inner().as_inner().st_mtime as i64 - } - fn st_mtime_nsec(&self) -> i64 { - self.as_inner().as_inner().st_mtime_nsec as i64 - } - fn st_ctime(&self) -> i64 { -- let file_attr = self.as_inner(); -- #[cfg(all(target_env = "gnu", target_pointer_width = "32"))] -- if let Some(ctime) = file_attr.stx_ctime() { -- return ctime.tv_sec; -- } -- file_attr.as_inner().st_ctime as i64 -+ self.as_inner().as_inner().st_ctime as i64 - } - fn st_ctime_nsec(&self) -> i64 { - self.as_inner().as_inner().st_ctime_nsec as i64 -diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs -index 8798aa7061c..1d92664b2e1 100644 ---- a/library/std/src/sys/unix/fs.rs -+++ b/library/std/src/sys/unix/fs.rs -@@ -117,19 +117,10 @@ struct StatxExtraFields { - // This is needed to check if btime is supported by the filesystem. - stx_mask: u32, - stx_btime: libc::statx_timestamp, -- // With statx, we can overcome 32-bit `time_t` too. -- #[cfg(target_pointer_width = "32")] -- stx_atime: libc::statx_timestamp, -- #[cfg(target_pointer_width = "32")] -- stx_ctime: libc::statx_timestamp, -- #[cfg(target_pointer_width = "32")] -- stx_mtime: libc::statx_timestamp, -- - } - -- // We prefer `statx` on Linux if available, which contains file creation time, -- // as well as 64-bit timestamps of all kinds. -- // Default `stat64` contains no creation time and may have 32-bit `time_t`. -+ // We prefer `statx` on Linux if available, which contains file creation time. -+ // Default `stat64` contains no creation time. - unsafe fn try_statx( - fd: c_int, - path: *const c_char, -@@ -219,13 +210,6 @@ fn statx( - let extra = StatxExtraFields { - stx_mask: buf.stx_mask, - stx_btime: buf.stx_btime, -- // Store full times to avoid 32-bit `time_t` truncation. -- #[cfg(target_pointer_width = "32")] -- stx_atime: buf.stx_atime, -- #[cfg(target_pointer_width = "32")] -- stx_ctime: buf.stx_ctime, -- #[cfg(target_pointer_width = "32")] -- stx_mtime: buf.stx_mtime, - }; - - Some(Ok(FileAttr { stat, statx_extra_fields: Some(extra) })) -@@ -380,36 +364,6 @@ impl FileAttr { - fn from_stat64(stat: stat64) -> Self { - Self { stat, statx_extra_fields: None } - } -- -- #[cfg(target_pointer_width = "32")] -- pub fn stx_mtime(&self) -> Option<&libc::statx_timestamp> { -- if let Some(ext) = &self.statx_extra_fields { -- if (ext.stx_mask & libc::STATX_MTIME) != 0 { -- return Some(&ext.stx_mtime); -- } -- } -- None -- } -- -- #[cfg(target_pointer_width = "32")] -- pub fn stx_atime(&self) -> Option<&libc::statx_timestamp> { -- if let Some(ext) = &self.statx_extra_fields { -- if (ext.stx_mask & libc::STATX_ATIME) != 0 { -- return Some(&ext.stx_atime); -- } -- } -- None -- } -- -- #[cfg(target_pointer_width = "32")] -- pub fn stx_ctime(&self) -> Option<&libc::statx_timestamp> { -- if let Some(ext) = &self.statx_extra_fields { -- if (ext.stx_mask & libc::STATX_CTIME) != 0 { -- return Some(&ext.stx_ctime); -- } -- } -- None -- } - } - } else { - impl FileAttr { -@@ -435,15 +389,24 @@ pub fn file_type(&self) -> FileType { - #[cfg(target_os = "netbsd")] - impl FileAttr { - pub fn modified(&self) -> io::Result { -- Ok(SystemTime::new(self.stat.st_mtime as i64, self.stat.st_mtimensec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_mtime as libc::time_t, -+ tv_nsec: self.stat.st_mtimensec as libc::c_long, -+ })) - } - - pub fn accessed(&self) -> io::Result { -- Ok(SystemTime::new(self.stat.st_atime as i64, self.stat.st_atimensec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_atime as libc::time_t, -+ tv_nsec: self.stat.st_atimensec as libc::c_long, -+ })) - } - - pub fn created(&self) -> io::Result { -- Ok(SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtimensec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_birthtime as libc::time_t, -+ tv_nsec: self.stat.st_birthtimensec as libc::c_long, -+ })) - } - } - -@@ -472,19 +435,18 @@ impl FileAttr { - target_os = "hurd", - )))] - pub fn modified(&self) -> io::Result { -- #[cfg(target_pointer_width = "32")] -- cfg_has_statx! { -- if let Some(mtime) = self.stx_mtime() { -- return Ok(SystemTime::new(mtime.tv_sec, mtime.tv_nsec as i64)); -- } -- } -- -- Ok(SystemTime::new(self.stat.st_mtime as i64, self.stat.st_mtime_nsec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_mtime as libc::time_t, -+ tv_nsec: self.stat.st_mtime_nsec as _, -+ })) - } - - #[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "vita"))] - pub fn modified(&self) -> io::Result { -- Ok(SystemTime::new(self.stat.st_mtime as i64, 0)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_mtime as libc::time_t, -+ tv_nsec: 0, -+ })) - } - - #[cfg(any(target_os = "horizon", target_os = "hurd"))] -@@ -500,19 +462,18 @@ pub fn modified(&self) -> io::Result { - target_os = "hurd", - )))] - pub fn accessed(&self) -> io::Result { -- #[cfg(target_pointer_width = "32")] -- cfg_has_statx! { -- if let Some(atime) = self.stx_atime() { -- return Ok(SystemTime::new(atime.tv_sec, atime.tv_nsec as i64)); -- } -- } -- -- Ok(SystemTime::new(self.stat.st_atime as i64, self.stat.st_atime_nsec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_atime as libc::time_t, -+ tv_nsec: self.stat.st_atime_nsec as _, -+ })) - } - - #[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "vita"))] - pub fn accessed(&self) -> io::Result { -- Ok(SystemTime::new(self.stat.st_atime as i64, 0)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_atime as libc::time_t, -+ tv_nsec: 0, -+ })) - } - - #[cfg(any(target_os = "horizon", target_os = "hurd"))] -@@ -529,7 +490,10 @@ pub fn accessed(&self) -> io::Result { - target_os = "watchos", - ))] - pub fn created(&self) -> io::Result { -- Ok(SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtime_nsec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: self.stat.st_birthtime as libc::time_t, -+ tv_nsec: self.stat.st_birthtime_nsec as libc::c_long, -+ })) - } - - #[cfg(not(any( -@@ -545,7 +509,10 @@ pub fn created(&self) -> io::Result { - cfg_has_statx! { - if let Some(ext) = &self.statx_extra_fields { - return if (ext.stx_mask & libc::STATX_BTIME) != 0 { -- Ok(SystemTime::new(ext.stx_btime.tv_sec, ext.stx_btime.tv_nsec as i64)) -+ Ok(SystemTime::from(libc::timespec { -+ tv_sec: ext.stx_btime.tv_sec as libc::time_t, -+ tv_nsec: ext.stx_btime.tv_nsec as _, -+ })) - } else { - Err(io::const_io_error!( - io::ErrorKind::Uncategorized, -diff --git a/library/std/src/sys/unix/time.rs b/library/std/src/sys/unix/time.rs -index f2e86a4fb2b..fee9e07ec01 100644 ---- a/library/std/src/sys/unix/time.rs -+++ b/library/std/src/sys/unix/time.rs -@@ -34,6 +34,7 @@ pub(in crate::sys::unix) struct Timespec { - - impl SystemTime { - #[cfg_attr(any(target_os = "horizon", target_os = "hurd"), allow(unused))] -+ #[cfg_attr(target_env = "gnu", allow(dead_code))] - pub fn new(tv_sec: i64, tv_nsec: i64) -> SystemTime { - SystemTime { t: Timespec::new(tv_sec, tv_nsec) } - } --- -2.43.0 - diff --git a/rust.spec b/rust.spec index c055ad0..143bfb0 100644 --- a/rust.spec +++ b/rust.spec @@ -70,13 +70,10 @@ Source100: rust-%{rust_version}-i686-unknown-linux-gnu.tar.gz Source200: README.md Patch1: 0001-Set-proper-llvm-targets.patch -Patch2: 0002-Disable-statx-for-all-builds.-JB-50106.patch Patch3: 0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch Patch4: 0004-Force-the-target-when-building-for-CompileKind-Host.patch Patch5: 0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch Patch6: 0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch -Patch7: 0007-Disable-aarch64-outline-atomics-for-now.patch -Patch8: 0008-Revert-Use-statx-s-64-bit-times-on-32-bit-linux-gnu.patch Patch9: 0009-Relocate-unset-tmp.patch # This is the real rustc spec - the stub one appears near the end. %ifarch %ix86 From 52d654a9325ff772dd64b1502cbe1f0f4c7ecb1d Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sat, 22 Jun 2024 11:52:10 +0300 Subject: [PATCH 2/4] [rust] Rust 1.79.0 --- 0001-Set-proper-llvm-targets.patch | 11 ++- ...s-to-be-able-to-tell-rustc-the-defau.patch | 11 ++- ...t-when-building-for-CompileKind-Host.patch | 17 ++-- ...rols-to-bypass-some-sb2-calls-betwee.patch | 99 ++++++++++--------- ...s-to-be-able-to-tell-cargo-the-defau.patch | 21 ++-- 0009-Relocate-unset-tmp.patch | 32 ++++-- rust-1.75.0-i686-unknown-linux-gnu.tar.gz | 3 - rust-1.79.0-i686-unknown-linux-gnu.tar.xz | 3 + rust.spec | 34 ++++--- rustc-1.75.0-src.tar.gz | 3 - rustc-1.79.0-src.tar.xz | 3 + 11 files changed, 137 insertions(+), 100 deletions(-) delete mode 100644 rust-1.75.0-i686-unknown-linux-gnu.tar.gz create mode 100644 rust-1.79.0-i686-unknown-linux-gnu.tar.xz delete mode 100644 rustc-1.75.0-src.tar.gz create mode 100644 rustc-1.79.0-src.tar.xz diff --git a/0001-Set-proper-llvm-targets.patch b/0001-Set-proper-llvm-targets.patch index 15eb2e4..4d2e1e2 100644 --- a/0001-Set-proper-llvm-targets.patch +++ b/0001-Set-proper-llvm-targets.patch @@ -5,23 +5,24 @@ Subject: [PATCH] Set proper llvm targets. Signed-off-by: Matti Kosola Signed-off-by: Ruben De Smet +Signed-off-by: Matti Viljanen --- config.example.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example.toml b/config.example.toml -index e5df28a49af..48a9fafea6f 100644 +index 5c1fac767..9a090fd33 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -99,7 +99,7 @@ change-id = 116881 +@@ -96,7 +96,7 @@ # the resulting rustc being unable to compile for the disabled architectures. # # To add support for new targets, see https://rustc-dev-guide.rust-lang.org/building/new-target.html. -#targets = "AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86" +targets = "X86;ARM;AArch64" - + # LLVM experimental targets to build support for. These targets are specified in # the same format as above, but since these targets are experimental, they are --- -2.43.0 +-- +2.45.2 diff --git a/0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch b/0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch index 54ba44a..12fe477 100644 --- a/0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch +++ b/0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch @@ -10,15 +10,16 @@ allows the same rustc binary to be used for all builds. Signed-off-by: David Greaves Signed-off-by: Ruben De Smet +Signed-off-by: Matti Viljanen --- compiler/rustc_session/src/config.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs -index f745bc390ca..934f16ab4ab 100644 +index 4f259960a..16defdafb 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs -@@ -2241,7 +2241,14 @@ pub fn parse_target_triple( +@@ -1922,7 +1922,14 @@ pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches }) } Some(target) => TargetTriple::TargetTriple(target), @@ -33,7 +34,7 @@ index f745bc390ca..934f16ab4ab 100644 + } } } - --- -2.43.0 + +-- +2.45.2 diff --git a/0004-Force-the-target-when-building-for-CompileKind-Host.patch b/0004-Force-the-target-when-building-for-CompileKind-Host.patch index ada72ff..5692fb8 100644 --- a/0004-Force-the-target-when-building-for-CompileKind-Host.patch +++ b/0004-Force-the-target-when-building-for-CompileKind-Host.patch @@ -7,24 +7,25 @@ Currently hardwired to be i686-unknown-linux-gnu Signed-off-by: David Greaves Signed-off-by: Ruben De Smet +Signed-off-by: Matti Viljanen --- - src/tools/cargo | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + src/tools/cargo/src/cargo/core/compiler/mod.rs | 3 +++ + 1 file changed, 3 insertions(+) diff --git a/src/tools/cargo/src/cargo/core/compiler/mod.rs b/src/tools/cargo/src/cargo/core/compiler/mod.rs -index 7024a2ac5..ebce975a9 100644 +index 3b0510ac9..6b745db92 100644 --- a/src/tools/cargo/src/cargo/core/compiler/mod.rs +++ b/src/tools/cargo/src/cargo/core/compiler/mod.rs -@@ -1111,6 +1111,9 @@ fn build_base_args(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder, unit: &Unit) - +@@ -1150,6 +1150,9 @@ fn build_base_args( + if let CompileKind::Target(n) = unit.kind { cmd.arg("--target").arg(n.rustc_target()); + } else { + debug!("kind is {:?} - Forcing this to be 686", unit.kind); + cmd.arg("--target").arg("i686-unknown-linux-gnu"); } - + opt( --- -2.42.0 +-- +2.45.2 diff --git a/0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch b/0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch index 128cab3..12a628c 100644 --- a/0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch +++ b/0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch @@ -35,18 +35,19 @@ needed to support the SHIM functionality Co-authored-by: Ruben De Smet Signed-off-by: David Greaves Signed-off-by: Ruben De Smet +Signed-off-by: Matti Viljanen --- - .../src/sys/unix/process/process_common.rs | 55 ++++++- - .../std/src/sys/unix/process/process_unix.rs | 137 ++++++++++++++++-- + .../sys/pal/unix/process/process_common.rs | 55 ++++++- + .../src/sys/pal/unix/process/process_unix.rs | 137 ++++++++++++++++-- 2 files changed, 172 insertions(+), 20 deletions(-) -diff --git a/library/std/src/sys/unix/process/process_common.rs b/library/std/src/sys/unix/process/process_common.rs -index bac32d9e60e..3cd9767da88 100644 ---- a/library/std/src/sys/unix/process/process_common.rs -+++ b/library/std/src/sys/unix/process/process_common.rs -@@ -85,7 +85,7 @@ pub unsafe fn sigaddset(set: *mut libc::sigset_t, signum: libc::c_int) -> libc:: +diff --git a/library/std/src/sys/pal/unix/process/process_common.rs b/library/std/src/sys/pal/unix/process/process_common.rs +index f615e8086..7e90aa40f 100644 +--- a/library/std/src/sys/pal/unix/process/process_common.rs ++++ b/library/std/src/sys/pal/unix/process/process_common.rs +@@ -85,7 +85,7 @@ cfg_if::cfg_if! { //////////////////////////////////////////////////////////////////////////////// - + pub struct Command { - program: CString, + pub(crate) program: CString, @@ -64,13 +65,13 @@ index bac32d9e60e..3cd9767da88 100644 + pub(crate) setuid: Option, + pub(crate) setgid: Option, + pub(crate) setgroups: Option, - + program_kind: ProgramKind, cwd: Option, @@ -110,6 +117,14 @@ pub struct Command { pgroup: Option, } - + +pub(crate) type ExecvpFn = fn(*const c_char, *const *const c_char) -> c_int; +pub(crate) type Dup2Fn = fn(c_int, c_int) -> c_int; +pub(crate) type CloseFn = fn(c_int) -> c_int; @@ -81,8 +82,8 @@ index bac32d9e60e..3cd9767da88 100644 + // Create a new type for argv, so that we can make it `Send` and `Sync` struct Argv(Vec<*const c_char>); - -@@ -183,16 +198,24 @@ pub fn new(program: &OsStr) -> Command { + +@@ -183,16 +198,24 @@ impl Command { let mut saw_nul = false; let program_kind = ProgramKind::new(program.as_ref()); let program = os2c(program, &mut saw_nul); @@ -110,7 +111,7 @@ index bac32d9e60e..3cd9767da88 100644 closures: Vec::new(), groups: None, stdin: None, -@@ -207,16 +230,24 @@ pub fn new(program: &OsStr) -> Command { +@@ -207,16 +230,24 @@ impl Command { let mut saw_nul = false; let program_kind = ProgramKind::new(program.as_ref()); let program = os2c(program, &mut saw_nul); @@ -138,10 +139,10 @@ index bac32d9e60e..3cd9767da88 100644 closures: Vec::new(), groups: None, stdin: None, -@@ -227,6 +258,16 @@ pub fn new(program: &OsStr) -> Command { +@@ -227,6 +258,16 @@ impl Command { } } - + + // This allows process_unix::{spawn, exec} to push program to the + // start of /usr/bin/env's arg list + pub fn insert_program(&mut self, arg: String) { @@ -155,23 +156,23 @@ index bac32d9e60e..3cd9767da88 100644 pub fn set_arg_0(&mut self, arg: &OsStr) { // Set a new arg0 let arg = os2c(arg, &mut self.saw_nul); -diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs -index 72aca4e6659..495368b58ec 100644 ---- a/library/std/src/sys/unix/process/process_unix.rs -+++ b/library/std/src/sys/unix/process/process_unix.rs -@@ -25,7 +25,7 @@ +diff --git a/library/std/src/sys/pal/unix/process/process_unix.rs b/library/std/src/sys/pal/unix/process/process_unix.rs +index d65657790..9b2f68b8c 100644 +--- a/library/std/src/sys/pal/unix/process/process_unix.rs ++++ b/library/std/src/sys/pal/unix/process/process_unix.rs +@@ -15,7 +15,7 @@ use crate::os::unix::io::AsRawFd; use libc::RTP_ID as pid_t; - + #[cfg(not(target_os = "vxworks"))] -use libc::{c_int, pid_t}; +use libc::{c_char, c_int, dlsym, pid_t}; - + #[cfg(not(any( target_os = "vxworks", -@@ -62,6 +62,10 @@ fn get_clock_resolution() -> Duration { +@@ -52,6 +52,10 @@ cfg_if::cfg_if! { } } - + +use crate::ffi::OsString; +use crate::intrinsics::transmute; +use sys::os::getenv; @@ -179,10 +180,10 @@ index 72aca4e6659..495368b58ec 100644 //////////////////////////////////////////////////////////////////////////////// // Command //////////////////////////////////////////////////////////////////////////////// -@@ -95,6 +99,65 @@ pub fn spawn( +@@ -85,6 +89,65 @@ impl Command { #[cfg(not(target_os = "linux"))] let (input, output) = sys::pipe::anon_pipe()?; - + + // If there is a RUST_EXEC_SHIM (could be "/usr/bin/env --") + // then we're probably going to directly execvp it via dlsym + // to avoid issues with threads and malloc post-fork and @@ -245,7 +246,7 @@ index 72aca4e6659..495368b58ec 100644 // Whatever happens after the fork is almost for sure going to touch or // look at the environment in one way or another (PATH in `execvp` or // accessing the `environ` pointer ourselves). Make sure no other thread -@@ -111,7 +174,7 @@ pub fn spawn( +@@ -101,7 +164,7 @@ impl Command { if pid == 0 { crate::panic::always_abort(); mem::forget(env_lock); // avoid non-async-signal-safe unlocking @@ -254,7 +255,7 @@ index 72aca4e6659..495368b58ec 100644 #[cfg(target_os = "linux")] if self.get_create_pidfd() { self.send_pidfd(&output); -@@ -268,7 +331,47 @@ pub fn exec(&mut self, default: Stdio) -> io::Error { +@@ -257,7 +320,47 @@ impl Command { Err(e) => e, } } @@ -303,9 +304,9 @@ index 72aca4e6659..495368b58ec 100644 // And at this point we've reached a special time in the life of the // child. The child must now be considered hamstrung and unable to // do anything other than syscalls really. Consider the following -@@ -308,13 +411,13 @@ unsafe fn do_exec( +@@ -297,13 +400,13 @@ impl Command { use crate::sys::{self, cvt_r}; - + if let Some(fd) = stdio.stdin.fd() { - cvt_r(|| libc::dup2(fd, libc::STDIN_FILENO))?; + cvt_r(|| self.unwrap_dup2(fd, libc::STDIN_FILENO))?; @@ -318,9 +319,9 @@ index 72aca4e6659..495368b58ec 100644 - cvt_r(|| libc::dup2(fd, libc::STDERR_FILENO))?; + cvt_r(|| self.unwrap_dup2(fd, libc::STDERR_FILENO))?; } - + #[cfg(not(target_os = "l4re"))] -@@ -322,10 +425,10 @@ unsafe fn do_exec( +@@ -311,10 +414,10 @@ impl Command { if let Some(_g) = self.get_groups() { //FIXME: Redox kernel does not support setgroups yet #[cfg(not(target_os = "redox"))] @@ -333,12 +334,18 @@ index 72aca4e6659..495368b58ec 100644 } if let Some(u) = self.get_uid() { // When dropping privileges from root, the `setgroups` call -@@ -337,13 +440,13 @@ unsafe fn do_exec( +@@ -326,7 +429,7 @@ impl Command { //FIXME: Redox kernel does not support setgroups yet #[cfg(not(target_os = "redox"))] - if libc::getuid() == 0 && self.get_groups().is_none() { -- cvt(libc::setgroups(0, crate::ptr::null()))?; -+ cvt(self.unwrap_setgroups(0, crate::ptr::null()))?; + if self.get_groups().is_none() { +- let res = cvt(libc::setgroups(0, crate::ptr::null())); ++ let res = cvt(self.unwrap_setgroups(0, crate::ptr::null())); + if let Err(e) = res { + // Here we ignore the case of not having CAP_SETGID. + // An alternative would be to require CAP_SETGID (in +@@ -336,11 +439,11 @@ impl Command { + } + } } - cvt(libc::setuid(u as uid_t))?; + cvt(self.unwrap_setuid(u as uid_t))?; @@ -348,9 +355,9 @@ index 72aca4e6659..495368b58ec 100644 - cvt(libc::chdir(cwd.as_ptr()))?; + cvt(self.unwrap_chdir(cwd.as_ptr()))?; } - + if let Some(pgroup) = self.get_pgroup() { -@@ -408,8 +511,12 @@ fn drop(&mut self) { +@@ -405,8 +508,12 @@ impl Command { _reset = Some(Reset(*sys::os::environ())); *sys::os::environ() = envp.as_ptr(); } @@ -364,19 +371,19 @@ index 72aca4e6659..495368b58ec 100644 + }; Err(io::Error::last_os_error()) } - -@@ -436,6 +543,7 @@ fn posix_spawn( + +@@ -433,6 +540,7 @@ impl Command { _: &ChildPipes, _: Option<&CStringArray>, ) -> io::Result> { + eprintln!("process_unix:270: in null posix_spawn"); Ok(None) } - -@@ -459,12 +567,15 @@ fn posix_spawn( - use crate::mem::MaybeUninit; + +@@ -457,12 +565,15 @@ impl Command { + use crate::sys::weak::weak; use crate::sys::{self, cvt_nz, unix_sigpipe_attr_specified}; - + + let skip_spawnvp: bool = getenv(&OsString::from("SB2_RUST_NO_SPAWNVP")).is_some(); + if self.get_gid().is_some() @@ -389,6 +396,6 @@ index 72aca4e6659..495368b58ec 100644 { return Ok(None); } --- -2.43.0 +-- +2.45.2 diff --git a/0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch b/0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch index b99845e..1c74d35 100644 --- a/0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch +++ b/0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch @@ -7,18 +7,19 @@ Subject: [PATCH] Scratchbox2 needs to be able to tell cargo the default This is analogous to the SB2 patch to rustc; ac226bbc018e11311394126fe580763c5bc77a2c Signed-off-by: Ruben De Smet +Signed-off-by: Matti Viljanen --- - src/tools/cargo | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + src/tools/cargo/src/cargo/core/compiler/compile_kind.rs | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs b/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs -index 73d8f89cc..5d17c15d2 100644 +index 222732dde..a5056be7b 100644 --- a/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs +++ b/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs @@ -71,7 +71,13 @@ impl CompileKind { } - - let kinds = match &config.build_config()?.target { + + let kinds = match &gctx.build_config()?.target { - None => Ok(vec![CompileKind::Host]), + None => { + if let Ok(sb2_tgt) = std::env::var("SB2_RUST_TARGET_TRIPLE") { @@ -26,10 +27,10 @@ index 73d8f89cc..5d17c15d2 100644 + } else { + Ok(vec![CompileKind::Host]) + } -+ } - Some(build_target_config) => dedup(&build_target_config.values(config)?), ++ }, + Some(build_target_config) => dedup(&build_target_config.values(gctx)?), }; - --- -2.42.0 + +-- +2.45.2 diff --git a/0009-Relocate-unset-tmp.patch b/0009-Relocate-unset-tmp.patch index 58c58db..fa6b55b 100644 --- a/0009-Relocate-unset-tmp.patch +++ b/0009-Relocate-unset-tmp.patch @@ -1,8 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Matti Viljanen +Date: Sat, 22 Jun 2024 11:30:30 +0300 +Subject: [PATCH] Relocate unset tmp + +In Linux, unset $TMPDIR defaults to /tmp. In sb2 the temp files written to /tmp +by rustc are no longer available when the linker tries to use them. Work around +the issue by setting $TMPDIR to $HOME/.tmp when determining the temporary +directory location whenever linking is determined to happen. + +If $TMPDIR is already set, that value is used as expected. + +Signed-off-by: Matti Viljanen +--- + compiler/rustc_codegen_ssa/src/back/link.rs | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index dd9d277fb..160e472cf 100644 +index b458f325b..e1b9666e6 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -48,7 +48,7 @@ use std::ffi::OsString; +@@ -48,7 +48,7 @@ use std::ffi::{OsStr, OsString}; use std::fs::{read, File, OpenOptions}; use std::io::{BufWriter, Write}; use std::ops::Deref; @@ -10,10 +27,10 @@ index dd9d277fb..160e472cf 100644 +use std::path::{MAIN_SEPARATOR, Path, PathBuf}; use std::process::{ExitStatus, Output, Stdio}; use std::{env, fmt, fs, io, mem, str}; - -@@ -95,11 +95,24 @@ pub fn link_binary<'a>( + +@@ -95,11 +95,24 @@ pub fn link_binary( }); - + if outputs.outputs.should_link() { + let mut clear_tmp = false; + if env::var_os("TMPDIR").is_none() && env::var_os("HOME").is_some() { @@ -28,7 +45,7 @@ index dd9d277fb..160e472cf 100644 let tmpdir = TempFileBuilder::new() .prefix("rustc") .tempdir() - .unwrap_or_else(|error| sess.emit_fatal(errors::CreateTempDir { error })); + .unwrap_or_else(|error| sess.dcx().emit_fatal(errors::CreateTempDir { error })); let path = MaybeTempDir::new(tmpdir, sess.opts.cg.save_temps); + if clear_tmp { + env::remove_var("TMP"); @@ -36,3 +53,6 @@ index dd9d277fb..160e472cf 100644 let output = out_filename( sess, crate_type, +-- +2.45.2 + diff --git a/rust-1.75.0-i686-unknown-linux-gnu.tar.gz b/rust-1.75.0-i686-unknown-linux-gnu.tar.gz deleted file mode 100644 index 7eadbbe..0000000 --- a/rust-1.75.0-i686-unknown-linux-gnu.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:107b8d8825deab338f338b15f047829da6225bb34644790847e96f0957c6678f -size 409233544 diff --git a/rust-1.79.0-i686-unknown-linux-gnu.tar.xz b/rust-1.79.0-i686-unknown-linux-gnu.tar.xz new file mode 100644 index 0000000..d7fd8de --- /dev/null +++ b/rust-1.79.0-i686-unknown-linux-gnu.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74a4b17c7b80b87d2e1f4fa83c8c0c5e920eee6d72fe570df97aa96d85fc25ec +size 220956232 diff --git a/rust.spec b/rust.spec index 143bfb0..e7ef3e6 100644 --- a/rust.spec +++ b/rust.spec @@ -11,13 +11,13 @@ %define rust_use_bootstrap 1 %define bootstrap_arches i486 -%global bootstrap_rust 1.75.0 -%global bootstrap_cargo 1.75.0 +%global bootstrap_rust 1.79.0 +%global bootstrap_cargo 1.79.0 # Only x86_64 and i686 are Tier 1 platforms at this time. # https://forge.rust-lang.org/platform-support.html -%global rust_version 1.75.0 +%global rust_version 1.79.0 %ifarch %ix86 %define xbuildjobs %{nil} @@ -65,8 +65,8 @@ License: (ASL 2.0 or MIT) and (BSD and MIT) URL: https://www.rust-lang.org %global rustc_package rustc-%{rust_version}-src -Source0: rustc-%{rust_version}-src.tar.gz -Source100: rust-%{rust_version}-i686-unknown-linux-gnu.tar.gz +Source0: rustc-%{rust_version}-src.tar.xz +Source100: rust-%{rust_version}-i686-unknown-linux-gnu.tar.xz Source200: README.md Patch1: 0001-Set-proper-llvm-targets.patch @@ -255,8 +255,6 @@ test -f '%{local_rust_root}/bin/rustc' sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure -rm -rf src/llvm-project/ - # We never enable other LLVM tools. rm -rf src/tools/clang rm -rf src/tools/lld @@ -412,13 +410,21 @@ find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+' # Remove unwanted documentation files (we already package them) -rm -f %{buildroot}%{_docdir}/%{name}/README.md -rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT -rm -f %{buildroot}%{_docdir}/%{name}/LICENSE -rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE -rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT -rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY -rm -f %{buildroot}%{_docdir}/%{name}/*.old +rm -f %{buildroot}%{_docdir}/cargo/README.md +rm -f %{buildroot}%{_docdir}/cargo/COPYRIGHT +rm -f %{buildroot}%{_docdir}/cargo/LICENSE +rm -f %{buildroot}%{_docdir}/cargo/LICENSE-APACHE +rm -f %{buildroot}%{_docdir}/cargo/LICENSE-MIT +rm -f %{buildroot}%{_docdir}/cargo/LICENSE-THIRD-PARTY +rm -f %{buildroot}%{_docdir}/cargo/*.old + +rm -f %{buildroot}%{_docdir}/rustc/README.md +rm -f %{buildroot}%{_docdir}/rustc/COPYRIGHT +rm -f %{buildroot}%{_docdir}/rustc/LICENSE +rm -f %{buildroot}%{_docdir}/rustc/LICENSE-APACHE +rm -f %{buildroot}%{_docdir}/rustc/LICENSE-MIT +rm -f %{buildroot}%{_docdir}/rustc/LICENSE-THIRD-PARTY +rm -f %{buildroot}%{_docdir}/rustc/*.old # Create the path for crate-devel packages mkdir -p %{buildroot}%{_datadir}/cargo/registry diff --git a/rustc-1.75.0-src.tar.gz b/rustc-1.75.0-src.tar.gz deleted file mode 100644 index 98e0fa6..0000000 --- a/rustc-1.75.0-src.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5b739f45bc9d341e2d1c570d65d2375591e22c2d23ef5b8a37711a0386abc088 -size 285857065 diff --git a/rustc-1.79.0-src.tar.xz b/rustc-1.79.0-src.tar.xz new file mode 100644 index 0000000..09b6964 --- /dev/null +++ b/rustc-1.79.0-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab826e84b8d48ec6eda3370065034dea8c006f6a946d78a9ba12bcb50e6d3c7a +size 162359512 From 789372c5709b9b41c26c4a3f5ca1486e9d2fdd7f Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Fri, 5 Jul 2024 10:09:10 +0300 Subject: [PATCH 3/4] [rust] Update .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index f087b42..1177240 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -*.tar.gz filter=lfs diff=lfs merge=lfs -text +*.tar.xz filter=lfs diff=lfs merge=lfs -text From 39673509bd8e8222dbbc392d561357e82cc6c22f Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sun, 7 Jul 2024 13:02:32 +0300 Subject: [PATCH 4/4] [rust] Rename patches sequential --- ...box2-needs-to-be-able-to-tell-rustc-the-defau.patch | 0 ...the-target-when-building-for-CompileKind-Host.patch | 0 ...-ENV-controls-to-bypass-some-sb2-calls-betwee.patch | 0 ...box2-needs-to-be-able-to-tell-cargo-the-defau.patch | 0 ...te-unset-tmp.patch => 0006-Relocate-unset-tmp.patch | 0 rust.spec | 10 +++++----- 6 files changed, 5 insertions(+), 5 deletions(-) rename 0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch => 0002-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch (100%) rename 0004-Force-the-target-when-building-for-CompileKind-Host.patch => 0003-Force-the-target-when-building-for-CompileKind-Host.patch (100%) rename 0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch => 0004-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch (100%) rename 0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch => 0005-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch (100%) rename 0009-Relocate-unset-tmp.patch => 0006-Relocate-unset-tmp.patch (100%) diff --git a/0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch b/0002-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch similarity index 100% rename from 0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch rename to 0002-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch diff --git a/0004-Force-the-target-when-building-for-CompileKind-Host.patch b/0003-Force-the-target-when-building-for-CompileKind-Host.patch similarity index 100% rename from 0004-Force-the-target-when-building-for-CompileKind-Host.patch rename to 0003-Force-the-target-when-building-for-CompileKind-Host.patch diff --git a/0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch b/0004-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch similarity index 100% rename from 0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch rename to 0004-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch diff --git a/0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch b/0005-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch similarity index 100% rename from 0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch rename to 0005-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch diff --git a/0009-Relocate-unset-tmp.patch b/0006-Relocate-unset-tmp.patch similarity index 100% rename from 0009-Relocate-unset-tmp.patch rename to 0006-Relocate-unset-tmp.patch diff --git a/rust.spec b/rust.spec index e7ef3e6..f82ac68 100644 --- a/rust.spec +++ b/rust.spec @@ -70,11 +70,11 @@ Source100: rust-%{rust_version}-i686-unknown-linux-gnu.tar.xz Source200: README.md Patch1: 0001-Set-proper-llvm-targets.patch -Patch3: 0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch -Patch4: 0004-Force-the-target-when-building-for-CompileKind-Host.patch -Patch5: 0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch -Patch6: 0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch -Patch9: 0009-Relocate-unset-tmp.patch +Patch2: 0002-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch +Patch3: 0003-Force-the-target-when-building-for-CompileKind-Host.patch +Patch4: 0004-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch +Patch5: 0005-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch +Patch6: 0006-Relocate-unset-tmp.patch # This is the real rustc spec - the stub one appears near the end. %ifarch %ix86