Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haiku: several smaller fixes to build and run rust on Haiku #51757

Merged
merged 3 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ mod toolstate;
#[cfg(windows)]
mod job;

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

Expand All @@ -188,7 +188,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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