From d6a9b3b9dcb447c23b6dcdd2768acce802621b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 3 Aug 2018 14:47:33 +0300 Subject: [PATCH] Split the non-dev version of Dockerfile into a few smaller steps Now that we can build compiler-rt and libunwind with a stripped llvm install, we can build things in a few smaller steps without ending up with a larger docker image than before. --- Dockerfile | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e504e94..673e336 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,14 +16,37 @@ WORKDIR /build ARG CORES=4 ENV TOOLCHAIN_PREFIX=/opt/llvm-mingw + +# Build and strip the LLVM installation +COPY build-llvm.sh strip-llvm.sh ./ +RUN ./build-llvm.sh $TOOLCHAIN_PREFIX && \ + ./strip-llvm.sh $TOOLCHAIN_PREFIX && \ + rm -rf /build + ENV TOOLCHAIN_ARCHS="i686 x86_64 armv7 aarch64" -# Build everything and clean up, in one step -COPY *.sh libssp-Makefile ./ +# Install the usual $TUPLE-clang binaries COPY wrappers/*.sh ./wrappers/ COPY wrappers/*.c ./wrappers/ -RUN ./build-all.sh $TOOLCHAIN_PREFIX && \ - ./strip-llvm.sh $TOOLCHAIN_PREFIX && \ +COPY install-wrappers.sh . +RUN ./install-wrappers.sh $TOOLCHAIN_PREFIX && \ + rm -rf /build + +# Build MinGW-w64, compiler-rt and mingw-w64's extra libraries +COPY build-mingw-w64.sh build-compiler-rt.sh build-mingw-w64-libraries.sh ./ +RUN ./build-mingw-w64.sh $TOOLCHAIN_PREFIX && \ + ./build-compiler-rt.sh $TOOLCHAIN_PREFIX && \ + ./build-mingw-w64-libraries.sh $TOOLCHAIN_PREFIX && \ + rm -rf /build + +# Build libunwind/libcxxabi/libcxx +COPY build-libcxx.sh merge-archives.sh ./ +RUN ./build-libcxx.sh $TOOLCHAIN_PREFIX && \ + rm -rf /build + +# Build libssp +COPY build-libssp.sh libssp-Makefile ./ +RUN ./build-libssp.sh $TOOLCHAIN_PREFIX && \ rm -rf /build # Cheating: Pull strip and objcopy from the normal binutils package.