Skip to content

Commit

Permalink
ci: add support for loongarch64-unknown-linux-{gnu,musl}
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher authored and briansmith committed Dec 7, 2024
1 parent 7973dcd commit 8eee469
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mk/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rustflags_self_contained="-Clink-self-contained=yes -Clinker=rust-lld"
qemu_aarch64="qemu-aarch64 -L /usr/aarch64-linux-gnu"
qemu_arm_gnueabi="qemu-arm -L /usr/arm-linux-gnueabi"
qemu_arm_gnueabihf="qemu-arm -L /usr/arm-linux-gnueabihf"
qemu_loongarch64="qemu-loongarch64 -L /usr/loongarch64-linux-gnu"
qemu_mips="qemu-mips -L /usr/mips-linux-gnu"
qemu_mips64="qemu-mips64 -L /usr/mips64-linux-gnuabi64"
qemu_mips64el="qemu-mips64el -L /usr/mips64el-linux-gnuabi64"
Expand Down Expand Up @@ -201,7 +202,16 @@ case $target in
;;
loongarch64-unknown-linux-gnu)
use_clang=1
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=clang-$llvm_version
export CC_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-gcc-14
export AR_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-gcc-ar
export CFLAGS_loongarch64_unknown_linux_gnu="--sysroot=/usr/loongarch64-linux-gnu"
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-linux-gnu-gcc-14
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER="$qemu_loongarch64"
;;
loongarch64-unknown-linux-musl)
use_clang=1
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Ctarget-feature=+crt-static $rustflags_self_contained"
export CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="$qemu_loongarch64"
;;
wasm32-unknown-unknown)
# The first two are only needed for when the "wasm_c" feature is enabled.
Expand Down
9 changes: 9 additions & 0 deletions mk/install-build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ i686-unknown-linux-musl|x86_64-unknown-linux-musl)
;;
loongarch64-unknown-linux-gnu)
use_clang=1
install_packages \
gcc-14-loongarch64-linux-gnu \
libc6-dev-loong64-cross \
qemu-user
;;
loongarch64-unknown-linux-musl)
use_clang=1
install_packages \
qemu-user
;;
mips-unknown-linux-gnu)
install_packages \
Expand Down

0 comments on commit 8eee469

Please sign in to comment.