2022-12-16 16:07:56 +01:00
|
|
|
ARG ORG=dockcross
|
|
|
|
FROM ${ORG}/base:latest
|
2021-10-04 12:51:28 +02:00
|
|
|
|
|
|
|
LABEL maintainer="Matt McCormick matt.mccormick@kitware.com"
|
2014-10-17 13:42:56 +02:00
|
|
|
|
2016-04-06 22:48:12 +02:00
|
|
|
RUN dpkg --add-architecture i386 && \
|
|
|
|
apt-get update && apt-get -y install \
|
|
|
|
gcc-multilib \
|
2016-04-14 01:24:04 +02:00
|
|
|
g++-multilib \
|
|
|
|
libc6:i386 \
|
2021-10-24 19:29:02 +02:00
|
|
|
libtbb-dev:i386 \
|
2016-04-16 01:40:28 +02:00
|
|
|
libstdc++6:i386 \
|
|
|
|
libbz2-dev:i386 \
|
|
|
|
libexpat1-dev:i386 \
|
2016-11-21 12:08:30 +01:00
|
|
|
ncurses-dev:i386
|
2014-10-17 13:42:56 +02:00
|
|
|
|
|
|
|
ENV CROSS_TRIPLE i686-linux-gnu
|
2016-04-06 22:48:12 +02:00
|
|
|
ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
|
2014-10-17 13:42:56 +02:00
|
|
|
ENV PATH ${PATH}:${CROSS_ROOT}/bin
|
2016-04-06 22:48:12 +02:00
|
|
|
RUN mkdir -p ${CROSS_ROOT}/bin
|
|
|
|
COPY ${CROSS_TRIPLE}.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}.sh
|
2016-04-14 01:24:04 +02:00
|
|
|
COPY ${CROSS_TRIPLE}-as.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as.sh
|
2016-04-16 01:39:21 +02:00
|
|
|
COPY ${CROSS_TRIPLE}-noop.sh ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-noop.sh
|
2022-10-17 21:14:30 +02:00
|
|
|
|
|
|
|
# Create symlinks for x86_64 binaries that support x86 and x86_64 targets natively
|
|
|
|
RUN cd ${CROSS_ROOT}/bin && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-ar ${CROSS_TRIPLE}-ar && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-c++filt ${CROSS_TRIPLE}-c++filt && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-dwp ${CROSS_TRIPLE}-dwp && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-elfedit ${CROSS_TRIPLE}-elfedit && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcc-ar ${CROSS_TRIPLE}-gcc-ar && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcc-ar-10 ${CROSS_TRIPLE}-gcc-ar-10 && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcc-nm ${CROSS_TRIPLE}-gcc-nm && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcc-ranlib ${CROSS_TRIPLE}-gcc-ranlib && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcc-ranlib-10 ${CROSS_TRIPLE}-gcc-ranlib-10 && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcov ${CROSS_TRIPLE}-gcov && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcov-10 ${CROSS_TRIPLE}-gcov-10 && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcov-dump ${CROSS_TRIPLE}-gcov-dump && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcov-tool ${CROSS_TRIPLE}-gcov-tool && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcov-tool-10 ${CROSS_TRIPLE}-gcov-tool-10 && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-nm ${CROSS_TRIPLE}-nm && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-objcopy ${CROSS_TRIPLE}-objcopy && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-pkg-config ${CROSS_TRIPLE}-pkg-config && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-ranlib ${CROSS_TRIPLE}-ranlib && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-readelf ${CROSS_TRIPLE}-readelf && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-size ${CROSS_TRIPLE}-size && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-strings ${CROSS_TRIPLE}-strings && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-strip ${CROSS_TRIPLE}-strip
|
|
|
|
|
|
|
|
# Use x86_64-linux-gnu.sh to pass -m32 to binaries that support an emulation flag
|
2016-04-06 22:48:12 +02:00
|
|
|
RUN cd ${CROSS_ROOT}/bin && \
|
|
|
|
chmod +x ${CROSS_TRIPLE}.sh && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-gcc && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-g++ && \
|
2022-10-17 21:14:30 +02:00
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-cpp && \
|
2016-04-14 01:24:04 +02:00
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-as && \
|
2022-10-17 21:14:30 +02:00
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-ld && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-ld.gold && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-lto-dump-10 && \
|
|
|
|
ln -s /usr/bin/x86_64-linux-gnu-objdump && \
|
2016-04-06 22:48:12 +02:00
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-gcc && \
|
2022-10-17 21:14:30 +02:00
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-cpp && \
|
2016-04-14 01:24:04 +02:00
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-g++ && \
|
2022-10-17 21:14:30 +02:00
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-ld && \
|
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-ld.gold && \
|
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-lto-dump-10 && \
|
|
|
|
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-objdump && \
|
2016-04-14 01:24:04 +02:00
|
|
|
ln -s ${CROSS_TRIPLE}-as.sh ${CROSS_TRIPLE}-as && \
|
2016-04-16 01:39:21 +02:00
|
|
|
ln -s ${CROSS_TRIPLE}-noop.sh ${CROSS_TRIPLE}-noop
|
2022-10-17 21:14:30 +02:00
|
|
|
|
2016-04-14 01:24:04 +02:00
|
|
|
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
|
|
|
|
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
|
|
|
|
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \
|
2022-10-17 21:14:30 +02:00
|
|
|
CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \
|
|
|
|
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \
|
|
|
|
LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld
|
2016-04-14 01:24:04 +02:00
|
|
|
|
|
|
|
COPY Toolchain.cmake /usr/lib/${CROSS_TRIPLE}/
|
|
|
|
ENV CMAKE_TOOLCHAIN_FILE /usr/lib/${CROSS_TRIPLE}/Toolchain.cmake
|
2016-09-25 04:37:00 +02:00
|
|
|
|
2019-07-24 03:28:37 +02:00
|
|
|
# Linux kernel cross compilation variables
|
|
|
|
ENV CROSS_COMPILE ${CROSS_TRIPLE}-
|
|
|
|
ENV ARCH x86
|
|
|
|
|
2016-09-25 04:37:00 +02:00
|
|
|
COPY linux32-entrypoint.sh /dockcross/
|
|
|
|
ENTRYPOINT ["/dockcross/linux32-entrypoint.sh"]
|
2016-10-31 04:57:04 +01:00
|
|
|
|
2020-05-07 02:21:14 +02:00
|
|
|
#include "common.label-and-env"
|