[PATCH] D39528: [LLD] [MinGW] Add an option -Xlink for passing options through to lld-link

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 14:08:33 PDT 2017


mstorsjo added inline comments.


================
Comment at: MinGW/Options.td:34
+def mllvm: S<"mllvm">;
+def Xlink : Separate<["-"], "Xlink">, HelpText<"Pass <arg> to the COFF linker">;
 
----------------
ruiu wrote:
> mstorsjo wrote:
> > ruiu wrote:
> > > I would prefer we always require = after -Xlink, because `-Xlink=-lldmap` is easier to read and less confusing than `-Xlink -lldmap` on command line.
> > Is there any predecent for such style elsewhere? The `-Xfoo -bar` style is used by clang (or does that one also support `-Xfoo=-bar`?), and there's also the `-Wl,-bar` style used in the clang and gcc drivers for some things. That syntax would be a little messy here though, since you'd already need to use `-Wl,` to pass options from clang to the mingw linker frontend.
> I don't know of any precedent of the style in compilers, but there might be in some command that takes meta-options. At least it helps me understand a command line if = is mandatory. If you feel strongly, I'm fine without = though.
I don't feel very strongly about it, so let's go with `-Xlink=-foo`.


https://reviews.llvm.org/D39528





More information about the llvm-commits mailing list