]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/aarch64_apple_darwin.rs
Rollup merge of #89876 - AlexApps99:const_ops, 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-a12".to_string();
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".to_string(), "arm64".to_string()]);
12     base.link_env_remove.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 arch = "aarch64";
18     let llvm_target = super::apple_base::macos_llvm_target(&arch);
19
20     Target {
21         llvm_target,
22         pointer_width: 64,
23         data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
24         arch: arch.to_string(),
25         options: TargetOptions {
26             mcount: "\u{1}mcount".to_string(),
27             frame_pointer: FramePointer::NonLeaf,
28             ..base
29         },
30     }
31 }