This simplifies build-mingw-w64.sh. When building on native windows (where we also provide unprefixed tools, we can't have the yet incomplete compiler toolchain in $PATH when building the mingw-w64 tools. (Logically, build-mingw-w64-tools belong with build-llvm and install-wrappers; using the original system compiler to build tools that are supposed to run on the current machine, as opposed to the cross target, like when building the runtimes.)
42 lines
1.6 KiB
Docker
42 lines
1.6 KiB
Docker
FROM ubuntu:18.04
|
|
|
|
RUN apt-get update -qq && apt-get install -qqy --no-install-recommends \
|
|
git wget bzip2 file unzip libtool pkg-config cmake build-essential \
|
|
automake yasm gettext autopoint vim python ninja-build subversion \
|
|
ca-certificates && \
|
|
apt-get clean -y && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
RUN git config --global user.name "LLVM MinGW" && \
|
|
git config --global user.email root@localhost
|
|
|
|
WORKDIR /build
|
|
|
|
ENV TOOLCHAIN_PREFIX=/opt/llvm-mingw
|
|
|
|
ARG TOOLCHAIN_ARCHS="i686 x86_64 armv7 aarch64"
|
|
|
|
ARG DEFAULT_CRT=ucrt
|
|
|
|
# Build everything that uses the llvm monorepo. We need to build the mingw runtime before the compiler-rt/libunwind/libcxxabi/libcxx runtimes.
|
|
COPY build-llvm.sh strip-llvm.sh install-wrappers.sh build-mingw-w64.sh build-mingw-w64-tools.sh build-compiler-rt.sh build-mingw-w64-libraries.sh build-libcxx.sh ./
|
|
COPY wrappers/*.sh wrappers/*.c wrappers/*.h ./wrappers/
|
|
RUN ./build-llvm.sh $TOOLCHAIN_PREFIX && \
|
|
./strip-llvm.sh $TOOLCHAIN_PREFIX && \
|
|
./install-wrappers.sh $TOOLCHAIN_PREFIX && \
|
|
./build-mingw-w64.sh $TOOLCHAIN_PREFIX --with-default-msvcrt=$DEFAULT_CRT && \
|
|
./build-mingw-w64-tools.sh $TOOLCHAIN_PREFIX && \
|
|
./build-compiler-rt.sh $TOOLCHAIN_PREFIX && \
|
|
./build-mingw-w64-libraries.sh $TOOLCHAIN_PREFIX && \
|
|
./build-libcxx.sh $TOOLCHAIN_PREFIX && \
|
|
./build-compiler-rt.sh $TOOLCHAIN_PREFIX --build-sanitizers && \
|
|
rm -rf /build/*
|
|
|
|
# Build libssp
|
|
COPY build-libssp.sh libssp-Makefile ./
|
|
RUN ./build-libssp.sh $TOOLCHAIN_PREFIX && \
|
|
rm -rf /build/*
|
|
|
|
ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
|