diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
commit | 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch) | |
tree | 3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /compiler/rustc_target/src/spec/apple_sdk_base.rs | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-f7f0cc2a5d72e2c61c1f6900e70eec992bea4273.tar.xz rustc-f7f0cc2a5d72e2c61c1f6900e70eec992bea4273.zip |
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_target/src/spec/apple_sdk_base.rs | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/compiler/rustc_target/src/spec/apple_sdk_base.rs b/compiler/rustc_target/src/spec/apple_sdk_base.rs index d77558f0f..49e302676 100644 --- a/compiler/rustc_target/src/spec/apple_sdk_base.rs +++ b/compiler/rustc_target/src/spec/apple_sdk_base.rs @@ -1,4 +1,4 @@ -use crate::spec::{cvs, LinkArgs, LinkerFlavor, LldFlavor, TargetOptions}; +use crate::spec::{cvs, TargetOptions}; use std::borrow::Cow; use Arch::*; @@ -61,53 +61,12 @@ fn link_env_remove(arch: Arch) -> Cow<'static, [Cow<'static, str>]> { } } -fn pre_link_args(os: &'static str, arch: Arch) -> LinkArgs { - let mut args = LinkArgs::new(); - - let target_abi = target_abi(arch); - - let platform_name = match target_abi { - "sim" => format!("{}-simulator", os), - "macabi" => "mac-catalyst".to_string(), - _ => os.to_string(), - }; - - let platform_version = match os.as_ref() { - "ios" => super::apple_base::ios_lld_platform_version(), - "tvos" => super::apple_base::tvos_lld_platform_version(), - "watchos" => super::apple_base::watchos_lld_platform_version(), - _ => unreachable!(), - }; - - let arch_str = target_arch_name(arch); - - if target_abi != "macabi" { - args.insert(LinkerFlavor::Gcc, vec!["-arch".into(), arch_str.into()]); - } - - args.insert( - LinkerFlavor::Lld(LldFlavor::Ld64), - vec![ - "-arch".into(), - arch_str.into(), - "-platform_version".into(), - platform_name.into(), - platform_version.clone().into(), - platform_version.into(), - ], - ); - - args -} - pub fn opts(os: &'static str, arch: Arch) -> TargetOptions { TargetOptions { abi: target_abi(arch).into(), cpu: target_cpu(arch).into(), - dynamic_linking: false, - pre_link_args: pre_link_args(os, arch), link_env_remove: link_env_remove(arch), has_thread_local: false, - ..super::apple_base::opts(os) + ..super::apple_base::opts(os, target_arch_name(arch), target_abi(arch)) } } |