Skip to content

Commit

Permalink
Add loongarch64-unknown-linux-musl support
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher authored and rami3l committed Jul 5, 2024
1 parent 41e26d9 commit 78ddd93
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 39 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,9 @@ jobs:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-linux-android
- aarch64-unknown-linux-gnu # skip-pr
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
- aarch64-unknown-linux-gnu # skip-pr
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
include:
- target: x86_64-unknown-linux-gnu
run_tests: YES
Expand Down Expand Up @@ -757,24 +757,24 @@ jobs:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-linux-android
- aarch64-unknown-linux-gnu # skip-pr
- aarch64-unknown-linux-musl # skip-pr skip-master
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
- i686-unknown-linux-gnu # skip-pr skip-master
- arm-unknown-linux-gnueabi # skip-pr skip-master
- arm-unknown-linux-gnueabihf # skip-pr skip-master
- x86_64-unknown-freebsd # skip-pr skip-master
- x86_64-unknown-netbsd # skip-pr skip-master
- x86_64-unknown-illumos # skip-pr skip-master
- powerpc-unknown-linux-gnu # skip-pr skip-master
- powerpc64le-unknown-linux-gnu # skip-pr skip-master
- s390x-unknown-linux-gnu # skip-pr skip-master
- arm-linux-androideabi # skip-pr skip-master
- armv7-linux-androideabi # skip-pr skip-master
- x86_64-linux-android # skip-pr skip-master
- riscv64gc-unknown-linux-gnu # skip-pr skip-master
- loongarch64-unknown-linux-gnu # skip-pr skip-master
- aarch64-unknown-linux-gnu # skip-pr
- aarch64-unknown-linux-musl # skip-pr skip-master
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
- i686-unknown-linux-gnu # skip-pr skip-master
- arm-unknown-linux-gnueabi # skip-pr skip-master
- arm-unknown-linux-gnueabihf # skip-pr skip-master
- x86_64-unknown-freebsd # skip-pr skip-master
- x86_64-unknown-netbsd # skip-pr skip-master
- x86_64-unknown-illumos # skip-pr skip-master
- powerpc-unknown-linux-gnu # skip-pr skip-master
- powerpc64le-unknown-linux-gnu # skip-pr skip-master
- s390x-unknown-linux-gnu # skip-pr skip-master
- arm-linux-androideabi # skip-pr skip-master
- armv7-linux-androideabi # skip-pr skip-master
- x86_64-linux-android # skip-pr skip-master
- riscv64gc-unknown-linux-gnu # skip-pr skip-master
- loongarch64-unknown-linux-gnu # skip-pr skip-master
include:
- target: x86_64-unknown-linux-gnu
run_tests: YES
Expand Down
37 changes: 19 additions & 18 deletions ci/actions-templates/linux-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ jobs: # skip-master skip-pr skip-stable
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-linux-android
- aarch64-unknown-linux-gnu # skip-pr
- aarch64-unknown-linux-musl # skip-pr skip-master
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
- i686-unknown-linux-gnu # skip-pr skip-master
- arm-unknown-linux-gnueabi # skip-pr skip-master
- arm-unknown-linux-gnueabihf # skip-pr skip-master
- x86_64-unknown-freebsd # skip-pr skip-master
- x86_64-unknown-netbsd # skip-pr skip-master
- x86_64-unknown-illumos # skip-pr skip-master
- powerpc-unknown-linux-gnu # skip-pr skip-master
- powerpc64le-unknown-linux-gnu # skip-pr skip-master
- s390x-unknown-linux-gnu # skip-pr skip-master
- arm-linux-androideabi # skip-pr skip-master
- armv7-linux-androideabi # skip-pr skip-master
- x86_64-linux-android # skip-pr skip-master
- riscv64gc-unknown-linux-gnu # skip-pr skip-master
- loongarch64-unknown-linux-gnu # skip-pr skip-master
- aarch64-unknown-linux-gnu # skip-pr
- aarch64-unknown-linux-musl # skip-pr skip-master
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
- i686-unknown-linux-gnu # skip-pr skip-master
- arm-unknown-linux-gnueabi # skip-pr skip-master
- arm-unknown-linux-gnueabihf # skip-pr skip-master
- x86_64-unknown-freebsd # skip-pr skip-master
- x86_64-unknown-netbsd # skip-pr skip-master
- x86_64-unknown-illumos # skip-pr skip-master
- powerpc-unknown-linux-gnu # skip-pr skip-master
- powerpc64le-unknown-linux-gnu # skip-pr skip-master
- s390x-unknown-linux-gnu # skip-pr skip-master
- arm-linux-androideabi # skip-pr skip-master
- armv7-linux-androideabi # skip-pr skip-master
- x86_64-linux-android # skip-pr skip-master
- riscv64gc-unknown-linux-gnu # skip-pr skip-master
- loongarch64-unknown-linux-gnu # skip-pr skip-master
- loongarch64-unknown-linux-musl # skip-pr skip-master skip-stable
include:
- target: x86_64-unknown-linux-gnu
run_tests: YES
Expand Down
2 changes: 2 additions & 0 deletions ci/cloudfront-invalidation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ rustup/dist/i686-unknown-linux-gnu/rustup-init
rustup/dist/i686-unknown-linux-gnu/rustup-init.sha256
rustup/dist/loongarch64-unknown-linux-gnu/rustup-init
rustup/dist/loongarch64-unknown-linux-gnu/rustup-init.sha256
rustup/dist/loongarch64-unknown-linux-musl/rustup-init
rustup/dist/loongarch64-unknown-linux-musl/rustup-init.sha256
rustup/dist/mips-unknown-linux-gnu/rustup-init
rustup/dist/mips-unknown-linux-gnu/rustup-init.sha256
rustup/dist/mips64-unknown-linux-gnuabi64/rustup-init
Expand Down
4 changes: 4 additions & 0 deletions ci/docker/loongarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM rust-loongarch64-unknown-linux-musl

ENV CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc
1 change: 1 addition & 0 deletions ci/fetch-rust-docker.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ case "$TARGET" in
x86_64-unknown-netbsd) image=dist-x86_64-netbsd ;;
riscv64gc-unknown-linux-gnu) image=dist-riscv64-linux ;;
loongarch64-unknown-linux-gnu) image=dist-loongarch64-linux ;;
loongarch64-unknown-linux-musl) image=dist-loongarch64-musl ;;
*) exit ;;
esac

Expand Down
2 changes: 2 additions & 0 deletions doc/user-guide/src/installation/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ You can manually download `rustup-init` for a given target from
- [sha256 file](https://static.rust-lang.org/rustup/dist/i686-unknown-linux-gnu/rustup-init.sha256)
- [loongarch64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/loongarch64-unknown-linux-gnu/rustup-init)
- [sha256 file](https://static.rust-lang.org/rustup/dist/loongarch64-unknown-linux-gnu/rustup-init.sha256)
- [loongarch64-unknown-linux-musl](https://static.rust-lang.org/rustup/dist/loongarch64-unknown-linux-musl/rustup-init)
- [sha256 file](https://static.rust-lang.org/rustup/dist/loongarch64-unknown-linux-musl/rustup-init.sha256)
- [mips-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/mips-unknown-linux-gnu/rustup-init)
- [sha256 file](https://static.rust-lang.org/rustup/dist/mips-unknown-linux-gnu/rustup-init.sha256)
- [mips64-unknown-linux-gnuabi64](https://static.rust-lang.org/rustup/dist/mips64-unknown-linux-gnuabi64/rustup-init)
Expand Down
5 changes: 5 additions & 0 deletions src/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ const TRIPLE_X86_64_UNKNOWN_LINUX: &str = "x86_64-unknown-linux-musl";
const TRIPLE_AARCH64_UNKNOWN_LINUX: &str = "aarch64-unknown-linux-gnu";
#[cfg(all(not(windows), target_env = "musl"))]
const TRIPLE_AARCH64_UNKNOWN_LINUX: &str = "aarch64-unknown-linux-musl";
#[cfg(all(not(windows), not(target_env = "musl")))]
const TRIPLE_LOONGARCH64_UNKNOWN_LINUX: &str = "loongarch64-unknown-linux-gnu";
#[cfg(all(not(windows), target_env = "musl"))]
const TRIPLE_LOONGARCH64_UNKNOWN_LINUX: &str = "loongarch64-unknown-linux-musl";

// MIPS platforms don't indicate endianness in uname, however binaries only
// run on boxes with the same endianness, as expected.
Expand Down Expand Up @@ -503,6 +507,7 @@ impl TargetTriple {
} else {
TRIPLE_AARCH64_UNKNOWN_LINUX
}),
(b"Linux", b"loongarch64") => Some(TRIPLE_LOONGARCH64_UNKNOWN_LINUX),
(b"Darwin", b"x86_64") => Some("x86_64-apple-darwin"),
(b"Darwin", b"i686") => Some("i686-apple-darwin"),
(b"FreeBSD", b"x86_64") => Some("x86_64-unknown-freebsd"),
Expand Down

0 comments on commit 78ddd93

Please sign in to comment.