[issue2145] ctypes.util.find_library(): posix .so without SONAME
STINNER Victor [EMAIL PROTECTED] added the comment: You can close this issue. It's not really a bug, it's a feature :-) find_library() only finds library and not programs. libdistorm64.so is compiled as a program, not a library. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
Thomas Heller [EMAIL PROTECTED] added the comment: Cool. -- resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
Changes by STINNER Victor: Added file: http://bugs.python.org/file9468/libdistorm64.so __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
Thomas Heller added the comment: Honestly I do not know enough about linux shared libraries to have any opinion about this issue. IIRC, the find_library should behave in a similar way as dynamic linking works on linux. If this libdistorm64.so is not a real so library, as you write, then maybe it should be expected that find_library does not find it. Can someone else help? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
Martin v. Löwis added the comment: haypo, can you please give precise instructions on how to reproduce this problem? a) what operating system are you using? b) what parameters are you passing to find_library? c) what result are you getting? d) what result are expecting instead? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
STINNER Victor added the comment: « haypo, can you please give precise instructions on how to reproduce this problem? » Sure. Download http://www.ragestorm.net/distorm/dl.php?id=11 (distorm-pkg1.7.28.tar.bz2), go to build/linux/. Then compile it with make and install it using make install. a) what operating system are you using? I'm using Ubuntu Gutsy, kernel 2.6.22, libc 2.6.1, ld 2.6.1, Python 2.5.1. b) what parameters are you passing to find_library? LIB_FILENAME = find_library('distorm64') c) what result are you getting? The function _findLib_ldconfig(), used by find_library() internals, returns '/usr/local/lib/libdistorm64.so.1' but _get_soname() returns an empty string. d) what result are expecting instead? _get_soname(filename) should returns filename instead of None (and not basename(filename) as I proposed). -- libdistorm64.so is not a real library, but i'm able to use it with cdll.LoadLibrary(). So I think that it can be considered as a Python (ctypes) bug. PS: Why note text box is so small (5 lines) in this bug report??? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
New submission from STINNER Victor: ctypes.util.find_library() fails to locate distorm64.so library because it has no SONAME entry: $ objdump -p -j .dynamic /usr/local/lib/libdistorm64.so /usr/local/lib/libdistorm64.so: file format elf32-i386 (...) Dynamic Section: NEEDED libc.so.6 INIT0x12f4c FINI0x1bf84 HASH0xb4 (...) Compare to libm.so: $ objdump -p -j .dynamic /usr/lib/libm.so /usr/lib/libm.so: file format elf32-i386 (...) Dynamic Section: NEEDED ld-linux.so.2 NEEDED libc.so.6 SONAME libm.so.6 INIT0x335c (...) I don't know why find_library() does use objdump to get SONAME. Workaround to find_library() bug: _get_soname() should return os.path.basename(f) instead of None. Is it correct? Note: libdistorm64.so compilation is maybe broken (it's maybe not a real so library), but I'm able to use it with ctypes :-) -- components: Library (Lib) messages: 62580 nosy: haypo severity: normal status: open title: ctypes.util.find_library(): posix .so without SONAME type: rfe versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2145] ctypes.util.find_library(): posix .so without SONAME
Martin v. Löwis added the comment: Thomas, can you take a look? -- assignee: - theller nosy: +loewis, theller __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com