Skip to content
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
9 changes: 9 additions & 0 deletions src/librustc_back/target/apple_ios_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use target::TargetOptions;
use self::Arch::*;

#[allow(non_camel_case_types)]
#[derive(Copy)]
pub enum Arch {
Armv7,
Armv7s,
Expand Down Expand Up @@ -70,8 +71,16 @@ fn pre_link_args(arch: Arch) -> Vec<String> {
"-Wl,-syslibroot".to_string(), get_sdk_root(sdk_name)]
}

fn target_cpu(arch: Arch) -> String {
match arch {
X86_64 => "x86-64",
_ => "generic",
}.to_string()
}

pub fn opts(arch: Arch) -> TargetOptions {
TargetOptions {
cpu: target_cpu(arch),
dynamic_linking: false,
executables: true,
// Although there is an experimental implementation of LLVM which
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/x86_64_apple_darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::apple_base::opts();
base.cpu = "x86-64".to_string();
base.eliminate_frame_pointer = false;
base.pre_link_args.push("-m64".to_string());

Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/x86_64_pc_windows_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::windows_base::opts();
base.cpu = "x86-64".to_string();
// On Win64 unwinding is handled by the OS, so we can link libgcc statically.
base.pre_link_args.push("-static-libgcc".to_string());
base.pre_link_args.push("-m64".to_string());
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/x86_64_unknown_dragonfly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::dragonfly_base::opts();
base.cpu = "x86-64".to_string();
base.pre_link_args.push("-m64".to_string());

Target {
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/x86_64_unknown_freebsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::freebsd_base::opts();
base.cpu = "x86-64".to_string();
base.pre_link_args.push("-m64".to_string());

Target {
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/x86_64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::linux_base::opts();
base.cpu = "x86-64".to_string();
base.pre_link_args.push("-m64".to_string());

Target {
Expand Down