<div dir="ltr">My thought on the order that I presented is that: argv[0] is a way to make a deliberate choice on the flavor, and if it's the same name as a known linker, it should behave as a drop-in replacement of the linker. Because the simulating linker is unlikely to have -flavor option, it felt wrong to recognize that.<div><div><div class="gmail_extra"><br></div><div class="gmail_extra">However, I see the benefit of accepting -flavor whatever argv[0] is.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So I'm OK with your patch if there's no objection from other LLD engineers.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 10:37 AM, Oleg Ranevskyy <span dir="ltr"><<a href="mailto:llvm.mail.list@gmail.com" target="_blank">llvm.mail.list@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">>>! In D5384#16, @ruiu wrote:<br>
> However the current evaluation order doesn't seem correct. I think it make a decision on the flavor in this order.<br>
><br>
> 1. If argv[0] is "ld", the default linker driver is chosen<br>
> 2. If argv[0] can be interpreted as a triple, the triple is chosen<br>
> 3. otherwise, look for -flavor (and probably argv[0] is "lld" in this case)<br>
><br>
> Currently 3 takes precedence over 2, which I feel wrong.<br>
<br>
</span>My patch makes the order even more different from that: 3 -> 1 -> 2.<br>
<br>
Let me explain my thoughts. If the user explicitly expresses his intentions by providing some command line arguments, it is quite confusing if these explicit settings get silently overridden by lld, making the linker behave differently from what the user wants. Dependence of this logic on the program name, which might be symlinked or even renamed, makes this even more confusing. That's why -flavor's being of the highest priority could make sense.<br>
<br>
Please feel free to correct me if this is not a good idea. I'll adjust the code according to your recommendations then.<br>
<br>
Thank you.<br>
<br>
<a href="http://reviews.llvm.org/D5384" target="_blank">http://reviews.llvm.org/D5384</a><br>
<br>
<br>
</blockquote></div><br></div></div></div></div>