[PATCH] D29464: [MinGWToolChain] Don't use GCC headers on Win32

Yaron Keren via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 22:03:44 PST 2017


yaron.keren added a comment.

These directories are "mostly" equivalent, with some headers existing is mings gcc dir but missing in clang resource dir and thus will break compilation.
For example, the most popular (37089 download this week) https://sourceforge.net/projects/mingw-w64 distribuion for Windows had elected to place the includes

  omp.h, quadmath.h, openacc.h

at

  c:\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\include\

with the corresponding libraries at

  c:\mingw32\lib\gcc\i686-w64-mingw32\5.4.0\

I had verified this still holds true for the latest i686-6.3.0-release-posix-dwarf-rt_v5-rev1.7z package.
Removing the include dir will make clang less useful for  mingw users using these includes, since they will not be found anymore.
Furthermore, It makes no sense to make such intrusive wide-ranging change where the original problem was with limits.h is actually due to:

  /* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
   Avert this #include_next madness. */
  #if defined __GNUC__ && !defined _GCC_LIMITS_H_
  #define _GCC_LIMITS_H_
  #endif

so the solution may be as simple as

  #if defined __GNUC__ && !defined _GCC_LIMITS_H_ && !defined __MINGW32__
  #define _GCC_LIMITS_H_
  #endif


https://reviews.llvm.org/D29464





More information about the cfe-commits mailing list