diff options
author | Cristian Adam <cristian.adam@qt.io> | 2022-06-23 20:44:24 +0200 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2022-06-27 07:33:23 +0000 |
commit | a26235dab98288cbcc13b6314ac2bff6ce9c604a (patch) | |
tree | 9c15d80572dbdb40cec74a0ca1be60caa1a123ac | |
parent | c95cf1c0cf3e8a8dc1f76ab85c03d0570d0ed160 (diff) |
ProjectExplorer: Fix abi detection of static Qt builds
Qt 6.2.4 static builds, both with MSVC 2019 and MinGW 11.2.0 are
having the coff headers at the 66 offset instead of 60.
I determined the value empirically, I haven't managed to find
a reference about the magic 60 or 66 values.
Fixes: QTCREATORBUG-27735
Change-Id: Ie2e9f8d6456e765acffce4991955067964b8c0fc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/plugins/projectexplorer/abi.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 2afbfa8be0..ea8e0fb77a 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -1197,8 +1197,14 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path) offset += fileLength.toInt() + 60 /* header */; tmp.append(abiOf(data.mid(toSkip))); - if (tmp.isEmpty() && fileName == "/0 ") + if (tmp.isEmpty() && fileName == "/0 ") { tmp = parseCoffHeader(data.mid(toSkip, 20)); // This might be windws... + if (tmp.isEmpty()) { + // Qt 6.2 static builds have the coff headers for both MSVC and MinGW at offset 66 + toSkip = 66 + fileNameOffset; + tmp = parseCoffHeader(data.mid(toSkip, 20)); + } + } if (!tmp.isEmpty() && tmp.at(0).binaryFormat() != MachOFormat) break; |