mirror of
https://github.com/bensuperpc/dockcross.git
synced 2026-07-26 04:48:08 +02:00
Add manylinux_2_28-aarch64 image and fix qemu path in 2_34 variant
Add a new manylinux_2_28-aarch64 cross-compilation image targeting AlmaLinux 8 (glibc 2.28) for building portable Python wheels for aarch64 from x86_64 hosts. Based on the manylinux_2_34-aarch64 variant with adjusted glibc (2.28) and kernel headers (4.18). Also fix CMAKE_CROSSCOMPILING_EMULATOR in the 2_34 Toolchain.cmake to use /usr/bin/qemu-aarch64-static (matching what the Dockerfile actually installs).
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
# manylinux_2_28-aarch64 is based on manylinux_2_28-x64 and the aarch64 toolchain installed. This allows to
|
||||
# run the container on a x86_64 host.
|
||||
# This image is not based on "pypa/manylinux_2_28_aarch64" because it would require the host to be aarch64.
|
||||
# For more details, read https://github.com/dockcross/dockcross/issues/367
|
||||
ARG ORG=dockcross
|
||||
FROM ${ORG}/manylinux_2_28-x64:latest
|
||||
|
||||
LABEL maintainer="Matt McCormick matt@mmmccormick.com"
|
||||
|
||||
# This is for 64-bit ARM Manylinux machine
|
||||
|
||||
# Crosstool-ng version
|
||||
ENV CT_VERSION=crosstool-ng-1.27.0
|
||||
|
||||
#include "common-manylinux_2_28.crosstool"
|
||||
|
||||
# The cross-compiling emulator
|
||||
# AlmaLinux 8 doesn't package qemu-user-static, so we download from multiarch/qemu-user-static
|
||||
ARG QEMU_VERSION=v7.2.0-1
|
||||
RUN \
|
||||
curl -L -o /usr/bin/qemu-aarch64-static \
|
||||
https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-aarch64-static && \
|
||||
chmod +x /usr/bin/qemu-aarch64-static
|
||||
|
||||
# The CROSS_TRIPLE is a configured alias of the "aarch64-unknown-linux-gnu" target.
|
||||
ENV CROSS_TRIPLE=aarch64-unknown-linux-gnu
|
||||
ENV CROSS_ROOT=${XCC_PREFIX}/${CROSS_TRIPLE}
|
||||
ENV PATH=${PATH}:${CROSS_ROOT}/bin
|
||||
|
||||
# Running scripts to cross compile python and copy libstdc++ into toolchain
|
||||
ADD manylinux_2_28-aarch64/xc_script /tmp/
|
||||
RUN PASS=2 /tmp/docker_setup_scripts/copy_libstd.sh
|
||||
RUN /tmp/docker_setup_scripts/prepare_cross_env.sh
|
||||
RUN rm -rf /tmp/docker_setup_scripts
|
||||
RUN rm -rf /tmp/usr/
|
||||
|
||||
ENV AS=${CROSS_TRIPLE}-as \
|
||||
AR=${CROSS_TRIPLE}-ar \
|
||||
CC=${CROSS_TRIPLE}-gcc \
|
||||
CPP=${CROSS_TRIPLE}-cpp \
|
||||
CXX=${CROSS_TRIPLE}-g++ \
|
||||
LD=${CROSS_TRIPLE}-ld \
|
||||
FC=${CROSS_TRIPLE}-gfortran \
|
||||
STRIP=${CROSS_TRIPLE}-strip \
|
||||
OBJCOPY=${CROSS_TRIPLE}-objcopy
|
||||
|
||||
ENV QEMU_LD_PREFIX="${CROSS_ROOT}/${CROSS_TRIPLE}/sysroot"
|
||||
ENV QEMU_SET_ENV="LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${QEMU_LD_PREFIX}"
|
||||
|
||||
COPY manylinux_2_28-aarch64/Toolchain.cmake ${CROSS_ROOT}/
|
||||
ENV CMAKE_TOOLCHAIN_FILE=${CROSS_ROOT}/Toolchain.cmake
|
||||
|
||||
ENV PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
|
||||
|
||||
# Linux kernel cross compilation variables
|
||||
ENV CROSS_COMPILE=${CROSS_TRIPLE}-
|
||||
ENV ARCH=arm64
|
||||
|
||||
ENV AUDITWHEEL_ARCH=aarch64
|
||||
ENV AUDITWHEEL_PLAT=manylinux_2_28_$AUDITWHEEL_ARCH
|
||||
|
||||
#include "common.label-and-env"
|
||||
Reference in New Issue
Block a user