MINGW-packages: Clang's LLD is broken, again!
After the last update of the llvm packages (9.0.0-3
), LDD no longer works.
ld.lld.exe
hangs indefinitely. (It miraculously worked once for me, but no luck since then.)
You can reproduce it simply by running
echo -e '#include <iostream>\nint main() {std::cout << "Hello!\\n";}' >a.cpp
clang++ -fuse-ld=lld a.cpp
This closely resembles bug https://github.com/msys2/MINGW-packages/issues/5231 that was already fixed.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19 (9 by maintainers)
Commits related to this issue
- fix for #6126, broken LLD - apply patch from: https://github.com/llvm/llvm-project/commit/564481aebe18a723c9cfe9ea9ca5808771f7e9d8 - lld doesn't seem to hangs up anymore — committed to adrpo/MINGW-packages by adrpo 4 years ago
- fix for #6126, broken LLD - apply patch from: https://github.com/llvm/llvm-project/commit/564481aebe18a723c9cfe9ea9ca5808771f7e9d8 - lld doesn't seem to hangs up anymore - fix CRLF to LF and update ... — committed to adrpo/MINGW-packages by adrpo 4 years ago
- Merge pull request #6128 from adrpo/FixClangLLD fix for #6126, broken LLD — committed to msys2/MINGW-packages by Alexpux 4 years ago
- fix lld hang (#6126) and dynlink clang to reduce size (#7190) - use the patch from jeremyd2019 - remove the changes to patch 302 - update check sums — committed to adrpo/MINGW-packages by adrpo 4 years ago
- fix lld hang (#6126) and dynlink clang to reduce size (#7190) - use the patch from jeremyd2019 - remove the changes to patch 302 - update check sums - resolve ambigous wasm name by prefixing it with l... — committed to adrpo/MINGW-packages by adrpo 4 years ago
- fix lld hang (#6126) and dynlink clang to reduce size (#7190) - use the patch from jeremyd2019 - remove the changes to patch 302 - update check sums - resolve ambigous wasm name by prefixing it with l... — committed to adrpo/MINGW-packages by adrpo 4 years ago
- clang: fix lld hang and dynlink clang to reduce size - use the patch from jeremyd2019 - remove the changes to patch 302 - update check sums - resolve ambigous wasm name by prefixing it with lld:: - b... — committed to adrpo/MINGW-packages by adrpo 4 years ago
- Merge pull request #7226 from adrpo/FixLldHangReduceClangSize fix lld hang (#6126) and dynlink clang to reduce size (#7190) — committed to msys2/MINGW-packages by lazka 4 years ago
On Linux, if a process calls
exit()
or returns frommain()
, the other threads are still running. The process will eventually exit despite them. It is not necessary to join with them, but it is cructial that they do not access destroyed (static) objects.On Windows, if a process calls
exit()
or returns frommain()
, the other threads are terminated at unpredictable locations before TLS callbacks. This places significant limits on whatDllMain()
and TLS callbacks can do and what they must not do.Your suggestion to bypass destructors upon process exit doesn’t seem correct to me, as such behavior is required by Itanium ABI. My opinion is that LLD should wait for worker threads explicitly before returning from
main()
, or if really those threads are out of question, call::Terminate(::GetCurrentProcess())
instead.