[PATCH] D131214: [clang][Driver] Pass correct reproduce flag to lld-link

Alex Brachet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 09:19:29 PDT 2022


abrachet marked 2 inline comments as done.
abrachet added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:1639
+    Twine ReproduceOption =
+        C.getDefaultToolChain().getTriple().isOSBinFormatCOFF()
+            ? "/reproduce:"
----------------
mstorsjo wrote:
> thakis wrote:
> > @mstorsjo, will this do the right thing for mingw?
> The correct thing for the mingw linker interface would be to do the same thing as for GNU style linkers, i.e. using the unix parameter form.
> 
> (With the lld mingw interface, the canonical way to pass options through to the underlying lld-link interface is e.g. `-Xlink=/reproduce:`. But as an unintended loophole, as long as you pass lld-link options with a leading slash instead of a dash, e.g. if you pass e.g. `/reproduce:` directly to the mingw interface, the mingw interface considers it a filename and passes it through as-is to lld-link, and lld-link the interprets it as an option. But that's not the kosher way to do it IMO.)
> 
> Thus, here, I think the correct thing would be to check `C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment()`.
Thanks


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131214/new/

https://reviews.llvm.org/D131214



More information about the cfe-commits mailing list