Skip to content

Commit 6647be9

Browse files
committed
Auto merge of #148435 - ZhongyaoChen:promote-riscv64a23-to-tier2, r=jieyouxu
Implement the MCP 932: Promote riscv64a23-unknown-linux-gnu to Tier 2 Implement the [MCP 932](rust-lang/compiler-team#932): Promote riscv64a23-unknown-linux-gnu to Tier 2 without host tools. Closes #148353. Changes: - Update target tier from 3 to 2 in target specification - Update platform documentation - Add CI/CD support for automatic building and distribution via rustup r? jieyouxu cc `@davidtwco` `@Noratrieb`
2 parents 86b95eb + 1af9b63 commit 6647be9

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

compiler/rustc_target/src/spec/targets/riscv64a23_unknown_linux_gnu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pub(crate) fn target() -> Target {
77
llvm_target: "riscv64-unknown-linux-gnu".into(),
88
metadata: TargetMetadata {
99
description: Some("RISC-V Linux (kernel 6.8.0, glibc 2.39)".into()),
10-
tier: Some(3),
11-
host_tools: Some(true),
10+
tier: Some(2),
11+
host_tools: Some(false),
1212
std: Some(true),
1313
},
1414
pointer_width: 64,

src/ci/docker/host-x86_64/dist-riscv64-linux/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ ENV PATH=$PATH:/x-tools/riscv64-unknown-linux-gnu/bin
2222

2323
ENV CC_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \
2424
AR_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-ar \
25-
CXX_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-g++
25+
CXX_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-g++ \
26+
CC_riscv64a23_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \
27+
AR_riscv64a23_unknown_linux_gnu=riscv64-unknown-linux-gnu-ar \
28+
CXX_riscv64a23_unknown_linux_gnu=riscv64-unknown-linux-gnu-g++
2629

2730
ENV HOSTS=riscv64gc-unknown-linux-gnu
31+
ENV TARGETS=riscv64gc-unknown-linux-gnu,riscv64a23-unknown-linux-gnu
2832

2933
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-profiler --disable-docs
30-
ENV SCRIPT python3 ../x.py dist --target $HOSTS --host $HOSTS
34+
ENV SCRIPT python3 ../x.py dist --target $TARGETS --host $HOSTS

src/doc/rustc/src/platform-support/riscv64a23-unknown-linux-gnu.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `riscv64a23-unknown-linux-gnu`
22

3-
**Tier: 3**
3+
**Tier: 2 (without Host Tools)**
44

55
RISC-V target using the ratified [RVA23 Profile](https://github.com/riscv/riscv-profiles/blob/main/src/rva23-profile.adoc).
66
This target will enable all mandary features of rva23u64 by default.
@@ -18,24 +18,26 @@ Other platforms may work, but are not tested. Please contanct if you encounter a
1818

1919
## Building the target
2020

21-
Tier-3 target is not distributed through `rustup`.
22-
23-
You need to build your own Rust, the target can be build with:
21+
Tier-2 targets are distributed through `rustup`. Install the target with:
2422

2523
```bash
26-
./x build --target riscv64a23-unknown-linux-gnu
24+
rustup target add riscv64a23-unknown-linux-gnu
2725
```
2826

2927
## Building Rust programs
3028

31-
Add the toolchain:
29+
Cross compile crates with:
3230

3331
```bash
34-
rustup toolchain link rva23-toolchain {path-to-rust}/build/host/stage2
32+
cargo build --target=riscv64a23-unknown-linux-gnu
3533
```
3634

37-
Then cross compile crates with:
35+
For cross-compilation, you may need to install the appropriate linker:
3836

3937
```bash
40-
RUSTFLAGS="-C linker=riscv64-linux-gnu-gcc" cargo +rva23-toolchain build --target=riscv64a23-unknown-linux-gnu
38+
# Ubuntu/Debian
39+
sudo apt-get install gcc-riscv64-linux-gnu
40+
41+
# Then set the linker
42+
RUSTFLAGS="-C linker=riscv64-linux-gnu-gcc" cargo build --target=riscv64a23-unknown-linux-gnu
4143
```

0 commit comments

Comments
 (0)