<div dir="rtl"><div dir="ltr"><span style="font-size:12.8px">Sure, r253066.</span><br></div><div dir="ltr"><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-11-13 19:40 GMT+02:00 Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">This needs a testcase. Nothing is checking the linker invocation.<br>
<br>
On 14 July 2015 at 01:23, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:<br>
</span><div class="HOEnZb"><div class="h5">> Author: yrnkrn<br>
> Date: Tue Jul 14 00:23:34 2015<br>
> New Revision: 242121<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=242121&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=242121&view=rev</a><br>
> Log:<br>
> Add support for -fuse-ld= in the mingw toolchain driver.<br>
> We will still default to ld until such a time lld become a<br>
> stable release. lld supports arm NT under the machine name "thumb2pe".<br>
><br>
> <a href="http://reviews.llvm.org/D11088" rel="noreferrer" target="_blank">http://reviews.llvm.org/D11088</a><br>
><br>
> Patch by Martell Malone<br>
> Reviewed by Reid Kleckner<br>
><br>
><br>
> Modified:<br>
> cfe/trunk/lib/Driver/Tools.cpp<br>
><br>
> Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=242121&r1=242120&r2=242121&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=242121&r1=242120&r2=242121&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/Tools.cpp Tue Jul 14 00:23:34 2015<br>
> @@ -8947,6 +8947,12 @@ void MinGW::Linker::ConstructJob(Compila<br>
> // handled somewhere else.<br>
> Args.ClaimAllArgs(options::OPT_w);<br>
><br>
> + StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ, "ld");<br>
> + if (LinkerName.equals_lower("lld")) {<br>
> + CmdArgs.push_back("-flavor");<br>
> + CmdArgs.push_back("gnu");<br>
> + }<br>
> +<br>
> if (!D.SysRoot.empty())<br>
> CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));<br>
><br>
> @@ -8958,6 +8964,8 @@ void MinGW::Linker::ConstructJob(Compila<br>
> CmdArgs.push_back("i386pe");<br>
> if (TC.getArch() == llvm::Triple::x86_64)<br>
> CmdArgs.push_back("i386pep");<br>
> + if (TC.getArch() == llvm::Triple::arm)<br>
> + CmdArgs.push_back("thumb2pe");<br>
><br>
> if (Args.hasArg(options::OPT_mwindows)) {<br>
> CmdArgs.push_back("--subsystem");<br>
> @@ -9067,7 +9075,7 @@ void MinGW::Linker::ConstructJob(Compila<br>
><br>
> if (Args.hasArg(options::OPT_static))<br>
> CmdArgs.push_back("--end-group");<br>
> - else<br>
> + else if (!LinkerName.equals_lower("lld"))<br>
> AddLibGCC(Args, CmdArgs);<br>
> }<br>
><br>
> @@ -9078,7 +9086,7 @@ void MinGW::Linker::ConstructJob(Compila<br>
> CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend.o")));<br>
> }<br>
> }<br>
> - const char *Exec = Args.MakeArgString(TC.GetProgramPath("ld"));<br>
> + const char *Exec = Args.MakeArgString(TC.GetProgramPath(LinkerName.data()));<br>
> C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));<br>
> }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>