Skip to content

Commit e289552

Browse files
authored
Merge pull request #4320 from heiher/ci-loong64-musl
ci: install musl from source for loongarch64
2 parents 4159080 + ec47180 commit e289552

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
FROM ubuntu:24.10
22

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

6-
COPY install-musl-cross.sh /
7-
RUN /install-musl-cross.sh loongarch64-unknown-linux-musl
7+
COPY install-musl.sh /
8+
RUN /install-musl.sh loongarch64
89

9-
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc \
10+
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
1011
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
11-
CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
12+
CC_loongarch64_unknown_linux_musl=musl-gcc \
1213
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
14+
RUSTFLAGS="-Ctarget-feature=+crt-static" \
15+
QEMU_LD_PREFIX=/musl-loongarch64 \
16+
PATH=$PATH:/musl-loongarch64/bin:/rust/bin

ci/install-musl-cross.sh

-10
This file was deleted.

ci/install-musl.sh

+16-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55

66
set -eux
77

8-
musl_version=1.1.24
8+
case ${1} in
9+
loongarch64)
10+
musl_version=1.2.5
11+
;;
12+
*)
13+
musl_version=1.1.24
14+
;;
15+
esac
16+
917
musl="musl-${musl_version}"
1018

1119
# Download, configure, build, and install musl:
@@ -53,6 +61,13 @@ case ${1} in
5361
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
5462
make install -j4
5563
;;
64+
loongarch64)
65+
musl_arch=loongarch64
66+
kernel_arch=loongarch
67+
CC=loongarch64-linux-gnu-gcc-14 \
68+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
69+
make install -j4
70+
;;
5671
*)
5772
echo "Unknown target arch: \"${1}\""
5873
exit 1

0 commit comments

Comments
 (0)