diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2019-02-06 17:26:34 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-08 10:57:19 +0000 |
| commit | e2c3247c233876ab090c9ce3d5325a6d46ab350f (patch) | |
| tree | cf38957a3510be612cde924f6184a5251b968a43 /meta/recipes-devtools/python/python3/0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch | |
| parent | cd6c61a26177296e24b442e2eda1514b5f931c0a (diff) | |
| download | poky-e2c3247c233876ab090c9ce3d5325a6d46ab350f.tar.gz | |
python3: upgrade to 3.7.2
I took the same approach as the recent perl upgrade: write recipe from scratch,
taking the pieces from the old recipe only when they were proven to be necessary.
The pgo, manifest and ptest features are all preserved.
New features:
- native and target recipes are now unified into one recipe
- check_build_completeness.py runs right after do_compile() and verifies that
all optional modules have been built (a notorious source of regressions)
- a new approach to sysconfig.py and distutils/sysconfig.py returning values
appropriate for native or target builds: we copy the configuration file to a
separate folder, add that folder to sys.path (through environment variable
that differs between native and target builds), and point python to the file
through another environment variable.
There were a few other patches where it was difficult to decide if the patch
is still relevant, and how to test that it works correctly; please add those
as-needed by testing the new python.
(From OE-Core rev: 02714c105426b0d687620913c1a7401b386428b6)
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3/0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch')
| -rw-r--r-- | meta/recipes-devtools/python/python3/0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch b/meta/recipes-devtools/python/python3/0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch new file mode 100644 index 0000000000..b9d5bc9c51 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | From b881a79adcd4ae5ac8fe4f49d0fc77c47f777919 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Fri, 4 Aug 2017 11:16:14 +0800 | ||
| 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: Submitted [https://github.com/python/cpython/pull/2999] | ||
| 50 | |||
| 51 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 52 | --- | ||
| 53 | setup.py | 7 +++++-- | ||
| 54 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 55 | |||
| 56 | diff --git a/setup.py b/setup.py | ||
| 57 | index b7a36a6..658ead3 100644 | ||
| 58 | --- a/setup.py | ||
| 59 | +++ b/setup.py | ||
| 60 | @@ -1584,8 +1584,10 @@ class PyBuildExt(build_ext): | ||
| 61 | elif host_platform.startswith('netbsd'): | ||
| 62 | macros = dict() | ||
| 63 | libraries = [] | ||
| 64 | - | ||
| 65 | - else: # Linux and other unices | ||
| 66 | + elif host_platform.startswith(('linux')): | ||
| 67 | + macros = dict() | ||
| 68 | + libraries = ['pthread'] | ||
| 69 | + else: # Other unices | ||
| 70 | macros = dict() | ||
| 71 | libraries = ['rt'] | ||
| 72 | |||
| 73 | @@ -1603,6 +1605,7 @@ class PyBuildExt(build_ext): | ||
| 74 | |||
| 75 | exts.append ( Extension('_multiprocessing', multiprocessing_srcs, | ||
| 76 | define_macros=list(macros.items()), | ||
| 77 | + libraries=libraries, | ||
| 78 | include_dirs=["Modules/_multiprocessing"])) | ||
| 79 | # End multiprocessing | ||
| 80 | |||
