Skip to content

Commit a9410cd

Browse files
committed
Auto merge of #58406 - Disasm:rv64-support, r=nagisa
Add riscv64{imac,gc}-unknown-none-elf targets Previous attempt by @fintelia: #58012 Related: rust-embedded/wg#218
2 parents f058741 + 1f1a824 commit a9410cd

File tree

6 files changed

+69
-1
lines changed

6 files changed

+69
-1
lines changed

src/ci/docker/dist-various-1/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ ENV TARGETS=$TARGETS,thumbv7em-none-eabihf
112112
ENV TARGETS=$TARGETS,thumbv8m.main-none-eabi
113113
ENV TARGETS=$TARGETS,riscv32imc-unknown-none-elf
114114
ENV TARGETS=$TARGETS,riscv32imac-unknown-none-elf
115+
ENV TARGETS=$TARGETS,riscv64imac-unknown-none-elf
116+
ENV TARGETS=$TARGETS,riscv64gc-unknown-none-elf
115117
ENV TARGETS=$TARGETS,armebv7r-none-eabi
116118
ENV TARGETS=$TARGETS,armebv7r-none-eabihf
117119
ENV TARGETS=$TARGETS,armv7r-none-eabi

src/librustc_target/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ supported_targets! {
451451

452452
("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
453453
("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
454+
("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
455+
("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
454456

455457
("aarch64-unknown-none", aarch64_unknown_none),
456458

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy,
2+
Target, TargetOptions, TargetResult};
3+
4+
pub fn target() -> TargetResult {
5+
Ok(Target {
6+
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(),
7+
llvm_target: "riscv64".to_string(),
8+
target_endian: "little".to_string(),
9+
target_pointer_width: "64".to_string(),
10+
target_c_int_width: "32".to_string(),
11+
target_os: "none".to_string(),
12+
target_env: String::new(),
13+
target_vendor: "unknown".to_string(),
14+
arch: "riscv64".to_string(),
15+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
16+
17+
options: TargetOptions {
18+
linker: Some("rust-lld".to_string()),
19+
cpu: "generic-rv64".to_string(),
20+
max_atomic_width: Some(64),
21+
atomic_cas: true,
22+
features: "+m,+a,+f,+d,+c".to_string(),
23+
executables: true,
24+
panic_strategy: PanicStrategy::Abort,
25+
relocation_model: "static".to_string(),
26+
emit_debug_gdb_scripts: false,
27+
abi_blacklist: super::riscv_base::abi_blacklist(),
28+
.. Default::default()
29+
},
30+
})
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy,
2+
Target, TargetOptions, TargetResult};
3+
4+
pub fn target() -> TargetResult {
5+
Ok(Target {
6+
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(),
7+
llvm_target: "riscv64".to_string(),
8+
target_endian: "little".to_string(),
9+
target_pointer_width: "64".to_string(),
10+
target_c_int_width: "32".to_string(),
11+
target_os: "none".to_string(),
12+
target_env: String::new(),
13+
target_vendor: "unknown".to_string(),
14+
arch: "riscv64".to_string(),
15+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
16+
17+
options: TargetOptions {
18+
linker: Some("rust-lld".to_string()),
19+
cpu: "generic-rv64".to_string(),
20+
max_atomic_width: Some(64),
21+
atomic_cas: true,
22+
features: "+m,+a,+c".to_string(),
23+
executables: true,
24+
panic_strategy: PanicStrategy::Abort,
25+
relocation_model: "static".to_string(),
26+
emit_debug_gdb_scripts: false,
27+
abi_blacklist: super::riscv_base::abi_blacklist(),
28+
.. Default::default()
29+
},
30+
})
31+
}

src/llvm-project

Submodule llvm-project updated 35 files

src/tools/build-manifest/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ static TARGETS: &'static [&'static str] = &[
8585
"powerpc64le-unknown-linux-gnu",
8686
"riscv32imc-unknown-none-elf",
8787
"riscv32imac-unknown-none-elf",
88+
"riscv64imac-unknown-none-elf",
89+
"riscv64gc-unknown-none-elf",
8890
"s390x-unknown-linux-gnu",
8991
"sparc64-unknown-linux-gnu",
9092
"sparcv9-sun-solaris",

0 commit comments

Comments
 (0)