classification
Title: ffi.c compile failures on AIX 5.3 with xlc
Type: compile error Stage: resolved
Components: ctypes Versions: Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: aixtools@gmail.com, akuchling, bugs-python@vendor.thewrittenword.com, drkirkby, elyeshel, gpion, pitrou, rubisher, sable
Priority: low Keywords: patch

Created on 2009-05-12 17:11 by elyeshel, last changed 2015-04-24 01:28 by aixtools@gmail.com. This issue is now closed.

Files
File name Uploaded Description Edit
pyffi.patch bugs-python@vendor.thewrittenword.com, 2010-04-26 17:28 Patch for fficonfig.py.in to use correct source file review
Messages (11)
msg87642 - (view) Author: Ely Eshel (elyeshel) Date: 2009-05-12 17:11
Building Python 3.0.1 with xlc on AIX 5.3, The following compiler 
errros come up:
/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 141.25: 1506-045 
(S) Undeclared identifier FFI_LINUX_SOFT_FLOAT.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 601.19: 1506-045 
(S) Undeclared identifier FFI_LINUX_SOFT_FLOAT.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 604.19: 1506-045 
(S) Undeclared identifier FFI_LINUX64.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 668.23: 1506-045 
(S) Undeclared identifier FFI_SYSV.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 902.10: 1506-045 
(S) Undeclared identifier FFI_SYSV.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 902.10: 1506-051 
(S) Case expression must be a valid integral constant.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 903.10: 1506-045 
(S) Undeclared identifier FFI_GCC_SYSV.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 903.10: 1506-051 
(S) Case expression must be a valid integral constant.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 904.10: 1506-045 
(S) Undeclared identifier FFI_LINUX.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 904.10: 1506-051 
(S) Case expression must be a valid integral constant.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 905.10: 1506-045 
(S) Undeclared identifier FFI_LINUX_SOFT_FLOAT.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 905.10: 1506-051 
(S) Case expression must be a valid integral constant.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 1027.26: 1506-045 
(S) Undeclared identifier FFI_SYSV.
"/home11/eeshel/dev/python/Python-
3.0.1/Modules/_ctypes/libffi/src/powerpc/ffi.c", line 1152.27: 1506-045 
(S) Undeclared identifier FFI_LINUX_SOFT_FLOAT.

Configuration command was:
configure --prefix=/home/eeshel/bin/python/python-3.0.1 --exec-
prefix=/home/eeshel/bin/python/python-3.0.1/ibm --with-
gcc="/bb/util/version10-022009/usr/vacpp/bin/xlc_r -Wl,-G" --with-
cxx="/bb/util/version10-022009/usr/vacpp/bin/xlc_r -Wl,-G" --disable-
ipv6 --disable-shared --with-threads
msg89139 - (view) Author: rubisher (rubisher) Date: 2009-06-09 08:09
Just to mention the same issue for Python-2.6.2 and gcc-4.2.0 on aix 
5.3 too.
msg89144 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-06-09 11:18
AIX doesn't seem listed in the platforms supported by libffi.
http://sourceware.org/libffi/ suggests you send platform test results to
libffi-discuss@sourceware.org

On the other hand, perhaps the libffi version which comes with Python is
outdated.
msg89188 - (view) Author: rubisher (rubisher) Date: 2009-06-10 07:16
Having a look at
<http://www-
03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html>

gcc libffi is wel available for Aix, though?

That said, I just need python for bzr and associated tools to maintain 
localy a small number of script, so imho I would be able survive 
without ffi support in python (even _ctype?).

Any idea how to remove this support at build from src time: I have a 
look at ./configure --help and even try to change some other 
compilation option like -O2 (in place of default -O3) but nothing 
seems to be helpfull.

Tx for additional advise.
msg91396 - (view) Author: rubisher (rubisher) Date: 2009-08-07 08:52
Well a few spare time let me investigate this way: using gc[cj] libffi.

I so first install libffi-4.2.0-3 as well as libffi-devel-4.2.0-3 (not
sure this last one is required, though) then configure python (2.6) with
--with-system-ffi but it doesn't seems to be enough to locate libffi so
I added symbolic links:
/usr/lib/libffi.a -> ../../opt/freeware/lib/libffi.a

/usr/include/ffi.h -> \
../../opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/include/ffi.h
/usr/include/ffitarget.h -> \
../../opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/include/ffitarget.h

After that I reach to compile python2.6.2 without error and at a first
glance it seems to work fine (just rebuild bzr 1.17 and launch some
cmdl, ;<)).

Hope this could help for python3 and xlC,
    r.
msg104255 - (view) Author: The Written Word (bugs-python@vendor.thewrittenword.com) Date: 2010-04-26 17:28
Python is using the wrong ffi code, it should be using ffi_darwin.c
msg132079 - (view) Author: David Kirkby (drkirkby) Date: 2011-03-25 12:04
I've just downloaded libffi-3.0.9 (the latest) and it builds with no problems on my AIX 5.3 system. 

Is there any chance of the version of libffi in Python being updated?
msg144369 - (view) Author: Gilles PION (gpion) Date: 2011-09-21 07:07
According to ffi site (http://sourceware.org/libffi/, the latest version is libffi-3.0.10, dated few days ago (which BTW I've been unable to compile on AIX, while 3.0.9 is OK)

So what are those 4.2.0-3 versions coming from?
msg144379 - (view) Author: rubisher (rubisher) Date: 2011-09-21 14:34
Hello Gilles,

The libffi-4.2.0-3 I used, was coming from the previously mentioned repository:
<http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html>.

That said, if I click on <Source> link, it points me to <ftp://ftp.gnu.org/gnu/gcc>
So, as far as I understand, it's the version of libffi coming with gcc project and so of the same release as the gcc 
available at this place i.e. 4.2.0-3.

What's the difference with sourceware.org/libffi?
It's very not clear to me: reading this announce: <http://sourceware.org/ml/libffi-discuss/2009/msg00146.html>, it seems 
that gcc one is the merge of the upstream?

Hth,
	r.

PS: As I was fired from my previous position, I don't have any more access to my testing system and so couldn't more 
helpful, sorry :<(

On 09/21/2011 09:07 AM, Gilles PION wrote:
>
> Gilles PION<gpion@lfdj.com>  added the comment:
>
> According to ffi site (http://sourceware.org/libffi/, the latest version is libffi-3.0.10, dated few days ago (which BTW I've been unable to compile on AIX, while 3.0.9 is OK)
>
> So what are those 4.2.0-3 versions coming from?
>
> ----------
> nosy: +gpion
>
> _______________________________________
> Python tracker<report@bugs.python.org>
> <http://bugs.python.org/issue6006>
> _______________________________________
>
msg240920 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2015-04-14 15:56
Closing as obsolete.
msg241907 - (view) Author: Michael Felt (aixtools@gmail.com) Date: 2015-04-24 01:28
Although this is closed - it is not (yet) resolved, really.

ctypes does not compile on AIX 5.3, or AIX 6.1.

Applying the patch posted (https://bugs.python.org/file17098/pyffi.patch) does get rid of most of the problems. However, to completely "fix" it I also copied as follows:

cp  -rp ../sourceforge/libffi/libffi-3.2.1/src/powerpc ./Python-2.7.8/Modules/_ctypes/libffi/src/powerpc
make clean
make

There are still other issues - BUT - with this ctypes completes as a module of python.
History
Date User Action Args
2015-04-24 01:28:26aixtools@gmail.comsetnosy: + aixtools@gmail.com

messages: + msg241907
versions: + Python 2.7, - Python 3.0
2015-04-14 15:56:02akuchlingsetstatus: open -> closed

nosy: + akuchling
messages: + msg240920

resolution: wont fix
stage: patch review -> resolved
2011-09-21 14:34:50rubishersetmessages: + msg144379
2011-09-21 07:07:19gpionsetnosy: + gpion
messages: + msg144369
2011-09-02 03:04:27meador.ingesetnosy: - theller
priority: normal -> low
assignee: theller ->
type: compile error
stage: patch review
2011-03-25 12:04:44drkirkbysetnosy: + drkirkby
messages: + msg132079
2010-09-14 12:36:16pitrousetnosy: + sable
2010-04-26 17:28:52bugs-python@vendor.thewrittenword.comsetfiles: + pyffi.patch

nosy: + bugs-python@vendor.thewrittenword.com
messages: + msg104255

keywords: + patch
2009-08-07 08:52:37rubishersetmessages: + msg91396
2009-06-10 07:16:20rubishersetmessages: + msg89188
2009-06-09 11:18:53pitrousetnosy: + pitrou
messages: + msg89144
2009-06-09 08:09:22rubishersetnosy: + rubisher
messages: + msg89139
2009-05-12 17:11:53elyeshelcreate