                      d = os.path.normpath(self.get_libgcc_dir())
                      root = os.path.join(d, os.pardir, os.pardir, os.pardir, os.pardir)
                      mingwdir = os.path.normpath(os.path.join(root, target, "lib"))
-@@ -318,19 +318,23 @@
+@@ -318,19 +325,23 @@
          if sys.platform == 'darwin':
              opt.remove('cc_dynamic')
          if sys.platform == 'win32':

diff -ruN numpy-1.8.0/numpy/distutils/fcompiler/gnu.py numpy-1.8.0-new/numpy/distutils/fcompiler/gnu.py
--- numpy-1.8.0/numpy/distutils/fcompiler/gnu.py	2013-10-30 12:31:40.000000000 -0600
+++ numpy-1.8.0-new/numpy/distutils/fcompiler/gnu.py	2014-02-28 13:01:45.916408800 -0700
@@ -302,9 +302,9 @@
         opt = GnuFCompiler.get_library_dirs(self)
         if sys.platform == 'win32':
             c_compiler = self.c_compiler

     def get_target(self):
diff -ruN numpy-1.8.0/numpy/distutils/mingw32ccompiler.py numpy-1.8.0-new/numpy/distutils/mingw32ccompiler.py
--- numpy-1.8.0/numpy/distutils/mingw32ccompiler.py	2013-10-30 12:31:40.000000000 -0600
+++ numpy-1.8.0-new/numpy/distutils/mingw32ccompiler.py	2014-03-07 09:32:42.906849900 -0700
@@ -95,7 +95,9 @@
         msvcr_dbg_success = build_msvcr_library(debug=True)
         if msvcr_success or msvcr_dbg_success:
             # add preprocessor statement for using customized msvcr lib
-            self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR')
+            # on 64-bit only.  Otherwise mingw32 fails on 32 bit.
+            if get_build_architecture() == 'AMD64':
+              self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR')
 
         # Define the MSVC version as hint for MinGW
         msvcr_version = '0x%03i0' % int(msvc_runtime_library().lstrip('msvcr'))
@@ -176,7 +178,8 @@
              target_lang=None):
         # Include the appropiate MSVC runtime library if Python was built
         # with MSVC >= 7.0 (MinGW standard is msvcrt)
