diff -rcN pypy/ctypes_configure/cbuild.py /cygdrive/f/Temp/pypy/ctypes_configure/cbuild.py
*** pypy/ctypes_configure/cbuild.py	Mon May 28 17:15:08 2012
--- /cygdrive/f/Temp/pypy/ctypes_configure/cbuild.py	Tue May 29 16:14:35 2012
***************
*** 372,378 ****
          self.library_dirs = list(eci.library_dirs)
          self.compiler_exe = compiler_exe
          self.profbased = profbased
!         if not sys.platform in ('win32', 'darwin'): # xxx
              if 'm' not in self.libraries:
                  self.libraries.append('m')
              if 'pthread' not in self.libraries:
--- 372,378 ----
          self.library_dirs = list(eci.library_dirs)
          self.compiler_exe = compiler_exe
          self.profbased = profbased
!         if not sys.platform in ('win32', 'darwin', 'cygwin'): # xxx
              if 'm' not in self.libraries:
                  self.libraries.append('m')
              if 'pthread' not in self.libraries:
diff -rcN pypy/pypy/translator/platform/distutils_platform.py /cygdrive/f/Temp/pypy/pypy/translator/platform/distutils_platform.py
*** pypy/pypy/translator/platform/distutils_platform.py	Mon May 28 17:16:26 2012
--- /cygdrive/f/Temp/pypy/pypy/translator/platform/distutils_platform.py	Tue May 29 16:13:55 2012
***************
*** 52,58 ****
          self.compile_extra = list(eci.compile_extra)
          self.link_extra = list(eci.link_extra)
          self.frameworks = list(eci.frameworks)
!         if not self.name in ('win32', 'darwin'): # xxx
              if 'm' not in self.libraries:
                  self.libraries.append('m')
              self.compile_extra += CFLAGS + ['-fomit-frame-pointer']
--- 52,58 ----
          self.compile_extra = list(eci.compile_extra)
          self.link_extra = list(eci.link_extra)
          self.frameworks = list(eci.frameworks)
!         if not self.name in ('win32', 'darwin', 'cygwin'): # xxx
              if 'm' not in self.libraries:
                  self.libraries.append('m')
              self.compile_extra += CFLAGS + ['-fomit-frame-pointer']
*** pypy/pypy/translator/c/src/thread_pthread.h	Wed May 30 11:32:30 2012
--- /cygdrive/d/pypy/pypy-2/pypy/pypy/translator/c/src/thread_pthread.h	Thu May 31 11:27:32 2012
***************
*** 134,143 ****
--- 134,148 ----
  	/* Jump through some hoops for Alpha OSF/1 */
  	threadid = pthread_self();
  
+ #ifdef __CYGWIN__
+ 	/* typedef __uint32_t pthread_t; */
+ 	return (long) threadid;
+ #else
  	if (sizeof(pthread_t) <= sizeof(long))
  		return (long) threadid;
  	else
  		return (long) *(long *) &threadid;
+ #endif
  }
  
  static long _pypythread_stacksize = 0;
***************
*** 190,199 ****
--- 195,209 ----
  
          pthread_detach(th);
  
+ #ifdef __CYGWIN__
+ 	/* typedef __uint32_t pthread_t; */
+ 	return (long) th;
+ #else
  	if (sizeof(pthread_t) <= sizeof(long))
  		return (long) th;
  	else
  		return (long) *(long *) &th;
+ #endif
  }
  
  long RPyThreadGetStackSize(void)
*** pypy/pypy/rpython/memory/gctransform/framework.py	Sun Jun  3 11:01:06 2012
--- ../pypy-work/pypy/pypy/rpython/memory/gctransform/framework.py	Tue Jun  5 08:00:25 2012
***************
*** 448,453 ****
--- 448,454 ----
  
          self.write_barrier_ptr = None
          self.write_barrier_from_array_ptr = None
+         self.write_barrier_failing_case_ptr = None
          if GCClass.needs_write_barrier:
              self.write_barrier_ptr = getfn(GCClass.write_barrier.im_func,
                                             [s_gc,
