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/__init__.py", line 1, in <module> import _PythonMagick ImportError: /usr/lib/python2.5/site-packages/PythonMagick/_PythonMagick.so: 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.
Created attachment 176001 [details] pythonmagick's config.log
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.
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).
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).
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.
fixed in the just committed 0.8.
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/__init__.py", line 1, in <module> import _PythonMagick ImportError: /usr/lib/python2.5/site-packages/PythonMagick/_PythonMagick.so: undefined symbol: _ZNK5boost6python7objects21py_function_impl_base9max_arityEv I see you say this bug had fix in pythonmagic-0.8 in "http://bugs.gentoo.org/show_bug.cgi?id=251809",but it came again. please help me ,thank you very much .