diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp
index 91d34a2ed7da37559a6af82b95f57f33d93bdc98..7fccf6b8471deb5a6f285700a0500ef9fda8939a 100644
--- a/src/plugins/projectexplorer/gcctoolchain.cpp
+++ b/src/plugins/projectexplorer/gcctoolchain.cpp
@@ -438,8 +438,12 @@ QList<Utils::FileName> GccToolChain::suggestedMkspecList() const
     if (abi.os() == Abi::LinuxOS) {
         if (abi.osFlavor() != Abi::GenericLinuxFlavor)
             return QList<Utils::FileName>(); // most likely not a desktop, so leave the mkspec alone.
-        if (abi.wordWidth() == host.wordWidth())
-            return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++")); // no need to explicitly set the word width
+        if (abi.wordWidth() == host.wordWidth()) {
+            // no need to explicitly set the word width, but provide that mkspec anyway to make sure
+            // that the correct compiler is picked if a mkspec with a wordwidth is given.
+            return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++"))
+                                            << Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()));
+        }
         return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()));
     }