Mingw-packages: Clang's LLD hangs most of the time

Created on 17 Apr 2019  路  4Comments  路  Source: msys2/MINGW-packages

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...?

Most helpful comment

That did the trick so here we go: #5247

CC @mstorsjo, probably he would like to hear back about this patch.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jagannatharjun picture jagannatharjun  路  3Comments

omichel picture omichel  路  4Comments

dimztimz picture dimztimz  路  9Comments

Alex-Gamper picture Alex-Gamper  路  8Comments

Ralayax picture Ralayax  路  7Comments