From 2ec72372c03a1a69351b6261f08e4772bdf2c26f88b096c0b86dc6425ff9160a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Mon, 9 Jan 2017 18:03:02 +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:win64/mingw64-winpthreads?expand=0&rev=18 --- memleak.patch | 16 ++++++++++++++++ mingw64-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/mingw64-winpthreads.spec b/mingw64-winpthreads.spec index f952395..87ff4b1 100644 --- a/mingw64-winpthreads.spec +++ b/mingw64-winpthreads.spec @@ -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 +Patch1: memleak.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 +%patch1 -p1 %build # The build is trying to link with libpthread.a but it has no need