about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-07 01:14:42 +0000
committerbors <bors@rust-lang.org>2019-07-07 01:14:42 +0000
commit4393768faa104b9879c601feee71eb0207dc4fe1 (patch)
tree4b539e955b6e013313cf4529a44e3567ef9ea23d
parentb0bd5f236d9bea38b8c9048f379fec179b09984c (diff)
parentc65ffa789d57004db42f6c30405c59e0a5bae330 (diff)
downloadrust-4393768faa104b9879c601feee71eb0207dc4fe1.tar.gz
rust-4393768faa104b9879c601feee71eb0207dc4fe1.zip
Auto merge of #62281 - Disasm:riscv-pic, r=nagisa
Add support for pc-relative addressing on 64-bit RISC-V

These changes allow Rust to generate position-independent code on `riscv64` targets with code model `medium`.

Closes: https://github.com/rust-lang/rust/issues/59802
See also: https://github.com/rust-embedded/riscv-rt/issues/25, https://github.com/rust-embedded/wg/issues/218
-rw-r--r--src/librustc_target/spec/riscv64gc_unknown_none_elf.rs1
-rw-r--r--src/librustc_target/spec/riscv64imac_unknown_none_elf.rs1
m---------src/llvm-project0
3 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs b/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
index a5c13fa28e2..8ef197461d9 100644
--- a/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
+++ b/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
@@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
             executables: true,
             panic_strategy: PanicStrategy::Abort,
             relocation_model: "static".to_string(),
+            code_model: Some("medium".to_string()),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
             eliminate_frame_pointer: false,
diff --git a/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs b/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
index 237d615ffcc..e8a91f0ef9d 100644
--- a/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
+++ b/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
@@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
             executables: true,
             panic_strategy: PanicStrategy::Abort,
             relocation_model: "static".to_string(),
+            code_model: Some("medium".to_string()),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
             eliminate_frame_pointer: false,
diff --git a/src/llvm-project b/src/llvm-project
-Subproject 1bbe0b3e1d756116cbf1fcf049555066ef92900
+Subproject 8538d56b2dd450063547a7690f7ffa2ac37c9c6