]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #61675 - fintelia:riscv-frame-pointer, r=nagisa
authorMazdak Farrokhzad <twingoow@gmail.com>
Wed, 12 Jun 2019 23:49:29 +0000 (01:49 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2019 23:49:29 +0000 (01:49 +0200)
Include frame pointer for bare metal RISC-V targets

This changes the default setting to enable the use of the frame pointer register when targeting RISC-V. On that architecture there is a dedicated frame pointer register which LLVM would otherwise never use so there is no increase in register pressure. Further, since these are bare metal targets, getting backtraces without the frame pointer is considerably more difficult (you can't just ask the OS to load the ELF executable and parse DWARF symbols). It is true that this setting can also be changed with the `-C force-frame-pointers` flag but that won't impact the compilation of the standard library, meaning that backtraces from, say, a panic handler would be useless.

src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
src/librustc_target/spec/riscv32imc_unknown_none_elf.rs
src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
src/librustc_target/spec/riscv64imac_unknown_none_elf.rs

index 5064393d31135b89800afa9bf499a1c4783ca2a2..8a97a09bb60aa5c71f5c2b5ac238ccc868bcc156 100644 (file)
@@ -25,6 +25,7 @@ pub fn target() -> TargetResult {
             relocation_model: "static".to_string(),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
+            eliminate_frame_pointer: false,
             .. Default::default()
         },
     })
index 31e74c5920cf9207396d06662dd39e587ff6a1ac..647d33e3ffeeed91ea49ab8ca96f63b37f979e7d 100644 (file)
@@ -26,6 +26,7 @@ pub fn target() -> TargetResult {
             relocation_model: "static".to_string(),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
+            eliminate_frame_pointer: false,
             .. Default::default()
         },
     })
index 2d4070c786fed8679728968120555d3619518f8e..a5c13fa28e2cedeefb09ec45aeec77d0951d6191 100644 (file)
@@ -25,6 +25,7 @@ pub fn target() -> TargetResult {
             relocation_model: "static".to_string(),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
+            eliminate_frame_pointer: false,
             .. Default::default()
         },
     })
index f2e152c741e02c4af7b0af8b40082e456c8dbab0..237d615ffcc4b6cd463df06c19f2b88d1cb4abc6 100644 (file)
@@ -25,6 +25,7 @@ pub fn target() -> TargetResult {
             relocation_model: "static".to_string(),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
+            eliminate_frame_pointer: false,
             .. Default::default()
         },
     })