Issue 29440: _dbm requires -lgdbm if gdbm is built as static libraries (original) (raw)

Issue29440

Created on 2017-02-04 05:18 by yan12125, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gdbm.patch yan12125,2017-02-04 05:18
gdbm.patch yan12125,2017-02-04 15:50 The correct patch, please ignore previous one
Messages (4)
msg286907 - (view) Author: (yan12125) * Date: 2017-02-04 05:18
In setup.py, _dbm links to gdbm_compat only. If gdbm is built as dynamic libraries, libgdbm_compat.so has a NEEDED flag for libgdbm.so, so both symbols in libgdbm and libgdbm_compat can be used. However, as static libraries does not provide such a flag, importing _dbm raises ImportError: shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m -c 'import _dbm' Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "gdbm_errno" referenced by "/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_dbm.cpython-37m.so"... gdbm_errno is a symbol in libgdbm.a. gdbm manual [1] suggests linking to both libraries, too. [1] http://www.gnu.org.ua/software/gdbm/manual/html_node/Compatibility.html
msg286908 - (view) Author: (yan12125) * Date: 2017-02-04 05:21
Add the developer who wrote this line ()
msg286971 - (view) Author: (yan12125) * Date: 2017-02-04 15:50
Sorry, -lgdbm should come after -lgdbm_compat, or symbols in libgdbm.a are still not resolved. I don't know why - linking is a magic :(
msg337012 - (view) Author: (yan12125) * Date: 2019-03-02 14:37
I gave up building gdbm as a static library. It brings more headache than benefits.
History
Date User Action Args
2022-04-11 14:58:42 admin set github: 73626
2019-03-02 14:37:49 yan12125 set status: open -> closedresolution: wont fixmessages: + stage: resolved
2017-02-04 15:50:03 yan12125 set files: + gdbm.patchmessages: +
2017-02-04 05:21:06 yan12125 set nosy: + ncoghlanmessages: +
2017-02-04 05🔞54 yan12125 create