]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_target/src/spec/i686_apple_darwin.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / compiler / rustc_target / src / spec / i686_apple_darwin.rs
CommitLineData
487cf647 1use super::apple_base::{macos_llvm_target, opts, Arch};
2b03887a 2use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions};
1a4d82fc 3
29967ef6 4pub fn target() -> Target {
487cf647
FG
5 // ld64 only understands i386 and not i686
6 let arch = Arch::I386;
7 let mut base = opts("macos", arch);
c30ab7b3 8 base.max_atomic_width = Some(64);
2b03887a 9 base.add_pre_link_args(LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-m32"]);
2b03887a 10 base.stack_probes = StackProbeType::X86;
136023e0 11 base.frame_pointer = FramePointer::Always;
1a4d82fc 12
29967ef6 13 Target {
487cf647 14 // Clang automatically chooses a more specific target based on
9c376795 15 // MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work
487cf647
FG
16 // correctly, we do too.
17 //
18 // While ld64 doesn't understand i686, LLVM does.
19 llvm_target: macos_llvm_target(Arch::I686).into(),
29967ef6 20 pointer_width: 32,
dfeec247
XL
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"
5e7ed085 23 .into(),
487cf647 24 arch: arch.target_arch(),
5e7ed085 25 options: TargetOptions { mcount: "\u{1}mcount".into(), ..base },
29967ef6 26 }
1a4d82fc 27}