Skip to content

Commit 158294d

Browse files
committed
Update libstd patches for latest nightly and macOS
1 parent 10ad950 commit 158294d

File tree

2 files changed

+84
-23
lines changed

2 files changed

+84
-23
lines changed

0007-Fix-libstd-building.patch

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
From 40c86527fe92b608a65cc1187901035ebc56b281 Mon Sep 17 00:00:00 2001
1+
From d8bb60cc115960702f73f83866cde65dcdcf1cb4 Mon Sep 17 00:00:00 2001
22
From: bjorn3 <[email protected]>
3-
Date: Sat, 6 Oct 2018 13:21:15 +0200
3+
Date: Sat, 17 Nov 2018 11:08:10 +0100
44
Subject: [PATCH] Fix libstd building
55

66
---
77
src/libstd/lib.rs | 6 ------
88
src/libstd/net/ip.rs | 20 --------------------
99
src/libstd/num.rs | 2 +-
10+
src/libstd/panic.rs | 6 ------
1011
src/libstd/primitive_docs.rs | 16 ----------------
11-
4 files changed, 1 insertion(+), 43 deletions(-)
12+
5 files changed, 1 insertion(+), 49 deletions(-)
1213

1314
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
14-
index 4768e8b..c89f99a 100644
15+
index 6110b05..8b0c897 100644
1516
--- a/src/libstd/lib.rs
1617
+++ b/src/libstd/lib.rs
17-
@@ -257,7 +257,6 @@
18+
@@ -255,7 +255,6 @@
1819
#![feature(const_cstr_unchecked)]
1920
#![feature(core_intrinsics)]
2021
#![feature(dropck_eyepatch)]
2122
-#![feature(duration_as_u128)]
2223
#![feature(exact_size_is_empty)]
2324
#![feature(external_doc)]
2425
#![feature(fixed_size_array)]
25-
@@ -287,7 +286,6 @@
26+
@@ -286,7 +285,6 @@
2627
#![feature(rustc_attrs)]
2728
#![feature(rustc_const_unstable)]
2829
#![feature(std_internals)]
2930
-#![cfg_attr(not(stage0), feature(stdsimd))]
3031
#![feature(shrink_to)]
3132
#![feature(slice_concat_ext)]
3233
#![feature(slice_internals)]
33-
@@ -410,8 +408,6 @@ pub use core::i16;
34+
@@ -402,8 +400,6 @@ pub use core::i16;
3435
pub use core::i32;
3536
#[stable(feature = "rust1", since = "1.0.0")]
3637
pub use core::i64;
@@ -39,7 +40,7 @@ index 4768e8b..c89f99a 100644
3940
#[stable(feature = "rust1", since = "1.0.0")]
4041
pub use core::usize;
4142
#[stable(feature = "rust1", since = "1.0.0")]
42-
@@ -444,8 +440,6 @@ pub use alloc_crate::string;
43+
@@ -436,8 +432,6 @@ pub use alloc_crate::string;
4344
pub use alloc_crate::vec;
4445
#[stable(feature = "rust1", since = "1.0.0")]
4546
pub use core::char;
@@ -49,10 +50,10 @@ index 4768e8b..c89f99a 100644
4950
pub use core::hint;
5051

5152
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
52-
index d45a66e..b25b862 100644
53+
index 8685cb7..c4bf4d2 100644
5354
--- a/src/libstd/net/ip.rs
5455
+++ b/src/libstd/net/ip.rs
55-
@@ -1393,26 +1393,6 @@ impl FromInner<c::in6_addr> for Ipv6Addr {
56+
@@ -1392,26 +1392,6 @@ impl FromInner<c::in6_addr> for Ipv6Addr {
5657
}
5758
}
5859

@@ -92,8 +93,32 @@ index 3f90c1f..85aab83 100644
9293

9394
#[cfg(test)] use fmt;
9495
#[cfg(test)] use ops::{Add, Sub, Mul, Div, Rem};
96+
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
97+
index 4bc18a5..5c87035 100644
98+
--- a/src/libstd/panic.rs
99+
+++ b/src/libstd/panic.rs
100+
@@ -264,9 +264,6 @@ impl RefUnwindSafe for atomic::AtomicI32 {}
101+
#[cfg(target_has_atomic = "64")]
102+
#[unstable(feature = "integer_atomics", issue = "32976")]
103+
impl RefUnwindSafe for atomic::AtomicI64 {}
104+
-#[cfg(all(not(stage0), target_has_atomic = "128"))]
105+
-#[unstable(feature = "integer_atomics", issue = "32976")]
106+
-impl RefUnwindSafe for atomic::AtomicI128 {}
107+
108+
#[cfg(target_has_atomic = "ptr")]
109+
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
110+
@@ -283,9 +280,6 @@ impl RefUnwindSafe for atomic::AtomicU32 {}
111+
#[cfg(target_has_atomic = "64")]
112+
#[unstable(feature = "integer_atomics", issue = "32976")]
113+
impl RefUnwindSafe for atomic::AtomicU64 {}
114+
-#[cfg(all(not(stage0), target_has_atomic = "128"))]
115+
-#[unstable(feature = "integer_atomics", issue = "32976")]
116+
-impl RefUnwindSafe for atomic::AtomicU128 {}
117+
118+
#[cfg(target_has_atomic = "8")]
119+
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
95120
diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs
96-
index 8d54728..c36893c 100644
121+
index c2a1612..99824c5 100644
97122
--- a/src/libstd/primitive_docs.rs
98123
+++ b/src/libstd/primitive_docs.rs
99124
@@ -809,14 +809,6 @@ mod prim_i32 { }
@@ -127,5 +152,5 @@ index 8d54728..c36893c 100644
127152
//
128153
/// The pointer-sized signed integer type.
129154
--
130-
2.17.1 (Apple Git-112)
155+
2.17.2 (Apple Git-113)
131156

0008-Replace-some-variadic-function-calls-with-unimplemen.patch

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
From 96aefe8fdd28704d903d585f5be6a667d2485582 Mon Sep 17 00:00:00 2001
1+
From d1d5c0e5272a8c3f78e9c4eb97c38d8f5d5a6d87 Mon Sep 17 00:00:00 2001
22
From: bjorn3 <[email protected]>
3-
Date: Thu, 15 Nov 2018 11:41:06 +0100
3+
Date: Sat, 17 Nov 2018 11:13:19 +0100
44
Subject: [PATCH] Replace some variadic function calls with unimplemented!()
55

66
---
77
src/libstd/sys/unix/fd.rs | 18 ++++++++++++++++++
8-
src/libstd/sys/unix/fs.rs | 9 +++++++++
8+
src/libstd/sys/unix/fs.rs | 17 ++++++++++++++++-
99
src/libstd/sys/unix/net.rs | 3 +++
1010
src/libstd/sys/unix/rand.rs | 3 +++
1111
src/libstd/sys/unix/thread.rs | 3 +++
12-
5 files changed, 36 insertions(+)
12+
5 files changed, 43 insertions(+), 1 deletion(-)
1313

1414
diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs
15-
index af33d26..2433ae4 100644
15+
index 5a81d6d..919f9d1 100644
1616
--- a/src/libstd/sys/unix/fd.rs
1717
+++ b/src/libstd/sys/unix/fd.rs
1818
@@ -156,9 +156,12 @@ impl FileDesc {
@@ -99,7 +99,7 @@ index af33d26..2433ae4 100644
9999
}
100100

101101
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
102-
index add06ae..e0d3f84 100644
102+
index add06ae..1a392fc 100644
103103
--- a/src/libstd/sys/unix/fs.rs
104104
+++ b/src/libstd/sys/unix/fs.rs
105105
@@ -465,6 +465,7 @@ impl File {
@@ -119,15 +119,51 @@ index add06ae..e0d3f84 100644
119119
}
120120

121121
pub fn file_attr(&self) -> io::Result<FileAttr> {
122-
@@ -667,6 +670,7 @@ impl fmt::Debug for File {
122+
@@ -535,6 +538,7 @@ impl File {
123+
}
124+
125+
pub fn datasync(&self) -> io::Result<()> {
126+
+ /*
127+
cvt_r(|| unsafe { os_datasync(self.0.raw()) })?;
128+
return Ok(());
129+
130+
@@ -547,7 +551,9 @@ impl File {
131+
#[cfg(not(any(target_os = "macos",
132+
target_os = "ios",
133+
target_os = "linux")))]
134+
- unsafe fn os_datasync(fd: c_int) -> c_int { libc::fsync(fd) }
135+
+ unsafe fn os_datasync(fd: c_int) -> c_int { libc::fsync(fd) }]
136+
+ */
137+
+ unimplemented!();
138+
}
139+
140+
pub fn truncate(&self, size: u64) -> io::Result<()> {
141+
@@ -643,6 +649,7 @@ impl fmt::Debug for File {
142+
143+
#[cfg(target_os = "macos")]
144+
fn get_path(fd: c_int) -> Option<PathBuf> {
145+
+ /*
146+
// FIXME: The use of PATH_MAX is generally not encouraged, but it
147+
// is inevitable in this case because macOS defines `fcntl` with
148+
// `F_GETPATH` in terms of `MAXPATHLEN`, and there are no
149+
@@ -657,6 +664,8 @@ impl fmt::Debug for File {
150+
buf.truncate(l as usize);
151+
buf.shrink_to_fit();
152+
Some(PathBuf::from(OsString::from_vec(buf)))
153+
+ */
154+
+ unimplemented!();
155+
}
156+
157+
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
158+
@@ -667,6 +676,7 @@ impl fmt::Debug for File {
123159

124160
#[cfg(any(target_os = "linux", target_os = "macos"))]
125161
fn get_mode(fd: c_int) -> Option<(bool, bool)> {
126162
+ /*
127163
let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) };
128164
if mode == -1 {
129165
return None;
130-
@@ -677,6 +681,8 @@ impl fmt::Debug for File {
166+
@@ -677,6 +687,8 @@ impl fmt::Debug for File {
131167
libc::O_WRONLY => Some((false, true)),
132168
_ => None
133169
}
@@ -136,15 +172,15 @@ index add06ae..e0d3f84 100644
136172
}
137173

138174
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
139-
@@ -868,6 +874,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
175+
@@ -868,6 +880,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
140176
len: libc::size_t,
141177
flags: libc::c_uint,
142178
) -> libc::c_long {
143179
+ /*
144180
libc::syscall(
145181
libc::SYS_copy_file_range,
146182
fd_in,
147-
@@ -877,6 +884,8 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
183+
@@ -877,6 +890,8 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
148184
len,
149185
flags,
150186
)
@@ -207,5 +243,5 @@ index f3a45d2..1c2f0ce 100644
207243

208244
#[cfg(any(target_os = "freebsd",
209245
--
210-
2.11.0
246+
2.17.2 (Apple Git-113)
211247

0 commit comments

Comments
 (0)