Enable md5 support for python 2.5.1 on AIX 5.3

H

Hajo Ehlers

Given
AIX 5.3 ML07 including
openssh.base.4.5.0.5301.I
openssl.base.0.9.8.4.I

Latest RPM packages from the AIX Toolbox 11/2007 including
- openssl-0.9.7l-2.aix5.1.ppc.rpm

Python 2.5.1

Problem:
$pythonTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/md5.py", line 6, in <module>
from hashlib import md5
File "/usr/local/lib/python2.5/hashlib.py", line 133, in <module>
md5 = __get_builtin_constructor('md5')
File "/usr/local/lib/python2.5/hashlib.py", line 60, in
__get_builtin_constructor
import _md5

Remarks:
python 2.5.1 requires openssl
openssl libraries are provided from:
- openssl.base 0.9.8.4 from IBM in installp format for the latest
openssh version and goes to /usr/lib
- openssl-0.9.7l-2 from the AIX toolbox and goes to /opt/freeware/lib

Analyse:
$ dump -Hv /usr/local/lib/python2.5/lib-dynload/_hashlib.so
/usr/local/lib/python2.5/lib-dynload/_hashlib.so:
INDEX PATH BASE MEMBER
0 /opt/freeware/lib:/usr/local/lib:/usr/vac/lib:/usr/lib/threads:/
usr/lib:/lib
1 libcrypto.a libcrypto.so.
0.9.7
2 .

$ ls -l /usr/local/lib/python2.5/lib-dynload/ | grep md5

Build environment
export LDFLAGS=" -L/opt/freeware/lib "
export CPPFLAGS=" -I/opt/freeware/include"
export OPT="-O2 -qmaxmem=-1 $CFLAGS"

../configure CC=cc_r CXX=xlC_r \
--without-gcc \
--with-gcc=cc_r \
--disable-shared \
--with-thread \
--disable-ipv6 \
--mandir=/usr/local/man \
--infodir=/usr/local/info

Thus the build has been done with the openssl version from the Toolbox
which can be seen as well from the build environment and no md5.so or
_md5.so file exist.

Solution:
For people using openssl v0.9.7 they should unmark _md5 in ./Modules/
Setup after 'configure' and before 'make'
$ perl -p -i -e 's/^#_md5/_md5/' ./Modules/Setup

For people using the openssl v0.9.8 from the openssl.base fileset
should use the following settings: ( /usr/lib is in front )
export LDFLAGS="-L/usr/lib -L/opt/freeware/lib "
export CPPFLAGS="-I/usr/include/openssl -I/opt/freeware/include"

or apply the workaround of openssl v0.9.7

hth
Hajo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,531
Members
45,004
Latest member
KetoBoostGummies

Latest Threads

Top