diff --git a/linux-armv6/Toolchain.cmake b/linux-armv6/Toolchain.cmake index e737f3a..1336f9d 100644 --- a/linux-armv6/Toolchain.cmake +++ b/linux-armv6/Toolchain.cmake @@ -1,5 +1,6 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR arm) 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_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_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/linux-armv7/Dockerfile b/linux-armv7/Dockerfile index 67f75e1..912d551 100644 --- a/linux-armv7/Dockerfile +++ b/linux-armv7/Dockerfile @@ -10,7 +10,11 @@ RUN apt-get update && apt-get install -y \ crossbuild-essential-armhf \ gfortran-arm-linux-gnueabihf \ 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_ROOT /usr/${CROSS_TRIPLE} diff --git a/linux-armv7/Toolchain.cmake b/linux-armv7/Toolchain.cmake index 49c5efd..51601a9 100644 --- a/linux-armv7/Toolchain.cmake +++ b/linux-armv7/Toolchain.cmake @@ -1,5 +1,6 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR arm) 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_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) +# 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_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) diff --git a/linux-x86/Dockerfile b/linux-x86/Dockerfile index c343852..bbd9bd1 100644 --- a/linux-x86/Dockerfile +++ b/linux-x86/Dockerfile @@ -6,7 +6,11 @@ RUN dpkg --add-architecture i386 && \ gcc-multilib \ g++-multilib \ 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_ROOT /usr/${CROSS_TRIPLE} @@ -14,6 +18,7 @@ ENV PATH ${PATH}:${CROSS_ROOT}/bin RUN mkdir -p ${CROSS_ROOT}/bin 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}-noop.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-noop.sh RUN cd ${CROSS_ROOT}/bin && \ chmod +x ${CROSS_TRIPLE}.sh && \ 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}-g++ && \ 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 \ AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ diff --git a/linux-x86/Toolchain.cmake b/linux-x86/Toolchain.cmake index 0d4a74a..4245df7 100644 --- a/linux-x86/Toolchain.cmake +++ b/linux-x86/Toolchain.cmake @@ -12,9 +12,9 @@ set(cross_triple "i686-linux-gnu") set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc) set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++) 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_CROSSCOMPILING_EMULATOR sh -c) +set(CMAKE_CROSSCOMPILING_EMULATOR /usr/${cross_triple}/bin/${cross_triple}-noop) diff --git a/linux-x86/i686-linux-gnu-noop.sh b/linux-x86/i686-linux-gnu-noop.sh new file mode 100755 index 0000000..311cb8c --- /dev/null +++ b/linux-x86/i686-linux-gnu-noop.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$@"