Skip to content

Commit 89a6142

Browse files
eduardosmAmanieu
authored andcommitted
Add loongarch64-unknown-linux-gnu to CI
1 parent 20a4551 commit 89a6142

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/workflows/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
- thumbv7m-none-eabi
9393
- thumbv7em-none-eabi
9494
- thumbv7em-none-eabihf
95+
- loongarch64-unknown-linux-gnu
9596

9697
# macOS targets
9798
- x86_64-apple-darwin
@@ -171,6 +172,8 @@ jobs:
171172
os: ubuntu-latest
172173
- target: riscv64gc-unknown-linux-gnu
173174
os: ubuntu-latest
175+
- target: loongarch64-unknown-linux-gnu
176+
os: ubuntu-latest
174177

175178
steps:
176179
- uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ubuntu:24.04
2+
RUN \
3+
apt-get update && \
4+
apt-get install -y --no-install-recommends gcc libc6-dev ca-certificates wget xz-utils && \
5+
wget "https://github.com/loongson/build-tools/releases/download/2024.08.08/x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0.tar.xz" && \
6+
tar -xvf x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0.tar.xz -C / && \
7+
rm x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0.tar.xz && \
8+
wget "https://github.com/loongson/build-tools/releases/download/2024.08.08/x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0-glibc_2.40.tar.xz" && \
9+
tar -xvf x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0-glibc_2.40.tar.xz -C / && \
10+
rm x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0-glibc_2.40.tar.xz && \
11+
wget "https://github.com/loongson/build-tools/releases/download/2023.08.08/qemu-loongarch64" && \
12+
install -m 755 qemu-loongarch64 /cross-tools/bin/qemu-loongarch64 && \
13+
rm qemu-loongarch64
14+
ENV \
15+
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER="/cross-tools/bin/loongarch64-unknown-linux-gnu-gcc" \
16+
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER="/cross-tools/bin/qemu-loongarch64 -L /cross-tools/target -E LD_LIBRARY_PATH=/cross-tools/loongarch64-unknown-linux-gnu/lib"

crates/core_arch/src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@
6666
)]
6767
#![cfg_attr(
6868
test,
69-
feature(stdarch_arm_feature_detection, stdarch_powerpc_feature_detection)
69+
feature(
70+
stdarch_arm_feature_detection,
71+
stdarch_powerpc_feature_detection,
72+
stdarch_loongarch_feature_detection
73+
)
7074
)]
7175

7276
#[cfg(test)]

0 commit comments

Comments
 (0)