Skip to content

Commit

Permalink
Auto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa
Browse files Browse the repository at this point in the history
Haiku: several smaller fixes to build and run rust on Haiku

This PR combines three small patches that help Rust build and run on the Haiku platform. These patches do not intend to impact other platforms.
  • Loading branch information
bors committed Jul 6, 2018
2 parents 3ea16c3 + bbe45ce commit e06c875
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Expand Up @@ -178,7 +178,7 @@ mod toolstate;
#[cfg(windows)]
mod job;

#[cfg(unix)]
#[cfg(all(unix, not(target_os = "haiku")))]
mod job {
use libc;

Expand All @@ -189,7 +189,7 @@ mod job {
}
}

#[cfg(not(any(unix, windows)))]
#[cfg(any(target_os = "haiku", not(any(unix, windows))))]
mod job {
pub unsafe fn setup(_build: &mut ::Build) {
}
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_target/spec/x86_64_unknown_haiku.rs
Expand Up @@ -16,6 +16,8 @@ pub fn target() -> TargetResult {
base.max_atomic_width = Some(64);
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.stack_probes = true;
// This option is required to build executables on Haiku x86_64
base.position_independent_executables = true;

Ok(Target {
llvm_target: "x86_64-unknown-haiku".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion src/libstd/build.rs
Expand Up @@ -121,7 +121,8 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> {
if !target.contains("apple-ios") &&
!target.contains("solaris") &&
!target.contains("redox") &&
!target.contains("android") {
!target.contains("android") &&
!target.contains("haiku") {
build.define("HAVE_DL_ITERATE_PHDR", "1");
}
build.define("_GNU_SOURCE", "1");
Expand Down

0 comments on commit e06c875

Please sign in to comment.