Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 18, 2025
1 parent 5a39beb commit 88ce0a1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
- target: armv7-unknown-linux-musleabihf
os: ubuntu-24.04-arm
- target: hexagon-unknown-linux-musl # tier3
- target: hexagon-unknown-linux-musl # tier3
os: ubuntu-24.04-arm
- target: i586-unknown-linux-musl
- target: i586-unknown-linux-musl
os: ubuntu-24.04-arm
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ See also [setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-t
| musl 1.2.3 [6] | 9.4.0 [1] | [2] | ✓ (libstdc++) [1] | ✓ (qemu) [3] [4] | [5] |

[1] 8.5.0 for powerpc-unknown-linux-muslspe, 13.2.0 for risc64gc-unknown-linux-musl, unavailable for hexagon-unknown-linux-musl<br>
[2] 17.0.0-rc3 for hexagon-unknown-linux-musl, otherwise host<br>
[2] 19.1.5 for hexagon-unknown-linux-musl, otherwise host<br>
[3] hexagon-unknown-linux-musl requires release mode for building test<br>
[4] Except for powerpc-unknown-linux-muslspe and riscv32gc-unknown-linux-musl<br>
[5] See target list below for details<br>
Expand All @@ -102,7 +102,7 @@ See also [setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-t
| `armv5te-unknown-linux-musleabi` | x86_64/aarch64 Linux (any libc) |
| `armv7-unknown-linux-musleabi` | x86_64/aarch64 Linux (any libc) |
| `armv7-unknown-linux-musleabihf` | x86_64/aarch64 Linux (any libc) |
| `hexagon-unknown-linux-musl` (tier3) | x86_64 Linux (glibc 2.27+) |
| `hexagon-unknown-linux-musl` (tier3) | x86_64/aarch64 Linux (glibc 2.27+) |
| `i586-unknown-linux-musl` | x86_64/aarch64 Linux (any libc) |
| `i686-unknown-linux-musl` | x86_64/aarch64 Linux (any libc) |
| `mips-unknown-linux-musl` (tier3) | x86_64/aarch64 Linux (any libc) |
Expand Down
21 changes: 14 additions & 7 deletions docker/base/linux-musl-hexagon.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@
# musl-cross-make doesn't support this target
#
# Refs:
# - https://codelinaro.jfrog.io/ui/native/codelinaro-toolchain-for-hexagon
# - https://github.com/qemu/qemu/blob/v9.0.0/tests/docker/dockerfiles/debian-hexagon-cross.docker
# - https://github.com/rust-lang/rust/blob/1.80.0/src/doc/rustc/src/platform-support/hexagon-unknown-linux-musl.md
# - https://github.com/qemu/qemu/blob/v9.2.0/tests/docker/dockerfiles/debian-hexagon-cross.docker

FROM ghcr.io/taiki-e/build-base:alpine AS builder
SHELL ["/bin/bash", "-CeEuxo", "pipefail", "-c"]
ARG RUST_TARGET
ARG TOOLCHAIN_DIR=/toolchain/x86_64-linux-gnu
RUN mkdir -p -- /toolchain
# https://codelinaro.jfrog.io/ui/native/codelinaro-toolchain-for-hexagon
ARG LLVM_VERSION=17.0.0-rc3
RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-cross-hexagon-unknown-linux-musl.tar.xz" \
| tar xJf - --strip-components 1 -C /toolchain

# https://github.com/quic/toolchain_for_hexagon/releases
ARG LLVM_VERSION=19.1.5
RUN <<EOF
dpkg_arch=$(dpkg --print-architecture)
case "${dpkg_arch##*-}" in
amd64) host=x86_64-linux-musl ;;
arm64) host=aarch64-linux-gnu ;;
*) printf >&2 '%s\n' "unsupported architecture '${dpkg_arch}'" && exit 1 ;;
esac
curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-cross-hexagon-unknown-linux-musl_${host}.tar.zst" \
| tar -I zstd xf - --strip-components 1 -C /toolchain
EOF
RUN <<EOF
cd -- "${TOOLCHAIN_DIR}"
ln -s -- "target/${RUST_TARGET}" "${RUST_TARGET}"
Expand Down
9 changes: 0 additions & 9 deletions tools/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,6 @@ for target in "${targets[@]}"; do
--build-arg "DISTRO_VERSION=${ubuntu_version}"
;;
*-linux-musl*)
case "${target}" in
# hexagon-*: Toolchains for these targets are not available on non-x86_64 host.
hexagon-*)
case "${arch}" in
x86_64) ;;
*) continue ;;
esac
;;
esac
if [[ -n "${MUSL_VERSION:-}" ]]; then
musl_versions=("${MUSL_VERSION}")
else
Expand Down
4 changes: 0 additions & 4 deletions tools/docker-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ for target in "${targets[@]}"; do
;;
*-linux-musl*)
arches=(amd64 arm64v8)
case "${target}" in
# hexagon-*: Toolchains for these targets are not available on non-x86_64 host.
hexagon-*) arches=(amd64) ;;
esac
if [[ -n "${MUSL_VERSION:-}" ]]; then
musl_versions=("${MUSL_VERSION}")
else
Expand Down

0 comments on commit 88ce0a1

Please sign in to comment.