
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-06-05 12:56 byfornwall, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| time_and_select_module_link_with_libm.patch | fornwall,2014-06-05 12:56 | review | ||
| audioop_ctypes_test_link_with_libm.patch | WanderingLogic,2014-10-27 15:46 | Additional patch to deal with missing -lm flag for audioop and _ctypes_test. | ||
| time_select_audioop_ctypes_test_link_with_libm.patch | WanderingLogic,2014-10-27 17:34 | Combined patches to add '-lm' flag. | review | |
| python-hg-modules-link-libm.patch | yan12125,2015-11-26 11:25 | review | ||
| ext_modules_libm.patch | xdegaye,2016-04-19 07:54 | review | ||
| Messages (15) | |||
|---|---|---|---|
| msg219813 -(view) | Author: Fredrik Fornwall (fornwall)* | Date: 2014-06-05 12:56 | |
The select and time modules use functions from libm, but do not link against it.* selectmodule.c calls ceil(3) in pyepoll_poll()* timemodule.c calls fmod(3) and floor(3) in floatsleep() | |||
| msg219814 -(view) | Author: Fredrik Fornwall (fornwall)* | Date: 2014-06-05 12:57 | |
Note: This causes problems at least when running on android, where the system is unable to find the symbols when loading the modules at runtime. | |||
| msg230076 -(view) | Author: Matt Frank (WanderingLogic)* | Date: 2014-10-27 15:54 | |
Additionally,* audioop calls floor()* _ctypes_test calls sqrt()Patch attached. | |||
| msg230077 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2014-10-27 15:58 | |
> audioop_ctypes_test_link_with_libm.patch + libraries=['m'])Why not using math_libs here? It would also be nice to add a comment explaining why libm is needed in each module.Can someone please combine both patches? | |||
| msg230080 -(view) | Author: Matt Frank (WanderingLogic)* | Date: 2014-10-27 17:34 | |
>> audioop_ctypes_test_link_with_libm.patch > + libraries=['m'])> Why not using math_libs here?math_libs is defined in detect_modules(). But the _ctypes_testextension is defined in a different function: detect_ctypes().The other option, would be to define math_libs=['m'] directly above this line and then use it once. I didn't think that added clarity, but I'd be happy to do it that way if it fits better with standard style.> It would also be nice to add a comment explaining why libm is needed in each module.Done.> Can someone please combine both patches?Done. | |||
| msg255410 -(view) | Author: (yan12125)* | Date: 2015-11-26 11:25 | |
Bump. For revc6930661599b timemodule.c and selectmodule.c no longer calls libm functions, while audioop.c and _ctypes_test.c still do. I have my updated patch here based on previous patches. Note that the introduction of detect_math_libs() is my naive try. Its naming and position in setup.py may need more consideration.Here's the result before and after my patch.Before:shell@GT-N7000:/data/local/tmp $ python3Python 3.6.0a0 (default:6a8fbb97c8d8+, Nov 26 2015, 18:42:29) [GCC 4.9 20140827 (prerelease)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import select >>> import time>>> import audioopTraceback (most recent call last): File "<stdin>", line 1, in <module>ImportError: dlopen failed: cannot locate symbol "floor" referenced by "audioop.cpython-36m-arm-linux-gnueabi.so"...>>> import _ctypes_testTraceback (most recent call last): File "<stdin>", line 1, in <module>ImportError: dlopen failed: cannot locate symbol "sqrt" referenced by "_ctypes_test.cpython-36m-arm-linux-gnueabi.so"...>>> After:shell@GT-N7000:/data/local/tmp $ python3Python 3.6.0a0 (default:c6930661599b+, Nov 26 2015, 19:10:15) [GCC 4.9 20140827 (prerelease)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import time>>> import selectrTraceback (most recent call last): File "<stdin>", line 1, in <module>ImportError: No module named 'selectr'>>> import select >>> import audioop>>> import _ctypes_test>>> Tested on Samsung Galaxy Note GT-N7000 with my custom build of CyanogenMod 11.0 | |||
| msg255411 -(view) | Author: (yan12125)* | Date: 2015-11-26 11:27 | |
Well, the hg revision of Python in two tests are different, because I `hg pull -u` each time I build. | |||
| msg263716 -(view) | Author: Xavier de Gaye (xdegaye)*![]() | Date: 2016-04-19 07:54 | |
The _datetime module also calls functions in libm: delta_new() usesround() and accum() uses modf().The attached patch updates setup.py for all the modules that use libm. | |||
| msg263718 -(view) | Author: (yan12125)* | Date: 2016-04-19 08:03 | |
The approach with a helper function is better. Seehttps://github.com/yan12125/python3-android/blob/038271d/mk/python/modules-link-libm.patch.By the way, I have verified there are no libraries referencing libm functions withhttps://github.com/yan12125/python3-android/blob/cpython-hg/devscripts/import_all.py | |||
| msg263738 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-04-19 13:58 | |
New changesetf92fea23161d by Victor Stinner in branch '3.5':setup.py: add missing libm dependencyhttps://hg.python.org/cpython/rev/f92fea23161dNew changeset3a9b47b062b9 by Victor Stinner in branch 'default':Merge 3.5: Issue#21668https://hg.python.org/cpython/rev/3a9b47b062b9 | |||
| msg263739 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2016-04-19 14:00 | |
I pushed ext_modules_libm.patch with the helper function proposed by Chi Hsuan Yen inhttps://github.com/yan12125/python3-android/blob/038271d/mk/python/modules-link-libm.patch.Tell me if it's not enough. I hope that it will make CPython a little bit more portable ;-) | |||
| msg263803 -(view) | Author: Xavier de Gaye (xdegaye)*![]() | Date: 2016-04-20 07:14 | |
The patch should be acknowledged inMisc/NEWS to Chi Hsuan Yen and not to me. | |||
| msg263811 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-04-20 07:58 | |
New changesetf76753f26982 by Victor Stinner in branch 'default':Issue#21668: Fix author of the patch.https://hg.python.org/cpython/rev/f76753f26982 | |||
| msg263812 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-04-20 08:02 | |
New changeset7530caa5ed1a by Victor Stinner in branch 'default':Issue#21668: Add also Chi Hsuan Yen toMisc/ACKShttps://hg.python.org/cpython/rev/7530caa5ed1a | |||
| msg263813 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2016-04-20 08:02 | |
> Xavier de Gaye: "The patch should be acknowledged inMisc/NEWS to Chi Hsuan Yen and not to me."Oh sorry. I see 4 authors in attached patches, I picked the latest. Thank you to all authors for your contribution on this issue ;-) I fixed the author inMisc/NEWS. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:04 | admin | set | github: 65867 |
| 2016-04-20 08:02:15 | vstinner | set | messages: +msg263813 |
| 2016-04-20 08:02:13 | python-dev | set | messages: +msg263812 |
| 2016-04-20 07:58:21 | python-dev | set | messages: +msg263811 |
| 2016-04-20 07:14:16 | xdegaye | set | messages: +msg263803 |
| 2016-04-19 14:00:07 | vstinner | set | status: open -> closed resolution: fixed messages: +msg263739 versions: + Python 3.6, - Python 3.4 |
| 2016-04-19 13:58:47 | python-dev | set | nosy: +python-dev messages: +msg263738 |
| 2016-04-19 08:03:57 | yan12125 | set | messages: +msg263718 |
| 2016-04-19 07:54:18 | xdegaye | set | files: +ext_modules_libm.patch nosy: +xdegaye messages: +msg263716 |
| 2015-11-26 11:27:38 | yan12125 | set | messages: +msg255411 |
| 2015-11-26 11:25:35 | yan12125 | set | files: +python-hg-modules-link-libm.patch nosy: +yan12125 messages: +msg255410 |
| 2015-02-23 14:38:36 | vstinner | link | issue23496 dependencies |
| 2014-10-27 17:34:48 | WanderingLogic | set | files: +time_select_audioop_ctypes_test_link_with_libm.patch messages: +msg230080 |
| 2014-10-27 15:58:49 | vstinner | set | messages: +msg230077 |
| 2014-10-27 15:57:51 | WanderingLogic | set | nosy: +freakboy3742 |
| 2014-10-27 15:54:51 | WanderingLogic | set | messages: +msg230076 |
| 2014-10-27 15:46:24 | WanderingLogic | set | files: +audioop_ctypes_test_link_with_libm.patch nosy: +WanderingLogic |
| 2014-06-05 13:18:30 | vstinner | set | nosy: +vstinner |
| 2014-06-05 12:57:24 | fornwall | set | messages: +msg219814 |
| 2014-06-05 12:56:33 | fornwall | create | |