Skip to content

Commit 44d53ad

Browse files
committed
Fix CI for riscv64-unknown-linux-gnu
1 parent b70ae88 commit 44d53ad

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ jobs:
168168
os: ubuntu-latest
169169
- target: thumbv7em-none-eabihf
170170
os: ubuntu-latest
171+
- target: riscv64gc-unknown-linux-gnu
172+
os: ubuntu-latest
171173

172174
steps:
173175
- uses: actions/checkout@master
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ubuntu:21.10
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
gcc libc6-dev qemu-user ca-certificates \
5+
gcc-riscv64-linux-gnu libc6-dev-riscv64-cross \
6+
qemu-user
7+
8+
ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc \
9+
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER="qemu-riscv64 -L /usr/riscv64-linux-gnu" \
10+
OBJDUMP=riscv64-linux-gnu-objdump

ci/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ case ${TARGET} in
4444
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon"
4545
export TARGET_CFLAGS="-mfpu=vfpv3-d16"
4646
;;
47+
# Some of our test dependencies use the deprecated `gcc` crates which
48+
# doesn't detect RISC-V compilers automatically, so do it manually here.
49+
riscv64*)
50+
export TARGET_CC="riscv64-linux-gnu-gcc"
51+
;;
4752
esac
4853

4954
echo "RUSTFLAGS=${RUSTFLAGS}"

0 commit comments

Comments
 (0)