Skip to content

Commit

Permalink
Merge pull request rust-lang#1388 from Kobzol/preserve-frame-pointer
Browse files Browse the repository at this point in the history
Pass `preserve_frame_pointers` to Cranelift
  • Loading branch information
bjorn3 authored Jul 29, 2023
2 parents 6641b3a + 92fb9c6 commit 85a99b3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 85a99b3

Please sign in to comment.