LLD (the clang's new linker) from package mingw-w64-x86_64-lld is pretty much unusable because it hangs on almost every run.
Official LLD binary from http://releases.llvm.org/download.html works correctly.
The hang can be reproduced with following commands:
echo -e '#include <iostream>\nint main() {std::cout << "Hello!\\n";}' >a.cpp
clang++ -fuse-ld=lld a.cpp
After this, ld.lld.exe (called by clang++) hangs indefinitely.
According to https://github.com/android-ndk/ndk/issues/855 (also https://sourceforge.net/p/mingw-w64/bugs/774/) this seems to be caused by a bug in winpthreads that causes a deadlock...?
Would you like to try using this patch https://github.com/mstorsjo/llvm/commit/winpthreads-workaround on top of MSYS2 mingw-w64-clang package?
If it works you can open PR with the fix.
@mati865 I tried it today, but I'm on a relatively old PC, so building clang takes around 5 hours. (And the build just got interrupted at 80% accidentally, and I'm yet to figure out how to gracefully continue it without resetting progress.)
Makepkg has argument -e that will skip extraction and prepare(), you should also comment out cmake part from build().
I'll try to find some time to do the build.
That did the trick so here we go: #5247
CC @mstorsjo, probably he would like to hear back about this patch.
Most helpful comment
That did the trick so here we go: #5247
CC @mstorsjo, probably he would like to hear back about this patch.