c7c78e0e1a
Clang-produced and GCC-produced binaries might be ABI-incompatible on MinGW. Explanation on GitHub: msys2/MINGW-packages/issues/6855#issuecomment-680859662. TL;DR: GCC-generated sections are 16-byte-padded, while Clang ones are not. It causes problems during merge of COMDAT sections. I observed the problem during compilation of runtime tests, but it is possible that the problem could affect main compilation pipeline as well. https://reviews.llvm.org/D86659 (which landed in LLVM 12) fixes the problem. So we have another motivation for switching to LLD besides https://youtrack.jetbrains.com/issue/KT-47605. The only known downside is unsupported defsym which causes slight binary size increase. I think it is doable.