<div dir="ltr">Just incase anyone comes here wondering why.<br>The thread for the original patch `r313082 - [Driver] MinGW: Remove custom linker detection` here on cfe-commits explains why.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 13, 2017 at 12:05 AM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I wonder why you reverted this change.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 12, 2017 at 4:04 PM, Martell Malone <span dir="ltr"><<a href="mailto:martellmalone@gmail.com" target="_blank">martellmalone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Will do in future, thanks Rui.</div><div class="m_-4475749364311255904HOEnZb"><div class="m_-4475749364311255904h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 13, 2017 at 12:03 AM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">When you revert a commit, please explain why you are reverting it in the commit message.<div><div class="m_-4475749364311255904m_4465653505783555494h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 12, 2017 at 3:58 PM, Martell Malone via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: martell<br>
Date: Tue Sep 12 15:58:12 2017<br>
New Revision: 313088<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=313088&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=313088&view=rev</a><br>
Log:<br>
Revert "[Driver] MinGW: Remove custom linker detection"<br>
<br>
This reverts rL313082<br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp<br>
cfe/trunk/test/Driver/mingw-us<wbr>eld.c<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MinGW.cpp?rev=313088&r1=313087&r2=313088&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/lib/Driver/Too<wbr>lChains/MinGW.cpp?rev=313088&r<wbr>1=313087&r2=313088&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp Tue Sep 12 15:58:12 2017<br>
@@ -104,6 +104,14 @@ void tools::MinGW::Linker::Construc<wbr>tJob(<br>
// handled somewhere else.<br>
Args.ClaimAllArgs(options::OP<wbr>T_w);<br>
<br>
+ StringRef LinkerName = Args.getLastArgValue(options::<wbr>OPT_fuse_ld_EQ, "ld");<br>
+ if (LinkerName.equals_lower("lld"<wbr>)) {<br>
+ CmdArgs.push_back("-flavor");<br>
+ CmdArgs.push_back("gnu");<br>
+ } else if (!LinkerName.equals_lower("ld"<wbr>)) {<br>
+ D.Diag(diag::err_drv_unsupport<wbr>ed_linker) << LinkerName;<br>
+ }<br>
+<br>
if (!D.SysRoot.empty())<br>
CmdArgs.push_back(Args.MakeAr<wbr>gString("--sysroot=" + D.SysRoot));<br>
<br>
@@ -233,7 +241,7 @@ void tools::MinGW::Linker::Construc<wbr>tJob(<br>
<br>
if (Args.hasArg(options::OPT_stat<wbr>ic))<br>
CmdArgs.push_back("--end-grou<wbr>p");<br>
- else<br>
+ else if (!LinkerName.equals_lower("lld<wbr>"))<br>
AddLibGCC(Args, CmdArgs);<br>
}<br>
<br>
@@ -244,7 +252,7 @@ void tools::MinGW::Linker::Construc<wbr>tJob(<br>
CmdArgs.push_back(Args.MakeAr<wbr>gString(TC.GetFilePath("crtend<wbr>.o")));<br>
}<br>
}<br>
- const char *Exec = Args.MakeArgString(TC.GetLinke<wbr>rPath());<br>
+ const char *Exec = Args.MakeArgString(TC.GetProgr<wbr>amPath(LinkerName.data()));<br>
C.addCommand(llvm::make_uniqu<wbr>e<Command>(JA, *this, Exec, CmdArgs, Inputs));<br>
}<br>
<br>
<br>
Modified: cfe/trunk/test/Driver/mingw-us<wbr>eld.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mingw-useld.c?rev=313088&r1=313087&r2=313088&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/Driver/mi<wbr>ngw-useld.c?rev=313088&r1=3130<wbr>87&r2=313088&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Driver/mingw-us<wbr>eld.c (original)<br>
+++ cfe/trunk/test/Driver/mingw-us<wbr>eld.c Tue Sep 12 15:58:12 2017<br>
@@ -1,19 +1,19 @@<br>
-// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clan<wbr>g_tree/mingw32 %s -fuse-ld=platform 2>&1 | FileCheck -check-prefix=CHECK_LD_32 %s<br>
-// CHECK_LD_32: "{{[^"]*}}ld{{(.exe)?}}"<br>
+// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clan<wbr>g_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_LD_32 %s<br>
+// CHECK_LD_32: ld{{(.exe)?}}"<br>
// CHECK_LD_32: "i386pe"<br>
-// CHECK_LD_32-NOT: "{{[^"]*}}ld.lld{{(.exe)?}}"<br>
+// CHECK_LD_32-NOT: "-flavor" "gnu"<br>
<br>
// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clan<wbr>g_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_32 %s<br>
// CHECK_LLD_32-NOT: invalid linker name in argument<br>
-// CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"<br>
+// CHECK_LLD_32: lld{{(.exe)?}}" "-flavor" "gnu"<br>
// CHECK_LLD_32: "i386pe"<br>
<br>
// RUN: %clang -### -target x86_64-pc-windows-gnu --sysroot=%S/Inputs/mingw_clan<wbr>g_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_64 %s<br>
// CHECK_LLD_64-NOT: invalid linker name in argument<br>
-// CHECK_LLD_64: "{{[^"]*}}ld.lld{{(.exe)?}}"<br>
+// CHECK_LLD_64: lld{{(.exe)?}}" "-flavor" "gnu"<br>
// CHECK_LLD_64: "i386pep"<br>
<br>
// RUN: %clang -### -target arm-pc-windows-gnu --sysroot=%S/Inputs/mingw_clan<wbr>g_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_ARM %s<br>
// CHECK_LLD_ARM-NOT: invalid linker name in argument<br>
-// CHECK_LLD_ARM: "{{[^"]*}}ld.lld{{(.exe)?}}"<br>
+// CHECK_LLD_ARM: lld{{(.exe)?}}" "-flavor" "gnu"<br>
// CHECK_LLD_ARM: "thumb2pe"<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>