Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ terminate.
| `aarch64-unknown-linux-gnu:centos` [7] | 2.17 | 4.8.5 | | 4.2.1 | ✓ |
| `aarch64-unknown-linux-musl` | 1.2.3 | 9.2.0 | ✓ | 6.1.0 | ✓ |
| `aarch64_be-unknown-linux-gnu` | 2.36 | 14.2.0 | ✓ | 6.1.0 | ✓ |
| `aarch64_be-unknown-linux-musl` | 1.2.5 | 14.2.0 | ✓ | 6.1.0 | ✓ |
| `arm-linux-androideabi` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ |
| `arm-unknown-linux-gnueabi` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ |
| `arm-unknown-linux-gnueabihf` | 2.31 | 8.5.0 | ✓ | 6.1.0 | ✓ |
Expand Down
45 changes: 45 additions & 0 deletions docker/Dockerfile.aarch64_be-unknown-linux-musl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:24.04 AS cross-base
ENV DEBIAN_FRONTEND=noninteractive

COPY common.sh lib.sh /
RUN /common.sh

COPY cmake.sh /
RUN /cmake.sh

FROM cross-base AS build

ARG VERBOSE
COPY crosstool-ng.sh /
COPY crosstool-config/aarch64_be-unknown-linux-musl.config /
RUN /crosstool-ng.sh aarch64_be-unknown-linux-musl.config 5

ENV PATH=/x-tools/aarch64_be-unknown-linux-musl/bin/:$PATH

COPY qemu.sh /
RUN /qemu.sh aarch64_be

COPY qemu-runner base-runner.sh /
COPY toolchain.cmake /opt/toolchain.cmake

COPY tidyup.sh /
RUN /tidyup.sh

ENV CROSS_TOOLCHAIN_PREFIX=aarch64_be-unknown-linux-musl-
ENV CROSS_SYSROOT=/x-tools/aarch64_be-unknown-linux-musl/aarch64_be-unknown-linux-musl/sysroot/
ENV CROSS_TARGET_RUNNER="/qemu-runner aarch64_be"
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER="$CROSS_TARGET_RUNNER" \
AR_aarch64_be_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_aarch64_be_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_aarch64_be_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"g++ \
CMAKE_TOOLCHAIN_FILE_aarch64_be_unknown_linux_musl=/opt/toolchain.cmake \
BINDGEN_EXTRA_CLANG_ARGS_aarch64_be_unknown_linux_musl="--sysroot=$CROSS_SYSROOT -idirafter/usr/include" \
QEMU_LD_PREFIX="$CROSS_SYSROOT" \
RUST_TEST_THREADS=1 \
CROSS_CMAKE_SYSTEM_NAME=Linux \
CROSS_CMAKE_SYSTEM_PROCESSOR=aarch64_be \
CROSS_CMAKE_CRT=musl \
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC"

RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner
39 changes: 39 additions & 0 deletions docker/crosstool-config/aarch64_be-unknown-linux-musl.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
CT_CONFIG_VERSION="4"
CT_EXPERIMENTAL=y
CT_PREFIX_DIR="/x-tools/${CT_TARGET}"
CT_ARCH_ARM=y
CT_ARCH_64=y
CT_ARCH_BE=y
CT_ARCH_FLOAT_HW=y
# CT_DEMULTILIB is not set
CT_ARCH_USE_MMU=y
CT_KERNEL_LINUX=y
CT_LINUX_V_5_19=y
# CT_LINUX_NO_VERSIONS is not set
CT_LINUX_VERSION="5.19.16"
CT_LINUX_later_than_4_8=y
CT_LINUX_4_8_or_later=y
CT_LINUX_later_than_3_7=y
CT_LINUX_3_7_or_later=y
CT_LINUX_later_than_3_2=y
CT_LINUX_3_2_or_later=y
CT_LIBC_MUSL=y
CT_MUSL_V_1_2_5=y
# CT_MUSL_NO_VERSIONS is not set
CT_MUSL_VERSION="1.2.5"
CT_GCC_V_14=y
# CT_GCC_NO_VERSIONS is not set
CT_GCC_VERSION="14.2.0"
CT_GCC_later_than_7=y
CT_GCC_7_or_later=y
CT_GCC_later_than_6=y
CT_GCC_6_or_later=y
CT_GCC_later_than_5=y
CT_GCC_5_or_later=y
CT_GCC_later_than_4_9=y
CT_GCC_4_9_or_later=y
CT_GCC_later_than_4_8=y
CT_GCC_4_8_or_later=y
CT_CC_GCC_ENABLE_DEFAULT_PIE=y
CT_CC_LANG_CXX=y

5 changes: 5 additions & 0 deletions src/docker/provided_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ pub static PROVIDED_IMAGES: &[ProvidedImage] = &[
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
sub: None
},
ProvidedImage {
name: "aarch64_be-unknown-linux-musl",
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
sub: None
},
ProvidedImage {
name: "arm-unknown-linux-musleabihf",
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
Expand Down
10 changes: 10 additions & 0 deletions targets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ dylib = true
std = true
run = true

[[target]]
target = "aarch64_be-unknown-linux-musl"
os = "ubuntu-latest"
cpp = true
dylib = true
std = true
run = true
runners = "qemu-user"
build-std = true

[[target]]
target = "arm-unknown-linux-musleabihf"
os = "ubuntu-latest"
Expand Down
Loading