<div dir="ltr"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Can't mingw just use lld-link style command line options instead of Unix style?</blockquote><div>Not really, there would be a lot or projects that invoke the linker directly that assume ld style.<br></div><div>On top of that I seriously doubt that gcc would add support for passing link style commands.<br></div><div>So lld would become unusable with gcc for mingw targets.<br><br><br>  <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 1:38 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">Can't mingw just use lld-link style command line options instead of Unix style? I'm not really excited about adding a new driver for COFF.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 9:28 AM, 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"><span><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"> Martell's original proposal is to create a new linker driver 
LinkDriver, move everything in COFF/Driver.{cpp,h} to that, and then add
 GNU ld support to that. As a result we'd have a super driver which 
understands both GNU and link.exe options/semantics</blockquote></span><div>That's not what the proposal was<br></div><div>It was to move the current COFF driver to lib/LinkDriver.<br></div><div>Then add a new gnu driver into COFF/Driver so that ELF/Driver and COFF/Driver could share more of the same code.<br><br>The gist I sent in above however was to just add a new GNUDriver.cpp into COFF where they can live side by side.<br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 1: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"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Aug 18, 2015 at 2:36 AM, Saleem Abdulrasool <span dir="ltr"><<a href="mailto:compnerd@compnerd.org" target="_blank">compnerd@compnerd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Monday, August 17, 2015, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Aug 16, 2015 at 1:43 AM, Saleem Abdulrasool <span dir="ltr"><<a>compnerd@compnerd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">compnerd added a comment.<br>
<br>
If we are fine with adding custom flags to the link command line, then aliases would be sufficient I think.  The idea is that you want to preserve the semantics of PE/COFF (which you called the semantics of Windows).  The difference is that the linker invocation should be similar to ld's, but continue to provide the current semantics.  There are a few extensions that are useful (which are compatible with the PE/COFF semantics), but the binaries that are generated by the alternate interface are meant to run on a Windows system, so losing the semantics of PE/COFF would be problematic.<br>
<br>
Just because the driver is written on/for unix, doesn't mean that the linker should provide unix semantics.  The semantics are that of PE/COFF because that is the target.  Its similar to how clang provides a GCC compatible interface which can still be used to generate a proper COFF object, even though ELF and COFF semantics are quite different.<br></blockquote><div><br></div><div>That's true, but in most use cases, Unix driver is used for Unix and provides Unix semantics, and so are COFF. Probably more than 99 out of 100 linker invocations, the default semantics are used. So defining a new driver layer for both Unix and Windows and then re-building the Unix and Windows drivers on top of it is too much. I really want something simpler.</div><div><br></div><div>There seems not necessary to create a new abstraction layer. We can write a small Python script or something which takes Unix ld-ish command line, translate that, and invokes lld-link with the translated options, can't we?</div></div></div></div></blockquote><div><br></div></div></div><div>As long as the script is part of the same repository, I see no difference.  It's just Python vs c++.  I'm not attached to any language, and we already need Python to build, so having that as a runtime dependency for llvm doesn't seem too big of a deal.  We should be able to document Python as a runtime dependency for lld I assume?<span></span> </div></blockquote><div><br></div></span><div>They are different. IIUC, Martell's original proposal is to create a new linker driver LinkDriver, move everything in COFF/Driver.{cpp,h} to that, and then add GNU ld support to that. As a result we'd have a super driver which understands both GNU and link.exe options/semantics. My proposal is different. I don't want to add a full support for GNU ld options or semantics for COFF. Instead I'd write an add-on script or something (which can even live outside LLVM project) which is a wrapper for lld-link. Such wrapper will never be able to be complete since not all GNU ld features are supported by link.exe, but that may be able to be "good enough".</div><span><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><font color="#888888"><br><br>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org<br>
</font></span></blockquote></span></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>