Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -1632,7 +1632,8 @@ } } - if (Arg *A = Args.getLastArg(options::OPT_G)) { + if (Arg *A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ, + options::OPT_msmall_data_threshold_EQ)) { StringRef v = A->getValue(); CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-mips-ssection-threshold=" + v)); @@ -1817,6 +1818,14 @@ CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); } + + if (Arg *A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ, + options::OPT_msmall_data_threshold_EQ)) { + StringRef v = A->getValue(); + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back(Args.MakeArgString("-ppc-ssection-threshold=" + v)); + A->claim(); + } } bool ppc::hasPPCAbiArg(const ArgList &Args, const char *Value) { @@ -9075,7 +9084,8 @@ else CmdArgs.push_back("-EL"); - if (Arg *A = Args.getLastArg(options::OPT_G)) { + if (Arg *A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ, + options::OPT_msmall_data_threshold_EQ)) { StringRef v = A->getValue(); CmdArgs.push_back(Args.MakeArgString("-G" + v)); A->claim(); @@ -9190,7 +9200,8 @@ CmdArgs.push_back("elf32ppc_fbsd"); } - if (Arg *A = Args.getLastArg(options::OPT_G)) { + if (Arg *A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ, + options::OPT_msmall_data_threshold_EQ)) { if (ToolChain.getArch() == llvm::Triple::mips || ToolChain.getArch() == llvm::Triple::mipsel || ToolChain.getArch() == llvm::Triple::mips64 ||