1
Fork 0

allow specifying an ios version for the llvm target

This commit is contained in:
Patrick Amrein 2021-08-02 15:26:24 +02:00
parent 5998c2e9ad
commit 8f65d154c8
4 changed files with 9 additions and 3 deletions

View file

@ -92,6 +92,12 @@ fn ios_deployment_target() -> (u32, u32) {
} }
pub fn ios_llvm_target(arch: &str) -> String { pub fn ios_llvm_target(arch: &str) -> String {
// Modern iOS tooling extracts information about deployment target
// from LC_BUILD_VERSION. This load command will only be emitted when
// we build with a version specific `llvm_target`, with the version
// set high enough. Luckily one LC_BUILD_VERSION is enough, for Xcode
// to pick it up (since std and core are still built with the fallback
// of version 7.0 and hence emit the old LC_IPHONE_MIN_VERSION).
let (major, minor) = ios_deployment_target(); let (major, minor) = ios_deployment_target();
format!("{}-apple-ios{}.{}.0", arch, major, minor) format!("{}-apple-ios{}.{}.0", arch, major, minor)
} }

View file

@ -3,7 +3,7 @@ use crate::spec::{Target, TargetOptions};
pub fn target() -> Target { pub fn target() -> Target {
Target { Target {
llvm_target: "armv7-apple-ios".to_string(), llvm_target: super::apple_base::ios_llvm_target("armv7"),
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(), data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
arch: "arm".to_string(), arch: "arm".to_string(),

View file

@ -4,7 +4,7 @@ use crate::spec::{StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub fn target() -> Target {
let base = opts("ios", Arch::I386); let base = opts("ios", Arch::I386);
Target { Target {
llvm_target: "i386-apple-ios".to_string(), llvm_target: super::apple_base::ios_sim_llvm_target("i386"),
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\ data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
f64:32:64-f80:128-n8:16:32-S128" f64:32:64-f80:128-n8:16:32-S128"

View file

@ -4,7 +4,7 @@ use crate::spec::{StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub fn target() -> Target {
let base = opts("ios", Arch::X86_64); let base = opts("ios", Arch::X86_64);
Target { Target {
llvm_target: "x86_64-apple-ios".to_string(), llvm_target: super::apple_base::ios_sim_llvm_target("x86_64"),
pointer_width: 64, pointer_width: 64,
data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
.to_string(), .to_string(),