From ca1542cdf6b6437a2f3dcdb33ac5216bf841c04a Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Fri, 4 Aug 2017 04:18:45 -0400 Subject: python2/python3: fix multiprocessing.BoundedSemaphore not work on qemux86/qemuarm In upstream, the following commit: https://github.com/python/cpython/commit/e711cafab13efc9c1fe6c5cd75826401445eb585 ... commit e711cafab13efc9c1fe6c5cd75826401445eb585 Author: Benjamin Peterson Date: Wed Jun 11 16:44:04 2008 +0000 Merged revisions 64104,64117 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ... (see diff in setup.py) It assigned libraries for multiprocessing module according the host_platform, but not pass it to Extension. In glibc, the following commit caused two definition of sem_getvalue are different. https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524 (see diff in nptl/sem_getvalue.c for detail) `__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1 and `__old_sem_getvalue' is to compat the old version sem_getvalue@GLIBC_2.0. If not explicitly link to library pthread (-lpthread), it will load glibc's sem_getvalue randomly at runtime. Such as build python on linux x86_64 host and run the python on linux x86_32 target. If not link library pthread, it caused multiprocessing bounded semaphore could not work correctly. ... >>> import multiprocessing >>> pool_sema = multiprocessing.BoundedSemaphore(value=1) >>> pool_sema.acquire() True >>> pool_sema.release() Traceback (most recent call last): File "", line 1, in ValueError: semaphore or lock released too many times ... And the semaphore issue also caused multiprocessing.Queue().put() hung. Signed-off-by: Hongxu Jia Signed-off-by: Ross Burton --- meta/recipes-devtools/python/python_2.7.13.bb | 1 + 1 file changed, 1 insertion(+) (limited to 'meta/recipes-devtools/python/python_2.7.13.bb') diff --git a/meta/recipes-devtools/python/python_2.7.13.bb b/meta/recipes-devtools/python/python_2.7.13.bb index 4ef99523e0..98bc8ada8b 100644 --- a/meta/recipes-devtools/python/python_2.7.13.bb +++ b/meta/recipes-devtools/python/python_2.7.13.bb @@ -27,6 +27,7 @@ SRC_URI += "\ file://use_sysroot_ncurses_instead_of_host.patch \ file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ file://Don-t-use-getentropy-on-Linux.patch \ + file://pass-missing-libraries-to-Extension-for-mul.patch \ " S = "${WORKDIR}/Python-${PV}" -- cgit v1.2.3