]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/aarch64_apple_darwin.rs
Rollup merge of #89685 - DeveloperC286:iter_fields_to_private, r=oli-obk
[rust.git] / compiler / rustc_target / src / spec / aarch64_apple_darwin.rs
1 use crate::spec::{FramePointer, LinkerFlavor, SanitizerSet, Target, TargetOptions};
2
3 pub fn target() -> Target {
4     let mut base = super::apple_base::opts("macos");
5     base.cpu = "apple-a14".into();
6     base.max_atomic_width = Some(128);
7
8     // FIXME: The leak sanitizer currently fails the tests, see #88132.
9     base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD;
10
11     base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-arch".into(), "arm64".into()]);
12     base.link_env_remove.to_mut().extend(super::apple_base::macos_link_env_remove());
13
14     // Clang automatically chooses a more specific target based on
15     // MACOSX_DEPLOYMENT_TARGET.  To enable cross-language LTO to work
16     // correctly, we do too.
17     let llvm_target = super::apple_base::macos_llvm_target("arm64");
18
19     Target {
20         llvm_target: llvm_target.into(),
21         pointer_width: 64,
22         data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
23         arch: "aarch64".into(),
24         options: TargetOptions {
25             mcount: "\u{1}mcount".into(),
26             frame_pointer: FramePointer::NonLeaf,
27             ..base
28         },
29     }
30 }