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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 14:11:14 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: MinGW/Options.td:34
+def mllvm: S<"mllvm">;
+def Xlink : Separate<["-"], "Xlink">, HelpText<"Pass <arg> to the COFF linker">;
 
----------------
mstorsjo wrote:
> 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`.
GNU ld manual says that it takes either -foo or --foo except a single letter option or an option starting with 'o' (to avoid conflict with -o). So, you want to use J instead of Joined to accept both -Xlink and --Xlink.


https://reviews.llvm.org/D39528





More information about the llvm-commits mailing list