]>
Commit | Line | Data |
---|---|---|
5869c6ff | 1 | use crate::spec::{LinkerFlavor, StackProbeType, Target, TargetOptions}; |
1a4d82fc | 2 | |
29967ef6 XL |
3 | pub fn target() -> Target { |
4 | let mut base = super::apple_base::opts("macos"); | |
85aaf69f | 5 | base.cpu = "core2".to_string(); |
c30ab7b3 | 6 | base.max_atomic_width = Some(128); // core2 support cmpxchg16b |
1a4d82fc | 7 | base.eliminate_frame_pointer = false; |
f9652781 XL |
8 | base.pre_link_args.insert( |
9 | LinkerFlavor::Gcc, | |
10 | vec!["-m64".to_string(), "-arch".to_string(), "x86_64".to_string()], | |
11 | ); | |
e1599b0c | 12 | base.link_env_remove.extend(super::apple_base::macos_link_env_remove()); |
6a06907d | 13 | base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) }; |
1a4d82fc | 14 | |
48663c56 XL |
15 | // Clang automatically chooses a more specific target based on |
16 | // MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work | |
17 | // correctly, we do too. | |
18 | let arch = "x86_64"; | |
19 | let llvm_target = super::apple_base::macos_llvm_target(&arch); | |
20 | ||
29967ef6 | 21 | Target { |
ba9703b0 | 22 | llvm_target, |
29967ef6 | 23 | pointer_width: 64, |
dfeec247 XL |
24 | data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
25 | .to_string(), | |
48663c56 | 26 | arch: arch.to_string(), |
29967ef6 XL |
27 | options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base }, |
28 | } | |
1a4d82fc | 29 | } |