]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/i686_apple_darwin.rs
Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix
[rust.git] / compiler / rustc_target / src / spec / i686_apple_darwin.rs
1 use crate::spec::{FramePointer, LinkerFlavor, StackProbeType, Target, TargetOptions};
2
3 pub fn target() -> Target {
4     let mut base = super::apple_base::opts("macos");
5     base.cpu = "yonah".into();
6     base.max_atomic_width = Some(64);
7     base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".into()]);
8     base.link_env_remove.to_mut().extend(super::apple_base::macos_link_env_remove());
9     // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
10     base.stack_probes = StackProbeType::Call;
11     base.frame_pointer = FramePointer::Always;
12
13     // Clang automatically chooses a more specific target based on
14     // MACOSX_DEPLOYMENT_TARGET.  To enable cross-language LTO to work
15     // correctly, we do too.
16     let arch = "i686";
17     let llvm_target = super::apple_base::macos_llvm_target(&arch);
18
19     Target {
20         llvm_target: llvm_target.into(),
21         pointer_width: 32,
22         data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
23             f64:32:64-f80:128-n8:16:32-S128"
24             .into(),
25         arch: "x86".into(),
26         options: TargetOptions { mcount: "\u{1}mcount".into(), ..base },
27     }
28 }