about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-13 01:49:29 +0200
committerGitHub <noreply@github.com>2019-06-13 01:49:29 +0200
commit0d8d08d067294b8ddbfd3e6cdb1efb0f834e8f2e (patch)
tree8288d6ee84c90de88cef491a5afb209adf410e79
parent96b58301a38e1c7bbcb2accfcdfea4132e52f3f3 (diff)
parent493d1b473a271e3fc8d332c6bf8e24930a7be597 (diff)
downloadrust-0d8d08d067294b8ddbfd3e6cdb1efb0f834e8f2e.tar.gz
rust-0d8d08d067294b8ddbfd3e6cdb1efb0f834e8f2e.zip
Rollup merge of #61675 - fintelia:riscv-frame-pointer, r=nagisa
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.
-rw-r--r--src/librustc_target/spec/riscv32imac_unknown_none_elf.rs1
-rw-r--r--src/librustc_target/spec/riscv32imc_unknown_none_elf.rs1
-rw-r--r--src/librustc_target/spec/riscv64gc_unknown_none_elf.rs1
-rw-r--r--src/librustc_target/spec/riscv64imac_unknown_none_elf.rs1
4 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs b/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
index 5064393d311..8a97a09bb60 100644
--- a/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
+++ b/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
@@ -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()
         },
     })
diff --git a/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs b/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs
index 31e74c5920c..647d33e3ffe 100644
--- a/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs
+++ b/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs
@@ -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()
         },
     })
diff --git a/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs b/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
index 2d4070c786f..a5c13fa28e2 100644
--- a/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
+++ b/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
@@ -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()
         },
     })
diff --git a/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs b/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
index f2e152c741e..237d615ffcc 100644
--- a/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
+++ b/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
@@ -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()
         },
     })