HA: [lld] r248389 - [ELF2] - added ignored command line options for compatibility.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 11:41:13 PDT 2015

Ok, its sounds reasonable. Sorry for this patch. Please revert then - I dont have write permissions for that.
От: davide.italiano at gmail.com [davide.italiano at gmail.com] от имени Davide Italiano [davide at freebsd.org]
Отправлено: 23 сентября 2015 г. 22:35
Кому: George Rimar
Копия: Rafael Espíndola; llvm-commits
Тема: Re: [lld] r248389 - [ELF2] - added ignored command line options for compatibility.

On Wed, Sep 23, 2015 at 11:05 AM, George Rimar <grimar at accesssoftek.com<mailto:grimar at accesssoftek.com>> wrote:
> I found the description of that flag in The GNU Linker book - http://www.eecs.umich.edu/courses/eecs373/readings/Linker.pdf
> Page 14:
> -assert keyword
> This option is ignored for SunOS compatibility

This was insteresting. Unfortunately, option handling doesn't seem to be very consistent between version and documentation.

On binutils 2.25:
% /usr/local/bin/ld.bfd -assert
/usr/local/bin/ld.bfd: unrecognized option '-assert'

% /usr/local/bin/ld.gold -assert
/usr/local/bin/ld.gold: -assert: missing argument

It seems that also older versions of ld don't ignore that version, just not recognize it (both single and double dash).

When there's ambiguity, I generally err on the side of being a little bit stricter (unless there's a good reason not to).
In this case in particular, it seems you don't have a real use case for this, and there's some contraddiction between what documentation says, what ld.bfd does and what gold does.

At the light of these facts, I propose to revert this given it seems whatever choice you make you violate something, and given this option has probably impact on a negligible amount of users.

Please let me know if you have any objections.



"There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare

More information about the llvm-commits mailing list