classification
Title: ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel)
Type: compile error Stage: resolved
Components: ctypes Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: theller Nosy List: doko, kumba, mirell, rpetrov, theller
Priority: normal Keywords: patch

Created on 2008-11-12 10:00 by doko, last changed 2009-05-03 14:21 by theller. This issue is now closed.

Files
File name Uploaded Description Edit
mips-ffi.patch mirell, 2009-01-06 05:31 Patch to re-insert logic for libffi when dealing with MIPS targets
py-issue-4305.patch rpetrov, 2009-02-14 12:17
py-issue-4305+configure.patch rpetrov, 2009-02-14 14:34
Messages (13)
msg75781 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2008-11-12 09:59
seen on the mipsel buildbot

running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
Traceback (most recent call last):
  File "./setup.py", line 1880, in <module>
    main()
  File "./setup.py", line 1875, in main
    'Lib/smtpd.py']
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/core.py",
line 152, in setup
    dist.run_commands()
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/dist.py",
line 975, in run_commands
    self.run_command(cmd)
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/dist.py",
line 995, in run_command
    cmd_obj.run()
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/command/build.py",
line 134, in run
    self.run_command(cmd_name)
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/cmd.py",
line 333, in run_command
    self.distribution.run_command(command)
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/dist.py",
line 995, in run_command
    cmd_obj.run()
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/command/build_ext.py",
line 343, in run
    self.build_extensions()
  File "./setup.py", line 201, in build_extensions
    build_ext.build_extensions(self)
  File
"/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/command/build_ext.py",
line 469, in build_extensions
    self.build_extension(ext)
  File "./setup.py", line 234, in build_extension
    if not self.configure_ctypes(ext):
  File "./setup.py", line 1684, in configure_ctypes
    execfile(ffi_configfile, globals(), fficonfig)
  File "build/temp.linux-mips-2.7-pydebug/libffi/fficonfig.py", line 32,
in <module>
    ffi_sources += ffi_platforms['MIPS']
KeyError: 'MIPS'
[47349 refs]
make: *** [sharedmods] Error 1
msg79232 - (view) Author: Mark Miller (mirell) Date: 2009-01-06 05:31
It's actually due to the merge of the libffi3 branch back in March,
which removed the logic for configure to deal with MIPS in
fficonfig.py.in. I've attached a patch which allows the build to work
correctly on the QEMU instance of the MIPSEL machine I have.
msg79234 - (view) Author: Mark Miller (mirell) Date: 2009-01-06 05:42
Adding this as affecting the 2.6 branch as well, since I initially
tested on a 2.6.1 tarball with this problem.
msg81987 - (view) Author: Mark Miller (mirell) Date: 2009-02-14 02:56
Would it be possible to get some feedback as to whether this is a
candidate for Python 2.6 on this patch?
msg82027 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-02-14 12:17
May I propose a simple py-issue-4305.patch. Let me know if patch work
for you.
msg82046 - (view) Author: Mark Miller (mirell) Date: 2009-02-14 13:41
Not entirely. I applied what you had for the autoconf section to my
configure, since I do not have autoconf installed in my environment. 

Specifically, this part of configure is what's messing with the build:

if test x$TARGET = xMIPS; then
  MIPS_TRUE=
  MIPS_FALSE='#'
else
  MIPS_TRUE='#'
  MIPS_FALSE=
fi

Since the target is being renamed to MIPS_LINUX or MIPS_IRIX, this test
assumes the target is not MIPS.

The patch you have gets past the build break, but doesn't actually
compile what I believe is a working libffi for MIPS.
msg82069 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-02-14 14:34
So I attach patch with changes in Modules/_ctypes/libffi/configure for
the tests.
msg86055 - (view) Author: Joshua Kinard (kumba) Date: 2009-04-17 06:26
Is there any movement on this perchance?  Just bumped into this on my
MIPS platform and discovered this bug.
msg86063 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2009-04-17 09:38
Joshua Kinard schrieb:
> Joshua Kinard <kumba@gentoo.org> added the comment:
> 
> Is there any movement on this perchance?  Just bumped into this on my
> MIPS platform and discovered this bug.

There is no MIPS buildbot at the moment, and I'm unclear which one
of the patches solves the issue.
msg86535 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2009-04-25 18:45
I wonder if fixes for issues like these (ctypes build errors on some
plaforms) could be verified by using cross compilers on linux?
msg86601 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-04-26 19:30
Thomas, the report is for:
------------
ffi_sources += ffi_platforms['MIPS']
KeyError: 'MIPS'
------------
you may test patch without to cross-compile. As example create two
directories.

In first one run:
..../Modules/_ctypes/libffi/configure --host=mips-pc-linux F77=no CXX=no
and in the second one:
..../Modules/_ctypes/libffi/configure --host=mips-sgi-irix5.0 FC=no

Compare directories as example:
$ diff -ur --exclude=config.* [DIR1] [DIR2]
msg86762 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2009-04-28 20:04
I've applied py-issue-4305.patch and reran configure 2.61. Committed as
rev 72081 (trunk), 72082 (py3k branch), 72083 (release26-maint branch),
72084 (release30-maint branch).

Can someone please confirm that it works now, so that I can close this
issue?
msg87046 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2009-05-03 14:21
Tested myself, on a mipsel debian qemu instance.
History
Date User Action Args
2009-05-03 14:21:36thellersetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg87046
2009-04-28 20:04:24thellersetversions: + Python 3.0, Python 3.1
resolution: accepted
title: ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) -> ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel)
messages: + msg86762

type: compile error
stage: resolved
2009-04-26 19:30:27rpetrovsetmessages: + msg86601
2009-04-25 18:45:24thellersetmessages: + msg86535
2009-04-17 09:38:50thellersetmessages: + msg86063
title: ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) -> ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel)
2009-04-17 06:26:30kumbasetnosy: + kumba
messages: + msg86055
2009-02-14 14:34:18rpetrovsetfiles: + py-issue-4305+configure.patch
messages: + msg82069
2009-02-14 13:41:42mirellsetmessages: + msg82046
2009-02-14 12:17:09rpetrovsetfiles: + py-issue-4305.patch
nosy: + rpetrov
messages: + msg82027
2009-02-14 02:56:41mirellsetmessages: + msg81987
2009-01-06 05:42:16mirellsetmessages: + msg79234
versions: + Python 2.6
2009-01-06 05:31:11mirellsetfiles: + mips-ffi.patch
nosy: + mirell
messages: + msg79232
keywords: + patch
2008-11-12 10:00:00dokocreate