Skip to content

Commit 67c051c

Browse files
authored
Merge pull request #2313 from tblah/tomeccles/riscv64gc-unknown-linux-gnu-support
riscv64gc-unknown-linux-gnu support
2 parents c582495 + 401800b commit 67c051c

File tree

7 files changed

+23
-1
lines changed

7 files changed

+23
-1
lines changed

ci/actions-templates/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ system.
5656
| armv7-linux-androideabi | Yes | Two | No | No |
5757
| i686-linux-android | Yes | Two | No | No |
5858
| x86_64-linux-android | Yes | Two | No | No |
59+
| riscv64gc-unknown-linux-gnu | Yes | --- | No | No |
5960
| ----------------------------- | ---------- | ----- | ------ | ---------- |
6061
| x86_64-apple-darwin | No | One | Yes | Yes |
6162
| ----------------------------- | ---------- | ----- | ------ | ---------- |

ci/actions-templates/linux-builds-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
- armv7-linux-androideabi # skip-pr skip-master
4747
- i686-linux-android # skip-pr skip-master
4848
- x86_64-linux-android # skip-pr skip-master
49+
- riscv64gc-unknown-linux-gnu # skip-pr skip-master skip-stable
4950
include:
5051
- target: x86_64-unknown-linux-gnu
5152
run_tests: YES
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM rust-riscv64gc-unknown-linux-gnu
2+
3+
4+
# We install a stable toolchain using rustup anyway, this should stop us getting
5+
# confused and still having this toolchain in $PATH
6+
RUN /usr/local/lib/rustlib/uninstall.sh
7+
# Weirdly that doesn't remove these:
8+
RUN rm /usr/local/bin/cargo /usr/local/bin/rust*
9+
10+
ENV CC_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \
11+
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-unknown-linux-gnu-gcc

ci/fetch-rust-docker.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ case "$TARGET" in
3232
x86_64-unknown-freebsd) image=dist-x86_64-freebsd ;;
3333
x86_64-unknown-linux-gnu) image=dist-x86_64-linux ;;
3434
x86_64-unknown-netbsd) image=dist-x86_64-netbsd ;;
35+
riscv64gc-unknown-linux-gnu) image=dist-various-1 ;;
3536
*) exit ;;
3637
esac
3738

rustup-init.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ get_architecture() {
295295
s390x)
296296
_cputype=s390x
297297
;;
298-
298+
riscv64)
299+
_cputype=riscv64gc
300+
;;
299301
*)
300302
err "unknown CPU type: $_cputype"
301303

@@ -321,6 +323,9 @@ get_architecture() {
321323
_ostype="${_ostype}eabihf"
322324
fi
323325
;;
326+
riscv64gc)
327+
err "riscv64 with 32-bit userland unsupported"
328+
;;
324329
esac
325330
fi
326331

src/dist/dist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static LIST_ARCHS: &[&str] = &[
9090
"powerpc",
9191
"powerpc64",
9292
"powerpc64le",
93+
"riscv64gc",
9394
"s390x",
9495
];
9596
static LIST_OSES: &[&str] = &[

tests/mock/clitools.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,8 @@ pub fn this_host_triple() -> String {
980980
"i686"
981981
} else if cfg!(target_arch = "x86_64") {
982982
"x86_64"
983+
} else if cfg!(target_arch = "riscv64") {
984+
"riscv64gc"
983985
} else {
984986
unimplemented!()
985987
};

0 commit comments

Comments
 (0)