Hi Martin,

> I'm by no means expert on bootloader code, but you should find place in
> the code where the python code is actually executed. See how it works
> and how it could be changed to run python code with statically linked
> python.

It took some debugging (past fork/exec calls) to find out why the
bootloader did not work. I found out that the child process crashed
with a segmentation fault when accessing undefined (NULL) Python
library symbols.

In the bootloader code, all Python symbols are referenced via PI_
prefixed variables which are pointers to the real Python library
symbols. E.g.
* 'PI_Py_NoSiteFlag' is a pointer to the Python library variable
'Py_NoSiteFlag'
* 'PI_Py_SetProgramName' is a pointer to the Python function
'Py_SetProgramName'

These symbols are declared, defined and bound like this using macros
defined in the file 'common/launch.h':
* The macros EXTDECLPROC and EXTDECLVAR are used to declare these
'PI_' symbols.
* The macros DECLPROC and DECLVAR are named a bit misleading but are
used to define the same symbols and assign them the value NULL.
* The macros GETPROCOPT, GETPROC and GETVAR are used to bind the
Python library symbols to the 'PI_' prefixed symbols.

On Windows and on Linux the binding of the symbols are done by loading
the Python library symbols dynamically in the code generated by the
GET* macros.

I have made some small changes to all the macros above in the AIX/
static-link case so the 'PI_' symbols are simply assigned the
addresses of the statically linked Python lib symbols.

And it seems to work. At least I can run a small test script that
prints to the console and writes a text file.

So far so good. :-)

Now, I have to do a little clean-up, look at TCL/TK detection (if it
makes sense on AIX) and run the tests.

/Martin

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to