[PATCH] MinGW toolchain

Johan Engelen j.b.c.engelen at alumnus.utwente.nl
Thu Jun 5 12:09:06 PDT 2014


================
Comment at: lib/Driver/MinGWToolChain.cpp:137
@@ +136,3 @@
+#ifdef _WIN32
+  // Assume sysroot toolchain
+  addSystemInclude(DriverArgs, CC1Args,
----------------
To find the correct include paths with [[ http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/ | Mingw-build packages]], "GCCVersion" has to be stripped from the paths and they need to be prepended with x86_64-w64-mingw32.
Here the code that makes it work:

  addSystemInclude(DriverArgs, CC1Args,
                   getDriver().Dir + "/../" + getTriple().getArchName().str() + "-w64-mingw32"
                   + "/include/c++");
  addSystemInclude(DriverArgs, CC1Args,
                   getDriver().Dir + "/../" + getTriple().getArchName().str() + "-w64-mingw32"
                   + "/include/c++/" + getTriple().getArchName().str() + "-w64-mingw32");
  addSystemInclude(DriverArgs, CC1Args,
                   getDriver().Dir + "/../" + getTriple().getArchName().str() + "-w64-mingw32"
                   + "/include/c++/backward");

http://reviews.llvm.org/D3420






More information about the cfe-commits mailing list