Index: lib/Driver/ToolChains/Arch/Mips.cpp =================================================================== --- lib/Driver/ToolChains/Arch/Mips.cpp +++ lib/Driver/ToolChains/Arch/Mips.cpp @@ -82,6 +82,9 @@ } } + if (ABIName.empty() && (Triple.getEnvironment() == llvm::Triple::GNUABIN32)) + ABIName = "n32"; + if (ABIName.empty() && (Triple.getVendor() == llvm::Triple::MipsTechnologies || Triple.getVendor() == llvm::Triple::ImaginationTechnologies)) { @@ -104,15 +107,8 @@ .Case("octeon", "n64") .Case("p5600", "o32") .Default(""); - if (Triple.getEnvironment() == llvm::Triple::GNUABIN32) - ABIName = llvm::StringSwitch(ABIName) - .Case("n64", "n32") - .Default(ABIName); } - if (ABIName.empty() && (Triple.getEnvironment() == llvm::Triple::GNUABIN32)) - ABIName = "n32"; - if (ABIName.empty()) { // Deduce ABI name from the target triple. ABIName = Triple.isMIPS32() ? "o32" : "n64"; Index: lib/Driver/ToolChains/Gnu.cpp =================================================================== --- lib/Driver/ToolChains/Gnu.cpp +++ lib/Driver/ToolChains/Gnu.cpp @@ -2060,7 +2060,6 @@ case llvm::Triple::mipsel: LibDirs.append(begin(MIPSELLibDirs), end(MIPSELLibDirs)); TripleAliases.append(begin(MIPSELTriples), end(MIPSELTriples)); - TripleAliases.append(begin(MIPSTriples), end(MIPSTriples)); BiarchLibDirs.append(begin(MIPS64ELLibDirs), end(MIPS64ELLibDirs)); BiarchTripleAliases.append(begin(MIPS64ELTriples), end(MIPS64ELTriples)); BiarchLibDirs.append(begin(MIPSN32ELLibDirs), end(MIPSN32ELLibDirs));