[PATCH] lld: handling of -flavor / -core command line switches
Oleg Ranevskyy
llvm.mail.list at gmail.com
Fri Sep 19 10:37:43 PDT 2014
>>! 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
More information about the llvm-commits
mailing list