about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec/linux_kernel_base.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-07-01 11:15:41 +0200
committerGitHub <noreply@github.com>2021-07-01 11:15:41 +0200
commitdfd30d7b705f858603ef6d21bdb893297aea37ba (patch)
tree876cce9ffd5b0aed8aea98104c13115c71ca2231 /compiler/rustc_target/src/spec/linux_kernel_base.rs
parent052e8d5933c14a350093ef03f0df00192cff90c7 (diff)
parent9b67cba4f6294e0db900397cdf5c59c1dc901ade (diff)
downloadrust-dfd30d7b705f858603ef6d21bdb893297aea37ba.tar.gz
rust-dfd30d7b705f858603ef6d21bdb893297aea37ba.zip
Rollup merge of #86652 - nagisa:nagisa/non-leaf-fp, r=petrochenkov
Add support for leaf function frame pointer elimination

This PR adds ability for the target specifications to specify frame
pointer emission type that's not just “always” or “whatever cg decides”.

In particular there's a new mode that allows omission of the frame
pointer for leaf functions (those that don't call any other functions).

We then set this new mode for Aarch64-based Apple targets.

Fixes #86196
Diffstat (limited to 'compiler/rustc_target/src/spec/linux_kernel_base.rs')
-rw-r--r--compiler/rustc_target/src/spec/linux_kernel_base.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_target/src/spec/linux_kernel_base.rs b/compiler/rustc_target/src/spec/linux_kernel_base.rs
index 145aa4a5894..a332e3b847a 100644
--- a/compiler/rustc_target/src/spec/linux_kernel_base.rs
+++ b/compiler/rustc_target/src/spec/linux_kernel_base.rs
@@ -1,4 +1,5 @@
-use crate::spec::{PanicStrategy, RelocModel, RelroLevel, StackProbeType, TargetOptions};
+use crate::spec::TargetOptions;
+use crate::spec::{FramePointer, PanicStrategy, RelocModel, RelroLevel, StackProbeType};
 
 pub fn opts() -> TargetOptions {
     TargetOptions {
@@ -7,7 +8,7 @@ pub fn opts() -> TargetOptions {
         panic_strategy: PanicStrategy::Abort,
         // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
         stack_probes: StackProbeType::Call,
-        eliminate_frame_pointer: false,
+        frame_pointer: FramePointer::Always,
         position_independent_executables: true,
         needs_plt: true,
         relro_level: RelroLevel::Full,