[PATCH] D37709: [MinGW] Add support for the options --[no-]whole-archive

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 23:16:30 PDT 2017


mstorsjo added inline comments.


================
Comment at: COFF/Options.td:99-100
 
+def whole_archive : F<"whole-archive">;
+def no_whole_archive : F<"no-whole-archive">;
+
----------------
pcc wrote:
> ruiu wrote:
> > Since they are lld-specific flags, I'd name -lld-whole-archive and -lld-no-whole-archive.
> I don't think you need to add lld-specific flags to support `--whole-archive`. Instead, you could implement support for the equivalent link.exe flag, `/wholearchive`. See also PR31824.
@pcc - Oh, that probably makes sense - I hadn't seen that option before. Then the MinGW driver just needs to inject `-wholearchive:` before each library between `--whole-archive` and `--no-whole-archive`. Since the driver doesn't do file magic detection, it probably needs to only match this for `*.a`, `*.lib` and `-lfoo` entries, but that's probably fine for most sensible use cases.


https://reviews.llvm.org/D37709





More information about the llvm-commits mailing list