Skip to content

Commit 34ea8f4

Browse files
committed
Add riscv64imc target
These changes are based on 8dfd5c3 which added the riscv32imc target.
1 parent c84e797 commit 34ea8f4

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ 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,riscv64imc-unknown-none-elf
115116
ENV TARGETS=$TARGETS,armebv7r-none-eabi
116117
ENV TARGETS=$TARGETS,armebv7r-none-eabihf
117118
ENV TARGETS=$TARGETS,armv7r-none-eabi

src/librustc_target/spec/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ supported_targets! {
451451

452452
("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
453453
("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
454+
("riscv64imc-unknown-none-elf", riscv64imc_unknown_none_elf),
454455

455456
("aarch64-unknown-none", aarch64_unknown_none),
456457

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use spec::{LinkerFlavor, LldFlavor, PanicStrategy,
12+
Target, TargetOptions, TargetResult};
13+
14+
pub fn target() -> TargetResult {
15+
Ok(Target {
16+
data_layout: "e-m:e-i64:64-n64-S128".to_string(),
17+
llvm_target: "riscv64".to_string(),
18+
target_endian: "little".to_string(),
19+
target_pointer_width: "64".to_string(),
20+
target_c_int_width: "32".to_string(),
21+
target_os: "none".to_string(),
22+
target_env: String::new(),
23+
target_vendor: "unknown".to_string(),
24+
arch: "riscv64".to_string(),
25+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
26+
27+
options: TargetOptions {
28+
linker: Some("rust-lld".to_string()),
29+
cpu: "generic-rv64".to_string(),
30+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86005
31+
max_atomic_width: None, //Some(32),
32+
atomic_cas: false,
33+
features: "+m,+c".to_string(),
34+
executables: true,
35+
panic_strategy: PanicStrategy::Abort,
36+
relocation_model: "static".to_string(),
37+
emit_debug_gdb_scripts: false,
38+
abi_blacklist: super::riscv_base::abi_blacklist(),
39+
.. Default::default()
40+
},
41+
})
42+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ static TARGETS: &'static [&'static str] = &[
8585
"powerpc64le-unknown-linux-gnu",
8686
"riscv32imc-unknown-none-elf",
8787
"riscv32imac-unknown-none-elf",
88+
"riscv64imc-unknown-none-elf",
8889
"s390x-unknown-linux-gnu",
8990
"sparc64-unknown-linux-gnu",
9091
"sparcv9-sun-solaris",

0 commit comments

Comments
 (0)