]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
New upstream version 1.58.1+dfsg1
[rustc.git] / compiler / rustc_target / src / spec / x86_64_apple_darwin.rs
CommitLineData
136023e0
XL
1use crate::spec::TargetOptions;
2use crate::spec::{FramePointer, LinkerFlavor, SanitizerSet, StackProbeType, Target};
1a4d82fc 3
29967ef6
XL
4pub fn target() -> Target {
5 let mut base = super::apple_base::opts("macos");
85aaf69f 6 base.cpu = "core2".to_string();
c30ab7b3 7 base.max_atomic_width = Some(128); // core2 support cmpxchg16b
136023e0 8 base.frame_pointer = FramePointer::Always;
f9652781
XL
9 base.pre_link_args.insert(
10 LinkerFlavor::Gcc,
11 vec!["-m64".to_string(), "-arch".to_string(), "x86_64".to_string()],
12 );
e1599b0c 13 base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
36d6ef2b
XL
14 // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
15 base.stack_probes = StackProbeType::Call;
3c0e092e
XL
16 base.supported_sanitizers =
17 SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK | SanitizerSet::THREAD;
1a4d82fc 18
48663c56
XL
19 // Clang automatically chooses a more specific target based on
20 // MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work
21 // correctly, we do too.
22 let arch = "x86_64";
23 let llvm_target = super::apple_base::macos_llvm_target(&arch);
24
29967ef6 25 Target {
ba9703b0 26 llvm_target,
29967ef6 27 pointer_width: 64,
dfeec247
XL
28 data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
29 .to_string(),
48663c56 30 arch: arch.to_string(),
29967ef6
XL
31 options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
32 }
1a4d82fc 33}