[PATCH] D49059: [MinGW] Skip adding default win32 api libraries if -lwindowsapp is specified

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 9 14:46:16 PDT 2018


smeenai added inline comments.


================
Comment at: test/Driver/mingw-windowsapp.c:5-6
+// CHECK_DEFAULT: "-lmsvcrt" "-ladvapi32" "-lshell32" "-luser32" "-lkernel32" "-lmingw32"
+// CHECK_WINDOWSAPP: "-lwindowsapp" "-lmingw32"
+// CHECK_WINDOWSAPP-SAME: "-lmsvcrt" "-lmingw32"
----------------
mstorsjo wrote:
> smeenai wrote:
> > Why do we end up with -lmingw32 twice, and why not just check the full line, like you're doing for the default case?
> I don't remember exactly why -lmingw32 ends up multiple times; I think it comes from legacy compat with binutils ld, where the library ordering matters more (a later static library doesn't trigger search in an earlier one).
> 
> I'm checking twice, since there are other unrelated entries between these that I didn't want to spell out, to avoid making the test overly specific (to avoid having to update the test in case some of those are changed).
Makes sense; I didn't realize before that all the other libraries in the default case were sandwiched between the -lmsvcrt and the -lmingw32 in the CHECK_WINDOWSAPP-SAME case.

A -NOT check would perhaps have been more obvious, but I think that might end up interacting poorly with the other checks, so I'm fine with this as is.


Repository:
  rC Clang

https://reviews.llvm.org/D49059





More information about the cfe-commits mailing list