[PATCH] lld: handling of -flavor / -core command line switches

Rui Ueyama ruiu at google.com
Fri Sep 19 16:42:41 PDT 2014


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.

However, I see the benefit of accepting -flavor whatever argv[0] is.

So I'm OK with your patch if there's no objection from other LLD engineers.

On Fri, Sep 19, 2014 at 10:37 AM, Oleg Ranevskyy <llvm.mail.list at gmail.com>
wrote:

> >>! In D5384#16, @ruiu wrote:
> > However the current evaluation order doesn't seem correct. I think it
> make a decision on the flavor in this order.
> >
> > 1. If argv[0] is "ld", the default linker driver is chosen
> > 2. If argv[0] can be interpreted as a triple, the triple is chosen
> > 3. otherwise, look for -flavor (and probably argv[0] is "lld" in this
> case)
> >
> > Currently 3 takes precedence over 2, which I feel wrong.
>
> My patch makes the order even more different from that: 3 -> 1 -> 2.
>
> 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.
>
> Please feel free to correct me if this is not a good idea. I'll adjust the
> code according to your recommendations then.
>
> Thank you.
>
> http://reviews.llvm.org/D5384
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140919/c2ba59ee/attachment.html>


More information about the llvm-commits mailing list