Skip to content

Commit

Permalink
ci: add support for loongarch64-unknown-linux-musl
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed Nov 18, 2024
1 parent d2516ab commit 7454ab3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/full_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ jobs:
- i686-linux-android
- i686-unknown-linux-musl
- loongarch64-unknown-linux-gnu
- loongarch64-unknown-linux-musl
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
Expand Down
14 changes: 14 additions & 0 deletions ci/docker/loongarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gcc git libc6-dev make qemu-user xz-utils

COPY install-musl-cross.sh /
RUN sh /install-musl-cross.sh loongarch64-unknown-linux-musl

ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
CFLAGS_loongarch64_unknown_linux_musl="-mabi=lp64d -fPIC" \
QEMU_LD_PREFIX=/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot \
PATH=$PATH:/loongarch64-unknown-linux-musl/bin:/rust/bin
10 changes: 10 additions & 0 deletions ci/install-musl-cross.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
#
# Install musl cross toolchain

set -ex

MUSL_CROSS_VER=20241103
MUSL_CROSS_URL=https://github.com/musl-cross/musl-cross/releases/download/$MUSL_CROSS_VER/$1.tar.xz

curl -L --retry 5 "$MUSL_CROSS_URL" | tar -xJf - -C /

0 comments on commit 7454ab3

Please sign in to comment.