mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-06-20 18:04:26 +02:00
Update linux-armv6 to latest crosstool-ng version
GCC 11 Linux 5.12.12 GLIBC 2.33 Binutils 2.36 Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
@ -1,48 +1,41 @@
|
||||
FROM dockcross/base:latest
|
||||
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
|
||||
|
||||
# Enable 32 bits binaries
|
||||
RUN dpkg --add-architecture i386 && \
|
||||
apt-get update && \
|
||||
apt-get install -y libstdc++6:i386 libgcc1:i386 zlib1g:i386
|
||||
# Crosstool-ng version
|
||||
# We use a git commit while waiting for 1.25 to release (1.24 is several years old)
|
||||
ENV CT_VERSION 9e10cb6fbaab6d83e1305b2d53ab585d14989667
|
||||
|
||||
# This is for 32-bit ARMv6 Linux
|
||||
# Raspberry Pi is ARMv6+VFP2
|
||||
#include "common.crosstool"
|
||||
|
||||
# The cross-compiling emulator
|
||||
RUN apt-get update && apt-get install -y \
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
qemu-user \
|
||||
qemu-user-static
|
||||
qemu-user-static \
|
||||
&& apt-get clean --yes
|
||||
|
||||
ENV CROSS_TRIPLE arm-linux-gnueabihf
|
||||
ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
|
||||
ENV AS=/usr/bin/${CROSS_TRIPLE}-as \
|
||||
AR=/usr/bin/${CROSS_TRIPLE}-ar \
|
||||
CC=/usr/bin/${CROSS_TRIPLE}-gcc \
|
||||
CPP=/usr/bin/${CROSS_TRIPLE}-cpp \
|
||||
CXX=/usr/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=/usr/bin/${CROSS_TRIPLE}-ld \
|
||||
FC=/usr/bin/${CROSS_TRIPLE}-gfortran
|
||||
|
||||
# Raspberry Pi is ARMv6+VFP2, Debian armhf is ARMv7+VFP3
|
||||
# Since this Dockerfile is targeting linux-arm from Raspberry Pi onward,
|
||||
# we're sticking with it's custom built cross-compiler with hardfp support.
|
||||
# We could use Debian's armel, but we'd have softfp and loose a good deal
|
||||
# of performance.
|
||||
# See: https://wiki.debian.org/RaspberryPi
|
||||
# We are also using the 4.7 version of the toolchain, so that glibc=2.13
|
||||
# The CROSS_TRIPLE is a configured alias of the "armv6-unknown-linux-gnueabihf" target.
|
||||
ENV CROSS_TRIPLE armv6-unknown-linux-gnueabihf
|
||||
ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}
|
||||
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
|
||||
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
|
||||
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \
|
||||
CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \
|
||||
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \
|
||||
FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran
|
||||
|
||||
# Instead of cloning the whole repo (>1GB at the of writing this), we want to do a so-called "sparse checkout" with "shallow cloning":
|
||||
# https://stackoverflow.com/questions/600079/is-there-any-way-to-clone-a-git-repositorys-sub-directory-only/13738951#13738951
|
||||
|
||||
RUN mkdir rpi_tools && cd rpi_tools && git init && git remote add -f origin https://github.com/raspberrypi/tools && \
|
||||
git config core.sparseCheckout true && echo "arm-bcm2708/gcc-linaro-${CROSS_TRIPLE}-raspbian" >> .git/info/sparse-checkout && \
|
||||
git pull --depth=1 origin master && rsync -av arm-bcm2708/gcc-linaro-${CROSS_TRIPLE}-raspbian/ /usr/ && rm -rf ../rpi_tools
|
||||
|
||||
# Allow dynamically linked executables to run with qemu-arm
|
||||
ENV QEMU_LD_PREFIX ${CROSS_ROOT}/libc
|
||||
ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${CROSS_ROOT}/libc/lib/${CROSS_TRIPLE}/"
|
||||
ENV QEMU_LD_PREFIX "${CROSS_ROOT}/${CROSS_TRIPLE}/sysroot"
|
||||
ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${QEMU_LD_PREFIX}"
|
||||
|
||||
COPY Toolchain.cmake ${CROSS_ROOT}/
|
||||
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake
|
||||
|
||||
ENV PKG_CONFIG_PATH /usr/lib/arm-linux-gnueabihf/
|
||||
|
||||
# Linux kernel cross compilation variables
|
||||
ENV PATH ${PATH}:${CROSS_ROOT}/bin
|
||||
ENV CROSS_COMPILE ${CROSS_TRIPLE}-
|
||||
|
Reference in New Issue
Block a user