view src/mingw-w64-2-pthreads.patch @ 4467:b7d6a53fa46c

gcc: update to 7.1 with tools * src/build-gcc.mk: update version 7.1.0 * src/cloog.mk: update 0.18.4 * src/gmp.mk: update 6.1.2 * src/isl.mk: update 0.16.1, add no-undefined flag * src/mpfr.mk: update 3.1.6 * src/native-gcc.mk: update 7.1.0 * src/isl-1-fixes.patch: removed file * dist-files.mk: remove reference to patch files, add mingw-w64 patch * src/build-gcc-1-mingw-float.patch: removed patch * src/native-gcc-1-mingw-float.patch: removed patch * src/build-gcc-2-intrinsics.patch: removed patch * src/native-gcc-2-intrinsics.patch: removed patch * src/mingw-w64.mk: update to 5.0.2 * src/gcc-1-mingw-float.patch: remove patch * src/gcc-2-darwin-no-pie.patch: remove patch * src/mingw-w64-2-pthreads.patch: new file * src/pthreads.mk: apply mingw patches to mingw sources before running configure
author John D
date Mon, 31 Jul 2017 16:53:21 -0400
parents
children
line wrap: on
line source

based on https://sourceforge.net/p/mingw-w64/mailman/message/35828127/

diff -ur mingw-w64-v5.0.2.orig/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c mingw-w64-v5.0.2/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
--- mingw-w64-v5.0.2.orig/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c	2017-07-31 16:10:12.189758140 -0400
+++ mingw-w64-v5.0.2/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c	2017-07-31 16:16:42.332643290 -0400
@@ -120,6 +120,7 @@
 u_quad_t	__udivdi3(u_quad_t a, u_quad_t b);
 u_quad_t	__umoddi3(u_quad_t a, u_quad_t b);
 int		__ucmpdi2(u_quad_t a, u_quad_t b);
+quad_t		__divmoddi4(quad_t a, quad_t b, quad_t *rem);
 
 #endif /* !_LIBKERN_QUAD_H_ */
 
@@ -546,6 +547,31 @@
 	(void)__qdivrem(a, b, &r);
 	return (r);
 }
+
+/*
+ * Divide two signed quads.
+ * This function is new in GCC 7.
+ */
+quad_t
+__divmoddi4(a, b, rem)
+	quad_t a, b, *rem;
+{
+	u_quad_t ua, ub, uq, ur;
+	int negq, negr;
+
+	if (a < 0)
+		ua = -(u_quad_t)a, negq = 1, negr = 1;
+	else
+		ua = a, negq = 0, negr = 0;
+	if (b < 0)
+		ub = -(u_quad_t)b, negq ^= 1;
+	else
+		ub = b;
+	uq = __qdivrem(ua, ub, &ur);
+	if (rem)
+		*rem = (negr ? -ur : ur);
+	return (negq ? -uq : uq);
+}
 #else
 static int __attribute__((unused)) dummy;
 #endif /*deined (_X86_) && !defined (__x86_64__)*/