]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/i686_apple_darwin.rs
Rollup merge of #106886 - dtolnay:fastinstall, r=Mark-Simulacrum
[rust.git] / compiler / rustc_target / src / spec / i686_apple_darwin.rs
1 use super::apple_base::{macos_llvm_target, opts, Arch};
2 use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions};
3
4 pub fn target() -> Target {
5     // ld64 only understands i386 and not i686
6     let arch = Arch::I386;
7     let mut base = opts("macos", arch);
8     base.max_atomic_width = Some(64);
9     base.add_pre_link_args(LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-m32"]);
10     base.stack_probes = StackProbeType::X86;
11     base.frame_pointer = FramePointer::Always;
12
13     Target {
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         //
18         // While ld64 doesn't understand i686, LLVM does.
19         llvm_target: macos_llvm_target(Arch::I686).into(),
20         pointer_width: 32,
21         data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
22             f64:32:64-f80:128-n8:16:32-S128"
23             .into(),
24         arch: arch.target_arch(),
25         options: TargetOptions { mcount: "\u{1}mcount".into(), ..base },
26     }
27 }