Auto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa

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.
This commit is contained in:
bors 2018-07-06 20:05:23 +00:00
commit e06c875442
3 changed files with 6 additions and 3 deletions

View file

@ -178,7 +178,7 @@ mod toolstate;
#[cfg(windows)]
mod job;
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "haiku")))]
mod job {
use libc;
@ -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) {
}

View file

@ -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(),

View file

@ -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");