From 367ce900a515515f221502f6020f04ea87cd5104526d2c732f8feb481b646fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Tue, 10 Jan 2017 08:01:24 +0000 Subject: [PATCH] Add memleak.patch to fix https://sourceforge.net/p/mingw-w64/bugs/571/ OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win32/mingw32-winpthreads?expand=0&rev=20 --- memleak.patch | 16 ++++++++++++++++ mingw32-winpthreads.spec | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 memleak.patch diff --git a/memleak.patch b/memleak.patch new file mode 100644 index 0000000..ab88bbb --- /dev/null +++ b/memleak.patch @@ -0,0 +1,16 @@ +Index: winpthreads/src/thread.c +=================================================================== +--- winpthreads.orig/src/thread.c ++++ winpthreads/src/thread.c +@@ -295,8 +295,10 @@ push_pthread_mem (_pthread_v *sv) + memset (sv, 0, sizeof(struct _pthread_v)); + if (pthr_last == NULL) + pthr_root = pthr_last = sv; +- else ++ else { + pthr_last->next = sv; ++ pthr_last = sv; ++ } + pthread_mutex_unlock (&mtx_pthr_locked); + } + diff --git a/mingw32-winpthreads.spec b/mingw32-winpthreads.spec index 8078635..6c16836 100644 --- a/mingw32-winpthreads.spec +++ b/mingw32-winpthreads.spec @@ -27,6 +27,7 @@ Url: http://mingw-w64.sf.net/ #DL-URL: http://download.sf.net/mingw-w64/mingw-w64-v5.0-rc1.tar.bz2 Source: mingw-w64-winpthreads-%version.tar.xz Source9: %name-rpmlintrc +Patch1: memleak.patch BuildRequires: mingw32-cross-gcc-bootstrap BuildRequires: mingw32-cross-pkg-config BuildRequires: mingw32-filesystem @@ -63,6 +64,7 @@ mingw-w64's implementation of POSIX threads for Windows. %prep %setup -q -n winpthreads +%patch1 -p1 %build # The build is trying to link with libpthread.a but it has no need