|
| 1 | +use super::apple_base::{macos_link_env_remove, macos_llvm_target, opts, Arch}; |
1 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
|
2 | 3 |
|
3 | 4 | pub fn target() -> Target {
|
4 |
| - let arch = "arm64"; |
5 |
| - let mut base = super::apple_base::opts("macos", arch, ""); |
| 5 | + let arch = Arch::Arm64; |
| 6 | + let mut base = opts("macos", arch); |
6 | 7 | base.cpu = "apple-a14".into();
|
7 | 8 | base.max_atomic_width = Some(128);
|
8 | 9 |
|
9 | 10 | // FIXME: The leak sanitizer currently fails the tests, see #88132.
|
10 | 11 | base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD;
|
11 | 12 |
|
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(arch); |
| 13 | + base.link_env_remove.to_mut().extend(macos_link_env_remove()); |
18 | 14 |
|
19 | 15 | Target {
|
20 |
| - llvm_target: llvm_target.into(), |
| 16 | + // Clang automatically chooses a more specific target based on |
| 17 | + // MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work |
| 18 | + // correctly, we do too. |
| 19 | + llvm_target: macos_llvm_target(arch).into(), |
21 | 20 | pointer_width: 64,
|
22 | 21 | data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
|
23 |
| - arch: "aarch64".into(), |
| 22 | + arch: arch.target_arch(), |
24 | 23 | options: TargetOptions {
|
25 | 24 | mcount: "\u{1}mcount".into(),
|
26 | 25 | frame_pointer: FramePointer::NonLeaf,
|
|
0 commit comments