From 4dd200259f28e608b845e3c063251b5157042397 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 4 Aug 2014 12:45:46 +0300 Subject: [PATCH] ProjectExplorer: Improve detection of MIPS variants Detect also "mips" and "mips64" as mips Change-Id: Ia2259bc4c1144834d20f6bd1c7c91f359e1a67d8 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/abi.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 56c3f8caa47..f6fe084a5b2 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -469,9 +469,9 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) } else if (p.startsWith(QLatin1String("arm"))) { arch = Abi::ArmArchitecture; width = 32; - } else if (p == QLatin1String("mipsel")) { + } else if (p.startsWith(QLatin1String("mips"))) { arch = Abi::MipsArchitecture; - width = 32; + width = p.endsWith(QLatin1String("64")) ? 64 : 32; } else if (p == QLatin1String("x86_64") || p == QLatin1String("amd64")) { arch = Abi::X86Architecture; width = 64; @@ -1057,6 +1057,14 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet_data() QTest::newRow("mipsel-unknown-linux-android") << int(Abi::MipsArchitecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) << int(Abi::ElfFormat) << 32; + + QTest::newRow("mips-linux-gnu") << int(Abi::MipsArchitecture) + << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) + << int(Abi::ElfFormat) << 32; + + QTest::newRow("mips64-linux-octeon-gnu") << int(Abi::MipsArchitecture) + << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) + << int(Abi::ElfFormat) << 64; } void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet()