Qt 6.7.0 statically built with llvm-mingw1706_64 has different ABI from compiler
-
I built Qt 6.7.0 statically with llvm-mingw1706_64 downloaded via Qt online installer. It works but Qt Creator reports an ABI mismatch.
Qt version: Qt 6.7.0 llvm-mingw 64-bit Static
ABI: x86-windows-unknown-pe-64bitCompiler: LLVM-MinGW 17.0.6 64-bit for C++
ABI: x86-windows-msys-pe-64bitOfficially provided Qt 6.7.0 llvm-mingw 64-bit version has ABI x86-windows-msys-pe-64bit, same to the compiler.
This shouldn't be a problem and I can build with it normally. But is there a way to fix this (compile Qt to the same ABI as the official version and the compiler)?
My configure command:
configure.bat -opensource -confirm-license -static -static-runtime -release -opengl desktop -skip qtwebengine -nomake examples -nomake tests -Wno-dev -platform win32-clang-g++ -prefix E:\Qt\6.7.0\llvm-mingw_64_static -- -DLLVM_INSTALL_DIR=C:\libclang1706_llvm
-
At https://bugreports.qt.io/browse/QTCREATORBUG-26247 you have an issue regarding the ABI detection and LLVM-MinGW.
The problem is that
lld-link
is not inserting anything in the binary to find out that it was compiled and linked with LLVM MinGW.For a dynamic build of Qt Qt Creator could check to see if it links to
libc++.dll
, but for a static build... this way is no longer possible.But, you should register your Qt version with
sdktool
which specifies the ABI from command line. See https://codereview.qt-project.org/c/qtsdk/tqtc-qtsdk/+/547748 for my change which fixedlldb
to be marked aslldb
and notgdb
. -
@cristian-adam Thanks for the explanation. Since it works well, I'll just leave it as is.