[PATCH] Mingw-w64 driver for clang

Reid Kleckner rnk at google.com
Fri May 8 10:45:37 PDT 2015


Sorry for the delay. I'm still not convinced that the LLVM_ON_WIN32 ifdefs are really the behavior we want for clang, but holding this patch up isn't helping. We keep getting bug reports from users who don't know how to find their mingw installation.


================
Comment at: lib/Driver/MinGWToolChain.cpp:38
@@ +37,3 @@
+#ifdef LLVM_ON_WIN32
+          getDriver().Dir + "/../lib/gcc/" + getTriple().getArchName().str() + "-w64-mingw32";
+#else
----------------
It took me a while to remember, but I think my primary issue with this change is that this line here makes clang inside mingw behave wildly differently from clang outside mingw's bin directory, without any way for the user to say "my toolchain is here, please use it". They have to resort to -isystem and -L, which is lame.

Still, this is an improvement, and we should probably move ahead with it.

================
Comment at: lib/Driver/MinGWToolChain.cpp:52
@@ +51,3 @@
+#ifdef LLVM_ON_WIN32
+  // assume sysrooted compiler
+  getFilePaths().push_back(getDriver().Dir + "/../lib");
----------------
nit: Please make comments into complete sentences, with a leading uppercase letter and period.

What does "assume sysrooted compiler" mean anyway? It seems like you're really assuming that Clang is installed inside a mingw installation bin directory, and we should look relative to that for libs. The Linux case is the one that's looking relative to a sysroot, so far as I can tell.

================
Comment at: lib/Driver/MinGWToolChain.cpp:194
@@ +193,3 @@
+                   + "/include/c++/" + GCCVersion + "/backward");
+#endif
+}
----------------
Please run clang-format to avoid 80col+ lines.

http://reviews.llvm.org/D5268

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list