[PATCH] D35619: [ELF] - Introduce multiclass Eq helper for Options.td

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 09:39:42 PDT 2017


grimar added inline comments.


================
Comment at: ELF/Options.td:203
 
-def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
-  HelpText<"Path to file to write output">;
+defm output: Eq<"output">, HelpText<"Path to file to write output">,
+  MetaVarName<"<path>">;
----------------
ruiu wrote:
> grimar wrote:
> > ruiu wrote:
> > > I don't think this is correct. If you pass `--output=foo`, it should be interpreted as `-o utput=foo`.
> > Both bfd and gold disagree with that:
> > 
> > umb at umb-virtual-machine:~/tests/502_optionsalias$ ld.bfd -v
> > GNU ld (GNU Binutils for Ubuntu) 2.26.1
> > umb at umb-virtual-machine:~/tests/502_optionsalias$ ld.gold -v
> > GNU gold (GNU Binutils for Ubuntu 2.26.1) 1.11
> > umb at umb-virtual-machine:~/tests/502_optionsalias$ ls
> > test.o
> > umb at umb-virtual-machine:~/tests/502_optionsalias$ ld.gold -shared test.o --output=foo1
> > umb at umb-virtual-machine:~/tests/502_optionsalias$ ld.bfd -shared test.o --output=foo2
> > umb at umb-virtual-machine:~/tests/502_optionsalias$ ls
> > foo1  foo2  test.o
> > 
> Sorry, I meant `-output=foo`.
ld.gold and ld.bfd disagree for `-output=foo`:

umb at umb-virtual-machine:~/tests/502_optionsalias$ ls
test.o
umb at umb-virtual-machine:~/tests/502_optionsalias$ ld.gold -shared test.o -output=foo1
umb at umb-virtual-machine:~/tests/502_optionsalias$ ld.bfd -shared test.o -output=foo2
umb at umb-virtual-machine:~/tests/502_optionsalias$ ls
foo1  test.o  utput=foo2
umb at umb-virtual-machine:~/tests/502_optionsalias$ 

I think we can choose any behavior. As I mentioned in description, I changed that for
--output because it makes declaration simpler and consistent with gold at the same time.

Do you prefer with bfd behavior ? gold one allows be a bit more consistent in this patch.


https://reviews.llvm.org/D35619





More information about the llvm-commits mailing list