Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 251809

Summary: dev-python/pythonmagick-0.7 fails to work with --as-needed
Product: Gentoo Linux Reporter: René 'Necoro' Neumann <gentoo>
Component: New packagesAssignee: Python Gentoo Team <python>
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 129413    
Attachments: pythonmagick's config.log
build and config log

Description René 'Necoro' Neumann 2008-12-20 23:02:21 UTC
If --as-needed is given in LDFLAGS, using pythonmagick fails with:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//usr/lib/python2.5/site-packages/PythonMagick/", line 1, in <module>
    import _PythonMagick
ImportError: /usr/lib/python2.5/site-packages/PythonMagick/ undefined symbol: _ZNK5boost6python7objects21py_function_impl_base9max_arityEv

This is because, it is not linked against libboost_python. And this in turn is because the configure script fails to find the necessairy library, because the testing application fails due to linkage errors.

I guess, the reason is because boost does not link directly against libpython. See the linker messages in the attached log file.
Comment 1 René 'Necoro' Neumann 2008-12-20 23:02:55 UTC
Created attachment 176001 [details]
pythonmagick's config.log
Comment 2 René 'Necoro' Neumann 2008-12-20 23:20:14 UTC
Well ... compiling boost with LDFLAGS="-Wl,--no-undefined" makes it abort in boost_python... So - I guess boost needs a fix so that pythonmagick can work.
Comment 3 Rafał Mużyło 2008-12-21 03:14:48 UTC
The problem here is that the missing symbols here
come from /usr/lib/libpython${PV}.so, so the most sane solution
in most of the cases will not be correct here.

Probably best move here would be to change the check they are using
with one that doesn't fail for a python module (as I suspect this could be
reproduced for any python module).
Comment 4 René 'Necoro' Neumann 2008-12-21 03:19:41 UTC
I do not understand. The problem is, that boost_python uses python-calls, but does not link against libpython. So I think, this could be solved by correctly linking boost_python :)

Changing the check in pythonmagick ... well is not possible (because it will _always_ fail with --as-needed). And even if it would: This would just be a workaround and not a fix (i.e. fix the symptom but not the problem).
Comment 5 Rafał Mużyło 2008-12-21 19:56:11 UTC
It doesn't link to python, but it still works:
didn't you wonder why ?

It's a python module - when it's used, it's loaded by python,
so it already has all of those symbols in memory.

But the python lib has ${PV} part for good reason - 
that why linking this with libpython may not be a good idea.

Then again, I may be wrong.
Comment 6 Sébastien Fabbro (RETIRED) gentoo-dev 2009-01-16 13:11:01 UTC
fixed in the just committed 0.8.
Comment 7 chengtao 2009-06-10 01:27:45 UTC
Created attachment 194065 [details]
build and config log 

I have build pythonmagic-0.8,but it have a run error,as fellow:
>>> import PythonMagick
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/PythonMagick/", line 1, in <module>
    import _PythonMagick
ImportError: /usr/lib/python2.5/site-packages/PythonMagick/ undefined symbol: _ZNK5boost6python7objects21py_function_impl_base9max_arityEv
I see you say this bug had fix in pythonmagic-0.8 in "",but it came again.
please help me ,thank you very much .