|
1 | 1 | use std::{borrow::Cow, env};
|
2 | 2 |
|
3 | 3 | use crate::spec::{add_link_args, add_link_args_iter};
|
4 |
| -use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs}; |
5 |
| -use crate::spec::{LinkerFlavor, Lld, SplitDebuginfo, StaticCow, Target, TargetOptions}; |
| 4 | +use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs, LinkerFlavor, Lld}; |
| 5 | +use crate::spec::{SplitDebuginfo, StackProbeType, StaticCow, Target, TargetOptions}; |
6 | 6 |
|
7 | 7 | #[cfg(test)]
|
8 | 8 | mod tests;
|
@@ -81,6 +81,14 @@ impl Arch {
|
81 | 81 | Arm64_sim => "apple-a12",
|
82 | 82 | }
|
83 | 83 | }
|
| 84 | + |
| 85 | + fn stack_probes(self) -> StackProbeType { |
| 86 | + match self { |
| 87 | + Armv7k | Armv7s => StackProbeType::None, |
| 88 | + Arm64 | Arm64e | Arm64_32 | I386 | I686 | X86_64 | X86_64h | X86_64_sim |
| 89 | + | X86_64_macabi | Arm64_macabi | Arm64_sim => StackProbeType::Inline, |
| 90 | + } |
| 91 | + } |
84 | 92 | }
|
85 | 93 |
|
86 | 94 | 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 {
|
147 | 155 | abi_return_struct_as_int: true,
|
148 | 156 | emit_debug_gdb_scripts: false,
|
149 | 157 | eh_frame_header: false,
|
| 158 | + stack_probes: arch.stack_probes(), |
150 | 159 |
|
151 | 160 | debuginfo_kind: DebuginfoKind::DwarfDsym,
|
152 | 161 | // The historical default for macOS targets is to run `dsymutil` which
|
|
0 commit comments