diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-01-11 23:14:38 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-12 21:09:02 +0000 |
| commit | fa7dd5d0460f69b8708353a3f287033fd9455418 (patch) | |
| tree | 234b8eb09c497f3f248a79c0298970538fc89f57 /meta/recipes-devtools/python/python3 | |
| parent | 90bb3644cc9dfa052154ed2a00e953ea01eaab29 (diff) | |
| download | poky-fa7dd5d0460f69b8708353a3f287033fd9455418.tar.gz | |
python3: drop unneeded multiprocessing module patch
pthread has been merged into the main libc library
(and was never separate in musl), so separate linking
for it is no longer needed.
I ran the reproducing sequence on qemux86, qemux86_64 and same targets with musl,
and it went fine:
root@qemux86:~# python3
Python 3.10.0 (default, Oct 4 2021, 17:55:55) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> pool_sema = multiprocessing.BoundedSemaphore(value=1)
>>> pool_sema.acquire()
True
>>> pool_sema.release()
>>>
(From OE-Core rev: 2eabd3b611f4afa5eafa4490b6b0ef7578b742de)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3')
| -rw-r--r-- | meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch deleted file mode 100644 index 374433c68e..0000000000 --- a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | From bad7e6a625436402a01d03021fb9ccd58bc9930f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 3 | Date: Thu, 9 Jan 2020 17:44:05 +0100 | ||
| 4 | Subject: [PATCH] setup.py: pass missing libraries to Extension for | ||
| 5 | multiprocessing module | ||
| 6 | |||
| 7 | In the following commit: | ||
| 8 | ... | ||
| 9 | commit e711cafab13efc9c1fe6c5cd75826401445eb585 | ||
| 10 | Author: Benjamin Peterson <benjamin@python.org> | ||
| 11 | Date: Wed Jun 11 16:44:04 2008 +0000 | ||
| 12 | |||
| 13 | Merged revisions 64104,64117 via svnmerge from | ||
| 14 | svn+ssh://pythondev@svn.python.org/python/trunk | ||
| 15 | ... | ||
| 16 | (see diff in setup.py) | ||
| 17 | It assigned libraries for multiprocessing module according | ||
| 18 | the host_platform, but not pass it to Extension. | ||
| 19 | |||
| 20 | In glibc, the following commit caused two definition of | ||
| 21 | sem_getvalue are different. | ||
| 22 | https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524 | ||
| 23 | (see diff in nptl/sem_getvalue.c for detail) | ||
| 24 | `__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1 | ||
| 25 | and `__old_sem_getvalue' is to compat the old version | ||
| 26 | sem_getvalue@GLIBC_2.0. | ||
| 27 | |||
| 28 | To build python for embedded Linux systems: | ||
| 29 | http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html | ||
| 30 | If not explicitly link to library pthread (-lpthread), it will | ||
| 31 | load glibc's sem_getvalue randomly at runtime. | ||
| 32 | |||
| 33 | Such as build python on linux x86_64 host and run the python | ||
| 34 | on linux x86_32 target. If not link library pthread, it caused | ||
| 35 | multiprocessing bounded semaphore could not work correctly. | ||
| 36 | ... | ||
| 37 | >>> import multiprocessing | ||
| 38 | >>> pool_sema = multiprocessing.BoundedSemaphore(value=1) | ||
| 39 | >>> pool_sema.acquire() | ||
| 40 | True | ||
| 41 | >>> pool_sema.release() | ||
| 42 | Traceback (most recent call last): | ||
| 43 | File "<stdin>", line 1, in <module> | ||
| 44 | ValueError: semaphore or lock released too many times | ||
| 45 | ... | ||
| 46 | |||
| 47 | And the semaphore issue also caused multiprocessing.Queue().put() hung. | ||
| 48 | |||
| 49 | Upstream-Status: Pending | ||
| 50 | |||
| 51 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 52 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 53 | |||
| 54 | --- | ||
| 55 | setup.py | 2 +- | ||
| 56 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 57 | |||
| 58 | diff --git a/setup.py b/setup.py | ||
| 59 | index d92face..f42bcbb 100644 | ||
| 60 | --- a/setup.py | ||
| 61 | +++ b/setup.py | ||
| 62 | @@ -1836,7 +1836,7 @@ class PyBuildExt(build_ext): | ||
| 63 | if (sysconfig.get_config_var('HAVE_SEM_OPEN') and not | ||
| 64 | sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')): | ||
| 65 | multiprocessing_srcs.append('_multiprocessing/semaphore.c') | ||
| 66 | - self.add(Extension('_multiprocessing', multiprocessing_srcs, | ||
| 67 | + self.add(Extension('_multiprocessing', multiprocessing_srcs, libraries=['pthread'], | ||
| 68 | include_dirs=["Modules/_multiprocessing"])) | ||
| 69 | |||
| 70 | if (not MS_WINDOWS and | ||
