diff --git a/gnu-system.am b/gnu-system.am index 5d817cc03e..394871d931 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -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 \ diff --git a/gnu/packages/patches/python-libffi-mips-n32-fix.patch b/gnu/packages/patches/python-libffi-mips-n32-fix.patch new file mode 100644 index 0000000000..393883779d --- /dev/null +++ b/gnu/packages/patches/python-libffi-mips-n32-fix.patch @@ -0,0 +1,21 @@ +Fix handling of uint32_t arguments on the MIPS N32 ABI. + +Patch by Mark H Weaver . + +--- 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. */ diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 4bee529557..372f763ee5 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2013, 2014 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge +;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +51,8 @@ (define-public python-2 (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 @@ (define-public python (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