From 0010386360f2ce5403b68880a34ee5fac9cc7045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 9 Aug 2016 16:36:59 +0300 Subject: [PATCH] Fix an issue with lld and llvm-ar 3.9 vs genlib --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 && \