]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
Auto merge of #77618 - fusion-engineering-forks:windows-parker, r=Amanieu
[rust.git] / compiler / rustc_target / src / spec / x86_64_apple_darwin.rs
1 use crate::spec::{LinkerFlavor, Target, TargetOptions};
2
3 pub fn target() -> Target {
4     let mut base = super::apple_base::opts("macos");
5     base.cpu = "core2".to_string();
6     base.max_atomic_width = Some(128); // core2 support cmpxchg16b
7     base.eliminate_frame_pointer = false;
8     base.pre_link_args.insert(
9         LinkerFlavor::Gcc,
10         vec!["-m64".to_string(), "-arch".to_string(), "x86_64".to_string()],
11     );
12     base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
13     base.stack_probes = true;
14
15     // Clang automatically chooses a more specific target based on
16     // MACOSX_DEPLOYMENT_TARGET.  To enable cross-language LTO to work
17     // correctly, we do too.
18     let arch = "x86_64";
19     let llvm_target = super::apple_base::macos_llvm_target(&arch);
20
21     Target {
22         llvm_target,
23         pointer_width: 64,
24         data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
25             .to_string(),
26         arch: arch.to_string(),
27         options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
28     }
29 }