This reverts commit49db4a3a15,9f1f0104f1,4f95c14adf,c34dc64028,570fdcd251,4bff0298c5and6939aee0c0. When relying on Clang config files, two issues appeared: - Running the compiler-rt tests fails, because the compiler-rt tests disable any default config files, breaking the compiler in this case: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/compiler-rt/test/lit.common.cfg.py#L983 - Wine fails to build using llvm-mingw as cross compiler, because Wine adds the --no-default-config flag to Clang while compiling, if supported: https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/configure.ac?ref_type=tags#L866-868 This causes llvm-mingw to omit the -rtlib=compiler-rt option (specified in a config file), making the compiler look for libgcc instead. Doing a check to see that linking succeeds doesn't necessarily help here - such a check already exists, but it tests linking with -nostdlib -nodefaultlibs: https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/aclocal.m4?ref_type=tags#L193-L206
42 lines
1.7 KiB
Docker
42 lines
1.7 KiB
Docker
FROM ubuntu:22.04
|
|
|
|
RUN apt-get update -qq && \
|
|
DEBIAN_FRONTEND="noninteractive" 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/*
|
|
|
|
|
|
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
|
|
|
|
ARG CFGUARD_ARGS=--enable-cfguard
|
|
|
|
# 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 build-lldb-mi.sh strip-llvm.sh install-wrappers.sh build-mingw-w64.sh build-mingw-w64-tools.sh build-compiler-rt.sh build-libcxx.sh build-mingw-w64-libraries.sh build-openmp.sh ./
|
|
COPY wrappers/*.sh wrappers/*.c wrappers/*.h ./wrappers/
|
|
RUN ./build-llvm.sh $TOOLCHAIN_PREFIX && \
|
|
./build-lldb-mi.sh $TOOLCHAIN_PREFIX && \
|
|
./strip-llvm.sh $TOOLCHAIN_PREFIX && \
|
|
./install-wrappers.sh $TOOLCHAIN_PREFIX && \
|
|
./build-mingw-w64.sh $TOOLCHAIN_PREFIX --with-default-msvcrt=$DEFAULT_CRT $CFGUARD_ARGS && \
|
|
./build-mingw-w64-tools.sh $TOOLCHAIN_PREFIX && \
|
|
./build-compiler-rt.sh $TOOLCHAIN_PREFIX $CFGUARD_ARGS && \
|
|
./build-libcxx.sh $TOOLCHAIN_PREFIX $CFGUARD_ARGS && \
|
|
./build-mingw-w64-libraries.sh $TOOLCHAIN_PREFIX $CFGUARD_ARGS && \
|
|
./build-compiler-rt.sh $TOOLCHAIN_PREFIX --build-sanitizers && \
|
|
./build-openmp.sh $TOOLCHAIN_PREFIX $CFGUARD_ARGS && \
|
|
rm -rf /build/*
|
|
|
|
ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
|