Skip to content
Open
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 @@ -206,6 +206,7 @@ terminate.
| `aarch64-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ |
| `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 | ✓ |
| `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
42 changes: 42 additions & 0 deletions docker/Dockerfile.aarch64_be-unknown-linux-gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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-gnu.config /
RUN /crosstool-ng.sh aarch64_be-unknown-linux-gnu.config 5

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

COPY qemu.sh /
RUN /qemu.sh aarch64_be

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

ENV CROSS_TOOLCHAIN_PREFIX=aarch64_be-unknown-linux-gnu-
ENV CROSS_SYSROOT=/x-tools/aarch64_be-unknown-linux-gnu/aarch64_be-unknown-linux-gnu/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_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_aarch64_be_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_aarch64_be_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \
CMAKE_TOOLCHAIN_FILE_aarch64_be_unknown_linux_gnu=/opt/toolchain.cmake \
BINDGEN_EXTRA_CLANG_ARGS_aarch64_be_unknown_linux_gnu="--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=gnu \
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC"

RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner
38 changes: 38 additions & 0 deletions docker/crosstool-config/aarch64_be-unknown-linux-gnu.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
CT_CONFIG_VERSION="4"
CT_PREFIX_DIR="/x-tools/${CT_TARGET}"
CT_DOWNLOAD_AGENT_CURL=y
CT_ARCH_ARM=y
CT_ARCH_64=y
CT_ARCH_BE=y
CT_ARCH_FLOAT_HW=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_GLIBC_V_2_36=y
# CT_GLIBC_NO_VERSIONS is not set
CT_GLIBC_VERSION="2.36"
CT_GLIBC_2_17_or_later=y
CT_GLIBC_later_than_2_14=y
CT_GLIBC_2_14_or_later=y
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_LANG_CXX=y

5 changes: 4 additions & 1 deletion docker/crosstool-ng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ main() {
local sleep=15s
local timeout=5m

install_packages autoconf \
install_packages \
adduser \
autoconf \
bison \
bzip2 \
curl \
flex \
gawk \
Expand Down
2 changes: 1 addition & 1 deletion docker/linux-runner
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ drivernet="virtio-net-pci"

# select qemu parameters
case "${arch}" in
aarch64)
aarch64|aarch64_be)
# 8 is the max number of cpu supported by qemu-aarch64
n=$(( n > 8 ? 8 : n ))
opt="-machine virt -cpu cortex-a57"
Expand Down
5 changes: 5 additions & 0 deletions src/docker/provided_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ pub static PROVIDED_IMAGES: &[ProvidedImage] = &[
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
sub: None
},
ProvidedImage {
name: "aarch64_be-unknown-linux-gnu",
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
sub: None
},
ProvidedImage {
name: "arm-unknown-linux-gnueabi",
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 @@ -54,6 +54,16 @@ std = true
run = true
runners = "qemu-user qemu-system"

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

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