]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/aarch64_apple_darwin.rs
Translate counters from Rust 1-based to LLVM 0-based counter ids
[rust.git] / compiler / rustc_target / src / spec / aarch64_apple_darwin.rs
1 use crate::spec::{LinkerFlavor, 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     base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-arch".to_string(), "arm64".to_string()]);
8
9     base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
10
11     // Clang automatically chooses a more specific target based on
12     // MACOSX_DEPLOYMENT_TARGET.  To enable cross-language LTO to work
13     // correctly, we do too.
14     let arch = "aarch64";
15     let llvm_target = super::apple_base::macos_llvm_target(&arch);
16
17     Target {
18         llvm_target,
19         pointer_width: 64,
20         data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
21         arch: arch.to_string(),
22         options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
23     }
24 }