1# 2# Docker all cross-compiler target (tests only) 3# 4# While the normal cross builds take care to setup proper multiarch 5# build environments which can cross build QEMU this just installs the 6# basic compilers for as many targets as possible. We shall use this 7# to build and run linux-user tests on GitLab 8# 9FROM docker.io/library/debian:12-slim 10 11# Duplicate deb line as deb-src 12RUN sed -in "s/Types: deb/Types: deb deb-src/g" /etc/apt/sources.list.d/debian.sources 13 14RUN export DEBIAN_FRONTEND=noninteractive && \ 15 apt-get update && \ 16 apt-get install -y eatmydata && \ 17 eatmydata apt-get dist-upgrade -y && \ 18 apt build-dep -yy --arch-only qemu 19 20# Add extra build tools and as many cross compilers as we can for testing 21RUN DEBIAN_FRONTEND=noninteractive eatmydata \ 22 apt install -y --no-install-recommends \ 23 bison \ 24 ccache \ 25 clang \ 26 dpkg-dev \ 27 flex \ 28 gcc \ 29 git \ 30 libclang-rt-dev \ 31 ninja-build \ 32 python3-pip \ 33 python3-setuptools \ 34 python3-tomli \ 35 python3-venv \ 36 python3-wheel 37 38# All the generally available compilers 39ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu \ 40 libc6-dev-arm64-cross \ 41 gcc-arm-linux-gnueabihf \ 42 libc6-dev-armhf-cross \ 43 gcc-mips-linux-gnu \ 44 libc6-dev-mips-cross \ 45 gcc-mips64-linux-gnuabi64 \ 46 libc6-dev-mips64-cross \ 47 gcc-mips64el-linux-gnuabi64 \ 48 libc6-dev-mips64el-cross \ 49 gcc-mipsel-linux-gnu \ 50 libc6-dev-mipsel-cross \ 51 gcc-powerpc64le-linux-gnu \ 52 libc6-dev-ppc64el-cross \ 53 gcc-riscv64-linux-gnu \ 54 libc6-dev-riscv64-cross \ 55 gcc-s390x-linux-gnu \ 56 libc6-dev-s390x-cross 57 58RUN if dpkg-architecture -e amd64; then \ 59 export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu libc6-dev-hppa-cross"; \ 60 export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu libc6-dev-m68k-cross"; \ 61 export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc-linux-gnu libc6-dev-powerpc-cross"; \ 62 export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross"; \ 63 export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-sparc64-linux-gnu libc6-dev-sparc64-cross"; \ 64 fi && \ 65 DEBIAN_FRONTEND=noninteractive eatmydata \ 66 apt install -y --no-install-recommends \ 67 ${AVAILABLE_COMPILERS} && \ 68 dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt 69 70 71ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools 72ENV DEF_TARGET_LIST aarch64-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sparc64-linux-user 73# As a final step configure the user (if env is defined) 74ENV MAKE /usr/bin/make 75ARG USER 76ARG UID 77RUN if [ "${USER}" ]; then \ 78 id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi 79