Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -2351,6 +2351,11 @@ continue; } + bool IsMips = C.getDefaultToolChain().getArch() == llvm::Triple::mips || + C.getDefaultToolChain().getArch() == llvm::Triple::mipsel || + C.getDefaultToolChain().getArch() == llvm::Triple::mips64 || + C.getDefaultToolChain().getArch() == llvm::Triple::mips64el; + if (Value == "-force_cpusubtype_ALL") { // Do nothing, this is the default and we don't support anything else. } else if (Value == "-L") { @@ -2376,16 +2381,16 @@ } else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") || Value.startswith("-mhwdiv") || Value.startswith("-march")) { // Do nothing, we'll validate it later. - } else if (Value == "--trap") { + } else if (IsMips && Value == "--trap") { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("+use-tcc-in-div"); - } else if (Value == "--break") { + } else if (IsMips && Value == "--break") { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("-use-tcc-in-div"); - } else if (Value.startswith("-msoft-float")) { + } else if (IsMips && Value.startswith("-msoft-float")) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("+soft-float"); - } else if (Value.startswith("-mhard-float")) { + } else if (IsMips && Value.startswith("-mhard-float")) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("-soft-float"); } else {