Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv64gc-unknown-linux-gnu support #2313

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/actions-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ system.
| armv7-linux-androideabi | Yes | Two | No | No |
| i686-linux-android | Yes | Two | No | No |
| x86_64-linux-android | Yes | Two | No | No |
| riscv64gc-unknown-linux-gnu | Yes | --- | No | No |
| ----------------------------- | ---------- | ----- | ------ | ---------- |
| x86_64-apple-darwin | No | One | Yes | Yes |
| ----------------------------- | ---------- | ----- | ------ | ---------- |
Expand Down
1 change: 1 addition & 0 deletions ci/actions-templates/linux-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
- armv7-linux-androideabi # skip-pr skip-master
- i686-linux-android # skip-pr skip-master
- x86_64-linux-android # skip-pr skip-master
- riscv64gc-unknown-linux-gnu # skip-pr skip-master skip-stable
include:
- target: x86_64-unknown-linux-gnu
run_tests: YES
Expand Down
11 changes: 11 additions & 0 deletions ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rust-riscv64gc-unknown-linux-gnu


# We install a stable toolchain using rustup anyway, this should stop us getting
# confused and still having this toolchain in $PATH
RUN /usr/local/lib/rustlib/uninstall.sh
# Weirdly that doesn't remove these:
RUN rm /usr/local/bin/cargo /usr/local/bin/rust*

ENV CC_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-unknown-linux-gnu-gcc
1 change: 1 addition & 0 deletions ci/fetch-rust-docker.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ case "$TARGET" in
x86_64-unknown-freebsd) image=dist-x86_64-freebsd ;;
x86_64-unknown-linux-gnu) image=dist-x86_64-linux ;;
x86_64-unknown-netbsd) image=dist-x86_64-netbsd ;;
riscv64gc-unknown-linux-gnu) image=dist-various-1 ;;
*) exit ;;
esac

Expand Down
7 changes: 6 additions & 1 deletion rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ get_architecture() {
s390x)
_cputype=s390x
;;

riscv64)
_cputype=riscv64gc
;;
*)
err "unknown CPU type: $_cputype"

Expand All @@ -321,6 +323,9 @@ get_architecture() {
_ostype="${_ostype}eabihf"
fi
;;
riscv64gc)
err "riscv64 with 32-bit userland unsupported"
;;
esac
fi

Expand Down
1 change: 1 addition & 0 deletions src/dist/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static LIST_ARCHS: &[&str] = &[
"powerpc",
"powerpc64",
"powerpc64le",
"riscv64gc",
"s390x",
];
static LIST_OSES: &[&str] = &[
Expand Down
2 changes: 2 additions & 0 deletions tests/mock/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,8 @@ pub fn this_host_triple() -> String {
"i686"
} else if cfg!(target_arch = "x86_64") {
"x86_64"
} else if cfg!(target_arch = "riscv64") {
"riscv64gc"
} else {
unimplemented!()
};
Expand Down