linux-armv6: Add CMake toolchain file.

This commit is contained in:
Matt McCormick 2015-05-13 14:09:25 -04:00
parent 293318fa31
commit 5a6db5b9e2
3 changed files with 25 additions and 13 deletions

View File

@ -13,7 +13,7 @@ linux-x86:
linux-x64:
$(DOCKER) build -t $(IMAGE)-linux-x64 linux-x64
linux-armv6:
linux-armv6: base linux-armv6/Dockerfile linux-armv6/Toolchain.cmake
$(DOCKER) build -t $(IMAGE)-linux-armv6 linux-armv6
linux-armv7: base linux-armv7/Dockerfile linux-armv7/Toolchain.cmake

View File

@ -1,11 +1,5 @@
FROM rburns/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com"
ENV CROSS_TRIPLE arm-linux-gnueabihf
ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV PATH ${PATH}:${CROSS_ROOT}/bin
ENV LD_LIBRARY_PATH ${CROSS_ROOT}/lib:${LD_LIBRARY_PATH}
ENV RASPBERRYPI_TOOLS_COMMIT 9c3d7b6ac692498dd36fec2872e0b55f910baac1
FROM thewtex/cross-compiler-base
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
# Enable 32 bits binaries
RUN dpkg --add-architecture i386 && \
@ -19,8 +13,11 @@ RUN dpkg --add-architecture i386 && \
# of performance.
# See: https://wiki.debian.org/RaspberryPi
# We are also using the 4.7 version of the toolchain, so that glibc=2.13
ENV CROSS_TRIPLE arm-linux-gnueabihf
ENV RASPBERRYPI_TOOLS_COMMIT 9c3d7b6ac692498dd36fec2872e0b55f910baac1
RUN curl -L https://github.com/raspberrypi/tools/archive/${RASPBERRYPI_TOOLS_COMMIT}.tar.gz | tar xvz --wildcards --no-anchored "*gcc-linaro-${CROSS_TRIPLE}-raspbian*" && \
rsync -av /tools-${RASPBERRYPI_TOOLS_COMMIT}/arm-bcm2708/gcc-linaro-${CROSS_TRIPLE}-raspbian/* /usr && \
cd /usr/bin && \
ln -s ${CROSS_TRIPLE}-gcc ${CROSS_TRIPLE}-cc && \
rm -rf /tools-${RASPBERRYPI_TOOLS_COMMIT}
rsync -av /usr/src/tools-${RASPBERRYPI_TOOLS_COMMIT}/arm-bcm2708/gcc-linaro-${CROSS_TRIPLE}-raspbian/ /usr/ && \
rm -rf /usr/src/tools-${RASPBERRYPI_TOOLS_COMMIT}
COPY Toolchain.cmake /usr/${CROSS_TRIPLE}/
ENV CMAKE_TOOLCHAIN_FILE /usr/${CROSS_TRIPLE}/Toolchain.cmake

View File

@ -0,0 +1,15 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(cross_triple "arm-linux-gnueabihf")
set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++)
set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran)
set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm)