Skip to content

Commit 2c5c024

Browse files
committed
Rebase patches onto 1.73
1 parent 1b83a42 commit 2c5c024

8 files changed

+70
-45
lines changed

0001-Set-proper-llvm-targets.patch

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Signed-off-by: Ruben De Smet <[email protected]>
1010
1 file changed, 1 insertion(+), 1 deletion(-)
1111

1212
diff --git a/config.example.toml b/config.example.toml
13-
index 0c65b25fe13..43beaed6e7b 100644
13+
index 5c4bee87553..63946e46122 100644
1414
--- a/config.example.toml
1515
+++ b/config.example.toml
1616
@@ -88,7 +88,7 @@ changelog-seen = 2
@@ -22,3 +22,6 @@ index 0c65b25fe13..43beaed6e7b 100644
2222

2323
# LLVM experimental targets to build support for. These targets are specified in
2424
# the same format as above, but since these targets are experimental, they are
25+
--
26+
2.42.0
27+

0002-Disable-statx-for-all-builds.-JB-50106.patch

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Signed-off-by: Ruben De Smet <[email protected]>
2020
1 file changed, 2 insertions(+), 30 deletions(-)
2121

2222
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
23-
index fbc7f04ce9a..bf49ad70590 100644
23+
index a5604c92a80..8438d7dcc30 100644
2424
--- a/library/std/src/sys/unix/fs.rs
2525
+++ b/library/std/src/sys/unix/fs.rs
26-
@@ -28,28 +28,11 @@
26+
@@ -17,28 +17,11 @@
2727
use crate::sys::{cvt, cvt_r};
2828
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
2929

@@ -52,7 +52,7 @@ index fbc7f04ce9a..bf49ad70590 100644
5252
#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "android"))]
5353
use libc::dirfd;
5454
#[cfg(any(target_os = "linux", target_os = "emscripten"))]
55-
@@ -109,20 +92,9 @@
55+
@@ -98,20 +81,9 @@
5656
// https://github.com/rust-lang/rust/pull/67774
5757
macro_rules! cfg_has_statx {
5858
({ $($then_tt:tt)* } else { $($else_tt:tt)* }) => {
@@ -75,3 +75,6 @@ index fbc7f04ce9a..bf49ad70590 100644
7575
}
7676

7777
cfg_has_statx! {{
78+
--
79+
2.42.0
80+

0003-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Signed-off-by: Ruben De Smet <[email protected]>
1515
1 file changed, 8 insertions(+), 1 deletion(-)
1616

1717
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
18-
index f97cb3440d2..9b96d0d2e57 100644
18+
index f00472f181d..a2b9fbf82db 100644
1919
--- a/compiler/rustc_session/src/config.rs
2020
+++ b/compiler/rustc_session/src/config.rs
21-
@@ -2170,7 +2170,14 @@ pub fn parse_target_triple(
21+
@@ -2226,7 +2226,14 @@ pub fn parse_target_triple(
2222
})
2323
}
2424
Some(target) => TargetTriple::TargetTriple(target),
@@ -34,3 +34,6 @@ index f97cb3440d2..9b96d0d2e57 100644
3434
}
3535
}
3636

37+
--
38+
2.42.0
39+

0004-Force-the-target-when-building-for-CompileKind-Host.patch

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Signed-off-by: Ruben De Smet <[email protected]>
1212
1 file changed, 1 insertion(+), 1 deletion(-)
1313

1414
diff --git a/src/tools/cargo/src/cargo/core/compiler/mod.rs b/src/tools/cargo/src/cargo/core/compiler/mod.rs
15-
index 31e63c226..976b101fd 100644
15+
index 7024a2ac5..ebce975a9 100644
1616
--- a/src/tools/cargo/src/cargo/core/compiler/mod.rs
1717
+++ b/src/tools/cargo/src/cargo/core/compiler/mod.rs
1818
@@ -1111,6 +1111,9 @@ fn build_base_args(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder, unit: &Unit)
@@ -25,3 +25,6 @@ index 31e63c226..976b101fd 100644
2525
}
2626

2727
opt(
28+
--
29+
2.42.0
30+

0005-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ index 640648e8707..f15625e0514 100644
155155
// Set a new arg0
156156
let arg = os2c(arg, &mut self.saw_nul);
157157
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs
158-
index 0ce93af66ac..04449d859bf 100644
158+
index 3963e7f52d5..d08e4db6199 100644
159159
--- a/library/std/src/sys/unix/process/process_unix.rs
160160
+++ b/library/std/src/sys/unix/process/process_unix.rs
161-
@@ -28,7 +28,7 @@
161+
@@ -25,7 +25,7 @@
162162
use libc::RTP_ID as pid_t;
163163

164164
#[cfg(not(target_os = "vxworks"))]
@@ -167,7 +167,7 @@ index 0ce93af66ac..04449d859bf 100644
167167

168168
#[cfg(not(any(
169169
target_os = "vxworks",
170-
@@ -65,6 +65,10 @@ fn get_clock_resolution() -> Duration {
170+
@@ -62,6 +62,10 @@ fn get_clock_resolution() -> Duration {
171171
}
172172
}
173173

@@ -178,8 +178,8 @@ index 0ce93af66ac..04449d859bf 100644
178178
////////////////////////////////////////////////////////////////////////////////
179179
// Command
180180
////////////////////////////////////////////////////////////////////////////////
181-
@@ -93,6 +97,65 @@ pub fn spawn(
182-
}
181+
@@ -95,6 +99,65 @@ pub fn spawn(
182+
#[cfg(not(target_os = "linux"))]
183183
let (input, output) = sys::pipe::anon_pipe()?;
184184

185185
+ // If there is a RUST_EXEC_SHIM (could be "/usr/bin/env --")
@@ -244,16 +244,16 @@ index 0ce93af66ac..04449d859bf 100644
244244
// Whatever happens after the fork is almost for sure going to touch or
245245
// look at the environment in one way or another (PATH in `execvp` or
246246
// accessing the `environ` pointer ourselves). Make sure no other thread
247-
@@ -109,7 +172,7 @@ pub fn spawn(
247+
@@ -111,7 +174,7 @@ pub fn spawn(
248248
if pid == 0 {
249249
crate::panic::always_abort();
250250
mem::forget(env_lock); // avoid non-async-signal-safe unlocking
251251
- drop(input);
252252
+ self.unwrap_drop(input);
253-
let Err(err) = unsafe { self.do_exec(theirs, envp.as_ref()) };
254-
let errno = err.raw_os_error().unwrap_or(libc::EINVAL) as u32;
255-
let errno = errno.to_be_bytes();
256-
@@ -336,7 +399,48 @@ pub fn exec(&mut self, default: Stdio) -> io::Error {
253+
#[cfg(target_os = "linux")]
254+
if self.get_create_pidfd() {
255+
self.send_pidfd(&output);
256+
@@ -268,7 +331,48 @@ pub fn exec(&mut self, default: Stdio) -> io::Error {
257257
Err(e) => e,
258258
}
259259
}
@@ -303,7 +303,7 @@ index 0ce93af66ac..04449d859bf 100644
303303
// And at this point we've reached a special time in the life of the
304304
// child. The child must now be considered hamstrung and unable to
305305
// do anything other than syscalls really. Consider the following
306-
@@ -376,13 +480,13 @@ unsafe fn do_exec(
306+
@@ -308,13 +412,13 @@ unsafe fn do_exec(
307307
use crate::sys::{self, cvt_r};
308308

309309
if let Some(fd) = stdio.stdin.fd() {
@@ -320,7 +320,7 @@ index 0ce93af66ac..04449d859bf 100644
320320
}
321321

322322
#[cfg(not(target_os = "l4re"))]
323-
@@ -390,10 +494,10 @@ unsafe fn do_exec(
323+
@@ -322,10 +426,10 @@ unsafe fn do_exec(
324324
if let Some(_g) = self.get_groups() {
325325
//FIXME: Redox kernel does not support setgroups yet
326326
#[cfg(not(target_os = "redox"))]
@@ -333,7 +333,7 @@ index 0ce93af66ac..04449d859bf 100644
333333
}
334334
if let Some(u) = self.get_uid() {
335335
// When dropping privileges from root, the `setgroups` call
336-
@@ -405,13 +509,13 @@ unsafe fn do_exec(
336+
@@ -337,13 +441,13 @@ unsafe fn do_exec(
337337
//FIXME: Redox kernel does not support setgroups yet
338338
#[cfg(not(target_os = "redox"))]
339339
if libc::getuid() == 0 && self.get_groups().is_none() {
@@ -350,7 +350,7 @@ index 0ce93af66ac..04449d859bf 100644
350350
}
351351

352352
if let Some(pgroup) = self.get_pgroup() {
353-
@@ -469,8 +573,12 @@ fn drop(&mut self) {
353+
@@ -401,8 +505,12 @@ fn drop(&mut self) {
354354
_reset = Some(Reset(*sys::os::environ()));
355355
*sys::os::environ() = envp.as_ptr();
356356
}
@@ -365,15 +365,15 @@ index 0ce93af66ac..04449d859bf 100644
365365
Err(io::Error::last_os_error())
366366
}
367367

368-
@@ -497,6 +605,7 @@ fn posix_spawn(
368+
@@ -429,6 +537,7 @@ fn posix_spawn(
369369
_: &ChildPipes,
370370
_: Option<&CStringArray>,
371371
) -> io::Result<Option<Process>> {
372372
+ eprintln!("process_unix:270: in null posix_spawn");
373373
Ok(None)
374374
}
375375

376-
@@ -520,12 +629,15 @@ fn posix_spawn(
376+
@@ -452,12 +561,15 @@ fn posix_spawn(
377377
use crate::mem::MaybeUninit;
378378
use crate::sys::{self, cvt_nz, unix_sigpipe_attr_specified};
379379

@@ -389,3 +389,6 @@ index 0ce93af66ac..04449d859bf 100644
389389
{
390390
return Ok(None);
391391
}
392+
--
393+
2.42.0
394+

0006-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Signed-off-by: Ruben De Smet <[email protected]>
1212
1 file changed, 1 insertion(+), 1 deletion(-)
1313

1414
diff --git a/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs b/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs
15-
index 73d8f89cc..d35f55d11 100644
15+
index 73d8f89cc..5d17c15d2 100644
1616
--- a/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs
1717
+++ b/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs
1818
@@ -71,7 +71,13 @@ impl CompileKind {
1919
}
20-
20+
2121
let kinds = match &config.build_config()?.target {
2222
- None => Ok(vec![CompileKind::Host]),
2323
+ None => {
@@ -29,3 +29,7 @@ index 73d8f89cc..d35f55d11 100644
2929
+ }
3030
Some(build_target_config) => dedup(&build_target_config.values(config)?),
3131
};
32+
33+
--
34+
2.42.0
35+

0007-Disable-aarch64-outline-atomics-for-now.patch

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ index da246089440..8c5daccc331 100644
2626
mcount: "\u{1}_mcount".into(),
2727
max_atomic_width: Some(128),
2828
supported_sanitizers: SanitizerSet::ADDRESS
29+
--
30+
2.42.0
31+

0008-Revert-Use-statx-s-64-bit-times-on-32-bit-linux-gnu.patch

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ index 479bbcc17a8..2e90d8d6be7 100644
5555
fn st_ctime_nsec(&self) -> i64 {
5656
self.as_inner().as_inner().st_ctime_nsec as i64
5757
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
58-
index bf49ad70590..ff01830e0f6 100644
58+
index 8438d7dcc30..c5ca8582f88 100644
5959
--- a/library/std/src/sys/unix/fs.rs
6060
+++ b/library/std/src/sys/unix/fs.rs
61-
@@ -109,19 +109,10 @@ struct StatxExtraFields {
61+
@@ -98,19 +98,10 @@ struct StatxExtraFields {
6262
// This is needed to check if btime is supported by the filesystem.
6363
stx_mask: u32,
6464
stx_btime: libc::statx_timestamp,
@@ -71,7 +71,7 @@ index bf49ad70590..ff01830e0f6 100644
7171
- stx_mtime: libc::statx_timestamp,
7272
-
7373
}
74-
74+
7575
- // We prefer `statx` on Linux if available, which contains file creation time,
7676
- // as well as 64-bit timestamps of all kinds.
7777
- // Default `stat64` contains no creation time and may have 32-bit `time_t`.
@@ -80,7 +80,7 @@ index bf49ad70590..ff01830e0f6 100644
8080
unsafe fn try_statx(
8181
fd: c_int,
8282
path: *const c_char,
83-
@@ -211,13 +202,6 @@ fn statx(
83+
@@ -200,13 +191,6 @@ fn statx(
8484
let extra = StatxExtraFields {
8585
stx_mask: buf.stx_mask,
8686
stx_btime: buf.stx_btime,
@@ -92,9 +92,9 @@ index bf49ad70590..ff01830e0f6 100644
9292
- #[cfg(target_pointer_width = "32")]
9393
- stx_mtime: buf.stx_mtime,
9494
};
95-
95+
9696
Some(Ok(FileAttr { stat, statx_extra_fields: Some(extra) }))
97-
@@ -365,36 +349,6 @@ impl FileAttr {
97+
@@ -354,36 +338,6 @@ impl FileAttr {
9898
fn from_stat64(stat: stat64) -> Self {
9999
Self { stat, statx_extra_fields: None }
100100
}
@@ -131,7 +131,7 @@ index bf49ad70590..ff01830e0f6 100644
131131
}
132132
} else {
133133
impl FileAttr {
134-
@@ -420,15 +374,24 @@ pub fn file_type(&self) -> FileType {
134+
@@ -409,15 +363,24 @@ pub fn file_type(&self) -> FileType {
135135
#[cfg(target_os = "netbsd")]
136136
impl FileAttr {
137137
pub fn modified(&self) -> io::Result<SystemTime> {
@@ -141,15 +141,15 @@ index bf49ad70590..ff01830e0f6 100644
141141
+ tv_nsec: self.stat.st_mtimensec as libc::c_long,
142142
+ }))
143143
}
144-
144+
145145
pub fn accessed(&self) -> io::Result<SystemTime> {
146146
- Ok(SystemTime::new(self.stat.st_atime as i64, self.stat.st_atimensec as i64))
147147
+ Ok(SystemTime::from(libc::timespec {
148148
+ tv_sec: self.stat.st_atime as libc::time_t,
149149
+ tv_nsec: self.stat.st_atimensec as libc::c_long,
150150
+ }))
151151
}
152-
152+
153153
pub fn created(&self) -> io::Result<SystemTime> {
154154
- Ok(SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtimensec as i64))
155155
+ Ok(SystemTime::from(libc::timespec {
@@ -158,8 +158,8 @@ index bf49ad70590..ff01830e0f6 100644
158158
+ }))
159159
}
160160
}
161-
162-
@@ -441,19 +404,18 @@ impl FileAttr {
161+
162+
@@ -430,19 +393,18 @@ impl FileAttr {
163163
target_os = "vita"
164164
)))]
165165
pub fn modified(&self) -> io::Result<SystemTime> {
@@ -176,7 +176,7 @@ index bf49ad70590..ff01830e0f6 100644
176176
+ tv_nsec: self.stat.st_mtime_nsec as _,
177177
+ }))
178178
}
179-
179+
180180
#[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "vita"))]
181181
pub fn modified(&self) -> io::Result<SystemTime> {
182182
- Ok(SystemTime::new(self.stat.st_mtime as i64, 0))
@@ -185,9 +185,9 @@ index bf49ad70590..ff01830e0f6 100644
185185
+ tv_nsec: 0,
186186
+ }))
187187
}
188-
188+
189189
#[cfg(target_os = "horizon")]
190-
@@ -468,19 +430,18 @@ pub fn modified(&self) -> io::Result<SystemTime> {
190+
@@ -457,19 +419,18 @@ pub fn modified(&self) -> io::Result<SystemTime> {
191191
target_os = "vita"
192192
)))]
193193
pub fn accessed(&self) -> io::Result<SystemTime> {
@@ -204,7 +204,7 @@ index bf49ad70590..ff01830e0f6 100644
204204
+ tv_nsec: self.stat.st_atime_nsec as _,
205205
+ }))
206206
}
207-
207+
208208
#[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "vita"))]
209209
pub fn accessed(&self) -> io::Result<SystemTime> {
210210
- Ok(SystemTime::new(self.stat.st_atime as i64, 0))
@@ -213,9 +213,9 @@ index bf49ad70590..ff01830e0f6 100644
213213
+ tv_nsec: 0,
214214
+ }))
215215
}
216-
216+
217217
#[cfg(target_os = "horizon")]
218-
@@ -497,7 +458,10 @@ pub fn accessed(&self) -> io::Result<SystemTime> {
218+
@@ -486,7 +447,10 @@ pub fn accessed(&self) -> io::Result<SystemTime> {
219219
target_os = "watchos",
220220
))]
221221
pub fn created(&self) -> io::Result<SystemTime> {
@@ -225,9 +225,9 @@ index bf49ad70590..ff01830e0f6 100644
225225
+ tv_nsec: self.stat.st_birthtime_nsec as libc::c_long,
226226
+ }))
227227
}
228-
228+
229229
#[cfg(not(any(
230-
@@ -513,7 +477,10 @@ pub fn created(&self) -> io::Result<SystemTime> {
230+
@@ -502,7 +466,10 @@ pub fn created(&self) -> io::Result<SystemTime> {
231231
cfg_has_statx! {
232232
if let Some(ext) = &self.statx_extra_fields {
233233
return if (ext.stx_mask & libc::STATX_BTIME) != 0 {
@@ -244,10 +244,13 @@ index 17b4130c202..4e8dd9a86e7 100644
244244
--- a/library/std/src/sys/unix/time.rs
245245
+++ b/library/std/src/sys/unix/time.rs
246246
@@ -36,6 +36,7 @@ pub(in crate::sys::unix) struct Timespec {
247-
247+
248248
impl SystemTime {
249249
#[cfg_attr(target_os = "horizon", allow(unused))]
250250
+ #[cfg_attr(target_env = "gnu", allow(dead_code))]
251251
pub fn new(tv_sec: i64, tv_nsec: i64) -> SystemTime {
252252
SystemTime { t: Timespec::new(tv_sec, tv_nsec) }
253253
}
254+
--
255+
2.42.0
256+

0 commit comments

Comments
 (0)