-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path0002-Disable-statx-for-all-builds.-JB-50106.patch
80 lines (72 loc) · 2.46 KB
/
0002-Disable-statx-for-all-builds.-JB-50106.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Breet <[email protected]>
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 <[email protected]
Signed-off-by: Matti Kosola <[email protected]>
Signed-off-by: Ruben De Smet <[email protected]>
---
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