]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
Auto merge of #97800 - pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext...
[rust.git] / compiler / rustc_target / src / spec / x86_64_apple_darwin.rs
1 use crate::spec::TargetOptions;
2 use crate::spec::{FramePointer, LinkerFlavor, SanitizerSet, StackProbeType, Target};
3
4 pub fn target() -> Target {
5     let arch = "x86_64";
6     let mut base = super::apple_base::opts("macos", arch, "");
7     base.cpu = "core2".into();
8     base.max_atomic_width = Some(128); // core2 support cmpxchg16b
9     base.frame_pointer = FramePointer::Always;
10     base.add_pre_link_args(LinkerFlavor::Gcc, &["-m64"]);
11     base.link_env_remove.to_mut().extend(super::apple_base::macos_link_env_remove());
12     // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
13     base.stack_probes = StackProbeType::Call;
14     base.supported_sanitizers =
15         SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK | SanitizerSet::THREAD;
16
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.
20     let llvm_target = super::apple_base::macos_llvm_target(&arch);
21
22     Target {
23         llvm_target: llvm_target.into(),
24         pointer_width: 64,
25         data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
26             .into(),
27         arch: arch.into(),
28         options: TargetOptions { mcount: "\u{1}mcount".into(), ..base },
29     }
30 }