2
0
Fridrich Strba 2017-05-31 18:51:30 +00:00 committed by Git OBS Bridge
parent 7cfedc1993
commit 35543d1538
2 changed files with 44 additions and 0 deletions

42
gcc7.patch Normal file
View File

@ -0,0 +1,42 @@
--- winpthreads/src/libgcc/dll_math.c 2013-04-10 20:11:34.000000000 +0200
+++ winpthreads/src/libgcc/dll_math.c 2017-05-31 13:02:25.869883546 +0200
@@ -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__)*/

View File

@ -27,6 +27,7 @@ Url: http://mingw-w64.sf.net/
#DL-URL: http://downloads.sf.net/mingw-w64/mingw-w64-v5.0-rc1.tar.bz2
Source: mingw-w64-winpthreads-%version.tar.xz
Source9: %name-rpmlintrc
Patch0: gcc7.patch
BuildRequires: mingw64-cross-gcc-bootstrap
BuildRequires: mingw64-cross-pkg-config
BuildRequires: mingw64-filesystem
@ -63,6 +64,7 @@ mingw-w64's implementation of POSIX threads for Windows.
%prep
%setup -q -n winpthreads
%patch0 -p1
%build
# The build is trying to link with libpthread.a but it has no need