~ruther/guix-local

ref: 3af2d27eb39102aebba4d79a663a4e024fd9700d guix-local/gnu/packages/patches/python-libffi-mips-n32-fix.patch -rw-r--r-- 662 bytes
3af2d27e — Ludovic Courtès daemon: Do not use 'vfork'. 11 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.  */