[PATCH] MinGW toolchain

Yaron Keren yaron.keren at gmail.com
Fri Apr 18 22:44:23 PDT 2014


  Chandler, I''ve contacted Ruben to contribute as well.

  David, I think Martell means that the driver needs to locate gcc and from this to find libstdc++ location.

  Martell, on previous e-mail discussion on the lists it was suggested that the best way to do this is by locating gcc.exe on the PATH. This way, you could have several MinGW versions installed on the system, possibly in non standard locations and the correct one would be chosen. Correct one means the gcc you'd get if you run gcc from the command prompt. This also avoids hardcoded paths as today.

  About the directories, it's worth supporting both MinGW-w64 and MinGW.org. Although personally I use and prefer the -w64 distribution we can't ignore MinGW.org is quite popular as well.

  Running    g++ -E -x c++ - -v < nul   you can get the include directories.
  Here is the directories I found for both distributions:

  mingw.org
  ---------
  gcc location
  BASEPATH\bin\gcc.exe

  C32 includes
  BASEPATH\lib\gcc\mingw32\X.Y.Z\include
  BASEPATH\lib\gcc\mingw32\X.Y.Z\include-fixed
  BASEPATH\include

  C++32 includes
  BASEPATH\lib\gcc\mingw32\X.Y.Z\include\c++
  BASEPATH\lib\gcc\mingw32\X.Y.Z\include\c++\mingw32
  BASEPATH\lib\gcc\mingw32\X.Y.Z\include\c++\backward

  mingw-w64
  ---------
  gcc includes
  BASEPATH\bin\gcc.exe

  C32 includes
  BASEPATH\lib\gcc\i686-w64-mingw32\X.Y.Z\include
  BASEPATH\lib\gcc\i686-w64-mingw32\X.Y.Z\include-fixed
  BASEPATH\i686-w64-mingw32\include

  C64 includes
  BASEPATH\lib\gcc\x86_64-w64-mingw32\X.Y.Z\include
  BASEPATH\lib\gcc\x86_64-w64-mingw32\X.Y.Z\include-fixed
  BASEPATH\x86_64-w64-mingw32\include

  C++32 includes
  BASEPATH\i686-w64-mingw32\include\c++

  C++64 includes
  BASEPATH\x86_64-w64-mingw32\include\c++

  I'm not sure the distribution could be reliably identified. If yes, we could add the distribution-specific includes. If not, we could add all include directories for both distributions and clang will prune the nonexisting ones. Note this will not work well if you have both disribtuions installed since all includes will be added.

http://reviews.llvm.org/D3420






More information about the cfe-commits mailing list