mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-10 22:00:09 +02:00
229 lines
8.7 KiB
Plaintext
229 lines
8.7 KiB
Plaintext
From f8a252b85663a5bedb19b8a3a284124f46d392ef 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 c31264103ad45685d400ad213b924d87ac016d85 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 cf245f081dc220efb6645f3c06e07745a1eadd91 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 2a6134f..5c126fc 100644
|
|
--- a/src/librustdoc/lib.rs
|
|
+++ b/src/librustdoc/lib.rs
|
|
@@ -102,7 +102,7 @@ struct Output {
|
|
}
|
|
|
|
pub fn main() {
|
|
- const STACK_SIZE: usize = 32_000_000; // 32MB
|
|
+ const STACK_SIZE: usize = 16_000_000; // 16MB on Haiku
|
|
env_logger::init().unwrap();
|
|
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
|
|
let s = env::args().collect::<Vec<_>>();
|
|
--
|
|
2.7.0
|
|
|
|
|
|
From d4df22eed703c3b8413a0dee4a71807a23c66f20 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 9b8099d..15557ad 100644
|
|
--- a/src/libunwind/build.rs
|
|
+++ b/src/libunwind/build.rs
|
|
@@ -39,5 +39,7 @@ fn main() {
|
|
println!("cargo:rustc-link-lib=static-nobundle=pthread");
|
|
} 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 816c3c70b1c7bd051bfb09ad20043f5da696e02e 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 f4c3571..0b785a3 100644
|
|
--- a/src/Cargo.lock
|
|
+++ b/src/Cargo.lock
|
|
@@ -78,7 +78,7 @@ dependencies = [
|
|
"gcc 0.3.45 (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.23 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
@@ -299,7 +299,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)",
|
|
@@ -1004,7 +1004,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
"checksum mdbook 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "2598843aeda0c5bb2e8e4d714564f1c3fc40f7844157e34563bf96ae3866b56e"
|
|
"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.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab1e588ef8efd702c7ed9d2bd774db5e6f4d878bb5a1a9f371828fbdff6973"
|
|
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 e9d851a1e77448b9f06d0e868b20ea744bd4eff3 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 6cd9496..5d05db0 100644
|
|
--- a/src/bootstrap/bootstrap.py
|
|
+++ b/src/bootstrap/bootstrap.py
|
|
@@ -367,6 +367,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 3d8f229..dbda8f4 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
|
|
|