Skip to content

ci: install musl from source for loongarch64 #4320

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

Merged
merged 1 commit into from
Mar 22, 2025
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
16 changes: 9 additions & 7 deletions ci/docker/loongarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM ubuntu:24.10

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gcc git libc6-dev make qemu-user xz-utils
ca-certificates curl gcc gcc-14-loongarch64-linux-gnu git libc6-dev \
make qemu-user xz-utils patch rsync

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

ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc \
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
CC_loongarch64_unknown_linux_musl=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
RUSTFLAGS="-Ctarget-feature=+crt-static" \
QEMU_LD_PREFIX=/musl-loongarch64 \
PATH=$PATH:/musl-loongarch64/bin:/rust/bin
10 changes: 0 additions & 10 deletions ci/install-musl-cross.sh

This file was deleted.

17 changes: 16 additions & 1 deletion ci/install-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@

set -eux

musl_version=1.1.24
case ${1} in
loongarch64)
musl_version=1.2.5
;;
*)
musl_version=1.1.24
;;
esac

musl="musl-${musl_version}"

# Download, configure, build, and install musl:
Expand Down Expand Up @@ -53,6 +61,13 @@ case ${1} in
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
loongarch64)
musl_arch=loongarch64
kernel_arch=loongarch
CC=loongarch64-linux-gnu-gcc-14 \
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
*)
echo "Unknown target arch: \"${1}\""
exit 1
Expand Down
Loading