Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang's LLD hangs most of the time #5231

Closed
HolyBlackCat opened this issue Apr 17, 2019 · 4 comments · Fixed by #5247
Closed

Clang's LLD hangs most of the time #5231

HolyBlackCat opened this issue Apr 17, 2019 · 4 comments · Fixed by #5247

Comments

@HolyBlackCat
Copy link

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 android/ndk#855 (also https://sourceforge.net/p/mingw-w64/bugs/774/) this seems to be caused by a bug in winpthreads that causes a deadlock...?

@mati865
Copy link
Collaborator

mati865 commented Apr 17, 2019

Would you like to try using this patch mstorsjo/llvm@winpthreads-workaround on top of MSYS2 mingw-w64-clang package?
If it works you can open PR with the fix.

@HolyBlackCat
Copy link
Author

@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.)

@mati865
Copy link
Collaborator

mati865 commented Apr 19, 2019

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.

@mati865
Copy link
Collaborator

mati865 commented Apr 19, 2019

That did the trick so here we go: #5247

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants