Target stack-probe support configurable finely

This adds capability to configure the target's stack probe support in a
more precise manner than just on/off. In particular now we allow
choosing between always inline-asm, always call or either one of those
depending on the LLVM version on a per-target basis.
This commit is contained in:
Simonas Kazlauskas
2021-01-09 16:54:20 +02:00
parent efdb859dcd
commit 007080b607
35 changed files with 203 additions and 87 deletions

View File

@@ -1,4 +1,6 @@
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, RelroLevel, TargetOptions};
use crate::spec::{
LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, RelroLevel, StackProbeType, TargetOptions,
};
pub fn opts() -> TargetOptions {
let mut pre_link_args = LinkArgs::new();
@@ -11,7 +13,7 @@ pub fn opts() -> TargetOptions {
env: "gnu".to_string(),
disable_redzone: true,
panic_strategy: PanicStrategy::Abort,
stack_probes: true,
stack_probes: StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) },
eliminate_frame_pointer: false,
linker_is_gnu: true,
position_independent_executables: true,