Python-checkins
Threads by month
- ----- 2025 -----
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
April 2013
- 12 participants
- 613 discussions
http://hg.python.org/cpython/rev/7e9e27d5ae71
changeset: 83561:7e9e27d5ae71
parent: 83558:688bc0b44d96
parent: 83560:5916e71c96ed
user: Gregory P. Smith <greg(a)krypto.org>
date: Tue Apr 30 00:06:20 2013 -0700
summary:
null merge
files:
--
Repository URL: http://hg.python.org/cpython
1
0
http://hg.python.org/cpython/rev/5916e71c96ed
changeset: 83560:5916e71c96ed
branch: 3.3
parent: 83557:c665abe15c4a
parent: 83559:663800e18fef
user: Gregory P. Smith <greg(a)krypto.org>
date: Tue Apr 30 00:05:50 2013 -0700
summary:
null merge
files:
--
Repository URL: http://hg.python.org/cpython
1
0

cpython (3.2): This local change was lost during the fixing of issue17192 to update
by gregory.p.smith April 30, 2013
by gregory.p.smith April 30, 2013
April 30, 2013
http://hg.python.org/cpython/rev/663800e18fef
changeset: 83559:663800e18fef
branch: 3.2
parent: 83554:7a2e0c1bb1a9
user: Gregory P. Smith <greg(a)krypto.org>
date: Tue Apr 30 00:05:25 2013 -0700
summary:
This local change was lost during the fixing of issue17192 to update
libffi to 3.0.13. (i'm not sure if it is needed anymore but see
issue 10309 for details which makes no mention of upstream; this
change is already in 3.3 and 3.4 but may need reapplying to 2.7
as done here)
files:
Modules/_ctypes/libffi/src/dlmalloc.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Modules/_ctypes/libffi/src/dlmalloc.c b/Modules/_ctypes/libffi/src/dlmalloc.c
--- a/Modules/_ctypes/libffi/src/dlmalloc.c
+++ b/Modules/_ctypes/libffi/src/dlmalloc.c
@@ -457,6 +457,11 @@
#define LACKS_ERRNO_H
#define MALLOC_FAILURE_ACTION
#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
+#elif !defined _GNU_SOURCE
+/* mremap() on Linux requires this via sys/mman.h
+ * See roundup issue 10309
+ */
+#define _GNU_SOURCE 1
#endif /* WIN32 */
#ifdef __OS2__
--
Repository URL: http://hg.python.org/cpython
1
0

cpython (merge 3.3 -> default): * Fix remaining bits of issue 17192 for 3.4 - these changes
by gregory.p.smith April 30, 2013
by gregory.p.smith April 30, 2013
April 30, 2013
http://hg.python.org/cpython/rev/688bc0b44d96
changeset: 83558:688bc0b44d96
parent: 83556:e0fdc21c7d13
parent: 83557:c665abe15c4a
user: Gregory P. Smith <greg(a)krypto.org>
date: Tue Apr 30 00:03:30 2013 -0700
summary:
* Fix remaining bits of issue 17192 for 3.4 - these changes
were missing from a messed up merge during the libffi 3.0.13
import. the diffs from upstream libffi 3.0.13 are now small.
files:
Modules/_ctypes/libffi/src/m68k/sysv.S | 57 ++-
Modules/_ctypes/libffi/src/mips/ffi.c | 11 +-
Modules/_ctypes/libffi/src/powerpc/ffi.c | 54 ++-
Modules/_ctypes/libffi/src/sparc/ffi.c | 16 +-
Modules/_ctypes/libffi/src/x86/ffi64.c | 44 +-
Modules/_ctypes/libffi/src/x86/ffitarget.h | 3 +-
Modules/_ctypes/libffi/src/x86/sysv.S | 17 +-
Modules/_ctypes/libffi/src/x86/unix64.S | 10 +-
Modules/_ctypes/libffi/testsuite/Makefile.am | 145 +++---
Modules/_ctypes/libffi/testsuite/Makefile.in | 195 ++++++---
Modules/_ctypes/libffi/testsuite/lib/libffi.exp | 19 +
Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c | 4 +-
Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h | 44 +--
Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c | 16 +-
Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c | 9 +-
Modules/_ctypes/libffi/testsuite/libffi.call/many2.c | 5 +-
16 files changed, 418 insertions(+), 231 deletions(-)
diff --git a/Modules/_ctypes/libffi/src/m68k/sysv.S b/Modules/_ctypes/libffi/src/m68k/sysv.S
--- a/Modules/_ctypes/libffi/src/m68k/sysv.S
+++ b/Modules/_ctypes/libffi/src/m68k/sysv.S
@@ -2,9 +2,10 @@
sysv.S - Copyright (c) 2012 Alan Hourihane
Copyright (c) 1998, 2012 Andreas Schwab
- Copyright (c) 2008 Red Hat, Inc.
-
- m68k Foreign Function Interface
+ Copyright (c) 2008 Red Hat, Inc.
+ Copyright (c) 2012 Thorsten Glaser
+
+ m68k Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -168,8 +169,28 @@
retstruct2:
btst #7,%d2
+ jbeq retsint8
+ move.w %d0,(%a1)
+ jbra epilogue
+
+retsint8:
+ btst #8,%d2
+ jbeq retsint16
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ ext.w %d0
+ ext.l %d0
+#else
+ extb.l %d0
+#endif
+ move.l %d0,(%a1)
+ jbra epilogue
+
+retsint16:
+ btst #9,%d2
jbeq noretval
- move.w %d0,(%a1)
+ ext.l %d0
+ move.l %d0,(%a1)
noretval:
epilogue:
@@ -201,8 +222,10 @@
lsr.l #1,%d0
jne 1f
jcc .Lcls_epilogue
+ | CIF_FLAGS_INT
move.l -12(%fp),%d0
.Lcls_epilogue:
+ | no CIF_FLAGS_*
unlk %fp
rts
1:
@@ -210,6 +233,7 @@
lsr.l #2,%d0
jne 1f
jcs .Lcls_ret_float
+ | CIF_FLAGS_DINT
move.l (%a0)+,%d0
move.l (%a0),%d1
jra .Lcls_epilogue
@@ -224,6 +248,7 @@
lsr.l #2,%d0
jne 1f
jcs .Lcls_ret_ldouble
+ | CIF_FLAGS_DOUBLE
#if defined(__MC68881__) || defined(__HAVE_68881__)
fmove.d (%a0),%fp0
#else
@@ -242,17 +267,37 @@
jra .Lcls_epilogue
1:
lsr.l #2,%d0
- jne .Lcls_ret_struct2
+ jne 1f
jcs .Lcls_ret_struct1
+ | CIF_FLAGS_POINTER
move.l (%a0),%a0
move.l %a0,%d0
jra .Lcls_epilogue
.Lcls_ret_struct1:
move.b (%a0),%d0
jra .Lcls_epilogue
-.Lcls_ret_struct2:
+1:
+ lsr.l #2,%d0
+ jne 1f
+ jcs .Lcls_ret_sint8
+ | CIF_FLAGS_STRUCT2
move.w (%a0),%d0
jra .Lcls_epilogue
+.Lcls_ret_sint8:
+ move.l (%a0),%d0
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ ext.w %d0
+ ext.l %d0
+#else
+ extb.l %d0
+#endif
+ jra .Lcls_epilogue
+1:
+ | CIF_FLAGS_SINT16
+ move.l (%a0),%d0
+ ext.l %d0
+ jra .Lcls_epilogue
CFI_ENDPROC()
.size CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV)
diff --git a/Modules/_ctypes/libffi/src/mips/ffi.c b/Modules/_ctypes/libffi/src/mips/ffi.c
--- a/Modules/_ctypes/libffi/src/mips/ffi.c
+++ b/Modules/_ctypes/libffi/src/mips/ffi.c
@@ -670,9 +670,16 @@
if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT)
return FFI_BAD_ABI;
fn = ffi_closure_O32;
-#else /* FFI_MIPS_N32 */
- if (cif->abi != FFI_N32 && cif->abi != FFI_N64)
+#else
+#if _MIPS_SIM ==_ABIN32
+ if (cif->abi != FFI_N32
+ && cif->abi != FFI_N32_SOFT_FLOAT)
return FFI_BAD_ABI;
+#else
+ if (cif->abi != FFI_N64
+ && cif->abi != FFI_N64_SOFT_FLOAT)
+ return FFI_BAD_ABI;
+#endif
fn = ffi_closure_N32;
#endif /* FFI_MIPS_O32 */
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi.c b/Modules/_ctypes/libffi/src/powerpc/ffi.c
--- a/Modules/_ctypes/libffi/src/powerpc/ffi.c
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi.c
@@ -48,6 +48,11 @@
FLAG_RETURNS_128BITS = 1 << (31-27), /* cr6 */
+ FLAG_SYSV_SMST_R4 = 1 << (31-26), /* use r4 for FFI_SYSV 8 byte
+ structs. */
+ FLAG_SYSV_SMST_R3 = 1 << (31-25), /* use r3 for FFI_SYSV 4 byte
+ structs. */
+
FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
#ifndef __NO_FPRS__
FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
@@ -367,7 +372,13 @@
/* Check that we didn't overrun the stack... */
FFI_ASSERT (copy_space.c >= next_arg.c);
FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
+ /* The assert below is testing that the number of integer arguments agrees
+ with the number found in ffi_prep_cif_machdep(). However, intarg_count
+ is incremeneted whenever we place an FP arg on the stack, so account for
+ that before our assert test. */
#ifndef __NO_FPRS__
+ if (fparg_count > NUM_FPR_ARG_REGISTERS)
+ intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
FFI_ASSERT (fpr_base.u
<= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
#endif
@@ -664,9 +675,11 @@
switch (type)
{
#ifndef __NO_FPRS__
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
flags |= FLAG_RETURNS_128BITS;
/* Fall through. */
+#endif
case FFI_TYPE_DOUBLE:
flags |= FLAG_RETURNS_64BITS;
/* Fall through. */
@@ -684,18 +697,35 @@
break;
case FFI_TYPE_STRUCT:
- /*
- * The final SYSV ABI says that structures smaller or equal 8 bytes
- * are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them
- * in memory.
- *
- * NOTE: The assembly code can safely assume that it just needs to
- * store both r3 and r4 into a 8-byte word-aligned buffer, as
- * we allocate a temporary buffer in ffi_call() if this flag is
- * set.
- */
- if (cif->abi == FFI_SYSV && size <= 8)
- flags |= FLAG_RETURNS_SMST;
+ if (cif->abi == FFI_SYSV)
+ {
+ /* The final SYSV ABI says that structures smaller or equal 8 bytes
+ are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them
+ in memory. */
+
+ /* Treat structs with size <= 8 bytes. */
+ if (size <= 8)
+ {
+ flags |= FLAG_RETURNS_SMST;
+ /* These structs are returned in r3. We pack the type and the
+ precalculated shift value (needed in the sysv.S) into flags.
+ The same applies for the structs returned in r3/r4. */
+ if (size <= 4)
+ {
+ flags |= FLAG_SYSV_SMST_R3;
+ flags |= 8 * (4 - size) << 8;
+ break;
+ }
+ /* These structs are returned in r3 and r4. See above. */
+ if (size <= 8)
+ {
+ flags |= FLAG_SYSV_SMST_R3 | FLAG_SYSV_SMST_R4;
+ flags |= 8 * (8 - size) << 8;
+ break;
+ }
+ }
+ }
+
intarg_count++;
flags |= FLAG_RETVAL_REFERENCE;
/* Fall through. */
diff --git a/Modules/_ctypes/libffi/src/sparc/ffi.c b/Modules/_ctypes/libffi/src/sparc/ffi.c
--- a/Modules/_ctypes/libffi/src/sparc/ffi.c
+++ b/Modules/_ctypes/libffi/src/sparc/ffi.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2011 Anthony Green
+ ffi.c - Copyright (c) 2011, 2013 Anthony Green
Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc.
SPARC Foreign Function Interface
@@ -376,6 +376,10 @@
unsigned, unsigned *, void (*fn)(void));
#endif
+#ifndef __GNUC__
+void ffi_flush_icache (void *, size_t);
+#endif
+
void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
extended_cif ecif;
@@ -417,7 +421,7 @@
/* behind "call", so we alloc some executable space for it. */
/* l7 is used, we need to make sure v8.S doesn't use %l7. */
unsigned int *call_struct = NULL;
- ffi_closure_alloc(32, &call_struct);
+ ffi_closure_alloc(32, (void **)&call_struct);
if (call_struct)
{
unsigned long f = (unsigned long)fn;
@@ -432,10 +436,14 @@
call_struct[5] = 0x01000000; /* nop */
call_struct[6] = 0x81c7e008; /* ret */
call_struct[7] = 0xbe100017; /* mov %l7, %i7 */
+#ifdef __GNUC__
asm volatile ("iflush %0; iflush %0+8; iflush %0+16; iflush %0+24" : :
"r" (call_struct) : "memory");
/* SPARC v8 requires 5 instructions for flush to be visible */
asm volatile ("nop; nop; nop; nop; nop");
+#else
+ ffi_flush_icache (call_struct, 32);
+#endif
ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes,
cif->flags, rvalue, call_struct);
ffi_closure_free(call_struct);
@@ -513,6 +521,7 @@
closure->user_data = user_data;
/* Flush the Icache. closure is 8 bytes aligned. */
+#ifdef __GNUC__
#ifdef SPARC64
asm volatile ("flush %0; flush %0+8" : : "r" (closure) : "memory");
#else
@@ -520,6 +529,9 @@
/* SPARC v8 requires 5 instructions for flush to be visible */
asm volatile ("nop; nop; nop; nop; nop");
#endif
+#else
+ ffi_flush_icache (closure, 16);
+#endif
return FFI_OK;
}
diff --git a/Modules/_ctypes/libffi/src/x86/ffi64.c b/Modules/_ctypes/libffi/src/x86/ffi64.c
--- a/Modules/_ctypes/libffi/src/x86/ffi64.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi64.c
@@ -1,5 +1,6 @@
/* -----------------------------------------------------------------------
- ffi64.c - Copyright (c) 20011 Anthony Green
+ ffi64.c - Copyright (c) 2013 The Written Word, Inc.
+ Copyright (c) 2011 Anthony Green
Copyright (c) 2008, 2010 Red Hat, Inc.
Copyright (c) 2002, 2007 Bo Thorsen <bo(a)suse.de>
@@ -37,17 +38,29 @@
#define MAX_GPR_REGS 6
#define MAX_SSE_REGS 8
-#ifdef __INTEL_COMPILER
+#if defined(__INTEL_COMPILER)
#define UINT128 __m128
#else
+#if defined(__SUNPRO_C)
+#include <sunmedia_types.h>
+#define UINT128 __m128i
+#else
#define UINT128 __int128_t
#endif
+#endif
+
+union big_int_union
+{
+ UINT32 i32;
+ UINT64 i64;
+ UINT128 i128;
+};
struct register_args
{
/* Registers for argument passing. */
UINT64 gpr[MAX_GPR_REGS];
- UINT128 sse[MAX_SSE_REGS];
+ union big_int_union sse[MAX_SSE_REGS];
};
extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
@@ -471,16 +484,33 @@
{
case X86_64_INTEGER_CLASS:
case X86_64_INTEGERSI_CLASS:
- reg_args->gpr[gprcount] = 0;
- memcpy (®_args->gpr[gprcount], a, size < 8 ? size : 8);
+ /* Sign-extend integer arguments passed in general
+ purpose registers, to cope with the fact that
+ LLVM incorrectly assumes that this will be done
+ (the x86-64 PS ABI does not specify this). */
+ switch (arg_types[i]->type)
+ {
+ case FFI_TYPE_SINT8:
+ *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT8 *) a);
+ break;
+ case FFI_TYPE_SINT16:
+ *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT16 *) a);
+ break;
+ case FFI_TYPE_SINT32:
+ *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT32 *) a);
+ break;
+ default:
+ reg_args->gpr[gprcount] = 0;
+ memcpy (®_args->gpr[gprcount], a, size < 8 ? size : 8);
+ }
gprcount++;
break;
case X86_64_SSE_CLASS:
case X86_64_SSEDF_CLASS:
- reg_args->sse[ssecount++] = *(UINT64 *) a;
+ reg_args->sse[ssecount++].i64 = *(UINT64 *) a;
break;
case X86_64_SSESF_CLASS:
- reg_args->sse[ssecount++] = *(UINT32 *) a;
+ reg_args->sse[ssecount++].i32 = *(UINT32 *) a;
break;
default:
abort();
diff --git a/Modules/_ctypes/libffi/src/x86/ffitarget.h b/Modules/_ctypes/libffi/src/x86/ffitarget.h
--- a/Modules/_ctypes/libffi/src/x86/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/x86/ffitarget.h
@@ -61,8 +61,9 @@
typedef long long ffi_sarg;
#endif
#else
-#if defined __x86_64__ && !defined __LP64__
+#if defined __x86_64__ && defined __ILP32__
#define FFI_SIZEOF_ARG 8
+#define FFI_SIZEOF_JAVA_RAW 4
typedef unsigned long long ffi_arg;
typedef long long ffi_sarg;
#else
diff --git a/Modules/_ctypes/libffi/src/x86/sysv.S b/Modules/_ctypes/libffi/src/x86/sysv.S
--- a/Modules/_ctypes/libffi/src/x86/sysv.S
+++ b/Modules/_ctypes/libffi/src/x86/sysv.S
@@ -1,5 +1,6 @@
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 1996, 1998, 2001-2003, 2005, 2008, 2010 Red Hat, Inc.
+ sysv.S - Copyright (c) 2013 The Written Word, Inc.
+ - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
X86 Foreign Function Interface
@@ -181,9 +182,19 @@
leal -24(%ebp), %edx
movl %edx, -12(%ebp) /* resp */
leal 8(%ebp), %edx
+#ifdef __SUNPRO_C
+ /* The SUNPRO compiler doesn't support GCC's regparm function
+ attribute, so we have to pass all three arguments to
+ ffi_closure_SYSV_inner on the stack. */
+ movl %edx, 8(%esp) /* args = __builtin_dwarf_cfa () */
+ leal -12(%ebp), %edx
+ movl %edx, 4(%esp) /* &resp */
+ movl %eax, (%esp) /* closure */
+#else
movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
leal -12(%ebp), %edx
movl %edx, (%esp) /* &resp */
+#endif
#if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__
call ffi_closure_SYSV_inner
#else
@@ -328,6 +339,9 @@
.size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV
#endif
+#if defined __GNUC__
+/* Only emit dwarf unwind info when building with GNU toolchain. */
+
#if defined __PIC__
# if defined __sun__ && defined __svr4__
/* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22
@@ -460,6 +474,7 @@
.LEFDE3:
#endif
+#endif
#endif /* ifndef __x86_64__ */
diff --git a/Modules/_ctypes/libffi/src/x86/unix64.S b/Modules/_ctypes/libffi/src/x86/unix64.S
--- a/Modules/_ctypes/libffi/src/x86/unix64.S
+++ b/Modules/_ctypes/libffi/src/x86/unix64.S
@@ -1,6 +1,7 @@
/* -----------------------------------------------------------------------
- unix64.S - Copyright (c) 2002 Bo Thorsen <bo(a)suse.de>
- Copyright (c) 2008 Red Hat, Inc
+ unix64.S - Copyright (c) 2013 The Written Word, Inc.
+ - Copyright (c) 2008 Red Hat, Inc
+ - Copyright (c) 2002 Bo Thorsen <bo(a)suse.de>
x86-64 Foreign Function Interface
@@ -324,6 +325,9 @@
.LUW9:
.size ffi_closure_unix64,.-ffi_closure_unix64
+#ifdef __GNUC__
+/* Only emit DWARF unwind info when building with the GNU toolchain. */
+
#ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
.section .eh_frame,"a",@unwind
#else
@@ -419,6 +423,8 @@
.align 8
.LEFDE3:
+#endif /* __GNUC__ */
+
#endif /* __x86_64__ */
#if defined __ELF__ && defined __linux__
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.am b/Modules/_ctypes/libffi/testsuite/Makefile.am
--- a/Modules/_ctypes/libffi/testsuite/Makefile.am
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.am
@@ -13,73 +13,82 @@
AM_RUNTESTFLAGS =
+EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
+
CLEANFILES = *.exe core* *.log *.sum
-EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
-libffi.call/cls_align_longdouble_split.c libffi.call/closure_loc_fn0.c \
-libffi.call/cls_schar.c libffi.call/closure_fn1.c \
-libffi.call/many2_win32.c libffi.call/return_ul.c \
-libffi.call/cls_align_double.c libffi.call/return_fl2.c \
-libffi.call/cls_1_1byte.c libffi.call/cls_64byte.c \
-libffi.call/nested_struct7.c libffi.call/cls_align_sint32.c \
-libffi.call/nested_struct2.c libffi.call/ffitest.h \
-libffi.call/nested_struct4.c libffi.call/cls_multi_ushort.c \
-libffi.call/struct3.c libffi.call/cls_3byte1.c \
-libffi.call/cls_16byte.c libffi.call/struct8.c \
-libffi.call/nested_struct8.c libffi.call/cls_multi_sshort.c \
-libffi.call/cls_3byte2.c libffi.call/fastthis2_win32.c \
-libffi.call/cls_pointer.c libffi.call/err_bad_typedef.c \
-libffi.call/cls_4_1byte.c libffi.call/cls_9byte2.c \
-libffi.call/cls_multi_schar.c libffi.call/stret_medium2.c \
-libffi.call/cls_5_1_byte.c libffi.call/call.exp \
-libffi.call/cls_double.c libffi.call/cls_align_sint16.c \
-libffi.call/cls_uint.c libffi.call/return_ll1.c \
-libffi.call/nested_struct3.c libffi.call/cls_20byte1.c \
-libffi.call/closure_fn4.c libffi.call/cls_uchar.c \
-libffi.call/struct2.c libffi.call/cls_7byte.c libffi.call/strlen.c \
-libffi.call/many.c libffi.call/testclosure.c libffi.call/return_fl.c \
-libffi.call/struct5.c libffi.call/cls_12byte.c \
-libffi.call/cls_multi_sshortchar.c \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
-libffi.call/return_fl3.c libffi.call/stret_medium.c \
-libffi.call/nested_struct6.c libffi.call/a.out \
-libffi.call/closure_fn3.c libffi.call/float3.c libffi.call/many2.c \
-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
-libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
-libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
-libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
-libffi.call/cls_sshort.c libffi.call/many_win32.c \
-libffi.call/nested_struct.c libffi.call/cls_20byte.c \
-libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
-libffi.call/return_uc.c libffi.call/closure_thiscall.c \
-libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
-libffi.call/promotion.c libffi.call/struct1_win32.c \
-libffi.call/return_dbl.c libffi.call/cls_24byte.c \
-libffi.call/struct4.c libffi.call/cls_6byte.c \
-libffi.call/cls_align_uint32.c libffi.call/float.c \
-libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
-libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
-libffi.call/cls_align_float.c libffi.call/return_fl1.c \
-libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
-libffi.call/stret_large2.c libffi.call/return_sl.c \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
-libffi.call/cls_2byte.c libffi.call/float2.c \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
-libffi.call/struct1.c libffi.call/nested_struct9.c \
-libffi.call/huge_struct.c libffi.call/problem1.c libffi.call/float4.c \
-libffi.call/fastthis3_win32.c libffi.call/return_ldl.c \
-libffi.call/strlen2_win32.c libffi.call/closure_fn5.c \
-libffi.call/struct2_win32.c libffi.call/struct6.c \
-libffi.call/return_ll.c libffi.call/struct9.c libffi.call/return_sc.c \
-libffi.call/struct7.c libffi.call/cls_align_uint64.c \
-libffi.call/cls_4byte.c libffi.call/strlen_win32.c \
-libffi.call/cls_6_1_byte.c libffi.call/cls_7_1_byte.c \
-libffi.special/unwindtest.cc libffi.special/special.exp \
-libffi.special/unwindtest_ffi_call.cc libffi.special/ffitestcxx.h \
-lib/wrapper.exp lib/target-libpath.exp lib/libffi.exp
+EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
+libffi.call/cls_align_longdouble_split.c \
+libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
+libffi.call/closure_fn1.c libffi.call/many2_win32.c \
+libffi.call/return_ul.c libffi.call/cls_align_double.c \
+libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
+libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
+libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
+libffi.call/ffitest.h libffi.call/nested_struct4.c \
+libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
+libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
+libffi.call/struct8.c libffi.call/nested_struct8.c \
+libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
+libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \
+libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
+libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
+libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
+libffi.call/call.exp libffi.call/cls_double.c \
+libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
+libffi.call/return_ll1.c libffi.call/nested_struct3.c \
+libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
+libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
+libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
+libffi.call/return_fl.c libffi.call/struct5.c \
+libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
+libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
+libffi.call/return_fl3.c libffi.call/stret_medium.c \
+libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
+libffi.call/float3.c libffi.call/many2.c \
+libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
+libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
+libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
+libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
+libffi.call/cls_sshort.c libffi.call/many_win32.c \
+libffi.call/nested_struct.c libffi.call/cls_20byte.c \
+libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
+libffi.call/return_uc.c libffi.call/closure_thiscall.c \
+libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
+libffi.call/promotion.c libffi.call/struct1_win32.c \
+libffi.call/return_dbl.c libffi.call/cls_24byte.c \
+libffi.call/struct4.c libffi.call/cls_6byte.c \
+libffi.call/cls_align_uint32.c libffi.call/float.c \
+libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
+libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
+libffi.call/cls_align_float.c libffi.call/return_fl1.c \
+libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
+libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
+libffi.call/stret_large2.c libffi.call/return_sl.c \
+libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
+libffi.call/cls_2byte.c libffi.call/float2.c \
+libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
+libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
+libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
+libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
+libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
+libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
+libffi.call/struct1.c libffi.call/nested_struct9.c \
+libffi.call/huge_struct.c libffi.call/problem1.c \
+libffi.call/float4.c libffi.call/fastthis3_win32.c \
+libffi.call/return_ldl.c libffi.call/strlen2_win32.c \
+libffi.call/closure_fn5.c libffi.call/struct2_win32.c \
+libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
+libffi.call/return_sc.c libffi.call/struct7.c \
+libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
+libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \
+libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \
+libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \
+libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \
+lib/libffi.exp libffi.call/cls_struct_va1.c \
+libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
+libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
+libffi.call/nested_struct11.c libffi.call/uninitialized.c \
+libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
+libffi.call/va_struct3.c
+
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.in b/Modules/_ctypes/libffi/testsuite/Makefile.in
--- a/Modules/_ctypes/libffi/testsuite/Makefile.in
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -37,7 +53,19 @@
subdir = testsuite
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
+ $(top_srcdir)/m4/ax_append_flag.m4 \
+ $(top_srcdir)/m4/ax_cc_maxopt.m4 \
+ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_compiler_vendor.m4 \
+ $(top_srcdir)/m4/ax_configure_args.m4 \
+ $(top_srcdir)/m4/ax_enable_builddir.m4 \
+ $(top_srcdir)/m4/ax_gcc_archflag.m4 \
+ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -47,6 +75,11 @@
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
DEJATOOL = $(PACKAGE)
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -114,6 +147,7 @@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PRTDIAG = @PRTDIAG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -134,6 +168,7 @@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
+ax_enable_builddir_sed = @ax_enable_builddir_sed@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -169,6 +204,7 @@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
+sys_symbol_underscore = @sys_symbol_underscore@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
@@ -191,75 +227,82 @@
echo $(top_srcdir)/../dejagnu/runtest ; \
else echo runtest; fi`
+EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
CLEANFILES = *.exe core* *.log *.sum
-EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
-libffi.call/cls_align_longdouble_split.c libffi.call/closure_loc_fn0.c \
-libffi.call/cls_schar.c libffi.call/closure_fn1.c \
-libffi.call/many2_win32.c libffi.call/return_ul.c \
-libffi.call/cls_align_double.c libffi.call/return_fl2.c \
-libffi.call/cls_1_1byte.c libffi.call/cls_64byte.c \
-libffi.call/nested_struct7.c libffi.call/cls_align_sint32.c \
-libffi.call/nested_struct2.c libffi.call/ffitest.h \
-libffi.call/nested_struct4.c libffi.call/cls_multi_ushort.c \
-libffi.call/struct3.c libffi.call/cls_3byte1.c \
-libffi.call/cls_16byte.c libffi.call/struct8.c \
-libffi.call/nested_struct8.c libffi.call/cls_multi_sshort.c \
-libffi.call/cls_3byte2.c libffi.call/fastthis2_win32.c \
-libffi.call/cls_pointer.c libffi.call/err_bad_typedef.c \
-libffi.call/cls_4_1byte.c libffi.call/cls_9byte2.c \
-libffi.call/cls_multi_schar.c libffi.call/stret_medium2.c \
-libffi.call/cls_5_1_byte.c libffi.call/call.exp \
-libffi.call/cls_double.c libffi.call/cls_align_sint16.c \
-libffi.call/cls_uint.c libffi.call/return_ll1.c \
-libffi.call/nested_struct3.c libffi.call/cls_20byte1.c \
-libffi.call/closure_fn4.c libffi.call/cls_uchar.c \
-libffi.call/struct2.c libffi.call/cls_7byte.c libffi.call/strlen.c \
-libffi.call/many.c libffi.call/testclosure.c libffi.call/return_fl.c \
-libffi.call/struct5.c libffi.call/cls_12byte.c \
-libffi.call/cls_multi_sshortchar.c \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
-libffi.call/return_fl3.c libffi.call/stret_medium.c \
-libffi.call/nested_struct6.c libffi.call/a.out \
-libffi.call/closure_fn3.c libffi.call/float3.c libffi.call/many2.c \
-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
-libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
-libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
-libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
-libffi.call/cls_sshort.c libffi.call/many_win32.c \
-libffi.call/nested_struct.c libffi.call/cls_20byte.c \
-libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
-libffi.call/return_uc.c libffi.call/closure_thiscall.c \
-libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
-libffi.call/promotion.c libffi.call/struct1_win32.c \
-libffi.call/return_dbl.c libffi.call/cls_24byte.c \
-libffi.call/struct4.c libffi.call/cls_6byte.c \
-libffi.call/cls_align_uint32.c libffi.call/float.c \
-libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
-libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
-libffi.call/cls_align_float.c libffi.call/return_fl1.c \
-libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
-libffi.call/stret_large2.c libffi.call/return_sl.c \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
-libffi.call/cls_2byte.c libffi.call/float2.c \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
-libffi.call/struct1.c libffi.call/nested_struct9.c \
-libffi.call/huge_struct.c libffi.call/problem1.c libffi.call/float4.c \
-libffi.call/fastthis3_win32.c libffi.call/return_ldl.c \
-libffi.call/strlen2_win32.c libffi.call/closure_fn5.c \
-libffi.call/struct2_win32.c libffi.call/struct6.c \
-libffi.call/return_ll.c libffi.call/struct9.c libffi.call/return_sc.c \
-libffi.call/struct7.c libffi.call/cls_align_uint64.c \
-libffi.call/cls_4byte.c libffi.call/strlen_win32.c \
-libffi.call/cls_6_1_byte.c libffi.call/cls_7_1_byte.c \
-libffi.special/unwindtest.cc libffi.special/special.exp \
-libffi.special/unwindtest_ffi_call.cc libffi.special/ffitestcxx.h \
-lib/wrapper.exp lib/target-libpath.exp lib/libffi.exp
+EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
+libffi.call/cls_align_longdouble_split.c \
+libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
+libffi.call/closure_fn1.c libffi.call/many2_win32.c \
+libffi.call/return_ul.c libffi.call/cls_align_double.c \
+libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
+libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
+libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
+libffi.call/ffitest.h libffi.call/nested_struct4.c \
+libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
+libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
+libffi.call/struct8.c libffi.call/nested_struct8.c \
+libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
+libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \
+libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
+libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
+libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
+libffi.call/call.exp libffi.call/cls_double.c \
+libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
+libffi.call/return_ll1.c libffi.call/nested_struct3.c \
+libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
+libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
+libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
+libffi.call/return_fl.c libffi.call/struct5.c \
+libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
+libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
+libffi.call/return_fl3.c libffi.call/stret_medium.c \
+libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
+libffi.call/float3.c libffi.call/many2.c \
+libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
+libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
+libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
+libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
+libffi.call/cls_sshort.c libffi.call/many_win32.c \
+libffi.call/nested_struct.c libffi.call/cls_20byte.c \
+libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
+libffi.call/return_uc.c libffi.call/closure_thiscall.c \
+libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
+libffi.call/promotion.c libffi.call/struct1_win32.c \
+libffi.call/return_dbl.c libffi.call/cls_24byte.c \
+libffi.call/struct4.c libffi.call/cls_6byte.c \
+libffi.call/cls_align_uint32.c libffi.call/float.c \
+libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
+libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
+libffi.call/cls_align_float.c libffi.call/return_fl1.c \
+libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
+libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
+libffi.call/stret_large2.c libffi.call/return_sl.c \
+libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
+libffi.call/cls_2byte.c libffi.call/float2.c \
+libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
+libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
+libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
+libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
+libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
+libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
+libffi.call/struct1.c libffi.call/nested_struct9.c \
+libffi.call/huge_struct.c libffi.call/problem1.c \
+libffi.call/float4.c libffi.call/fastthis3_win32.c \
+libffi.call/return_ldl.c libffi.call/strlen2_win32.c \
+libffi.call/closure_fn5.c libffi.call/struct2_win32.c \
+libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
+libffi.call/return_sc.c libffi.call/struct7.c \
+libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
+libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \
+libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \
+libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \
+libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \
+lib/libffi.exp libffi.call/cls_struct_va1.c \
+libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
+libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
+libffi.call/nested_struct11.c libffi.call/uninitialized.c \
+libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
+libffi.call/va_struct3.c
all: all-am
@@ -306,6 +349,8 @@
ctags: CTAGS
CTAGS:
+cscope cscopelist:
+
check-DEJAGNU: site.exp
srcdir='$(srcdir)'; export srcdir; \
@@ -316,11 +361,11 @@
if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
then :; else exit_status=1; fi; \
done; \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ else echo "WARNING: could not find 'runtest'" 1>&2; :;\
fi; \
exit $$exit_status
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
- @echo 'Making a new site.exp file...'
+ @echo 'Making a new site.exp file ...'
@echo '## these variables are automatically generated by make ##' >site.tmp
@echo '# Do not edit here. If you wish to override these values' >>site.tmp
@echo '# edit the last section' >>site.tmp
diff --git a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
--- a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
+++ b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
@@ -101,9 +101,17 @@
global tool_root_dir
global ld_library_path
+ global using_gcc
+
set blddirffi [pwd]/..
verbose "libffi $blddirffi"
+ # Are we building with GCC?
+ set tmp [grep ../config.status "GCC='yes'"]
+ if { [string match $tmp "GCC='yes'"] } {
+
+ set using_gcc "yes"
+
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
@@ -127,6 +135,13 @@
}
}
}
+
+ } else {
+
+ set using_gcc "no"
+
+ }
+
# add the library path for libffi.
append ld_library_path ":${blddirffi}/.libs"
@@ -203,6 +218,10 @@
lappend options "libs= -lffi"
+ if { [string match "aarch64*-*-linux*" $target_triplet] } {
+ lappend options "libs= -lpthread"
+ }
+
verbose "options: $options"
return [target_compile $source $dest $type $options]
}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
@@ -5,7 +5,9 @@
Originator: Blake Chaffin */
/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
+/* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have
+ remove the xfail for arm*-*-* below, until we know more. */
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
@@ -15,7 +15,7 @@
#define MAX_ARGS 256
-#define CHECK(x) !(x) ? abort() : 0
+#define CHECK(x) !(x) ? (abort(), 1) : 0
/* Define __UNUSED__ that also other compilers than gcc can run the tests. */
#undef __UNUSED__
@@ -127,44 +127,6 @@
#define PRId64 "I64d"
#endif
-#ifdef USING_MMAP
-static inline void *
-allocate_mmap (size_t size)
-{
- void *page;
-#if defined (HAVE_MMAP_DEV_ZERO)
- static int dev_zero_fd = -1;
+#ifndef PRIuPTR
+#define PRIuPTR "u"
#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
- if (dev_zero_fd == -1)
- {
- dev_zero_fd = open ("/dev/zero", O_RDONLY);
- if (dev_zero_fd == -1)
- {
- perror ("open /dev/zero: %m");
- exit (1);
- }
- }
-#endif
-
-
-#ifdef HAVE_MMAP_ANON
- page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
-#ifdef HAVE_MMAP_DEV_ZERO
- page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE, dev_zero_fd, 0);
-#endif
-
- if (page == (void *) MAP_FAILED)
- {
- perror ("virtual memory exhausted");
- exit (1);
- }
-
- return page;
-}
-
-#endif
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
@@ -56,9 +56,9 @@
* different. */
/* Call it statically and then via ffi */
resfp=float_va_fn(0,2.0);
- // { dg-output "0: 2.0 : total: 2.0" }
+ /* { dg-output "0: 2.0 : total: 2.0" } */
printf("compiled: %.1f\n", resfp);
- // { dg-output "\ncompiled: 2.0" }
+ /* { dg-output "\ncompiled: 2.0" } */
arg_types[0] = &ffi_type_uint;
arg_types[1] = &ffi_type_double;
@@ -71,16 +71,16 @@
values[0] = &firstarg;
values[1] = &doubles[0];
ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- // { dg-output "\n0: 2.0 : total: 2.0" }
+ /* { dg-output "\n0: 2.0 : total: 2.0" } */
printf("ffi: %.1f\n", resfp);
- // { dg-output "\nffi: 2.0" }
+ /* { dg-output "\nffi: 2.0" } */
/* Second test, float_va_fn(2,2.0,3.0,4.0), now with variadic params */
/* Call it statically and then via ffi */
resfp=float_va_fn(2,2.0,3.0,4.0);
- // { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" }
+ /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
printf("compiled: %.1f\n", resfp);
- // { dg-output "\ncompiled: 11.0" }
+ /* { dg-output "\ncompiled: 11.0" } */
arg_types[0] = &ffi_type_uint;
arg_types[1] = &ffi_type_double;
@@ -99,9 +99,9 @@
values[2] = &doubles[1];
values[3] = &doubles[2];
ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- // { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" }
+ /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
printf("ffi: %.1f\n", resfp);
- // { dg-output "\nffi: 11.0" }
+ /* { dg-output "\nffi: 11.0" } */
exit(0);
}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
@@ -8,6 +8,7 @@
/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
+/* { dg-options -Wformat=0 { target moxie*-*-elf } } */
/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
#include "ffitest.h"
@@ -295,7 +296,7 @@
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK);
ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
- // { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
@@ -308,7 +309,7 @@
retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
- // { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK);
@@ -323,7 +324,7 @@
ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
ui8, si8);
- // { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
@@ -336,7 +337,7 @@
retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
- // { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
return 0;
}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
@@ -12,7 +12,10 @@
typedef unsigned char u8;
-__attribute__((noinline)) uint8_t
+#ifdef __GNUC__
+__attribute__((noinline))
+#endif
+uint8_t
foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
uint8_t e, uint8_t f, uint8_t g)
{
--
Repository URL: http://hg.python.org/cpython
1
0

cpython (3.3): * Fix remaining bits of issue 17192 for 3.3 - these changes
by gregory.p.smith April 30, 2013
by gregory.p.smith April 30, 2013
April 30, 2013
http://hg.python.org/cpython/rev/c665abe15c4a
changeset: 83557:c665abe15c4a
branch: 3.3
parent: 83555:aa3371fa9773
user: Gregory P. Smith <greg(a)krypto.org>
date: Tue Apr 30 00:03:01 2013 -0700
summary:
* Fix remaining bits of issue 17192 for 3.3 - these changes
were missing from a messed up merge during the libffi 3.0.13
import. the diffs from upstream libffi 3.0.13 are now small.
files:
Modules/_ctypes/libffi/src/m68k/sysv.S | 57 ++-
Modules/_ctypes/libffi/src/mips/ffi.c | 11 +-
Modules/_ctypes/libffi/src/powerpc/ffi.c | 54 ++-
Modules/_ctypes/libffi/src/sparc/ffi.c | 16 +-
Modules/_ctypes/libffi/src/x86/ffi64.c | 44 +-
Modules/_ctypes/libffi/src/x86/ffitarget.h | 3 +-
Modules/_ctypes/libffi/src/x86/sysv.S | 17 +-
Modules/_ctypes/libffi/src/x86/unix64.S | 10 +-
Modules/_ctypes/libffi/testsuite/Makefile.am | 145 +++---
Modules/_ctypes/libffi/testsuite/Makefile.in | 195 ++++++---
Modules/_ctypes/libffi/testsuite/lib/libffi.exp | 19 +
Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c | 4 +-
Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h | 44 +--
Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c | 16 +-
Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c | 9 +-
Modules/_ctypes/libffi/testsuite/libffi.call/many2.c | 5 +-
16 files changed, 418 insertions(+), 231 deletions(-)
diff --git a/Modules/_ctypes/libffi/src/m68k/sysv.S b/Modules/_ctypes/libffi/src/m68k/sysv.S
--- a/Modules/_ctypes/libffi/src/m68k/sysv.S
+++ b/Modules/_ctypes/libffi/src/m68k/sysv.S
@@ -2,9 +2,10 @@
sysv.S - Copyright (c) 2012 Alan Hourihane
Copyright (c) 1998, 2012 Andreas Schwab
- Copyright (c) 2008 Red Hat, Inc.
-
- m68k Foreign Function Interface
+ Copyright (c) 2008 Red Hat, Inc.
+ Copyright (c) 2012 Thorsten Glaser
+
+ m68k Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -168,8 +169,28 @@
retstruct2:
btst #7,%d2
+ jbeq retsint8
+ move.w %d0,(%a1)
+ jbra epilogue
+
+retsint8:
+ btst #8,%d2
+ jbeq retsint16
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ ext.w %d0
+ ext.l %d0
+#else
+ extb.l %d0
+#endif
+ move.l %d0,(%a1)
+ jbra epilogue
+
+retsint16:
+ btst #9,%d2
jbeq noretval
- move.w %d0,(%a1)
+ ext.l %d0
+ move.l %d0,(%a1)
noretval:
epilogue:
@@ -201,8 +222,10 @@
lsr.l #1,%d0
jne 1f
jcc .Lcls_epilogue
+ | CIF_FLAGS_INT
move.l -12(%fp),%d0
.Lcls_epilogue:
+ | no CIF_FLAGS_*
unlk %fp
rts
1:
@@ -210,6 +233,7 @@
lsr.l #2,%d0
jne 1f
jcs .Lcls_ret_float
+ | CIF_FLAGS_DINT
move.l (%a0)+,%d0
move.l (%a0),%d1
jra .Lcls_epilogue
@@ -224,6 +248,7 @@
lsr.l #2,%d0
jne 1f
jcs .Lcls_ret_ldouble
+ | CIF_FLAGS_DOUBLE
#if defined(__MC68881__) || defined(__HAVE_68881__)
fmove.d (%a0),%fp0
#else
@@ -242,17 +267,37 @@
jra .Lcls_epilogue
1:
lsr.l #2,%d0
- jne .Lcls_ret_struct2
+ jne 1f
jcs .Lcls_ret_struct1
+ | CIF_FLAGS_POINTER
move.l (%a0),%a0
move.l %a0,%d0
jra .Lcls_epilogue
.Lcls_ret_struct1:
move.b (%a0),%d0
jra .Lcls_epilogue
-.Lcls_ret_struct2:
+1:
+ lsr.l #2,%d0
+ jne 1f
+ jcs .Lcls_ret_sint8
+ | CIF_FLAGS_STRUCT2
move.w (%a0),%d0
jra .Lcls_epilogue
+.Lcls_ret_sint8:
+ move.l (%a0),%d0
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ ext.w %d0
+ ext.l %d0
+#else
+ extb.l %d0
+#endif
+ jra .Lcls_epilogue
+1:
+ | CIF_FLAGS_SINT16
+ move.l (%a0),%d0
+ ext.l %d0
+ jra .Lcls_epilogue
CFI_ENDPROC()
.size CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV)
diff --git a/Modules/_ctypes/libffi/src/mips/ffi.c b/Modules/_ctypes/libffi/src/mips/ffi.c
--- a/Modules/_ctypes/libffi/src/mips/ffi.c
+++ b/Modules/_ctypes/libffi/src/mips/ffi.c
@@ -670,9 +670,16 @@
if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT)
return FFI_BAD_ABI;
fn = ffi_closure_O32;
-#else /* FFI_MIPS_N32 */
- if (cif->abi != FFI_N32 && cif->abi != FFI_N64)
+#else
+#if _MIPS_SIM ==_ABIN32
+ if (cif->abi != FFI_N32
+ && cif->abi != FFI_N32_SOFT_FLOAT)
return FFI_BAD_ABI;
+#else
+ if (cif->abi != FFI_N64
+ && cif->abi != FFI_N64_SOFT_FLOAT)
+ return FFI_BAD_ABI;
+#endif
fn = ffi_closure_N32;
#endif /* FFI_MIPS_O32 */
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi.c b/Modules/_ctypes/libffi/src/powerpc/ffi.c
--- a/Modules/_ctypes/libffi/src/powerpc/ffi.c
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi.c
@@ -48,6 +48,11 @@
FLAG_RETURNS_128BITS = 1 << (31-27), /* cr6 */
+ FLAG_SYSV_SMST_R4 = 1 << (31-26), /* use r4 for FFI_SYSV 8 byte
+ structs. */
+ FLAG_SYSV_SMST_R3 = 1 << (31-25), /* use r3 for FFI_SYSV 4 byte
+ structs. */
+
FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
#ifndef __NO_FPRS__
FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
@@ -367,7 +372,13 @@
/* Check that we didn't overrun the stack... */
FFI_ASSERT (copy_space.c >= next_arg.c);
FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
+ /* The assert below is testing that the number of integer arguments agrees
+ with the number found in ffi_prep_cif_machdep(). However, intarg_count
+ is incremeneted whenever we place an FP arg on the stack, so account for
+ that before our assert test. */
#ifndef __NO_FPRS__
+ if (fparg_count > NUM_FPR_ARG_REGISTERS)
+ intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
FFI_ASSERT (fpr_base.u
<= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
#endif
@@ -664,9 +675,11 @@
switch (type)
{
#ifndef __NO_FPRS__
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
flags |= FLAG_RETURNS_128BITS;
/* Fall through. */
+#endif
case FFI_TYPE_DOUBLE:
flags |= FLAG_RETURNS_64BITS;
/* Fall through. */
@@ -684,18 +697,35 @@
break;
case FFI_TYPE_STRUCT:
- /*
- * The final SYSV ABI says that structures smaller or equal 8 bytes
- * are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them
- * in memory.
- *
- * NOTE: The assembly code can safely assume that it just needs to
- * store both r3 and r4 into a 8-byte word-aligned buffer, as
- * we allocate a temporary buffer in ffi_call() if this flag is
- * set.
- */
- if (cif->abi == FFI_SYSV && size <= 8)
- flags |= FLAG_RETURNS_SMST;
+ if (cif->abi == FFI_SYSV)
+ {
+ /* The final SYSV ABI says that structures smaller or equal 8 bytes
+ are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them
+ in memory. */
+
+ /* Treat structs with size <= 8 bytes. */
+ if (size <= 8)
+ {
+ flags |= FLAG_RETURNS_SMST;
+ /* These structs are returned in r3. We pack the type and the
+ precalculated shift value (needed in the sysv.S) into flags.
+ The same applies for the structs returned in r3/r4. */
+ if (size <= 4)
+ {
+ flags |= FLAG_SYSV_SMST_R3;
+ flags |= 8 * (4 - size) << 8;
+ break;
+ }
+ /* These structs are returned in r3 and r4. See above. */
+ if (size <= 8)
+ {
+ flags |= FLAG_SYSV_SMST_R3 | FLAG_SYSV_SMST_R4;
+ flags |= 8 * (8 - size) << 8;
+ break;
+ }
+ }
+ }
+
intarg_count++;
flags |= FLAG_RETVAL_REFERENCE;
/* Fall through. */
diff --git a/Modules/_ctypes/libffi/src/sparc/ffi.c b/Modules/_ctypes/libffi/src/sparc/ffi.c
--- a/Modules/_ctypes/libffi/src/sparc/ffi.c
+++ b/Modules/_ctypes/libffi/src/sparc/ffi.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2011 Anthony Green
+ ffi.c - Copyright (c) 2011, 2013 Anthony Green
Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc.
SPARC Foreign Function Interface
@@ -376,6 +376,10 @@
unsigned, unsigned *, void (*fn)(void));
#endif
+#ifndef __GNUC__
+void ffi_flush_icache (void *, size_t);
+#endif
+
void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
extended_cif ecif;
@@ -417,7 +421,7 @@
/* behind "call", so we alloc some executable space for it. */
/* l7 is used, we need to make sure v8.S doesn't use %l7. */
unsigned int *call_struct = NULL;
- ffi_closure_alloc(32, &call_struct);
+ ffi_closure_alloc(32, (void **)&call_struct);
if (call_struct)
{
unsigned long f = (unsigned long)fn;
@@ -432,10 +436,14 @@
call_struct[5] = 0x01000000; /* nop */
call_struct[6] = 0x81c7e008; /* ret */
call_struct[7] = 0xbe100017; /* mov %l7, %i7 */
+#ifdef __GNUC__
asm volatile ("iflush %0; iflush %0+8; iflush %0+16; iflush %0+24" : :
"r" (call_struct) : "memory");
/* SPARC v8 requires 5 instructions for flush to be visible */
asm volatile ("nop; nop; nop; nop; nop");
+#else
+ ffi_flush_icache (call_struct, 32);
+#endif
ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes,
cif->flags, rvalue, call_struct);
ffi_closure_free(call_struct);
@@ -513,6 +521,7 @@
closure->user_data = user_data;
/* Flush the Icache. closure is 8 bytes aligned. */
+#ifdef __GNUC__
#ifdef SPARC64
asm volatile ("flush %0; flush %0+8" : : "r" (closure) : "memory");
#else
@@ -520,6 +529,9 @@
/* SPARC v8 requires 5 instructions for flush to be visible */
asm volatile ("nop; nop; nop; nop; nop");
#endif
+#else
+ ffi_flush_icache (closure, 16);
+#endif
return FFI_OK;
}
diff --git a/Modules/_ctypes/libffi/src/x86/ffi64.c b/Modules/_ctypes/libffi/src/x86/ffi64.c
--- a/Modules/_ctypes/libffi/src/x86/ffi64.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi64.c
@@ -1,5 +1,6 @@
/* -----------------------------------------------------------------------
- ffi64.c - Copyright (c) 20011 Anthony Green
+ ffi64.c - Copyright (c) 2013 The Written Word, Inc.
+ Copyright (c) 2011 Anthony Green
Copyright (c) 2008, 2010 Red Hat, Inc.
Copyright (c) 2002, 2007 Bo Thorsen <bo(a)suse.de>
@@ -37,17 +38,29 @@
#define MAX_GPR_REGS 6
#define MAX_SSE_REGS 8
-#ifdef __INTEL_COMPILER
+#if defined(__INTEL_COMPILER)
#define UINT128 __m128
#else
+#if defined(__SUNPRO_C)
+#include <sunmedia_types.h>
+#define UINT128 __m128i
+#else
#define UINT128 __int128_t
#endif
+#endif
+
+union big_int_union
+{
+ UINT32 i32;
+ UINT64 i64;
+ UINT128 i128;
+};
struct register_args
{
/* Registers for argument passing. */
UINT64 gpr[MAX_GPR_REGS];
- UINT128 sse[MAX_SSE_REGS];
+ union big_int_union sse[MAX_SSE_REGS];
};
extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
@@ -471,16 +484,33 @@
{
case X86_64_INTEGER_CLASS:
case X86_64_INTEGERSI_CLASS:
- reg_args->gpr[gprcount] = 0;
- memcpy (®_args->gpr[gprcount], a, size < 8 ? size : 8);
+ /* Sign-extend integer arguments passed in general
+ purpose registers, to cope with the fact that
+ LLVM incorrectly assumes that this will be done
+ (the x86-64 PS ABI does not specify this). */
+ switch (arg_types[i]->type)
+ {
+ case FFI_TYPE_SINT8:
+ *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT8 *) a);
+ break;
+ case FFI_TYPE_SINT16:
+ *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT16 *) a);
+ break;
+ case FFI_TYPE_SINT32:
+ *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT32 *) a);
+ break;
+ default:
+ reg_args->gpr[gprcount] = 0;
+ memcpy (®_args->gpr[gprcount], a, size < 8 ? size : 8);
+ }
gprcount++;
break;
case X86_64_SSE_CLASS:
case X86_64_SSEDF_CLASS:
- reg_args->sse[ssecount++] = *(UINT64 *) a;
+ reg_args->sse[ssecount++].i64 = *(UINT64 *) a;
break;
case X86_64_SSESF_CLASS:
- reg_args->sse[ssecount++] = *(UINT32 *) a;
+ reg_args->sse[ssecount++].i32 = *(UINT32 *) a;
break;
default:
abort();
diff --git a/Modules/_ctypes/libffi/src/x86/ffitarget.h b/Modules/_ctypes/libffi/src/x86/ffitarget.h
--- a/Modules/_ctypes/libffi/src/x86/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/x86/ffitarget.h
@@ -61,8 +61,9 @@
typedef long long ffi_sarg;
#endif
#else
-#if defined __x86_64__ && !defined __LP64__
+#if defined __x86_64__ && defined __ILP32__
#define FFI_SIZEOF_ARG 8
+#define FFI_SIZEOF_JAVA_RAW 4
typedef unsigned long long ffi_arg;
typedef long long ffi_sarg;
#else
diff --git a/Modules/_ctypes/libffi/src/x86/sysv.S b/Modules/_ctypes/libffi/src/x86/sysv.S
--- a/Modules/_ctypes/libffi/src/x86/sysv.S
+++ b/Modules/_ctypes/libffi/src/x86/sysv.S
@@ -1,5 +1,6 @@
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 1996, 1998, 2001-2003, 2005, 2008, 2010 Red Hat, Inc.
+ sysv.S - Copyright (c) 2013 The Written Word, Inc.
+ - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
X86 Foreign Function Interface
@@ -181,9 +182,19 @@
leal -24(%ebp), %edx
movl %edx, -12(%ebp) /* resp */
leal 8(%ebp), %edx
+#ifdef __SUNPRO_C
+ /* The SUNPRO compiler doesn't support GCC's regparm function
+ attribute, so we have to pass all three arguments to
+ ffi_closure_SYSV_inner on the stack. */
+ movl %edx, 8(%esp) /* args = __builtin_dwarf_cfa () */
+ leal -12(%ebp), %edx
+ movl %edx, 4(%esp) /* &resp */
+ movl %eax, (%esp) /* closure */
+#else
movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
leal -12(%ebp), %edx
movl %edx, (%esp) /* &resp */
+#endif
#if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__
call ffi_closure_SYSV_inner
#else
@@ -328,6 +339,9 @@
.size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV
#endif
+#if defined __GNUC__
+/* Only emit dwarf unwind info when building with GNU toolchain. */
+
#if defined __PIC__
# if defined __sun__ && defined __svr4__
/* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22
@@ -460,6 +474,7 @@
.LEFDE3:
#endif
+#endif
#endif /* ifndef __x86_64__ */
diff --git a/Modules/_ctypes/libffi/src/x86/unix64.S b/Modules/_ctypes/libffi/src/x86/unix64.S
--- a/Modules/_ctypes/libffi/src/x86/unix64.S
+++ b/Modules/_ctypes/libffi/src/x86/unix64.S
@@ -1,6 +1,7 @@
/* -----------------------------------------------------------------------
- unix64.S - Copyright (c) 2002 Bo Thorsen <bo(a)suse.de>
- Copyright (c) 2008 Red Hat, Inc
+ unix64.S - Copyright (c) 2013 The Written Word, Inc.
+ - Copyright (c) 2008 Red Hat, Inc
+ - Copyright (c) 2002 Bo Thorsen <bo(a)suse.de>
x86-64 Foreign Function Interface
@@ -324,6 +325,9 @@
.LUW9:
.size ffi_closure_unix64,.-ffi_closure_unix64
+#ifdef __GNUC__
+/* Only emit DWARF unwind info when building with the GNU toolchain. */
+
#ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
.section .eh_frame,"a",@unwind
#else
@@ -419,6 +423,8 @@
.align 8
.LEFDE3:
+#endif /* __GNUC__ */
+
#endif /* __x86_64__ */
#if defined __ELF__ && defined __linux__
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.am b/Modules/_ctypes/libffi/testsuite/Makefile.am
--- a/Modules/_ctypes/libffi/testsuite/Makefile.am
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.am
@@ -13,73 +13,82 @@
AM_RUNTESTFLAGS =
+EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
+
CLEANFILES = *.exe core* *.log *.sum
-EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
-libffi.call/cls_align_longdouble_split.c libffi.call/closure_loc_fn0.c \
-libffi.call/cls_schar.c libffi.call/closure_fn1.c \
-libffi.call/many2_win32.c libffi.call/return_ul.c \
-libffi.call/cls_align_double.c libffi.call/return_fl2.c \
-libffi.call/cls_1_1byte.c libffi.call/cls_64byte.c \
-libffi.call/nested_struct7.c libffi.call/cls_align_sint32.c \
-libffi.call/nested_struct2.c libffi.call/ffitest.h \
-libffi.call/nested_struct4.c libffi.call/cls_multi_ushort.c \
-libffi.call/struct3.c libffi.call/cls_3byte1.c \
-libffi.call/cls_16byte.c libffi.call/struct8.c \
-libffi.call/nested_struct8.c libffi.call/cls_multi_sshort.c \
-libffi.call/cls_3byte2.c libffi.call/fastthis2_win32.c \
-libffi.call/cls_pointer.c libffi.call/err_bad_typedef.c \
-libffi.call/cls_4_1byte.c libffi.call/cls_9byte2.c \
-libffi.call/cls_multi_schar.c libffi.call/stret_medium2.c \
-libffi.call/cls_5_1_byte.c libffi.call/call.exp \
-libffi.call/cls_double.c libffi.call/cls_align_sint16.c \
-libffi.call/cls_uint.c libffi.call/return_ll1.c \
-libffi.call/nested_struct3.c libffi.call/cls_20byte1.c \
-libffi.call/closure_fn4.c libffi.call/cls_uchar.c \
-libffi.call/struct2.c libffi.call/cls_7byte.c libffi.call/strlen.c \
-libffi.call/many.c libffi.call/testclosure.c libffi.call/return_fl.c \
-libffi.call/struct5.c libffi.call/cls_12byte.c \
-libffi.call/cls_multi_sshortchar.c \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
-libffi.call/return_fl3.c libffi.call/stret_medium.c \
-libffi.call/nested_struct6.c libffi.call/a.out \
-libffi.call/closure_fn3.c libffi.call/float3.c libffi.call/many2.c \
-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
-libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
-libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
-libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
-libffi.call/cls_sshort.c libffi.call/many_win32.c \
-libffi.call/nested_struct.c libffi.call/cls_20byte.c \
-libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
-libffi.call/return_uc.c libffi.call/closure_thiscall.c \
-libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
-libffi.call/promotion.c libffi.call/struct1_win32.c \
-libffi.call/return_dbl.c libffi.call/cls_24byte.c \
-libffi.call/struct4.c libffi.call/cls_6byte.c \
-libffi.call/cls_align_uint32.c libffi.call/float.c \
-libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
-libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
-libffi.call/cls_align_float.c libffi.call/return_fl1.c \
-libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
-libffi.call/stret_large2.c libffi.call/return_sl.c \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
-libffi.call/cls_2byte.c libffi.call/float2.c \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
-libffi.call/struct1.c libffi.call/nested_struct9.c \
-libffi.call/huge_struct.c libffi.call/problem1.c libffi.call/float4.c \
-libffi.call/fastthis3_win32.c libffi.call/return_ldl.c \
-libffi.call/strlen2_win32.c libffi.call/closure_fn5.c \
-libffi.call/struct2_win32.c libffi.call/struct6.c \
-libffi.call/return_ll.c libffi.call/struct9.c libffi.call/return_sc.c \
-libffi.call/struct7.c libffi.call/cls_align_uint64.c \
-libffi.call/cls_4byte.c libffi.call/strlen_win32.c \
-libffi.call/cls_6_1_byte.c libffi.call/cls_7_1_byte.c \
-libffi.special/unwindtest.cc libffi.special/special.exp \
-libffi.special/unwindtest_ffi_call.cc libffi.special/ffitestcxx.h \
-lib/wrapper.exp lib/target-libpath.exp lib/libffi.exp
+EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
+libffi.call/cls_align_longdouble_split.c \
+libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
+libffi.call/closure_fn1.c libffi.call/many2_win32.c \
+libffi.call/return_ul.c libffi.call/cls_align_double.c \
+libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
+libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
+libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
+libffi.call/ffitest.h libffi.call/nested_struct4.c \
+libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
+libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
+libffi.call/struct8.c libffi.call/nested_struct8.c \
+libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
+libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \
+libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
+libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
+libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
+libffi.call/call.exp libffi.call/cls_double.c \
+libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
+libffi.call/return_ll1.c libffi.call/nested_struct3.c \
+libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
+libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
+libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
+libffi.call/return_fl.c libffi.call/struct5.c \
+libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
+libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
+libffi.call/return_fl3.c libffi.call/stret_medium.c \
+libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
+libffi.call/float3.c libffi.call/many2.c \
+libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
+libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
+libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
+libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
+libffi.call/cls_sshort.c libffi.call/many_win32.c \
+libffi.call/nested_struct.c libffi.call/cls_20byte.c \
+libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
+libffi.call/return_uc.c libffi.call/closure_thiscall.c \
+libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
+libffi.call/promotion.c libffi.call/struct1_win32.c \
+libffi.call/return_dbl.c libffi.call/cls_24byte.c \
+libffi.call/struct4.c libffi.call/cls_6byte.c \
+libffi.call/cls_align_uint32.c libffi.call/float.c \
+libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
+libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
+libffi.call/cls_align_float.c libffi.call/return_fl1.c \
+libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
+libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
+libffi.call/stret_large2.c libffi.call/return_sl.c \
+libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
+libffi.call/cls_2byte.c libffi.call/float2.c \
+libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
+libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
+libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
+libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
+libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
+libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
+libffi.call/struct1.c libffi.call/nested_struct9.c \
+libffi.call/huge_struct.c libffi.call/problem1.c \
+libffi.call/float4.c libffi.call/fastthis3_win32.c \
+libffi.call/return_ldl.c libffi.call/strlen2_win32.c \
+libffi.call/closure_fn5.c libffi.call/struct2_win32.c \
+libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
+libffi.call/return_sc.c libffi.call/struct7.c \
+libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
+libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \
+libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \
+libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \
+libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \
+lib/libffi.exp libffi.call/cls_struct_va1.c \
+libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
+libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
+libffi.call/nested_struct11.c libffi.call/uninitialized.c \
+libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
+libffi.call/va_struct3.c
+
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.in b/Modules/_ctypes/libffi/testsuite/Makefile.in
--- a/Modules/_ctypes/libffi/testsuite/Makefile.in
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -37,7 +53,19 @@
subdir = testsuite
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
+ $(top_srcdir)/m4/ax_append_flag.m4 \
+ $(top_srcdir)/m4/ax_cc_maxopt.m4 \
+ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_compiler_vendor.m4 \
+ $(top_srcdir)/m4/ax_configure_args.m4 \
+ $(top_srcdir)/m4/ax_enable_builddir.m4 \
+ $(top_srcdir)/m4/ax_gcc_archflag.m4 \
+ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -47,6 +75,11 @@
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
DEJATOOL = $(PACKAGE)
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -114,6 +147,7 @@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PRTDIAG = @PRTDIAG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -134,6 +168,7 @@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
+ax_enable_builddir_sed = @ax_enable_builddir_sed@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -169,6 +204,7 @@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
+sys_symbol_underscore = @sys_symbol_underscore@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
@@ -191,75 +227,82 @@
echo $(top_srcdir)/../dejagnu/runtest ; \
else echo runtest; fi`
+EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
CLEANFILES = *.exe core* *.log *.sum
-EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
-libffi.call/cls_align_longdouble_split.c libffi.call/closure_loc_fn0.c \
-libffi.call/cls_schar.c libffi.call/closure_fn1.c \
-libffi.call/many2_win32.c libffi.call/return_ul.c \
-libffi.call/cls_align_double.c libffi.call/return_fl2.c \
-libffi.call/cls_1_1byte.c libffi.call/cls_64byte.c \
-libffi.call/nested_struct7.c libffi.call/cls_align_sint32.c \
-libffi.call/nested_struct2.c libffi.call/ffitest.h \
-libffi.call/nested_struct4.c libffi.call/cls_multi_ushort.c \
-libffi.call/struct3.c libffi.call/cls_3byte1.c \
-libffi.call/cls_16byte.c libffi.call/struct8.c \
-libffi.call/nested_struct8.c libffi.call/cls_multi_sshort.c \
-libffi.call/cls_3byte2.c libffi.call/fastthis2_win32.c \
-libffi.call/cls_pointer.c libffi.call/err_bad_typedef.c \
-libffi.call/cls_4_1byte.c libffi.call/cls_9byte2.c \
-libffi.call/cls_multi_schar.c libffi.call/stret_medium2.c \
-libffi.call/cls_5_1_byte.c libffi.call/call.exp \
-libffi.call/cls_double.c libffi.call/cls_align_sint16.c \
-libffi.call/cls_uint.c libffi.call/return_ll1.c \
-libffi.call/nested_struct3.c libffi.call/cls_20byte1.c \
-libffi.call/closure_fn4.c libffi.call/cls_uchar.c \
-libffi.call/struct2.c libffi.call/cls_7byte.c libffi.call/strlen.c \
-libffi.call/many.c libffi.call/testclosure.c libffi.call/return_fl.c \
-libffi.call/struct5.c libffi.call/cls_12byte.c \
-libffi.call/cls_multi_sshortchar.c \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
-libffi.call/return_fl3.c libffi.call/stret_medium.c \
-libffi.call/nested_struct6.c libffi.call/a.out \
-libffi.call/closure_fn3.c libffi.call/float3.c libffi.call/many2.c \
-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
-libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
-libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
-libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
-libffi.call/cls_sshort.c libffi.call/many_win32.c \
-libffi.call/nested_struct.c libffi.call/cls_20byte.c \
-libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
-libffi.call/return_uc.c libffi.call/closure_thiscall.c \
-libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
-libffi.call/promotion.c libffi.call/struct1_win32.c \
-libffi.call/return_dbl.c libffi.call/cls_24byte.c \
-libffi.call/struct4.c libffi.call/cls_6byte.c \
-libffi.call/cls_align_uint32.c libffi.call/float.c \
-libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
-libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
-libffi.call/cls_align_float.c libffi.call/return_fl1.c \
-libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
-libffi.call/stret_large2.c libffi.call/return_sl.c \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
-libffi.call/cls_2byte.c libffi.call/float2.c \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
-libffi.call/struct1.c libffi.call/nested_struct9.c \
-libffi.call/huge_struct.c libffi.call/problem1.c libffi.call/float4.c \
-libffi.call/fastthis3_win32.c libffi.call/return_ldl.c \
-libffi.call/strlen2_win32.c libffi.call/closure_fn5.c \
-libffi.call/struct2_win32.c libffi.call/struct6.c \
-libffi.call/return_ll.c libffi.call/struct9.c libffi.call/return_sc.c \
-libffi.call/struct7.c libffi.call/cls_align_uint64.c \
-libffi.call/cls_4byte.c libffi.call/strlen_win32.c \
-libffi.call/cls_6_1_byte.c libffi.call/cls_7_1_byte.c \
-libffi.special/unwindtest.cc libffi.special/special.exp \
-libffi.special/unwindtest_ffi_call.cc libffi.special/ffitestcxx.h \
-lib/wrapper.exp lib/target-libpath.exp lib/libffi.exp
+EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
+libffi.call/cls_align_longdouble_split.c \
+libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
+libffi.call/closure_fn1.c libffi.call/many2_win32.c \
+libffi.call/return_ul.c libffi.call/cls_align_double.c \
+libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
+libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
+libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
+libffi.call/ffitest.h libffi.call/nested_struct4.c \
+libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
+libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
+libffi.call/struct8.c libffi.call/nested_struct8.c \
+libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
+libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \
+libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
+libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
+libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
+libffi.call/call.exp libffi.call/cls_double.c \
+libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
+libffi.call/return_ll1.c libffi.call/nested_struct3.c \
+libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
+libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
+libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
+libffi.call/return_fl.c libffi.call/struct5.c \
+libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
+libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
+libffi.call/return_fl3.c libffi.call/stret_medium.c \
+libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
+libffi.call/float3.c libffi.call/many2.c \
+libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
+libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
+libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
+libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
+libffi.call/cls_sshort.c libffi.call/many_win32.c \
+libffi.call/nested_struct.c libffi.call/cls_20byte.c \
+libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
+libffi.call/return_uc.c libffi.call/closure_thiscall.c \
+libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
+libffi.call/promotion.c libffi.call/struct1_win32.c \
+libffi.call/return_dbl.c libffi.call/cls_24byte.c \
+libffi.call/struct4.c libffi.call/cls_6byte.c \
+libffi.call/cls_align_uint32.c libffi.call/float.c \
+libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
+libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
+libffi.call/cls_align_float.c libffi.call/return_fl1.c \
+libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
+libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
+libffi.call/stret_large2.c libffi.call/return_sl.c \
+libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
+libffi.call/cls_2byte.c libffi.call/float2.c \
+libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
+libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
+libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
+libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
+libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
+libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
+libffi.call/struct1.c libffi.call/nested_struct9.c \
+libffi.call/huge_struct.c libffi.call/problem1.c \
+libffi.call/float4.c libffi.call/fastthis3_win32.c \
+libffi.call/return_ldl.c libffi.call/strlen2_win32.c \
+libffi.call/closure_fn5.c libffi.call/struct2_win32.c \
+libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
+libffi.call/return_sc.c libffi.call/struct7.c \
+libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
+libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \
+libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \
+libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \
+libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \
+lib/libffi.exp libffi.call/cls_struct_va1.c \
+libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
+libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
+libffi.call/nested_struct11.c libffi.call/uninitialized.c \
+libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
+libffi.call/va_struct3.c
all: all-am
@@ -306,6 +349,8 @@
ctags: CTAGS
CTAGS:
+cscope cscopelist:
+
check-DEJAGNU: site.exp
srcdir='$(srcdir)'; export srcdir; \
@@ -316,11 +361,11 @@
if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
then :; else exit_status=1; fi; \
done; \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ else echo "WARNING: could not find 'runtest'" 1>&2; :;\
fi; \
exit $$exit_status
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
- @echo 'Making a new site.exp file...'
+ @echo 'Making a new site.exp file ...'
@echo '## these variables are automatically generated by make ##' >site.tmp
@echo '# Do not edit here. If you wish to override these values' >>site.tmp
@echo '# edit the last section' >>site.tmp
diff --git a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
--- a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
+++ b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
@@ -101,9 +101,17 @@
global tool_root_dir
global ld_library_path
+ global using_gcc
+
set blddirffi [pwd]/..
verbose "libffi $blddirffi"
+ # Are we building with GCC?
+ set tmp [grep ../config.status "GCC='yes'"]
+ if { [string match $tmp "GCC='yes'"] } {
+
+ set using_gcc "yes"
+
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
@@ -127,6 +135,13 @@
}
}
}
+
+ } else {
+
+ set using_gcc "no"
+
+ }
+
# add the library path for libffi.
append ld_library_path ":${blddirffi}/.libs"
@@ -203,6 +218,10 @@
lappend options "libs= -lffi"
+ if { [string match "aarch64*-*-linux*" $target_triplet] } {
+ lappend options "libs= -lpthread"
+ }
+
verbose "options: $options"
return [target_compile $source $dest $type $options]
}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
@@ -5,7 +5,9 @@
Originator: Blake Chaffin */
/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
+/* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have
+ remove the xfail for arm*-*-* below, until we know more. */
+/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
@@ -15,7 +15,7 @@
#define MAX_ARGS 256
-#define CHECK(x) !(x) ? abort() : 0
+#define CHECK(x) !(x) ? (abort(), 1) : 0
/* Define __UNUSED__ that also other compilers than gcc can run the tests. */
#undef __UNUSED__
@@ -127,44 +127,6 @@
#define PRId64 "I64d"
#endif
-#ifdef USING_MMAP
-static inline void *
-allocate_mmap (size_t size)
-{
- void *page;
-#if defined (HAVE_MMAP_DEV_ZERO)
- static int dev_zero_fd = -1;
+#ifndef PRIuPTR
+#define PRIuPTR "u"
#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
- if (dev_zero_fd == -1)
- {
- dev_zero_fd = open ("/dev/zero", O_RDONLY);
- if (dev_zero_fd == -1)
- {
- perror ("open /dev/zero: %m");
- exit (1);
- }
- }
-#endif
-
-
-#ifdef HAVE_MMAP_ANON
- page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
-#ifdef HAVE_MMAP_DEV_ZERO
- page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE, dev_zero_fd, 0);
-#endif
-
- if (page == (void *) MAP_FAILED)
- {
- perror ("virtual memory exhausted");
- exit (1);
- }
-
- return page;
-}
-
-#endif
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
@@ -56,9 +56,9 @@
* different. */
/* Call it statically and then via ffi */
resfp=float_va_fn(0,2.0);
- // { dg-output "0: 2.0 : total: 2.0" }
+ /* { dg-output "0: 2.0 : total: 2.0" } */
printf("compiled: %.1f\n", resfp);
- // { dg-output "\ncompiled: 2.0" }
+ /* { dg-output "\ncompiled: 2.0" } */
arg_types[0] = &ffi_type_uint;
arg_types[1] = &ffi_type_double;
@@ -71,16 +71,16 @@
values[0] = &firstarg;
values[1] = &doubles[0];
ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- // { dg-output "\n0: 2.0 : total: 2.0" }
+ /* { dg-output "\n0: 2.0 : total: 2.0" } */
printf("ffi: %.1f\n", resfp);
- // { dg-output "\nffi: 2.0" }
+ /* { dg-output "\nffi: 2.0" } */
/* Second test, float_va_fn(2,2.0,3.0,4.0), now with variadic params */
/* Call it statically and then via ffi */
resfp=float_va_fn(2,2.0,3.0,4.0);
- // { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" }
+ /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
printf("compiled: %.1f\n", resfp);
- // { dg-output "\ncompiled: 11.0" }
+ /* { dg-output "\ncompiled: 11.0" } */
arg_types[0] = &ffi_type_uint;
arg_types[1] = &ffi_type_double;
@@ -99,9 +99,9 @@
values[2] = &doubles[1];
values[3] = &doubles[2];
ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- // { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" }
+ /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
printf("ffi: %.1f\n", resfp);
- // { dg-output "\nffi: 11.0" }
+ /* { dg-output "\nffi: 11.0" } */
exit(0);
}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
@@ -8,6 +8,7 @@
/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
+/* { dg-options -Wformat=0 { target moxie*-*-elf } } */
/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
#include "ffitest.h"
@@ -295,7 +296,7 @@
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK);
ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
- // { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
@@ -308,7 +309,7 @@
retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
- // { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK);
@@ -323,7 +324,7 @@
ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
ui8, si8);
- // { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
"%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
@@ -336,7 +337,7 @@
retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
- // { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
+ /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
return 0;
}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
@@ -12,7 +12,10 @@
typedef unsigned char u8;
-__attribute__((noinline)) uint8_t
+#ifdef __GNUC__
+__attribute__((noinline))
+#endif
+uint8_t
foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
uint8_t e, uint8_t f, uint8_t g)
{
--
Repository URL: http://hg.python.org/cpython
1
0

cpython (merge 3.3 -> default): * Fix PART of issue 17192 for 3.4 - reapply the issue11729 patch
by gregory.p.smith April 30, 2013
by gregory.p.smith April 30, 2013
April 30, 2013
http://hg.python.org/cpython/rev/e0fdc21c7d13
changeset: 83556:e0fdc21c7d13
parent: 83553:84cef4f1999a
parent: 83555:aa3371fa9773
user: Gregory P. Smith <greg(a)krypto.org>
date: Mon Apr 29 23:48:03 2013 -0700
summary:
* Fix PART of issue 17192 for 3.4 - reapply the issue11729 patch
that was undone in the merge fun from upstream which already
had it in 3.0.13.
* Add the missing update to libffi.info.
files:
Modules/_ctypes/libffi/configure | 6 +++---
Modules/_ctypes/libffi/configure.ac | 6 +++---
Modules/_ctypes/libffi/doc/libffi.info | Bin
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -14505,10 +14505,10 @@
$as_echo_n "(cached) " >&6
else
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
+ libffi_cv_as_x86_pcrel=yes
fi
fi
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
--- a/Modules/_ctypes/libffi/configure.ac
+++ b/Modules/_ctypes/libffi/configure.ac
@@ -367,10 +367,10 @@
if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
AC_CACHE_CHECK([assembler supports pc related relocs],
libffi_cv_as_x86_pcrel, [
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
+ libffi_cv_as_x86_pcrel=yes
fi
])
if test "x$libffi_cv_as_x86_pcrel" = xyes; then
diff --git a/Modules/_ctypes/libffi/doc/libffi.info b/Modules/_ctypes/libffi/doc/libffi.info
index 896a5ec0f1efe6231df04e22e25ec1e280b5e077..6d5acf830ac97ec0f11923d3e9808477900c8e29
GIT binary patch
[stripped]
--
Repository URL: http://hg.python.org/cpython
1
0

cpython (merge 3.2 -> 3.3): * Fix PART of issue 17192 for 3.3 - reapply the issue11729 patch
by gregory.p.smith April 30, 2013
by gregory.p.smith April 30, 2013
April 30, 2013
http://hg.python.org/cpython/rev/aa3371fa9773
changeset: 83555:aa3371fa9773
branch: 3.3
parent: 83551:68d1ac152b5d
parent: 83554:7a2e0c1bb1a9
user: Gregory P. Smith <greg(a)krypto.org>
date: Mon Apr 29 23:47:17 2013 -0700
summary:
* Fix PART of issue 17192 for 3.3 - reapply the issue11729 patch
that was undone in the merge fun from upstream which already
had it in 3.0.13.
* Add the missing update to libffi.info.
files:
Modules/_ctypes/libffi/configure | 6 +++---
Modules/_ctypes/libffi/configure.ac | 6 +++---
Modules/_ctypes/libffi/doc/libffi.info | Bin
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -14505,10 +14505,10 @@
$as_echo_n "(cached) " >&6
else
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
+ libffi_cv_as_x86_pcrel=yes
fi
fi
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
--- a/Modules/_ctypes/libffi/configure.ac
+++ b/Modules/_ctypes/libffi/configure.ac
@@ -367,10 +367,10 @@
if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
AC_CACHE_CHECK([assembler supports pc related relocs],
libffi_cv_as_x86_pcrel, [
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
+ libffi_cv_as_x86_pcrel=yes
fi
])
if test "x$libffi_cv_as_x86_pcrel" = xyes; then
diff --git a/Modules/_ctypes/libffi/doc/libffi.info b/Modules/_ctypes/libffi/doc/libffi.info
index 896a5ec0f1efe6231df04e22e25ec1e280b5e077..6d5acf830ac97ec0f11923d3e9808477900c8e29
GIT binary patch
[stripped]
--
Repository URL: http://hg.python.org/cpython
1
0

cpython (3.2): * Fix issue 17192 for 3.2 - reapply the issue11729 patch that was undone
by gregory.p.smith April 30, 2013
by gregory.p.smith April 30, 2013
April 30, 2013
http://hg.python.org/cpython/rev/7a2e0c1bb1a9
changeset: 83554:7a2e0c1bb1a9
branch: 3.2
parent: 83134:7680dbf5cb3f
user: Gregory P. Smith <greg(a)krypto.org>
date: Mon Apr 29 23:45:38 2013 -0700
summary:
* Fix issue 17192 for 3.2 - reapply the issue11729 patch that was undone
in the merge fun from upstream which already had it in 3.0.13.
* Add the missing update to libffi.info.
files:
Modules/_ctypes/libffi/configure | 6 +++---
Modules/_ctypes/libffi/configure.ac | 6 +++---
Modules/_ctypes/libffi/doc/libffi.info | Bin
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -14505,10 +14505,10 @@
$as_echo_n "(cached) " >&6
else
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
+ libffi_cv_as_x86_pcrel=yes
fi
fi
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
--- a/Modules/_ctypes/libffi/configure.ac
+++ b/Modules/_ctypes/libffi/configure.ac
@@ -367,10 +367,10 @@
if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
AC_CACHE_CHECK([assembler supports pc related relocs],
libffi_cv_as_x86_pcrel, [
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
+ libffi_cv_as_x86_pcrel=yes
fi
])
if test "x$libffi_cv_as_x86_pcrel" = xyes; then
diff --git a/Modules/_ctypes/libffi/doc/libffi.info b/Modules/_ctypes/libffi/doc/libffi.info
index 896a5ec0f1efe6231df04e22e25ec1e280b5e077..6d5acf830ac97ec0f11923d3e9808477900c8e29
GIT binary patch
[stripped]
--
Repository URL: http://hg.python.org/cpython
1
0

peps: Some more clarifications and edits. Describe datagram protocol.
by guido.van.rossum April 30, 2013
by guido.van.rossum April 30, 2013
April 30, 2013
http://hg.python.org/peps/rev/6440a19fb6a4
changeset: 4867:6440a19fb6a4
user: Guido van Rossum <guido(a)python.org>
date: Mon Apr 29 21:24:46 2013 -0700
summary:
Some more clarifications and edits. Describe datagram protocol.
files:
pep-3156.txt | 210 +++++++++++++++++++++++---------------
1 files changed, 124 insertions(+), 86 deletions(-)
diff --git a/pep-3156.txt b/pep-3156.txt
--- a/pep-3156.txt
+++ b/pep-3156.txt
@@ -130,10 +130,6 @@
Details of the interfaces defined by the various standard types of
transports and protocols are given later.
-
-Specification
-=============
-
Dependencies
------------
@@ -143,6 +139,10 @@
packages, and no C code, except for the proactor-based event loop on
Windows.
+
+Event Loop Interface Specification
+==================================
+
Module Namespace
----------------
@@ -217,14 +217,6 @@
be retrieved by calling ``get_event_loop_policy()``. (TBD: Require
inheriting from ``AbstractEventLoopPolicy``?)
-Notes for the Event Loop Interface
-----------------------------------
-
-A note about times: as usual in Python, all timeouts, intervals and
-delays are measured in seconds, and may be ints or floats. The
-accuracy and precision of the clock are up to the implementation; the
-default implementation uses ``time.monotonic()``.
-
Event Loop Classes
------------------
@@ -298,6 +290,16 @@
- Signal callbacks: ``add_signal_handler()``,
``remove_signal_handler()``.
+Specifying Times
+----------------
+
+As usual in Python, all timeouts, intervals and delays are measured in
+seconds, and may be ints or floats. The accuracy and precision of the
+clock are up to the implementation; the default implementation uses
+``time.monotonic()``. Books could be written about the implications
+of this choice. Better read the docs for the stdandard library
+``time`` module.
+
Required Event Loop Methods
---------------------------
@@ -1033,7 +1035,9 @@
The optional second argument is the destination address. If
omitted, ``remote_addr`` must have been specified in the
``create_datagram_endpoint()`` call that created this transport. If
- present, and ``remote_addr`` was specified, they must match.
+ present, and ``remote_addr`` was specified, they must match. The
+ (data, addr) pair may be sent immediately or buffered. The return
+ value is None.
- ``abort()``. Immediately close the transport. Buffered data will
be discarded.
@@ -1056,20 +1060,26 @@
Protocols
---------
-XXX This is about where I left off.
-
-TBD Describe different kinds of protocols (bidrectional stream,
-unidirectional stream, datagram).
-
Protocols are always used in conjunction with transports. While a few
common protocols are provided (e.g. decent though not necessarily
excellent HTTP client and server implementations), most protocols will
be implemented by user code or third-party libraries.
-A protocol must implement the following methods, which will be called
-by the transport. Consider these callbacks that are always called by
-the event loop in the right context. (See the "Context" section
-above.)
+
+Like for transports, we distinguish between stream protocols, datagram
+protocols, and perhaps other custom protocols. The most common type
+of protocol is a bidirectional stream protocol. (There are no
+unidirectional protocols.)
+
+(TBD: should protocol callbacks be allowed to be coroutines?)
+
+Stream Protocols
+''''''''''''''''
+
+A (bidirectional) stream protocol must implement the following
+methods, which will be called by the transport. Think of these as
+callbacks that are always called by the event loop in the right
+context. (See the "Context" section way above.)
- ``connection_made(transport)``. Indicates that the transport is
ready and connected to the entity at the other end. The protocol
@@ -1108,6 +1118,36 @@
TBD: Discuss whether user code needs to do anything to make sure that
protocol and transport aren't garbage-collected prematurely.
+Datagram Protocols
+''''''''''''''''''
+
+Datagram protocols have ``connection_made()`` and
+``connection_lost()`` methods with the same signatures as stream
+protocols. (As explained in the section about datagram transports, we
+prefer the slightly odd nomenclature over defining different method
+names to indicating the opening and closing of the socket.)
+
+In addition, they have the following methods:
+
+- ``datagram_received(data, addr)``. Indicates that a datagram
+ ``data`` (a bytes objects) was received from remote address ``addr``
+ (an IPv4 2-tuple or an IPv6 4-tuple).
+
+- ``connection_refused(exc)``. Indicates that a send or receive
+ operation raised a ``ConnectionRefused`` exception. This typically
+ indicates that a negative acknowledgment was received for a
+ previously sent datagram (not for the datagram that was being sent,
+ if the exception was raised by a send operation). Immediately after
+ this the socket will be closed and ``connection_lost()`` will be
+ called with the same exception argument.
+
+Here is a chart indicating the order and multiplicity of calls:
+
+ 1. ``connection_made()`` -- exactly once
+ 2. ``datagram_received()`` -- zero or more times
+ 3. ``connection_refused()`` -- at most once
+ 4. ``connection_lost()`` -- exactly once
+
Callback Style
--------------
@@ -1128,13 +1168,6 @@
loop.call_soon(functools.partial(foo, "abc", repeat=42))
-Choosing an Event Loop Implementation
--------------------------------------
-
-TBD. (This is about the choice to use e.g. select vs. poll vs. epoll,
-and how to override the choice. Probably belongs in the event loop
-policy.)
-
Coroutines and the Scheduler
============================
@@ -1159,25 +1192,27 @@
different (though related) concepts:
- The function that defines a coroutine (a function definition
- decorated with ``tulip.coroutine``). If disambiguation is needed,
- we call this a *coroutine function*.
+ decorated with ``tulip.coroutine``). If disambiguation is needed
+ we will call this a *coroutine function*.
- The object obtained by calling a coroutine function. This object
represents a computation or an I/O operation (usually a combination)
- that will complete eventually. For disambiguation we call it a
- *coroutine object*.
+ that will complete eventually. If disambiguation is needed we will
+ call it a *coroutine object*.
Things a coroutine can do:
- ``result = yield from future`` -- suspends the coroutine until the
- future is done, then returns the future's result, or raises its
- exception, which will be propagated.
+ future is done, then returns the future's result, or raises an
+ exception, which will be propagated. (If the future is cancelled,
+ it will raise a ``CancelledError`` exception.) Note that tasks are
+ futures, and everything said about futures also applies to tasks.
- ``result = yield from coroutine`` -- wait for another coroutine to
produce a result (or raise an exception, which will be propagated).
The ``coroutine`` expression must be a *call* to another coroutine.
-- ``return result`` -- produce a result to the coroutine that is
+- ``return expression`` -- produce a result to the coroutine that is
waiting for this one using ``yield from``.
- ``raise exception`` -- raise an exception in the coroutine that is
@@ -1191,7 +1226,7 @@
(assuming the other coroutine is already running!), or convert it to a
Task (see below).
-Coroutines can only run when the event loop is running.
+Coroutines (and tasks) can only run when the event loop is running.
Waiting for Multiple Coroutines
-------------------------------
@@ -1207,13 +1242,14 @@
tuple of two sets of Futures, ``(done, pending)``, where ``done`` is
the set of original Futures (or wrapped coroutines) that are done
(or cancelled), and ``pending`` is the rest, i.e. those that are
- still not done (nor cancelled). Optional arguments ``timeout`` and
- ``return_when`` have the same meaning and defaults as for
- ``concurrent.futures.wait()``: ``timeout``, if not ``None``,
- specifies a timeout for the overall operation; ``return_when``,
- specifies when to stop. The constants ``FIRST_COMPLETED``,
- ``FIRST_EXCEPTION``, ``ALL_COMPLETED`` are defined with the same
- values and the same meanings as in PEP 3148:
+ still not done (nor cancelled). Note that with the defaults for
+ ``timeout`` and ``return_when``, ``done`` will always be an empty
+ list. Optional arguments ``timeout`` and ``return_when`` have the
+ same meaning and defaults as for ``concurrent.futures.wait()``:
+ ``timeout``, if not ``None``, specifies a timeout for the overall
+ operation; ``return_when``, specifies when to stop. The constants
+ ``FIRST_COMPLETED``, ``FIRST_EXCEPTION``, ``ALL_COMPLETED`` are
+ defined with the same values and the same meanings as in PEP 3148:
- ``ALL_COMPLETED`` (default): Wait until all Futures are done or
completed (or until the timeout occurs).
@@ -1239,30 +1275,49 @@
result = yield from f # May raise an exception.
# Use result.
+ Note: if you do not wait for the futures as they are produced by the
+ iterator, your ``for`` loop may not make progress (since you are not
+ allowing other tasks to run).
+
+Sleeping
+--------
+
+The coroutine ``sleep(delay)`` returns after a given time delay.
+
+(TBD: Should the optional second argument, ``result``, be part of the
+spec?)
+
Tasks
-----
A Task is an object that manages an independently running coroutine.
-The Task interface is the same as the Future interface. The task
-becomes done when its coroutine returns or raises an exception; if it
-returns a result, that becomes the task's result, if it raises an
-exception, that becomes the task's exception.
+The Task interface is the same as the Future interface, and in fact
+``Task`` is a subclass of ``Future``. The task becomes done when its
+coroutine returns or raises an exception; if it returns a result, that
+becomes the task's result, if it raises an exception, that becomes the
+task's exception.
Cancelling a task that's not done yet prevents its coroutine from
-completing; in this case an exception is thrown into the coroutine
-that it may catch to further handle cancellation, but it doesn't have
-to (this is done using the standard ``close()`` method on generators,
-described in PEP 342).
+completing. In this case a ``CancelledError`` exception is thrown
+into the coroutine that it may catch to further handle cancellation.
+If the exception is not caught, the generator will be properly
+finalized anyway, as described in PEP 342.
Tasks are also useful for interoperating between coroutines and
callback-based frameworks like Twisted. After converting a coroutine
into a Task, callbacks can be added to the Task.
-You may ask, why not convert all coroutines to Tasks? The
-``(a)tulip.coroutine`` decorator could do this. This would slow things
-down considerably in the case where one coroutine calls another (and
-so on), as switching to a "bare" coroutine has much less overhead than
-switching to a Task.
+There are two ways to convert a coroutine into a task: explicitly, by
+calling the coroutine function and then passing the resulting
+coroutine object to the ``tulip.Task()`` constructor; or implicitly,
+by decorating the coroutine with ``(a)tulip.task`` (instead of
+``(a)tulip.coroutine``).
+
+You may ask, why not automatically convert all coroutines to Tasks?
+The ``(a)tulip.coroutine`` decorator could do this. However, this would
+slow things down considerably in the case where one coroutine calls
+another (and so on), as switching to a "bare" coroutine has much less
+overhead than switching to a Task.
The Scheduler
-------------
@@ -1274,38 +1329,21 @@
public interface of the event loop, so it will work with third-party
event loop implementations, too.
-Sleeping
---------
-
-TBD: ``yield sleep(seconds)``. Can use ``sleep(0)`` to suspend to
-poll for I/O.
-
Coroutines and Protocols
------------------------
-The best way to use coroutines to implement protocols is probably to
-use a streaming buffer that gets filled by ``data_received()`` and can
-be read asynchronously using methods like ``read(n)`` and
-``readline()`` that return a Future. When the connection is closed,
-``read()`` should return a Future whose result is ``b''``, or raise an
-exception if ``connection_closed()`` is called with an exception.
+The best way to use coroutines to implement an Internet protocol such
+as FTP is probably to use a streaming buffer that gets filled by
+``data_received()`` and can be read asynchronously using methods like
+``read(n)`` and ``readline()`` that are coroutines or return a Future.
+When the connection is closed, ``read()`` should eventually produce
+``b''``, or raise an exception if ``connection_closed()`` is called
+with an exception.
-To write, the ``write()`` method (and friends) on the transport can be
-used -- these do not return Futures. A standard protocol
-implementation should be provided that sets this up and kicks off the
-coroutine when ``connection_made()`` is called.
-
-TBD: Be more specific.
-
-Cancellation
-------------
-
-TBD. When a Task is cancelled its coroutine may see an exception at
-any point where it is yielding to the scheduler (i.e., potentially at
-any ``yield from`` operation). We need to spell out which exception
-is raised.
-
-Also TBD: timeouts.
+To write a response, the ``write()`` method (and friends) on the
+transport can be used -- these do not return Futures. A standard
+protocol implementation should be provided that sets this up and kicks
+off the coroutine when ``connection_made()`` is called.
Open Issues
@@ -1336,7 +1374,7 @@
these would all require using Tulip internals.
- Locks and queues? The Tulip implementation contains implementations
- of most types of locks and queues modeled after the stdlib
+ of most types of locks and queues modeled after the standard library
``threading`` and ``queue`` modules. Should we incorporate these in
the PEP?
--
Repository URL: http://hg.python.org/peps
1
0
results for 84cef4f1999a on branch "default"
--------------------------------------------
Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/antoine/cpython/refleaks/refloggeZEsp', '-x']
1
0