Notable changes since 12.0.0 for llvm-mingw are: llvm: - Produce proper cross-section relative relocations on ARM and AArch64 - Fixed the calling convention for AArch64 for variadic functions involving floats in the fixed arguments - Added a windres compatible frontend in llvm-rc, avoiding the need for external wrappers - Build LLVM with -ffunction-sections and --gc-sections, shrinking a full build of llvm-mingw without LLVM_BUILD_LLVM_DYLIB by 22% (but llvm-mingw uses LLVM_BUILD_LLVM_DYLIB these days, which shrinks the build even more) - Avoid optimizing/changing function calls into stpcpy due to optimizations - llvm-ml has improved to the point where it can build the OpenMP assembly file without needing to use another assembler tool lld: - Support linking directly against DLLs without using import libraries - Improved reliability when running on Windows, avoiding some hangs when terminating - Fixed linking with --export-all-symbols in combination with -ffunction-sections - Fixed --export-all-symbols when linking EXEs - Fixed autoexport from LTO objects with comdat symbols - Print warnings with a "ld.lld" prefix instead of "lld-link" - Avoid thread exhaustion on 32 bit Windows - Accepting more forms of options, like -static and --stack= clang: - Fixed reading long doubles with va_arg on x86_64 - Fixed calling std::once in a dynamically linked libstdc++ runtimes: - Complete support for std::filesystem in libc++ (which was previously backported to 12.0.0 in llvm-mingw too, but the previous release had a bug in using e.g. the u8path() method when linking against the DLL version of libc++) - Implemented semaphores in libc++ - Provide the __gcc_personality_seh0 symbol, fixing building C code with -fexceptions and __attribute__((cleanup)) - Simplified building/installing compiler-rt and libunwind - Silenced lots of build warnings in OpenMP
78 lines
3.2 KiB
Docker
78 lines
3.2 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-tiny python3 python3-distutils \
|
|
ninja-build ca-certificates curl less zip && \
|
|
apt-get clean -y && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Manually install a newer version of CMake; this is needed since building
|
|
# LLVM requires CMake 3.13.4, while Ubuntu 18.04 ships with 3.10.2. If
|
|
# updating to a newer distribution, this can be dropped.
|
|
RUN cd /opt && \
|
|
wget https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1-Linux-$(uname -m).tar.gz && \
|
|
tar -zxvf cmake-*.tar.gz && \
|
|
rm cmake-*.tar.gz && \
|
|
mv cmake-* cmake
|
|
ENV PATH=/opt/cmake/bin:$PATH
|
|
|
|
# Install a newer version of Git; the version of Git in Ubuntu 18.04 is
|
|
# said to have issues with submodules, see e.g.
|
|
# https://github.com/mstorsjo/llvm-mingw/pull/210#issuecomment-870104971 and
|
|
# https://github.com/mstorsjo/llvm-mingw/pull/210#issuecomment-873486503.
|
|
# This isn't needed for building LLVM itself, but makes the built Docker
|
|
# image more useful for use as image for building other projects. If updating
|
|
# to a newer distribution, this can be dropped.
|
|
RUN apt-get update -qq && \
|
|
apt-get install -qqy --no-install-recommends software-properties-common && \
|
|
add-apt-repository ppa:git-core/ppa && \
|
|
apt-get update -qq && \
|
|
apt-get upgrade -qqy git && \
|
|
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 UASM, for building openmp. In the future, llvm-ml should be able
|
|
# to handle it, but it doesn't yet.
|
|
RUN git clone https://github.com/Terraspace/UASM && \
|
|
cd UASM && \
|
|
git checkout 16a853bd6de807fe2c42569f8375a029684c0f22 && \
|
|
make -f gccLinux64.mak -j$(nproc) && \
|
|
mkdir -p $TOOLCHAIN_PREFIX/bin && \
|
|
cp GccUnixR/uasm $TOOLCHAIN_PREFIX/bin
|
|
COPY wrappers/uasm-wrapper.sh $TOOLCHAIN_PREFIX/bin
|
|
|
|
# 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 build-openmp.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 && \
|
|
./build-openmp.sh $TOOLCHAIN_PREFIX && \
|
|
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
|