SWIG crashes on AIX (with python, and probably everything else SWIG support)

此生再无相见时 提交于 2019-12-04 17:38:15

This post didn't help me directly, but again pointed me in the right direction - but then the situation is different, I am building an embedded python. See http://docs.python.org/extending/embedding.html#linking-requirements

>>> import distutils.sysconfig
>>> distutils.sysconfig.get_config_var("LINKFORSHARED")
'-Wl,-bE:Modules/python.exp -lld'
Davide

This is not an actual question, but a report on how I fixed my problem (see here why I'm doing this). And actually I wasn't able to solve it myself, but it was thanks to this other guy. I am rewriting it here, because he was too specific (AIX 5.1 with perl and C++, and I found him serendipitously, while I was searching for something else! I wasn't able to find his answer at all when I was searching for this problem! I hope this post will be more findable to others! My problem is on AIX 5.3 with python and C. I believe that it is common to every SWIG installation on AIX (thus I didn't tag python and C). I'll contact the developers soon so they might fix the help in the first place.

Well, the fix is simply to use a different link line, in particular as follows:

ld -G -bI:/your-python-path/lib/python2.5/config/python.exp -bnoentry -bexpall -lC -lc -ldl example.o example_wrap.o -o _example.so

The key is the exp file, which you should find yourself for your language/installation:

find /your-python-or-perl-or-other-language-path/ -name *exp

Hope this helps!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!