mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-10 22:00:09 +02:00
174 lines
7.5 KiB
Plaintext
174 lines
7.5 KiB
Plaintext
From 8be1b79b06dae145da5300a17b59618e1db3b0d3 Mon Sep 17 00:00:00 2001
|
|
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
|
|
Date: Wed, 5 Jun 2019 20:01:20 +0200
|
|
Subject: Add Haiku-specific patches for Rust 1.33.0
|
|
|
|
|
|
diff --git a/Cargo.lock b/Cargo.lock
|
|
index 9f2bba2..c44be08 100644
|
|
--- a/Cargo.lock
|
|
+++ b/Cargo.lock
|
|
@@ -1164,7 +1164,7 @@ dependencies = [
|
|
"cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"curl-sys 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
- "libssh2-sys 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
+ "libssh2-sys 0.2.11 (git+https://github.com/alexcrichton/ssh2-rs?rev=74d7f04)",
|
|
"libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
@@ -1182,7 +1182,7 @@ dependencies = [
|
|
[[package]]
|
|
name = "libssh2-sys"
|
|
version = "0.2.11"
|
|
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
+source = "git+https://github.com/alexcrichton/ssh2-rs?rev=74d7f04#74d7f04dbee9997510bdad5608bb06970c6b4c8a"
|
|
dependencies = [
|
|
"cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
@@ -1813,7 +1813,7 @@ name = "rand_chacha"
|
|
version = "0.1.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
- "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
+ "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
@@ -1835,7 +1835,7 @@ name = "rand_hc"
|
|
version = "0.1.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
- "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
+ "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
@@ -1860,7 +1860,7 @@ name = "rand_xorshift"
|
|
version = "0.1.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
- "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
+ "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
@@ -3495,7 +3495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
"checksum libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)" = "023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd"
|
|
"checksum libgit2-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "48441cb35dc255da8ae72825689a95368bf510659ae1ad55dc4aa88cb1789bf1"
|
|
"checksum libnghttp2-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d75d7966bda4730b722d1eab8e668df445368a24394bae9fc1e8dc0ab3dbe4f4"
|
|
-"checksum libssh2-sys 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d"
|
|
+"checksum libssh2-sys 0.2.11 (git+https://github.com/alexcrichton/ssh2-rs?rev=74d7f04)" = "<none>"
|
|
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
|
|
"checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
|
|
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
|
|
diff --git a/Cargo.toml b/Cargo.toml
|
|
index cb3c0ee..1bb1bca 100644
|
|
--- a/Cargo.toml
|
|
+++ b/Cargo.toml
|
|
@@ -59,6 +59,7 @@ cargo = { path = "src/tools/cargo" }
|
|
# that we're shipping as well (to ensure that the rustfmt in RLS and the
|
|
# `rustfmt` executable are the same exact version).
|
|
rustfmt-nightly = { path = "src/tools/rustfmt" }
|
|
+libssh2-sys = { git = "https://github.com/alexcrichton/ssh2-rs", rev = "74d7f04" }
|
|
|
|
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
|
|
# here
|
|
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
|
|
index 889e1ec..f7166ef 100644
|
|
--- a/src/librustc_driver/lib.rs
|
|
+++ b/src/librustc_driver/lib.rs
|
|
@@ -1443,9 +1443,14 @@ fn parse_crate_attrs<'a>(sess: &'a Session, input: &Input) -> PResult<'a, Vec<as
|
|
}
|
|
|
|
// Temporarily have stack size set to 32MB to deal with various crates with long method
|
|
-// chains or deep syntax trees.
|
|
+// chains or deep syntax trees, except when on Haiku
|
|
// FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line
|
|
-const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB
|
|
+
|
|
+#[cfg(not(target_os = "haiku"))]
|
|
+const STACK_SIZE: usize = 32 * 1024 * 1024;
|
|
+
|
|
+#[cfg(target_os = "haiku")]
|
|
+const STACK_SIZE: usize = 16 * 1024 * 1024;
|
|
|
|
/// Runs `f` in a suitable thread for running `rustc`; returns a `Result` with either the return
|
|
/// value of `f` or -- if a panic occurs -- the panic value.
|
|
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
|
|
index e29557f..c2d4692 100644
|
|
--- a/src/libstd/sys/unix/thread.rs
|
|
+++ b/src/libstd/sys/unix/thread.rs
|
|
@@ -167,8 +167,7 @@ impl Thread {
|
|
unsafe {
|
|
let ret = libc::pthread_join(self.id, ptr::null_mut());
|
|
mem::forget(self);
|
|
- assert!(ret == 0,
|
|
- "failed to join thread: {}", io::Error::from_raw_os_error(ret));
|
|
+ debug_assert_eq!(ret, 0);
|
|
}
|
|
}
|
|
|
|
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
|
|
index 28fd4df..feb7954 100644
|
|
--- a/src/libstd/sys/windows/c.rs
|
|
+++ b/src/libstd/sys/windows/c.rs
|
|
@@ -264,7 +264,6 @@ pub const FILE_END: DWORD = 2;
|
|
|
|
pub const WAIT_OBJECT_0: DWORD = 0x00000000;
|
|
pub const WAIT_TIMEOUT: DWORD = 258;
|
|
-pub const WAIT_FAILED: DWORD = 0xFFFFFFFF;
|
|
|
|
#[cfg(target_env = "msvc")]
|
|
#[cfg(feature = "backtrace")]
|
|
diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs
|
|
index bd7cb67..695f2bf 100644
|
|
--- a/src/libstd/sys/windows/thread.rs
|
|
+++ b/src/libstd/sys/windows/thread.rs
|
|
@@ -58,11 +58,7 @@ impl Thread {
|
|
}
|
|
|
|
pub fn join(self) {
|
|
- let rc = unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE) };
|
|
- if rc == c::WAIT_FAILED {
|
|
- panic!("failed to join on thread: {}",
|
|
- io::Error::last_os_error());
|
|
- }
|
|
+ unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE); }
|
|
}
|
|
|
|
pub fn yield_now() {
|
|
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
|
|
index a55b32c..12f9617 100644
|
|
--- a/src/libstd/thread/mod.rs
|
|
+++ b/src/libstd/thread/mod.rs
|
|
@@ -1432,11 +1432,6 @@ impl<T> JoinHandle<T> {
|
|
/// [`panic`]: ../../std/macro.panic.html
|
|
/// [atomic memory orderings]: ../../std/sync/atomic/index.html
|
|
///
|
|
- /// # Panics
|
|
- ///
|
|
- /// This function may panic on some platforms if a thread attempts to join
|
|
- /// itself or otherwise may create a deadlock with joining threads.
|
|
- ///
|
|
/// # Examples
|
|
///
|
|
/// ```
|
|
diff --git a/src/llvm/lib/Support/Unix/Signals.inc b/src/llvm/lib/Support/Unix/Signals.inc
|
|
index ad88d5e..9d320b7 100644
|
|
--- a/src/llvm/lib/Support/Unix/Signals.inc
|
|
+++ b/src/llvm/lib/Support/Unix/Signals.inc
|
|
@@ -47,7 +47,9 @@
|
|
#include "llvm/Support/raw_ostream.h"
|
|
#include <algorithm>
|
|
#include <string>
|
|
+#define _BSD_SOURCE
|
|
#include <sysexits.h>
|
|
+#undef _BSD_SOURCE
|
|
#ifdef HAVE_BACKTRACE
|
|
# include BACKTRACE_HEADER // For backtrace().
|
|
#endif
|
|
--
|
|
2.19.0
|
|
|