Issue 118621 - python: build breaks due to undefined symbol: dbm_nextkey in dbm.so module
python: build breaks due to undefined symbol: dbm_nextkey in dbm.so module
Status: CLOSED FIXED
Product: Build Tools
Classification: Code
Component: external prerequisites
4.0.0-dev
PC Linux
: P5 major (vote)
: ---
Assigned To: Ariel Constenla-Haile
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-19 22:23 UTC by Ariel Constenla-Haile
Modified: 2013-02-21 23:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
Patch to solve linking issues (6.53 KB, patch)
2011-11-20 22:09 UTC, Ariel Constenla-Haile
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Ariel Constenla-Haile 2011-11-19 22:23:13 UTC
Build breaks on Fedora 16:

building 'dbm' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_GDBM_NDBM_H -I. -I/mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/Python-2.6.1/./Include -I. -IInclude -I./Include -I/usr/local/include -I/mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/Python-2.6.1/Include -I/mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/Python-2.6.1 -c /mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/Python-2.6.1/Modules/dbmmodule.c -o build/temp.linux-x86_64-2.6/mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/Python-2.6.1/Modules/dbmmodule.o
gcc -pthread -shared build/temp.linux-x86_64-2.6/mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/Python-2.6.1/Modules/dbmmodule.o -L/mnt/build/openoffice/apache/trunk/main/python/unxlngx6/misc/build/python-inst/lib -L/usr/local/lib -L. -lgdbm -lpython2.6 -o build/lib.linux-x86_64-2.6/dbm.so
*** WARNING: renaming "dbm" since importing it failed: build/lib.linux-x86_64-2.6/dbm.so: undefined symbol: dbm_nextkey

[...]

Failed to build these modules:
dbm                                                   

[...]
ERROR: error 65280 occurred while making /mnt/build/openoffice/apache/trunk/main/python


Modules/dbmmodule.c uses the old interface, but links only to gdbm, where the function is named gdbm_nextkey. It should also link against the compatiblity library (in systems where there is one).
Comment 1 Ariel Constenla-Haile 2011-11-19 22:43:33 UTC
Notice that the second time you try to build the python module, without cleaning the output directory, the build does not fail (does Python modules are  built by Python itself, not make, and does no return an exit code in this case).
Comment 2 Ariel Constenla-Haile 2011-11-19 23:51:41 UTC
the issue is solved in upstream-Python:

Issue 4587
Title:	Need to rework the dbm lib/include selection process
http://bugs.python.org/issue4587

http://hg.python.org/cpython/diff/2ef2cb5773fe/setup.py
Comment 3 Ariel Constenla-Haile 2011-11-20 22:09:44 UTC
Created attachment 77036 [details]
Patch to solve linking issues

The patch applies the upstream fix http://hg.python.org/cpython/diff/2ef2cb5773fe/setup.py

This patch is attached here just in case anyone wants to build the dbm.so module. It can not be applied in OOo because it will not work in a generic Linux build (the module is linked against different libraries on different systems, so a generic build may result in undefined symbols).

I guess no one will complain about OOo not including this python module, it seems it wasn't shipped with the generic Linux build (at least 330m20 (Build:9567) does not ship it).
Comment 4 Ariel Constenla-Haile 2012-01-28 13:52:55 UTC
Fixed in Revision 1204286