0
0
Fork 0
haikuports/dev-lang/rust/patches/rust-1.17.0.patchset

229 lines
8.6 KiB
Plaintext

From 29a293b243ccc2af78b471af767176713a3c8468 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Wed, 20 Sep 2017 07:26:48 +0000
Subject: [PATCH 1/6] Haiku: disable rpath as standard option on the compiler
---
src/librustc_back/target/haiku_base.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs
index bfdc9fa..3fd0389 100644
--- a/src/librustc_back/target/haiku_base.rs
+++ b/src/librustc_back/target/haiku_base.rs
@@ -16,7 +16,7 @@ pub fn opts() -> TargetOptions {
linker: "cc".to_string(),
dynamic_linking: true,
executables: true,
- has_rpath: true,
+ has_rpath: false,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
.. Default::default()
--
2.7.0
From 3f4cea9e6f171322f04e28b0057cda30c916c46d Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Wed, 20 Sep 2017 07:27:38 +0000
Subject: [PATCH 2/6] Haiku: add missing F_RDLCK constant
---
src/librustc_data_structures/flock.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs
index 26417e3..32f0fd4 100644
--- a/src/librustc_data_structures/flock.rs
+++ b/src/librustc_data_structures/flock.rs
@@ -113,6 +113,7 @@ mod imp {
pub l_sysid: libc::c_int,
}
+ pub const F_RDLCK: libc::c_short = 0x0040;
pub const F_UNLCK: libc::c_short = 0x0200;
pub const F_WRLCK: libc::c_short = 0x0400;
pub const F_SETLK: libc::c_int = 0x0080;
--
2.7.0
From 1270fb2a678dbe246d6ed0135687b09aa3fe0ae3 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Wed, 20 Sep 2017 17:36:59 +0000
Subject: [PATCH 3/6] Haiku: reduce stack memory to 16MB (max on Haiku)
---
src/librustdoc/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 84f69cd..8c31464 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -98,7 +98,7 @@ struct Output {
}
pub fn main() {
- const STACK_SIZE: usize = 32_000_000; // 32MB
+ const STACK_SIZE: usize = 16_000_000; // 16MB on Haiku
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
let s = env::args().collect::<Vec<_>>();
main_args(&s)
--
2.7.0
From 9181d72c5d6199534714df0f4dc76d6961af7e16 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Mon, 9 Oct 2017 21:31:02 +0000
Subject: [PATCH 4/6] Haiku: link libunwind to libgcc_s
---
src/libunwind/build.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index ed3d521..d2d895a 100644
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -38,5 +38,7 @@ fn main() {
println!("cargo:rustc-link-lib=gcc_eh");
} else if target.contains("fuchsia") {
println!("cargo:rustc-link-lib=unwind");
+ } else if target.contains("haiku") {
+ println!("cargo:rustc-link-lib=gcc_s");
}
}
--
2.7.0
From c237d65e40d80bdd4f1a55e7dc2571bb2cc724bd Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Tue, 10 Oct 2017 06:32:35 +0000
Subject: [PATCH 5/6] Haiku: depend on a num_cpus package with Haiku support
---
src/Cargo.lock | 6 +++---
src/bootstrap/Cargo.toml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Cargo.lock b/src/Cargo.lock
index b34007d..50a22f1 100644
--- a/src/Cargo.lock
+++ b/src/Cargo.lock
@@ -68,7 +68,7 @@ dependencies = [
"gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -301,7 +301,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num_cpus"
-version = "0.2.13"
+version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -980,7 +980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum mdbook 0.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "06a68e8738e42b38a02755d3ce5fa12d559e17acb238e4326cbc3cc056e65280"
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
"checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99"
-"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
+"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584"
"checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842"
"checksum pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8"
"checksum pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1058d7bb927ca067656537eec4e02c2b4b70eaaa129664c5b90c111e20326f41"
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml
index 1eda160..6bcb4e6 100644
--- a/src/bootstrap/Cargo.toml
+++ b/src/bootstrap/Cargo.toml
@@ -27,7 +27,7 @@ test = false
build_helper = { path = "../build_helper" }
cmake = "0.1.17"
filetime = "0.1"
-num_cpus = "0.2"
+num_cpus = "1.4"
toml = "0.1"
getopts = "0.2"
rustc-serialize = "0.3"
--
2.7.0
From 7aeb3052d02f83dd85eb75f21306e2aa8c765077 Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Mon, 24 Apr 2017 14:21:36 +0000
Subject: [PATCH 6/6] Haiku: add missing cases of using LIBRARY_PATH
---
src/bootstrap/bootstrap.py | 3 +++
src/bootstrap/util.rs | 2 ++
src/librustc_back/dynamic_lib.rs | 2 ++
src/tools/compiletest/src/procsrv.rs | 2 ++
4 files changed, 9 insertions(+)
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index b326f95..1e9e2d4 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -364,6 +364,9 @@ class RustBuild(object):
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
(os.pathsep + env["DYLD_LIBRARY_PATH"]) \
if "DYLD_LIBRARY_PATH" in env else ""
+ env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
+ (os.pathsep + env["LIBRARY_PATH"]) \
+ if "LIBRARY_PATH" in env else ""
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
if not os.path.isfile(self.cargo()):
diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs
index dab20f4..e01c06b 100644
--- a/src/bootstrap/util.rs
+++ b/src/bootstrap/util.rs
@@ -139,6 +139,8 @@ pub fn dylib_path_var() -> &'static str {
"PATH"
} else if cfg!(target_os = "macos") {
"DYLD_LIBRARY_PATH"
+ } else if cfg!(target_os = "haiku") {
+ "LIBRARY_PATH"
} else {
"LD_LIBRARY_PATH"
}
diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs
index 38e6006..e6f305c 100644
--- a/src/librustc_back/dynamic_lib.rs
+++ b/src/librustc_back/dynamic_lib.rs
@@ -68,6 +68,8 @@ impl DynamicLibrary {
"PATH"
} else if cfg!(target_os = "macos") {
"DYLD_LIBRARY_PATH"
+ } else if cfg!(target_os = "haiku") {
+ "LIBRARY_PATH"
} else {
"LD_LIBRARY_PATH"
}
diff --git a/src/tools/compiletest/src/procsrv.rs b/src/tools/compiletest/src/procsrv.rs
index 7e4f40a..20933ad 100644
--- a/src/tools/compiletest/src/procsrv.rs
+++ b/src/tools/compiletest/src/procsrv.rs
@@ -20,6 +20,8 @@ pub fn dylib_env_var() -> &'static str {
"PATH"
} else if cfg!(target_os = "macos") {
"DYLD_LIBRARY_PATH"
+ } else if cfg!(target_os = "haiku") {
+ "LIBRARY_PATH"
} else {
"LD_LIBRARY_PATH"
}
--
2.7.0