embedding on aix fails

apolloner apolloner at bap.at
Wed Apr 9 01:05:49 EDT 2003


AIX 4.3.3
VisualAge C++ Professional / C for AIX Compiler, Version 6
Python 2.2.2 

I have an executable named t and it works fine .
then I do a link 
$ ln t x ( or: $ ln t z )
and try to run this x ... and I get a Segmentation fault(coredump) !
$ ln t y
and run y and it works.

The program is using the python library and if the segfault happens,
it is because the adress of the Py_InitModule4 function is 
wrong in initstrop after loading the library strop.so dynamically.
Executing t or y this adress is ok ! ( verified with testprints ) 

Python itself works great , loading all these libraries without any problem !

the program :

#include "Python.h"
int main(int argc, char ** argv)
  {
  Py_Initialize();
  PyRun_SimpleString("from string import *\n");
  }

cc_r -Wl,-bE:Modules/python.exp -I. -I./Include -o t t.c \
    libpython2.2.a -lld  -ldl -lm

ptyhon is compiled in the following way ( output of make ) 

cc_r  -Wl,-bE:Modules/python.exp -lld -o python  Modules/python.o  \
    libpython2.2.a -ldl    -lm

what could be wrong with my linkage ??

regards
udo




More information about the Python-list mailing list