Skip to content

Commit ef39104

Browse files
heihertgross35
authored andcommitted
ci: add support for loongarch64-unknown-linux-musl
(backport <rust-lang#4092>) (cherry picked from commit e03b594)
1 parent 91989b6 commit ef39104

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/full_ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ jobs:
165165
- i686-linux-android
166166
- i686-unknown-linux-musl
167167
- loongarch64-unknown-linux-gnu
168+
- loongarch64-unknown-linux-musl
168169
- powerpc-unknown-linux-gnu
169170
- powerpc64-unknown-linux-gnu
170171
- powerpc64le-unknown-linux-gnu
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
ca-certificates curl gcc git libc6-dev make qemu-user xz-utils
5+
6+
COPY install-musl-cross.sh /
7+
RUN sh /install-musl-cross.sh loongarch64-unknown-linux-musl
8+
9+
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc \
10+
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
11+
CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
12+
CFLAGS_loongarch64_unknown_linux_musl="-mabi=lp64d -fPIC" \
13+
QEMU_LD_PREFIX=/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot \
14+
PATH=$PATH:/loongarch64-unknown-linux-musl/bin:/rust/bin

ci/install-musl-cross.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
#
3+
# Install musl cross toolchain
4+
5+
set -ex
6+
7+
MUSL_CROSS_VER=20241103
8+
MUSL_CROSS_URL=https://github.com/musl-cross/musl-cross/releases/download/$MUSL_CROSS_VER/$1.tar.xz
9+
10+
curl -L --retry 5 "$MUSL_CROSS_URL" | tar -xJf - -C /

0 commit comments

Comments
 (0)