]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichton
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Wed, 26 Apr 2017 22:11:03 +0000 (22:11 +0000)
committerGitHub <noreply@github.com>
Wed, 26 Apr 2017 22:11:03 +0000 (22:11 +0000)
Haiku: fix initial platform support

src/bootstrap/bootstrap.py
src/bootstrap/util.rs
src/librustc_back/dynamic_lib.rs
src/librustc_back/target/haiku_base.rs
src/librustc_data_structures/flock.rs
src/libunwind/build.rs
src/tools/compiletest/src/procsrv.rs

index 1dfc5593e5f5eca41444320bb9ea83096428621f..e5f8143b41871e424276c9958c786822a5293ffe 100644 (file)
@@ -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()):
index dab20f44bc361d4e18cdeb0d50fa1236ebe320c2..e01c06b10fcd63097de8a14f8b5e2b0f525bccb3 100644 (file)
@@ -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"
     }
index 38e60060925e6f59c4b5df25317b59526e10cbde..e6f305c22b2d4f621a1b7ecc0c4ac2ddd8fb261a 100644 (file)
@@ -68,6 +68,8 @@ pub fn envvar() -> &'static str {
             "PATH"
         } else if cfg!(target_os = "macos") {
             "DYLD_LIBRARY_PATH"
+        } else if cfg!(target_os = "haiku") {
+            "LIBRARY_PATH"
         } else {
             "LD_LIBRARY_PATH"
         }
index bfdc9faaa8a736b37addb6b2c67868ca5cf37c63..8e7f463563c38e947d1775cde793d35cfac86aa1 100644 (file)
@@ -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()
     }
 }
index 26417e3ba7cd1ef825662510bf3638cba933093c..32f0fd4199776656b52c81ba80b3568097370039 100644 (file)
@@ -113,6 +113,7 @@ pub struct flock {
             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;
index 9b8099d55a024eea1e7e8f80a2f6049c76c6aed4..be9aa6c5d40ba7f3d35697f183432145934fb5d7 100644 (file)
@@ -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");
     }
 }
index 3d8f2296236a2014c6c60df5657c7ab5fd522b26..dbda8f4d802c02a0f6689a7709a59fd8aea7602a 100644 (file)
@@ -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"
     }