From f7852320a5b904b42e1c73965929e76da31f45d46c51735f9e5810e9120b064c Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 31 May 2017 11:38:11 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win32/mingw32-winpthreads?expand=0&rev=23 --- gcc7.patch | 42 ++++++++++++++++++++++++++++++++++++++++ mingw32-winpthreads.spec | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 gcc7.patch diff --git a/gcc7.patch b/gcc7.patch new file mode 100644 index 0000000..3e56782 --- /dev/null +++ b/gcc7.patch @@ -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__)*/ diff --git a/mingw32-winpthreads.spec b/mingw32-winpthreads.spec index 86ac4fa..4de84d3 100644 --- a/mingw32-winpthreads.spec +++ b/mingw32-winpthreads.spec @@ -28,6 +28,7 @@ Url: http://mingw-w64.sf.net/ Source: mingw-w64-winpthreads-%version.tar.xz Source9: %name-rpmlintrc Patch1: memleak.patch +Patch2: gcc7.patch BuildRequires: mingw32-cross-gcc-bootstrap BuildRequires: mingw32-cross-pkg-config BuildRequires: mingw32-filesystem @@ -65,6 +66,7 @@ mingw-w64's implementation of POSIX threads for Windows. %prep %setup -q -n winpthreads %patch1 -p1 +%patch2 -p1 %build # The build is trying to link with libpthread.a but it has no need