Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -1790,6 +1790,14 @@ case llvm::Triple::mips64: case llvm::Triple::mips64el: getMIPSTargetFeatures(D, Triple, Args, Features); + if (ForAS) { + StringRef CPUName; + StringRef ABIName; + mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName); + + CmdArgs.push_back("-target-abi"); + CmdArgs.push_back(ABIName.data()); + } break; case llvm::Triple::arm: Index: tools/driver/cc1as_main.cpp =================================================================== --- tools/driver/cc1as_main.cpp +++ tools/driver/cc1as_main.cpp @@ -78,6 +78,9 @@ /// be a list of strings starting with '+' or '-'. std::vector Features; + /// If given, the name of the target ABI to use. + std::string ABI; + /// @} /// @name Language Options /// @{ @@ -185,6 +188,7 @@ Opts.Triple = llvm::Triple::normalize(Args->getLastArgValue(OPT_triple)); Opts.CPU = Args->getLastArgValue(OPT_target_cpu); Opts.Features = Args->getAllArgValues(OPT_target_feature); + Opts.ABI = Args->getLastArgValue(OPT_target_abi); // Use the default target triple if unspecified. if (Opts.Triple.empty())