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