about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2017-04-26 22:11:03 +0000
committerGitHub <noreply@github.com>2017-04-26 22:11:03 +0000
commit639000ea2e1ff688ceea6d61dc257e53b5efa918 (patch)
treebdd8d6adec2e903e12a865f399b1abb2c722621a
parenta3dde0b457b5c5fd736ce1ff1419d90646a93a15 (diff)
parent0d63f13378f8d8625a439ecbb36b3f97d0d2263d (diff)
Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichton
Haiku: fix initial platform support
-rw-r--r--src/bootstrap/bootstrap.py3
-rw-r--r--src/bootstrap/util.rs2
-rw-r--r--src/librustc_back/dynamic_lib.rs2
-rw-r--r--src/librustc_back/target/haiku_base.rs3
-rw-r--r--src/librustc_data_structures/flock.rs1
-rw-r--r--src/libunwind/build.rs2
-rw-r--r--src/tools/compiletest/src/procsrv.rs2
7 files changed, 14 insertions, 1 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 1dfc5593e5f..e5f8143b418 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 dab20f44bc3..e01c06b10fc 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 38e60060925..e6f305c22b2 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/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs
index bfdc9faaa8a..8e7f463563c 100644
--- a/src/librustc_back/target/haiku_base.rs
+++ b/src/librustc_back/target/haiku_base.rs
@@ -16,9 +16,10 @@ 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,
+        no_integrated_as: true,
         .. Default::default()
     }
 }
diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs
index 26417e3ba7c..32f0fd41997 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;
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index 9b8099d55a0..be9aa6c5d40 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");
     }
 }
diff --git a/src/tools/compiletest/src/procsrv.rs b/src/tools/compiletest/src/procsrv.rs
index 3d8f2296236..dbda8f4d802 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"
     }