Skip to content

Commit 955b2bf

Browse files
committed
Add aarch64_be-unknown-linux-gnu target
1 parent 49cd054 commit 955b2bf

File tree

7 files changed

+98
-1
lines changed

7 files changed

+98
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ terminate.
206206
| `aarch64-unknown-linux-gnu` | 2.31 | 9.4.0 || 6.1.0 ||
207207
| `aarch64-unknown-linux-gnu:centos` [7] | 2.17 | 4.8.5 | | 4.2.1 ||
208208
| `aarch64-unknown-linux-musl` | 1.2.3 | 9.2.0 || 6.1.0 ||
209+
| `aarch64_be-unknown-linux-gnu` | 2.36 | 14.2.0 || 6.1.0 ||
209210
| `arm-linux-androideabi` [1] | 9.0.8 | 9.0.8 || 6.1.0 ||
210211
| `arm-unknown-linux-gnueabi` | 2.31 | 9.4.0 || 6.1.0 ||
211212
| `arm-unknown-linux-gnueabihf` | 2.31 | 8.5.0 || 6.1.0 ||
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM ubuntu:24.04 AS cross-base
2+
ENV DEBIAN_FRONTEND=noninteractive
3+
4+
COPY common.sh lib.sh /
5+
RUN /common.sh
6+
7+
COPY cmake.sh /
8+
RUN /cmake.sh
9+
10+
FROM cross-base AS build
11+
12+
ARG VERBOSE
13+
COPY crosstool-ng.sh /
14+
COPY crosstool-config/aarch64_be-unknown-linux-gnu.config /
15+
RUN /crosstool-ng.sh aarch64_be-unknown-linux-gnu.config 5
16+
17+
ENV PATH=/x-tools/aarch64_be-unknown-linux-gnu/bin/:$PATH
18+
19+
COPY qemu.sh /
20+
RUN /qemu.sh aarch64_be
21+
22+
COPY qemu-runner base-runner.sh /
23+
COPY toolchain.cmake /opt/toolchain.cmake
24+
25+
ENV CROSS_TOOLCHAIN_PREFIX=aarch64_be-unknown-linux-gnu-
26+
ENV CROSS_SYSROOT=/x-tools/aarch64_be-unknown-linux-gnu/aarch64_be-unknown-linux-gnu/sysroot/
27+
ENV CROSS_TARGET_RUNNER="/qemu-runner aarch64_be"
28+
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
29+
CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER="$CROSS_TARGET_RUNNER" \
30+
AR_aarch64_be_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \
31+
CC_aarch64_be_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \
32+
CXX_aarch64_be_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \
33+
CMAKE_TOOLCHAIN_FILE_aarch64_be_unknown_linux_gnu=/opt/toolchain.cmake \
34+
BINDGEN_EXTRA_CLANG_ARGS_aarch64_be_unknown_linux_gnu="--sysroot=$CROSS_SYSROOT -idirafter/usr/include" \
35+
QEMU_LD_PREFIX="$CROSS_SYSROOT" \
36+
RUST_TEST_THREADS=1 \
37+
CROSS_CMAKE_SYSTEM_NAME=Linux \
38+
CROSS_CMAKE_SYSTEM_PROCESSOR=aarch64_be \
39+
CROSS_CMAKE_CRT=gnu \
40+
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC"
41+
42+
RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner

docker/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ install_packages \
2525
autoconf \
2626
automake \
2727
binutils \
28+
bzip2 \
2829
ca-certificates \
2930
curl \
3031
file \
@@ -42,6 +43,7 @@ if_centos install_packages \
4243
pkgconfig
4344

4445
if_ubuntu install_packages \
46+
adduser \
4547
g++ \
4648
gfortran \
4749
libc6-dev \
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
CT_CONFIG_VERSION="4"
2+
CT_PREFIX_DIR="/x-tools/${CT_TARGET}"
3+
CT_DOWNLOAD_AGENT_CURL=y
4+
CT_ARCH_ARM=y
5+
CT_ARCH_64=y
6+
CT_ARCH_BE=y
7+
CT_ARCH_FLOAT_HW=y
8+
CT_KERNEL_LINUX=y
9+
CT_LINUX_V_5_19=y
10+
# CT_LINUX_NO_VERSIONS is not set
11+
CT_LINUX_VERSION="5.19.16"
12+
CT_LINUX_later_than_4_8=y
13+
CT_LINUX_4_8_or_later=y
14+
CT_LINUX_later_than_3_7=y
15+
CT_LINUX_3_7_or_later=y
16+
CT_LINUX_later_than_3_2=y
17+
CT_LINUX_3_2_or_later=y
18+
CT_GLIBC_V_2_36=y
19+
# CT_GLIBC_NO_VERSIONS is not set
20+
CT_GLIBC_VERSION="2.36"
21+
CT_GLIBC_2_17_or_later=y
22+
CT_GLIBC_later_than_2_14=y
23+
CT_GLIBC_2_14_or_later=y
24+
CT_GCC_V_14=y
25+
# CT_GCC_NO_VERSIONS is not set
26+
CT_GCC_VERSION="14.2.0"
27+
CT_GCC_later_than_7=y
28+
CT_GCC_7_or_later=y
29+
CT_GCC_later_than_6=y
30+
CT_GCC_6_or_later=y
31+
CT_GCC_later_than_5=y
32+
CT_GCC_5_or_later=y
33+
CT_GCC_later_than_4_9=y
34+
CT_GCC_4_9_or_later=y
35+
CT_GCC_later_than_4_8=y
36+
CT_GCC_4_8_or_later=y
37+
CT_CC_LANG_CXX=y
38+

docker/linux-runner

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ drivernet="virtio-net-pci"
5353

5454
# select qemu parameters
5555
case "${arch}" in
56-
aarch64)
56+
aarch64|aarch64_be)
5757
# 8 is the max number of cpu supported by qemu-aarch64
5858
n=$(( n > 8 ? 8 : n ))
5959
opt="-machine virt -cpu cortex-a57"

src/docker/provided_images.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ pub static PROVIDED_IMAGES: &[ProvidedImage] = &[
2323
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
2424
sub: None
2525
},
26+
ProvidedImage {
27+
name: "aarch64_be-unknown-linux-gnu",
28+
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
29+
sub: None
30+
},
2631
ProvidedImage {
2732
name: "arm-unknown-linux-gnueabi",
2833
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],

targets.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ std = true
5454
run = true
5555
runners = "qemu-user qemu-system"
5656

57+
[[target]]
58+
target = "aarch64_be-unknown-linux-gnu"
59+
os = "ubuntu-latest"
60+
cpp = true
61+
dylib = true
62+
std = true
63+
run = true
64+
runners = "qemu-user"
65+
5766
[[target]]
5867
target = "arm-unknown-linux-gnueabi"
5968
os = "ubuntu-latest"

0 commit comments

Comments
 (0)