Eq helper allows to define XXX and XXX= options forms easily.
Patch adds testcases for ferw aliases.
Details
Diff Detail
Event Timeline
ELF/Driver.cpp | ||
---|---|---|
808 | Rebase and remove this line. | |
ELF/Options.td | ||
10 | Is JSEq short for Joined-Separate-EQual? That doesn't make much sense. I'd name this just Eq. | |
11 | Remove space before :. Use the extended version as we don't need to save characters here. def "": Separate<["--", "-"], name>; def _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(name)>; | |
12 | NAME -> name | |
30 | I think it is better to remove help from JSEq and keep HelpText for each option. |
- Addressed review comments.
ELF/Driver.cpp | ||
---|---|---|
808 | Done. | |
ELF/Options.td | ||
10 | Done. | |
11 | Done. | |
12 | 'name' will not work here. See: | |
30 | I would not do that because of next reasons:
|
ELF/Options.td | ||
---|---|---|
30 | I think showing both non-alias and alias options in the --help message is fine, and that's actually we want. I want everything to show up in the --help message as long as the linker accepts it. |
ELF/Options.td | ||
---|---|---|
30 | What I mean that we probably may want: But if we assign HelpText for both option and its alias, like you suggest, That does not look as desired result, no ? |
ELF/Options.td | ||
---|---|---|
30 | I think that is fine. |
ELF/Options.td | ||
---|---|---|
30 | What about options that have other aliases ? For example if I would do this change defm entry: Eq<"entry">, HelpText<"Name of entry point symbol">, MetaVarName<"<entry>">; To produce output that you want: --entry <entry> Name of entry point symbol --entry= <entry> Name of entry point symbol -e <entry> Name of entry point symbol Do you want to define HelpText for aliases like alias_entry_e too ? |
ELF/Options.td | ||
---|---|---|
30 | I don't care about that that much. It at least doesn't look bad to me, it is easy to understand and easy to parse. Even if we want something else, I don't like to do everything at once. |
- Reformated to 80 characters per line
(where possible, for lines changed by patch only).
ELF/Options.td | ||
---|---|---|
187 | I don't think this is correct. If you pass --output=foo, it should be interpreted as -o utput=foo. |
ELF/Options.td | ||
---|---|---|
187 | Both bfd and gold disagree with that: umb@umb-virtual-machine:~/tests/502_optionsalias$ ld.bfd -v |
ELF/Options.td | ||
---|---|---|
187 | Sorry, I meant -output=foo. |
ELF/Options.td | ||
---|---|---|
187 | ld.gold and ld.bfd disagree for -output=foo: umb@umb-virtual-machine:~/tests/502_optionsalias$ ls I think we can choose any behavior. As I mentioned in description, I changed that for Do you prefer with bfd behavior ? gold one allows be a bit more consistent in this patch. |
ELF/Options.td | ||
---|---|---|
283 | Sort |
If that's the case, that's a bug in gold, if they aim compatibility with ld.bfd. The manual page for ld.bfd clearly states that -o<something> should be interpreted as -o <something>
Thanks !
Looks now we want to add HelpText for all others aliases we have so
they show up in help among regular options and _eq aliases ?
Rebase and remove this line.