Haiku: Adjust haiku target to match new librustc_back design

This commit is contained in:
Alexander von Gluck IV 2016-09-25 16:55:40 -05:00
parent 8ec1d21ffa
commit 7e91b86707
4 changed files with 44 additions and 26 deletions

View File

@ -0,0 +1,23 @@
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use target::TargetOptions;
use std::default::Default;
pub fn opts() -> TargetOptions {
TargetOptions {
linker: "cc".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: true,
linker_is_gnu: true,
.. Default::default()
}
}

View File

@ -8,12 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use target::Target;
use target::TargetOptions;
use std::default::Default;
use target::{Target, TargetResult};
pub fn target() -> Target {
Target {
pub fn target() -> TargetResult {
let mut base = super::haiku_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m32".to_string());
Ok(Target {
llvm_target: "i686-unknown-haiku".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
@ -22,12 +25,6 @@ pub fn target() -> Target {
target_os: "haiku".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: TargetOptions {
linker: "cc".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: true,
.. Default::default()
},
}
options: base,
})
}

View File

@ -56,6 +56,7 @@
mod bitrig_base;
mod dragonfly_base;
mod freebsd_base;
mod haiku_base;
mod linux_base;
mod linux_musl_base;
mod openbsd_base;

View File

@ -8,12 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use target::Target;
use target::TargetOptions;
use std::default::Default;
use target::{Target, TargetResult};
pub fn target() -> Target {
Target {
pub fn target() -> TargetResult {
let mut base = super::haiku_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m64".to_string());
Ok(Target {
llvm_target: "x86_64-unknown-haiku".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
@ -22,12 +25,6 @@ pub fn target() -> Target {
target_os: "haiku".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: TargetOptions {
linker: "cc".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: true,
.. Default::default()
},
}
options: base,
})
}