[cfe-dev] MinGW build does not compile with C++11

Meador Inge meadori at codesourcery.com
Tue Mar 11 12:04:51 PDT 2014


On 03/11/2014 09:21 AM, Rafael EspĂ­ndola wrote:

> According to http://stackoverflow.com/questions/19666666/mingw-g-does-not-recognize-off-t-when-compiling-with-c11
> it should be possible to use gnu++11 on mingw. Is that sufficient to
> build llvm+clang?

It is.  I recently ran into this problem and patching with the following allows
a full build of LLVM/Clang for i686-mingw32 host (GCC 4.7.2):

--- Makefile.rules      (revision 203598)
+++ Makefile.rules      (working copy)
@@ -322,7 +322,13 @@ endif
 ifeq ($(ENABLE_CXX1Y),1)
   CXX.Flags += -std=c++1y
 else
-       CXX.Flags += -std=c++11
+  ifeq ($(HOST_OS),MingW)
+    # MinGW is a bit stricter and lacks things like
+    # 'strdup', 'stricmp', etc...
+    CXX.Flags += -std=gnu++11
+  else
+    CXX.Flags += -std=c++11
+  endif
 endif

I am happy to apply the above if others are OK with it.
I am currently interested in using mingw32.

-- 
Meador Inge
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list