diff options
Diffstat (limited to 'compiler/rustc_target/src/spec/base/apple/mod.rs')
| -rw-r--r-- | compiler/rustc_target/src/spec/base/apple/mod.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_target/src/spec/base/apple/mod.rs b/compiler/rustc_target/src/spec/base/apple/mod.rs index 497994a5998..66c85146c29 100644 --- a/compiler/rustc_target/src/spec/base/apple/mod.rs +++ b/compiler/rustc_target/src/spec/base/apple/mod.rs @@ -2,8 +2,8 @@ use std::borrow::Cow; use std::env; use crate::spec::{ - Cc, DebuginfoKind, FloatAbi, FramePointer, LinkerFlavor, Lld, SplitDebuginfo, StackProbeType, - StaticCow, TargetOptions, cvs, + BinaryFormat, Cc, DebuginfoKind, FloatAbi, FramePointer, LinkerFlavor, Lld, RustcAbi, + SplitDebuginfo, StackProbeType, StaticCow, TargetOptions, cvs, }; #[cfg(test)] @@ -103,7 +103,7 @@ pub(crate) fn base( arch: Arch, abi: TargetAbi, ) -> (TargetOptions, StaticCow<str>, StaticCow<str>) { - let opts = TargetOptions { + let mut opts = TargetOptions { abi: abi.target_abi().into(), llvm_floatabi: Some(FloatAbi::Hard), os: os.into(), @@ -116,6 +116,7 @@ pub(crate) fn base( dynamic_linking: true, families: cvs!["unix"], is_like_osx: true, + binary_format: BinaryFormat::MachO, // LLVM notes that macOS 10.11+ and iOS 9+ default // to v4, so we do the same. // https://github.com/llvm/llvm-project/blob/378778a0d10c2f8d5df8ceff81f95b6002984a4b/clang/lib/Driver/ToolChains/Darwin.cpp#L1203 @@ -154,6 +155,10 @@ pub(crate) fn base( ..Default::default() }; + if matches!(arch, Arch::I386 | Arch::I686) { + // All Apple x86-32 targets have SSE2. + opts.rustc_abi = Some(RustcAbi::X86Sse2); + } (opts, unversioned_llvm_target(os, arch, abi), arch.target_arch()) } |
