Merge pull request #6 from jcfr/fix-toolchains

Fix toolchains
This commit is contained in:
Matt McCormick 2016-04-16 20:40:45 -04:00
commit 8fca54adb4
6 changed files with 24 additions and 11 deletions

View File

@ -1,5 +1,6 @@
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(cross_triple "arm-linux-gnueabihf") set(cross_triple "arm-linux-gnueabihf")
@ -7,7 +8,7 @@ set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++) set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++)
set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran)
set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple} /usr/${cross_triple}/libc/usr)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -10,7 +10,11 @@ RUN apt-get update && apt-get install -y \
crossbuild-essential-armhf \ crossbuild-essential-armhf \
gfortran-arm-linux-gnueabihf \ gfortran-arm-linux-gnueabihf \
qemu-user \ qemu-user \
qemu-user-static qemu-user-static \
libbz2-dev:armhf \
libexpat1-dev:armhf \
ncurses-dev:armhf \
libssl-dev:armhf
ENV CROSS_TRIPLE arm-linux-gnueabihf ENV CROSS_TRIPLE arm-linux-gnueabihf
ENV CROSS_ROOT /usr/${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}

View File

@ -1,5 +1,6 @@
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(cross_triple "arm-linux-gnueabihf") set(cross_triple "arm-linux-gnueabihf")
@ -7,9 +8,8 @@ set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-cc)
set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-c++) set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-c++)
set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran)
set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) # Discard path returned by pkg-config and associated with HINTS in module
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # like FindOpenSSL.
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_IGNORE_PATH /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/lib/)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm)

View File

@ -6,7 +6,11 @@ RUN dpkg --add-architecture i386 && \
gcc-multilib \ gcc-multilib \
g++-multilib \ g++-multilib \
libc6:i386 \ libc6:i386 \
libstdc++6:i386 libstdc++6:i386 \
libbz2-dev:i386 \
libexpat1-dev:i386 \
ncurses-dev:i386 \
libssl-dev:i386
ENV CROSS_TRIPLE i686-linux-gnu ENV CROSS_TRIPLE i686-linux-gnu
ENV CROSS_ROOT /usr/${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
@ -14,6 +18,7 @@ ENV PATH ${PATH}:${CROSS_ROOT}/bin
RUN mkdir -p ${CROSS_ROOT}/bin RUN mkdir -p ${CROSS_ROOT}/bin
COPY ${CROSS_TRIPLE}.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}.sh COPY ${CROSS_TRIPLE}.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}.sh
COPY ${CROSS_TRIPLE}-as.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as.sh COPY ${CROSS_TRIPLE}-as.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as.sh
COPY ${CROSS_TRIPLE}-noop.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-noop.sh
RUN cd ${CROSS_ROOT}/bin && \ RUN cd ${CROSS_ROOT}/bin && \
chmod +x ${CROSS_TRIPLE}.sh && \ chmod +x ${CROSS_TRIPLE}.sh && \
ln -s /usr/bin/x86_64-linux-gnu-gcc && \ ln -s /usr/bin/x86_64-linux-gnu-gcc && \
@ -22,7 +27,8 @@ RUN cd ${CROSS_ROOT}/bin && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-gcc && \ ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-gcc && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-g++ && \ ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-g++ && \
ln -s ${CROSS_TRIPLE}-as.sh ${CROSS_TRIPLE}-as && \ ln -s ${CROSS_TRIPLE}-as.sh ${CROSS_TRIPLE}-as && \
ln -s /usr/bin/x86_64-linux-gnu-ar ${CROSS_TRIPLE}-ar ln -s /usr/bin/x86_64-linux-gnu-ar ${CROSS_TRIPLE}-ar && \
ln -s ${CROSS_TRIPLE}-noop.sh ${CROSS_TRIPLE}-noop
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \

View File

@ -12,9 +12,9 @@ set(cross_triple "i686-linux-gnu")
set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc) set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc)
set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++) set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++)
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
set(CMAKE_AR /usr/${cross_triple}/bin/${cross_triple}-ar)
# Prevent 64-bit libraries from being discovered # Discard path returned by pkg-config and associated with HINTS in module
# like FindOpenSSL.
set(CMAKE_IGNORE_PATH /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/lib/) set(CMAKE_IGNORE_PATH /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/lib/)
set(CMAKE_CROSSCOMPILING_EMULATOR sh -c) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/${cross_triple}/bin/${cross_triple}-noop)

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "$@"