summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Nolden <nolden@kde.org>2016-06-13 22:31:17 +0200
committerRalf Nolden <nolden@kde.org>2016-06-14 09:00:07 +0000
commit9b4c91caccdf01fc78fb93da2805c0e26d38633a (patch)
tree8a7115f0f05440da8a96c47c0403a90062edb1d2
parent47b4f2c73834dd971a5ce418368b5d991d08a666 (diff)
downloadqt-creator-9b4c91caccdf01fc78fb93da2805c0e26d38633a.tar.gz
qmake ABI detection fix for NetBSD and OpenBSD
The ABI dection works on inspecting the ELF header which should contain the values for ELFOSABI, with the macro ELFOSABI_NETBSD equals 2 and ELFOSABI_OPENBSD equals 12. However, on these systems the ELF binaries are built using 0 so detection will fail and default to Linux, preventing to use the correct qmake for Desktop Qt. Therefore, on these systems default 0 to use the host OS (NetBSD or OpenBSD), otherwise Linux as before. Change-Id: I293389980860977ba6c2ad9903edd567f0a5b9f0 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r--src/plugins/projectexplorer/abi.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp
index 33689a4bfb..f83542a9f7 100644
--- a/src/plugins/projectexplorer/abi.cpp
+++ b/src/plugins/projectexplorer/abi.cpp
@@ -199,12 +199,20 @@ static QList<Abi> abiOf(const QByteArray &data)
Abi::OSFlavor flavor = Abi::GenericUnixFlavor;
// http://www.sco.com/developers/gabi/latest/ch4.eheader.html#elfid
switch (osAbi) {
- case 2: // NetBSD:
+#if defined(Q_OS_NETBSD)
+ case 0: // NetBSD: ELFOSABI_NETBSD 2, however, NetBSD uses 0
os = Abi::BsdOS;
flavor = Abi::NetBsdFlavor;
break;
- case 3: // Linux:
+#elif defined(Q_OS_OPENBSD)
+ case 0: // OpenBSD: ELFOSABI_OPENBSD 12, however, OpenBSD uses 0
+ os = Abi::BsdOS;
+ flavor = Abi::OpenBsdFlavor;
+ break;
+#else
case 0: // no extra info available: Default to Linux:
+#endif
+ case 3: // Linux:
case 97: // ARM, also linux most of the time.
os = Abi::LinuxOS;
flavor = Abi::GenericLinuxFlavor;
@@ -217,9 +225,6 @@ static QList<Abi> abiOf(const QByteArray &data)
os = Abi::BsdOS;
flavor = Abi::FreeBsdFlavor;
break;
- case 12: // OpenBSD:
- os = Abi::BsdOS;
- flavor = Abi::OpenBsdFlavor;
}
switch (machine) {