diff --git a/Dockerfile b/Dockerfile index 5db03be..99cfa4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,10 +94,15 @@ ENV AS=llvm-as ENV NM=llvm-nm # Build mingw with our freshly built cross compiler +# Since somewhere between llvm 3.8 and 3.9, SVN rev 273373, git mirror commit +# d319cd64a4a15,, llvm-ar tries to detect the format (gnu vs bsd) of the +# existing .a file. For files generated by genlib, it seems to detect the +# wrong format, leading to lld later segfaulting when trying to link. +# Force the flag -format gnu to llvm-ar in this step to work around this issue. RUN cd mingw-w64/mingw-w64-crt && \ autoreconf -vif && \ mkdir build && cd build && \ - ../configure --host=$TARGET_TUPLE --prefix=$MINGW_PREFIX \ + AR="llvm-ar -format gnu" ../configure --host=$TARGET_TUPLE --prefix=$MINGW_PREFIX \ --disable-lib32 --disable-lib64 --enable-libarm32 \ --with-genlib && \ make -j4 && \