From 6856f45178b995479b768534e7d1856574ad2663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 16 Jul 2017 03:30:01 +0200 Subject: [PATCH] python: fix i686 issues with gcc>=6.3.1 See #6321 --- .../patches/fix-i686-semaphore_lock.patch | 20 ------------------- srcpkgs/python/template | 6 +++++- 2 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 srcpkgs/python/patches/fix-i686-semaphore_lock.patch diff --git a/srcpkgs/python/patches/fix-i686-semaphore_lock.patch b/srcpkgs/python/patches/fix-i686-semaphore_lock.patch deleted file mode 100644 index 19038b013e..0000000000 --- a/srcpkgs/python/patches/fix-i686-semaphore_lock.patch +++ /dev/null @@ -1,20 +0,0 @@ -Make sure sval is set before comparing it with self->maxvalue. -Compare only if the return value was zero. -This fixes "ValueError: semaphore or lock released too many times" -which occured only for i686. - ---- Modules/_multiprocessing/semaphore.c 2016-12-17 21:05:07.000000000 +0100 -+++ Modules/_multiprocessing/semaphore.c 2016-12-31 17:42:30.429238082 +0100 -@@ -382,9 +382,10 @@ - - /* This check is not an absolute guarantee that the semaphore - does not rise above maxvalue. */ -+ int res = sem_getvalue(self->handle, &sval); -- if (sem_getvalue(self->handle, &sval) < 0) { -+ if (res < 0) { - return PyErr_SetFromErrno(PyExc_OSError); -- } else if (sval >= self->maxvalue) { -+ } else if (res == 0 && sval >= self->maxvalue) { - PyErr_SetString(PyExc_ValueError, "semaphore or lock " - "released too many times"); - return NULL; diff --git a/srcpkgs/python/template b/srcpkgs/python/template index 7e73385639..b95a421fb6 100644 --- a/srcpkgs/python/template +++ b/srcpkgs/python/template @@ -4,7 +4,7 @@ # pkgname=python version=2.7.13 -revision=4 +revision=5 wrksrc="Python-${version}" hostmakedepends="pkg-config" makedepends=" @@ -26,6 +26,10 @@ alternatives=" python:python:/usr/bin/python2.7 python:python.1:/usr/share/man/man1/python2.7.1" +case "$XBPS_TARGET_MACHINE" in + i686*) CFLAGS="-DHAVE_BROKEN_SEM_GETVALUE=1" ;; +esac + pre_configure() { # Ensure that internal copies of expat, libffi and zlib are not used. rm -r Modules/expat