Skip to content

Commit

Permalink
Rollup merge of rust-lang#41456 - jessicah:haiku-support, r=alexcrichton
Browse files Browse the repository at this point in the history
Haiku: fix initial platform support
  • Loading branch information
frewsxcv authored Apr 26, 2017
2 parents 27bbf70 + 0d63f13 commit 64eebc9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ def build_bootstrap(self):
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()):
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_back/dynamic_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_back/target/haiku_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
1 change: 1 addition & 0 deletions src/librustc_data_structures/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/libunwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 0 deletions src/tools/compiletest/src/procsrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 64eebc9

Please sign in to comment.