[Development] [RFCs] Migrate from GCC MinGW to LLVM MinGW
cristian.adam at qt.io
Wed Jul 19 17:46:27 CEST 2023
we are thinking of migrating from GCC MinGW to LLVM MinGW. The ticket in question is [QTBUG-107516] Migrate from GCC MinGW to LLVM-MinGW - Qt Bug Tracker<https://bugreports.qt.io/browse/QTBUG-107516>
For a while now we have a CI configuration testing with LLVM MinGW.
The benefits of the LLVM MinGW<https://github.com/mstorsjo/llvm-mingw> would be (quote from the website):
* Support for targeting ARM/ARM64 (while GCC obviously does support these architectures, it doesn't support Windows on ARM)
* A single toolchain targeting all four architectures (i686, x86_64, armv7 and arm64) instead of separate compiler binaries for each architecture
* Support for generating debug info in PDB format
* Support for Address Sanitizer and Undefined Behaviour Sanitizer
* Since LLVM 16: Support for Control Flow Guard (-mguard=cf compile and link flags)
In the bug report I've tested also gdb 11.2.0 and lldb 16.0.6 with Qt Creator's source code and lldb was twice as fast at reaching the breakpoint (35s vs 1m14s).
With this migration would should also switch to Universal CRT<https://devblogs.microsoft.com/cppblog/introducing-the-universal-crt/>. The toolchain comes in both ucrt and msvcrt variants, but the former is preferrable nowadays.
At Windows Runtime (WinRT) APIs support · Issue #307 · mstorsjo/llvm-mingw (github.com)<https://github.com/mstorsjo/llvm-mingw/issues/307> we can see that starting with LLVM 15 and with a recent release of C++/WinRT<https://github.com/microsoft/cppwinrt/releases> or mingw-w64-cppwinrt<https://github.com/alvinhochun/mingw-w64-cppwinrt/releases/> we could have feature parity with the Visual C++ toolchain.
I've tried it out with Qt 6.5.2 and LLVM-MinGW 16.0.6 and got the following configure output:
Building for: win32-clang-g++ (x86_64, CPU features: mmx sse sse2)
Compiler: clang 16.0.6
Using C++ standard ..................... C++20
cpp/winrt base ......................... yes
Note that not all Qt modules using WinRT are working at this time. I searched after *winrt*.cpp and got:
Any thoughts about this migration?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development