Re: Any AIX experts out there?

"M.-A. Lemburg" <[email protected]> Sat, 01 Feb 2003 23:25:03 +0100
Newsgroups gmane.comp.python.snake-farm.user
Organization eGenix.com Software GmbH
Message-ID <[email protected]>
Neal Norwitz wrote:
> On Sat, Feb 01, 2003 at 10:25:00PM +0100, M.-A. Lemburg wrote:
> 
>>Laura Creighton wrote:
>>
>>>The Snake Farm is having trouble building Python on AIX.
>>>See: 
>>>http://lists.lysator.liu.se/pipermail/snake-farm/2003-January/000654.html
>>>
>>>Does anybody recognise these symptoms?
>>
>>Some tips:
>>
>>* you may not rename the binary of the interpreter after you have
>>  built it; use a symbolic link instead (e.g. copying "python"
>>  to "python2.2" and the running python2.2 will cause the AIX
>>  dynamic linker to dump core).
>>
>>* building has to be done with:
>>
>>  configure --without-gcc
>>  gmake CC=cc_r OPT="-O2 -qmaxmem=4000"
>>  gmake CC=cc_r OPT="-O2 -qmaxmem=4000" install
>>
>>  (gmake == GNU make; this is important !)
> 
> 
> I am able to build now based on information provided by Gary Hooks
> from IBM.  Here's what he said:
> 
>         The python.exp list is wrong.  Using only the #! means that
>         every listed symbol is a deferred import, and those are
>         resolved by loading subsequent modules or calling loadbind().
>         What you need is a first line that has 3 characters: "#!."
>         The period is critical.  It tells the binder,and later the
>         loader, that the symbol comes from the main application.  This
>         is why the module call-back fails.
> 
>         The "." syntax was introduced in AIX 4.2.  The question is
>         really, what code was doing the dynamic loading?  If it worked
>         on AIX 3.2 and 4.1, then it's pretty certain that Jens
>         Uwe-Mager's dlopen implementation was being used, and his code
>         did a full loadbind() of every module against every other
>         module.  That would have resolved the deferred imports.
>         AFAIK, that old dlopen code still works, although we encourage
>         people to use the native dlopen API.
> 
>         If you put the period in, the import list won't be handled
>         properly pre-4.2.  Yes, much changed in that release.  So you
>         have a bit of a conundrum.  Not sure if configure can be
>         trained to figure out the version/release and manipulate the
>         import list appropriately...
> 
> I've modified configure to recognize if we are AIX 4.2+ and add in the
> period.  Is it possible that no one else is using dynamic (shared)
> libraries on AIX 4.2+?

No :-)

I've built Python on AIX a couple of times (both on AIX 3 and 4)
and always used shared libs (the mx tools and other third party tools).
I never had to change python.exp, so I'm not sure whether this
really fixes the problem.

Could be that makexp_aix needs fixing though: it relies on the
format of nm output, so if that changes, it's likely to cause
problems.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/