[issue21668] The select and time modules uses libm functions without linking against it

Chi Hsuan Yen report at bugs.python.org
Thu Nov 26 06:25:35 EST 2015


Chi Hsuan Yen added the comment:

Bump. For rev c6930661599b 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 at GT-N7000:/data/local/tmp $ python3
Python 3.6.0a0 (default:6a8fbb97c8d8+, Nov 26 2015, 18:42:29) 
[GCC 4.9 20140827 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import select 
>>> import time
>>> import audioop
Traceback (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_test
Traceback (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 at GT-N7000:/data/local/tmp $ python3
Python 3.6.0a0 (default:c6930661599b+, Nov 26 2015, 19:10:15) 
[GCC 4.9 20140827 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> import selectr
Traceback (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

----------
nosy: +Chi Hsuan Yen
Added file: http://bugs.python.org/file41168/python-hg-modules-link-libm.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21668>
_______________________________________


More information about the Python-bugs-list mailing list