diff options
| author | Josh Stone <jistone@redhat.com> | 2023-12-12 17:26:51 -0800 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2023-12-12 17:26:51 -0800 |
| commit | 233de9d89eae58bebfb59341bd01bb6be80a80f1 (patch) | |
| tree | e6ff56ecfa8562f723991138e0f7577968ef3c4f /compiler/rustc_target/src/spec/base | |
| parent | b99b5e57521783d2d70a1ee2bcfdf59b25b68fdf (diff) | |
Set the `StackProbeType` in `apple::opts`
Diffstat (limited to 'compiler/rustc_target/src/spec/base')
| -rw-r--r-- | compiler/rustc_target/src/spec/base/apple/mod.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/rustc_target/src/spec/base/apple/mod.rs b/compiler/rustc_target/src/spec/base/apple/mod.rs index f32cb06d68f..afd60b40c3b 100644 --- a/compiler/rustc_target/src/spec/base/apple/mod.rs +++ b/compiler/rustc_target/src/spec/base/apple/mod.rs @@ -1,8 +1,8 @@ use std::{borrow::Cow, env}; use crate::spec::{add_link_args, add_link_args_iter}; -use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs}; -use crate::spec::{LinkerFlavor, Lld, SplitDebuginfo, StaticCow, Target, TargetOptions}; +use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs, LinkerFlavor, Lld}; +use crate::spec::{SplitDebuginfo, StackProbeType, StaticCow, Target, TargetOptions}; #[cfg(test)] mod tests; @@ -81,6 +81,14 @@ impl Arch { Arm64_sim => "apple-a12", } } + + fn stack_probes(self) -> StackProbeType { + match self { + Armv7k | Armv7s => StackProbeType::None, + Arm64 | Arm64e | Arm64_32 | I386 | I686 | X86_64 | X86_64h | X86_64_sim + | X86_64_macabi | Arm64_macabi | Arm64_sim => StackProbeType::Inline, + } + } } fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs { @@ -147,6 +155,7 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions { abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, eh_frame_header: false, + stack_probes: arch.stack_probes(), debuginfo_kind: DebuginfoKind::DwarfDsym, // The historical default for macOS targets is to run `dsymutil` which |
