about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-09 20:51:34 +0000
committerbors <bors@rust-lang.org>2023-08-09 20:51:34 +0000
commit08d00b40aef2017fe6dba3ff7d6476efa0c10888 (patch)
tree3ab94eb73722a6850545db6ab4e837ca8989d8ec /compiler/rustc_codegen_cranelift/src/lib.rs
parent27a43f083480a3a2a02a544a8ab6030aaab73a53 (diff)
parent37751893cce65bc707bdc017b81e40bd241ed2d1 (diff)
downloadrust-08d00b40aef2017fe6dba3ff7d6476efa0c10888.tar.gz
rust-08d00b40aef2017fe6dba3ff7d6476efa0c10888.zip
Auto merge of #114666 - bjorn3:sync_cg_clif-2023-08-09, r=bjorn3
Sync rustc_codegen_cranelift

A couple of small bug fixes this time. In addition I fixed the test suite after the introduction of `#![deny(internal_feature)]` broke it.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/lib.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs
index ebd153cb71d..d01ded8abaa 100644
--- a/compiler/rustc_codegen_cranelift/src/lib.rs
+++ b/compiler/rustc_codegen_cranelift/src/lib.rs
@@ -260,6 +260,13 @@ fn build_isa(sess: &Session, backend_config: &BackendConfig) -> Arc<dyn isa::Tar
     flags_builder.set("enable_verifier", enable_verifier).unwrap();
     flags_builder.set("regalloc_checker", enable_verifier).unwrap();
 
+    let preserve_frame_pointer = sess.target.options.frame_pointer
+        != rustc_target::spec::FramePointer::MayOmit
+        || matches!(sess.opts.cg.force_frame_pointers, Some(true));
+    if preserve_frame_pointer {
+        flags_builder.set("preserve_frame_pointers", "true").unwrap();
+    }
+
     let tls_model = match target_triple.binary_format {
         BinaryFormat::Elf => "elf_gd",
         BinaryFormat::Macho => "macho",