gnu: python: Apply mips n32 fix to bundled libffi.

* gnu/packages/patches/python-libffi-mips-n32-fix.patch: New file.
* gnu/packages/python.scm (python-2, python): Add it.
* gnu-system.am (dist_patch_DATA): Add it.
This commit is contained in:
Mark H Weaver 2014-04-07 16:32:16 -04:00
parent d013fe50ba
commit 32d5c72952
3 changed files with 27 additions and 1 deletions

View File

@ -316,6 +316,7 @@ dist_patch_DATA = \
gnu/packages/patches/plotutils-libpng-jmpbuf.patch \
gnu/packages/patches/procps-make-3.82.patch \
gnu/packages/patches/python-fix-tests.patch \
gnu/packages/patches/python-libffi-mips-n32-fix.patch \
gnu/packages/patches/qemu-make-4.0.patch \
gnu/packages/patches/qemu-multiple-smb-shares.patch \
gnu/packages/patches/qt4-tests.patch \

View File

@ -0,0 +1,21 @@
Fix handling of uint32_t arguments on the MIPS N32 ABI.
Patch by Mark H Weaver <mhw@netris.org>.
--- Modules/_ctypes/libffi/src/mips/ffi.c.orig 2013-03-16 07:19:39.000000000 -0400
+++ Modules/_ctypes/libffi/src/mips/ffi.c 2013-10-22 01:11:03.111985247 -0400
@@ -170,7 +170,14 @@
break;
case FFI_TYPE_UINT32:
+#ifdef FFI_MIPS_N32
+ /* The N32 ABI requires that 32-bit integers
+ be sign-extended to 64-bits, regardless of
+ whether they are signed or unsigned. */
+ *(ffi_arg *)argp = *(SINT32 *)(* p_argv);
+#else
*(ffi_arg *)argp = *(UINT32 *)(* p_argv);
+#endif
break;
/* This can only happen with 64bit slots. */

View File

@ -2,6 +2,7 @@
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -50,6 +51,8 @@
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
version "/Python-" version ".tar.xz"))
(patches (list (search-patch "python-libffi-mips-n32-fix.patch")))
(patch-flags '("-p0"))
(sha256
(base32
"18gnpyh071dxa0rv3silrz92jw9qpblswzwv4gzqcwxzz20qxmhz"))))
@ -190,7 +193,8 @@ data types.")
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
version "/Python-" version ".tar.xz"))
(patches (list (search-patch "python-fix-tests.patch")))
(patches (list (search-patch "python-fix-tests.patch")
(search-patch "python-libffi-mips-n32-fix.patch")))
(patch-flags '("-p0"))
(sha256
(base32