Commit 029273fc authored by Gregory P. Smith's avatar Gregory P. Smith

Fixes issue #17192: Update the ctypes module's libffi to v3.0.13. This

specifically addresses a stack misalignment issue on x86 and issues on
some more recent platforms.
parent a846f5ac
...@@ -940,6 +940,10 @@ Library ...@@ -940,6 +940,10 @@ Library
Extension Modules Extension Modules
----------------- -----------------
- Issue #17192: Update the ctypes module's libffi to v3.0.13. This
specifically addresses a stack misalignment issue on x86 and issues on
some more recent platforms.
- Issue #12268: The io module file object write methods no longer abort early - Issue #12268: The io module file object write methods no longer abort early
when one of its write system calls is interrupted (EINTR). when one of its write system calls is interrupted (EINTR).
......
diff -urN libffi.orig/configure libffi/configure diff -r -N -u libffi.orig/autom4te.cache/output.0 libffi/autom4te.cache/output.0
--- libffi.orig/configure 2010-03-19 18:29:54.588499862 +0100 diff -r -N -u libffi.orig/configure libffi/configure
+++ libffi/configure 2010-03-19 18:32:09.113499479 +0100 --- libffi.orig/configure 2013-03-17 15:37:50.000000000 -0700
@@ -11228,6 +11228,9 @@ +++ libffi/configure 2013-03-18 15:11:39.611575163 -0700
i?86-*-solaris2.1[0-9]*) @@ -13368,6 +13368,10 @@
TARGET=X86_64; TARGETDIR=x86 fi
;; ;;
+ i*86-*-nto-qnx*) + i*86-*-nto-qnx*)
+ TARGET=X86; TARGETDIR=x86 + TARGET=X86; TARGETDIR=x86
+ ;; + ;;
i?86-*-*) +
TARGET=X86; TARGETDIR=x86 x86_64-*-darwin*)
TARGET=X86_DARWIN; TARGETDIR=x86
;; ;;
@@ -11245,12 +11248,12 @@ @@ -13426,12 +13430,12 @@
;; ;;
mips-sgi-irix5.* | mips-sgi-irix6.*) mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
- TARGET=MIPS; TARGETDIR=mips - TARGET=MIPS; TARGETDIR=mips
+ TARGET=MIPS_IRIX; TARGETDIR=mips + TARGET=MIPS_IRIX; TARGETDIR=mips
;; ;;
mips*-*-linux*) mips*-*-linux* | mips*-*-openbsd*)
# Support 128-bit long double for NewABI. # Support 128-bit long double for NewABI.
HAVE_LONG_DOUBLE='defined(__mips64)' HAVE_LONG_DOUBLE='defined(__mips64)'
- TARGET=MIPS; TARGETDIR=mips - TARGET=MIPS; TARGETDIR=mips
...@@ -26,8 +28,8 @@ diff -urN libffi.orig/configure libffi/configure ...@@ -26,8 +28,8 @@ diff -urN libffi.orig/configure libffi/configure
;; ;;
powerpc*-*-linux* | powerpc-*-sysv*) powerpc*-*-linux* | powerpc-*-sysv*)
@@ -11307,7 +11310,7 @@ @@ -13491,7 +13495,7 @@
as_fn_error "\"libffi has not been ported to $host.\"" "$LINENO" 5 as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
fi fi
- if test x$TARGET = xMIPS; then - if test x$TARGET = xMIPS; then
...@@ -35,7 +37,7 @@ diff -urN libffi.orig/configure libffi/configure ...@@ -35,7 +37,7 @@ diff -urN libffi.orig/configure libffi/configure
MIPS_TRUE= MIPS_TRUE=
MIPS_FALSE='#' MIPS_FALSE='#'
else else
@@ -12422,6 +12425,12 @@ @@ -14862,6 +14866,12 @@
ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc" ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
...@@ -48,44 +50,45 @@ diff -urN libffi.orig/configure libffi/configure ...@@ -48,44 +50,45 @@ diff -urN libffi.orig/configure libffi/configure
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure # tests run on this system so they can be shared between configure
@@ -13521,6 +13530,8 @@ @@ -16047,6 +16057,8 @@
"testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
"libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;; "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
+ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;; + "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
+ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;; + "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac esac
diff -urN libffi.orig/configure.ac libffi/configure.ac diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
--- libffi.orig/configure.ac 2010-03-19 18:27:44.988498585 +0100 --- libffi.orig/configure.ac 2013-03-17 15:37:50.000000000 -0700
+++ libffi/configure.ac 2010-03-19 18:31:29.252505178 +0100 +++ libffi/configure.ac 2013-03-18 15:11:11.392989136 -0700
@@ -1,4 +1,7 @@ @@ -1,4 +1,7 @@
dnl Process this with autoconf to create configure dnl Process this with autoconf to create configure
+# +#
+# file from libffi - slightly patched for ctypes +# file from libffi - slightly patched for Python's ctypes
+# +#
AC_PREREQ(2.63) AC_PREREQ(2.68)
@@ -91,6 +94,9 @@ @@ -146,6 +149,10 @@
i?86-*-solaris2.1[[0-9]]*) fi
TARGET=X86_64; TARGETDIR=x86
;; ;;
+ i*86-*-nto-qnx*) + i*86-*-nto-qnx*)
+ TARGET=X86; TARGETDIR=x86 + TARGET=X86; TARGETDIR=x86
+ ;; + ;;
i?86-*-*) +
TARGET=X86; TARGETDIR=x86 x86_64-*-darwin*)
TARGET=X86_DARWIN; TARGETDIR=x86
;; ;;
@@ -108,12 +114,12 @@ @@ -204,12 +211,12 @@
;; ;;
mips-sgi-irix5.* | mips-sgi-irix6.*) mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
- TARGET=MIPS; TARGETDIR=mips - TARGET=MIPS; TARGETDIR=mips
+ TARGET=MIPS_IRIX; TARGETDIR=mips + TARGET=MIPS_IRIX; TARGETDIR=mips
;; ;;
mips*-*-linux*) mips*-*-linux* | mips*-*-openbsd*)
# Support 128-bit long double for NewABI. # Support 128-bit long double for NewABI.
HAVE_LONG_DOUBLE='defined(__mips64)' HAVE_LONG_DOUBLE='defined(__mips64)'
- TARGET=MIPS; TARGETDIR=mips - TARGET=MIPS; TARGETDIR=mips
...@@ -93,16 +96,16 @@ diff -urN libffi.orig/configure.ac libffi/configure.ac ...@@ -93,16 +96,16 @@ diff -urN libffi.orig/configure.ac libffi/configure.ac
;; ;;
powerpc*-*-linux* | powerpc-*-sysv*) powerpc*-*-linux* | powerpc-*-sysv*)
@@ -170,7 +176,7 @@ @@ -269,7 +276,7 @@
AC_MSG_ERROR(["libffi has not been ported to $host."]) AC_MSG_ERROR(["libffi has not been ported to $host."])
fi fi
-AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS) -AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
+AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null]) +AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
AM_CONDITIONAL(X86, test x$TARGET = xX86) AM_CONDITIONAL(X86, test x$TARGET = xX86)
AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD) @@ -567,4 +574,8 @@
@@ -401,4 +407,8 @@
AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
......
.libs
.deps
*.o
*.lo
.dirstamp
*.la
Makefile
config.log
config.status
*~
fficonfig.h
include/ffi.h
include/ffitarget.h
libffi.pc
libtool
stamp-h1
libffi*gz
autom4te.cache
libffi.xcodeproj/xcuserdata
libffi.xcodeproj/project.xcworkspace
ios/
language: c
compiler:
- gcc
- clang
before_script: sudo apt-get install dejagnu
script: ./configure && make && make check
This diff is collapsed.
2010-01-15 Anthony Green <green@redhat.com> 2011-02-08 Andreas Tobler <andreast@fgznet.ch>
* README: Add notes on building with Microsoft Visual C++. * testsuite/lib/libffi.exp: Tweak for stand-alone mode.
2010-01-15 Daniel Witte <dwitte@mozilla.com>
* msvcc.sh: New file.
* src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
* src/x86/ffi.c: Tweak function declaration and remove excess
parens.
* include/ffi.h.in: Add __declspec(align(8)) to typedef struct
ffi_closure.
* src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
function ffi_call_win32 on X86_WIN32.
* src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
(ffi_call_STDCALL): Remove.
* src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
to ffi_prep_cif_machdep for x86.
* src/x86/ffi.c (ffi_prep_cif_machdep): To here.
2010-01-15 Oliver Kiddle <okiddle@yahoo.co.uk>
* src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
Sun Studio compiler compatibility.
2010-01-12 Conrad Irwin <conrad.irwin@gmail.com>
* doc/libffi.texi: Add closure example.
* doc/libffi.info: Rebuilt.
2009-12-25 Samuli Suominen <ssuominen@gentoo.org> 2009-12-25 Samuli Suominen <ssuominen@gentoo.org>
...@@ -603,8 +574,8 @@ ...@@ -603,8 +574,8 @@
* Makefile.am, include/Makefile.am: Move headers to * Makefile.am, include/Makefile.am: Move headers to
libffi_la_SOURCES for new automake. libffi_la_SOURCES for new automake.
* Makefile.in, include/Makefile.in: Rebuilt. * Makefile.in, include/Makefile.in: Rebuilt.
* testsuite/lib/wrapper.exp: Copied from gcc tree to allow for * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for
execution outside of gcc tree. execution outside of gcc tree.
* testsuite/lib/target-libpath.exp: Ditto. * testsuite/lib/target-libpath.exp: Ditto.
......
libffi - Copyright (c) 1996-2009 Anthony Green, Red Hat, Inc and others. libffi - Copyright (c) 1996-2012 Anthony Green, Red Hat, Inc and others.
See source files for details. See source files for details.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
...@@ -9,8 +9,8 @@ distribute, sublicense, and/or sell copies of the Software, and to ...@@ -9,8 +9,8 @@ distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to permit persons to whom the Software is furnished to do so, subject to
the following conditions: the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be
in all copies or substantial portions of the Software. included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
......
...@@ -2,37 +2,50 @@ ...@@ -2,37 +2,50 @@
AUTOMAKE_OPTIONS = foreign subdir-objects AUTOMAKE_OPTIONS = foreign subdir-objects
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include testsuite man SUBDIRS = include testsuite man
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \
src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \ build-ios.sh src/alpha/ffi.c src/alpha/osf.S \
src/avr32/ffi.c src/avr32/sysv.S src/avr32/ffitarget.h \ src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \ src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \
src/ia64/ffi.c src/ia64/ffitarget.h src/ia64/ia64_flags.h \ src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \
src/ia64/unix.S \ src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \
src/mips/ffi.c src/mips/n32.S src/mips/o32.S \ src/ia64/ia64_flags.h src/ia64/unix.S src/mips/ffi.c \
src/mips/ffitarget.h \ src/mips/n32.S src/mips/o32.S src/metag/ffi.c \
src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \ src/metag/ffitarget.h src/metag/sysv.S src/moxie/ffi.c \
src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h \
src/powerpc/ffi.c src/powerpc/sysv.S \ src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \
src/powerpc/linux64.S src/powerpc/linux64_closure.S \ src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
src/powerpc/ppc_closure.S src/powerpc/asm.h \ src/microblaze/ffi.c src/microblaze/sysv.S \
src/powerpc/aix.S src/powerpc/darwin.S \ src/microblaze/ffitarget.h src/powerpc/ffi.c \
src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \ src/powerpc/sysv.S src/powerpc/linux64.S \
src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \ src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \ src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \
src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \ src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
src/sparc/ffi.c src/x86/darwin64.S \ src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h src/sh64/ffi.c \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/win64.S \ src/sh64/sysv.S src/sh64/ffitarget.h src/sparc/v8.S \
src/x86/darwin.S src/x86/freebsd.S \ src/sparc/v9.S src/sparc/ffitarget.h src/sparc/ffi.c \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \ src/x86/darwin64.S src/x86/ffi.c src/x86/sysv.S \
src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ src/x86/win32.S src/x86/darwin.S src/x86/win64.S \
src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \ src/x86/freebsd.S src/x86/ffi64.c src/x86/unix64.S \
libtool-version ChangeLog.libffi m4/libtool.m4 \ src/x86/ffitarget.h src/pa/ffitarget.h src/pa/ffi.c \
m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 src/pa/linux.S src/pa/hpux32.S src/frv/ffi.c src/bfin/ffi.c \
src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S \
src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c \
src/tile/ffitarget.h src/tile/tile.S libtool-version \
src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S \
ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4 \
m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh \
generate-ios-source-and-headers.py \
generate-osx-source-and-headers.py \
libffi.xcodeproj/project.pbxproj src/arm/trampoline.S \
libtool-ldflags
info_TEXINFOS = doc/libffi.texi info_TEXINFOS = doc/libffi.texi
...@@ -69,6 +82,7 @@ AM_MAKEFLAGS = \ ...@@ -69,6 +82,7 @@ AM_MAKEFLAGS = \
"exec_prefix=$(exec_prefix)" \ "exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \ "infodir=$(infodir)" \
"libdir=$(libdir)" \ "libdir=$(libdir)" \
"mandir=$(mandir)" \
"prefix=$(prefix)" \ "prefix=$(prefix)" \
"AR=$(AR)" \ "AR=$(AR)" \
"AS=$(AS)" \ "AS=$(AS)" \
...@@ -79,14 +93,15 @@ AM_MAKEFLAGS = \ ...@@ -79,14 +93,15 @@ AM_MAKEFLAGS = \
"RANLIB=$(RANLIB)" \ "RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)" "DESTDIR=$(DESTDIR)"
MAKEOVERRIDES= # Subdir rules rely on $(FLAGS_TO_PASS)
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
ACLOCAL_AMFLAGS=$(ACLOCAL_AMFLAGS) -I m4 MAKEOVERRIDES=
lib_LTLIBRARIES = libffi.la toolexeclib_LTLIBRARIES = libffi.la
noinst_LTLIBRARIES = libffi_convenience.la noinst_LTLIBRARIES = libffi_convenience.la
libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c \ libffi_la_SOURCES = src/prep_cif.c src/types.c \
src/raw_api.c src/java_raw_api.c src/closures.c src/raw_api.c src/java_raw_api.c src/closures.c
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
...@@ -94,9 +109,16 @@ pkgconfig_DATA = libffi.pc ...@@ -94,9 +109,16 @@ pkgconfig_DATA = libffi.pc
nodist_libffi_la_SOURCES = nodist_libffi_la_SOURCES =
if FFI_DEBUG
nodist_libffi_la_SOURCES += src/debug.c
endif
if MIPS if MIPS
nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S
endif endif
if BFIN
nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
endif
if X86 if X86
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
endif endif
...@@ -127,6 +149,12 @@ endif ...@@ -127,6 +149,12 @@ endif
if M68K if M68K
nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
endif endif
if MOXIE
nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
endif
if MICROBLAZE
nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
endif
if POWERPC if POWERPC
nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
endif endif
...@@ -139,8 +167,14 @@ endif ...@@ -139,8 +167,14 @@ endif
if POWERPC_FREEBSD if POWERPC_FREEBSD
nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
endif endif
if AARCH64
nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c
endif
if ARM if ARM
nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
if FFI_EXEC_TRAMPOLINE_TABLE
nodist_libffi_la_SOURCES += src/arm/trampoline.S
endif
endif endif
if AVR32 if AVR32
nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
...@@ -169,18 +203,23 @@ endif ...@@ -169,18 +203,23 @@ endif
if PA_HPUX if PA_HPUX
nodist_libffi_la_SOURCES += src/pa/hpux32.S src/pa/ffi.c nodist_libffi_la_SOURCES += src/pa/hpux32.S src/pa/ffi.c
endif endif
if TILE
nodist_libffi_la_SOURCES += src/tile/tile.S src/tile/ffi.c
endif
if XTENSA
nodist_libffi_la_SOURCES += src/xtensa/sysv.S src/xtensa/ffi.c
endif
if METAG
nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
endif
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
AM_CFLAGS = -Wall -g -fexceptions LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS) libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
AM_CCASFLAGS = $(AM_CPPFLAGS) AM_CCASFLAGS = $(AM_CPPFLAGS)
# No install-html or install-pdf support in automake yet
.PHONY: install-html install-pdf
install-html:
install-pdf:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/sh
PLATFORM_IOS=/Developer/Platforms/iPhoneOS.platform/
PLATFORM_IOS_SIM=/Developer/Platforms/iPhoneSimulator.platform/
SDK_IOS_VERSION="4.2"
MIN_IOS_VERSION="3.0"
OUTPUT_DIR="universal-ios"
build_target () {
local platform=$1
local sdk=$2
local arch=$3
local triple=$4
local builddir=$5
mkdir -p "${builddir}"
pushd "${builddir}"
export CC="${platform}"/Developer/usr/bin/gcc-4.2
export CFLAGS="-arch ${arch} -isysroot ${sdk} -miphoneos-version-min=${MIN_IOS_VERSION}"
../configure --host=${triple} && make
popd
}
# Build all targets
build_target "${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv6 arm-apple-darwin10 armv6-ios
build_target "${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv7 arm-apple-darwin10 armv7-ios
build_target "${PLATFORM_IOS_SIM}" "${PLATFORM_IOS_SIM}/Developer/SDKs/iPhoneSimulator${SDK_IOS_VERSION}.sdk/" i386 i386-apple-darwin10 i386-ios-sim
# Create universal output directories
mkdir -p "${OUTPUT_DIR}"
mkdir -p "${OUTPUT_DIR}/include"
mkdir -p "${OUTPUT_DIR}/include/armv6"
mkdir -p "${OUTPUT_DIR}/include/armv7"
mkdir -p "${OUTPUT_DIR}/include/i386"
# Create the universal binary
lipo -create armv6-ios/.libs/libffi.a armv7-ios/.libs/libffi.a i386-ios-sim/.libs/libffi.a -output "${OUTPUT_DIR}/libffi.a"
# Copy in the headers
copy_headers () {
local src=$1
local dest=$2
# Fix non-relative header reference
sed 's/<ffitarget.h>/"ffitarget.h"/' < "${src}/include/ffi.h" > "${dest}/ffi.h"
cp "${src}/include/ffitarget.h" "${dest}"
}
copy_headers armv6-ios "${OUTPUT_DIR}/include/armv6"
copy_headers armv7-ios "${OUTPUT_DIR}/include/armv7"
copy_headers i386-ios-sim "${OUTPUT_DIR}/include/i386"
# Create top-level header
(
cat << EOF
#ifdef __arm__
#include <arm/arch.h>
#ifdef _ARM_ARCH_6
#include "include/armv6/ffi.h"
#elif _ARM_ARCH_7
#include "include/armv7/ffi.h"
#endif
#elif defined(__i386__)
#include "include/i386/ffi.h"
#endif
EOF
) > "${OUTPUT_DIR}/ffi.h"
#! /bin/sh #! /bin/sh
# Wrapper for compilers which do not understand `-c -o'. # Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22 scriptversion=2009-10-06.20; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
# Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>. # Written by Tom Tromey <tromey@cygnus.com>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -17,8 +18,7 @@ scriptversion=2005-05-14.22 ...@@ -17,8 +18,7 @@ scriptversion=2005-05-14.22
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; then ...@@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; then
fi fi
# Name of file we expect compiler to create. # Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory. # Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name # Note: use `[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected # that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build. # object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then if mkdir "$lockdir" >/dev/null 2>&1; then
break break
...@@ -124,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15 ...@@ -124,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15
ret=$? ret=$?
if test -f "$cofile"; then if test -f "$cofile"; then
mv "$cofile" "$ofile" test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile" test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi fi
rmdir "$lockdir" rmdir "$lockdir"
...@@ -138,5 +138,6 @@ exit $ret ...@@ -138,5 +138,6 @@ exit $ret
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$" # time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End: # End:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
This manual is for Libffi, a portable foreign-function interface This manual is for Libffi, a portable foreign-function interface
library. library.
Copyright @copyright{} 2008, 2010 Red Hat, Inc. Copyright @copyright{} 2008, 2010, 2011 Red Hat, Inc.
@quotation @quotation
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
...@@ -133,8 +133,6 @@ This initializes @var{cif} according to the given parameters. ...@@ -133,8 +133,6 @@ This initializes @var{cif} according to the given parameters.
you want. @ref{Multiple ABIs} for more information. you want. @ref{Multiple ABIs} for more information.
@var{nargs} is the number of arguments that this function accepts. @var{nargs} is the number of arguments that this function accepts.
@samp{libffi} does not yet handle varargs functions; see @ref{Missing
Features} for more information.
@var{rtype} is a pointer to an @code{ffi_type} structure that @var{rtype} is a pointer to an @code{ffi_type} structure that
describes the return type of the function. @xref{Types}. describes the return type of the function. @xref{Types}.
...@@ -150,6 +148,30 @@ objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter ...@@ -150,6 +148,30 @@ objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter
is invalid. is invalid.
@end defun @end defun
If the function being called is variadic (varargs) then
@code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}.
@findex ffi_prep_cif_var
@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi var{abi}, unsigned int @var{nfixedargs}, unsigned int var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
This initializes @var{cif} according to the given parameters for
a call to a variadic function. In general it's operation is the
same as for @code{ffi_prep_cif} except that:
@var{nfixedargs} is the number of fixed arguments, prior to any
variadic arguments. It must be greater than zero.
@var{ntotalargs} the total number of arguments, including variadic
and fixed arguments.
Note that, different cif's must be prepped for calls to the same
function when different numbers of arguments are passed.
Also note that a call to @code{ffi_prep_cif_var} with
@var{nfixedargs}=@var{nototalargs} is NOT equivalent to a call to
@code{ffi_prep_cif}.
@end defun
To call a function using an initialized @code{ffi_cif}, use the To call a function using an initialized @code{ffi_cif}, use the
@code{ffi_call} function: @code{ffi_call} function:
...@@ -171,7 +193,9 @@ discarded. ...@@ -171,7 +193,9 @@ discarded.
@var{avalues} is a vector of @code{void *} pointers that point to the @var{avalues} is a vector of @code{void *} pointers that point to the
memory locations holding the argument values for a call. If @var{cif} memory locations holding the argument values for a call. If @var{cif}
declares that the function has no arguments (i.e., @var{nargs} was 0), declares that the function has no arguments (i.e., @var{nargs} was 0),
then @var{avalues} is ignored. then @var{avalues} is ignored. Note that argument values may be
modified by the callee (for instance, structs passed by value); the
burden of copying pass-by-value arguments is placed on the caller.
@end defun @end defun
...@@ -336,7 +360,7 @@ You must first describe the structure to @samp{libffi} by creating a ...@@ -336,7 +360,7 @@ You must first describe the structure to @samp{libffi} by creating a
new @code{ffi_type} object for it. new @code{ffi_type} object for it.
@tindex ffi_type @tindex ffi_type
@deftp ffi_type @deftp {Data type} ffi_type
The @code{ffi_type} has the following members: The @code{ffi_type} has the following members:
@table @code @table @code
@item size_t size @item size_t size
...@@ -438,7 +462,7 @@ require special allocation on platforms that have a non-executable ...@@ -438,7 +462,7 @@ require special allocation on platforms that have a non-executable
heap. Memory management for closures is handled by a pair of heap. Memory management for closures is handled by a pair of
functions: functions:
@findex ffi_closure_alloca @findex ffi_closure_alloc
@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code}) @defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code})
Allocate a chunk of memory holding @var{size} bytes. This returns a Allocate a chunk of memory holding @var{size} bytes. This returns a
pointer to the writable address, and sets *@var{code} to the pointer to the writable address, and sets *@var{code} to the
...@@ -570,9 +594,7 @@ support for these. ...@@ -570,9 +594,7 @@ support for these.
@itemize @bullet @itemize @bullet
@item @item
There is no support for calling varargs functions. This may work on Variadic closures.
some platforms, depending on how the ABI is defined, but it is not
reliable.
@item @item
There is no support for bit fields in structures. There is no support for bit fields in structures.
...@@ -589,6 +611,8 @@ The ``raw'' API is undocumented. ...@@ -589,6 +611,8 @@ The ``raw'' API is undocumented.
@c anything else? @c anything else?
@end itemize @end itemize
Note that variadic support is very new and tested on a relatively
small number of platforms.
@node Index @node Index
@unnumbered Index @unnumbered Index
......
@set UPDATED 14 February 2008 @set UPDATED 16 March 2013
@set UPDATED-MONTH February 2008 @set UPDATED-MONTH March 2013
@set EDITION 3.0.8 @set EDITION 3.0.13
@set VERSION 3.0.8 @set VERSION 3.0.13
@set UPDATED 14 February 2008 @set UPDATED 16 March 2013
@set UPDATED-MONTH February 2008 @set UPDATED-MONTH March 2013
@set EDITION 3.0.8 @set EDITION 3.0.13
@set VERSION 3.0.8 @set VERSION 3.0.13
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
/* Define this if you want extra debugging. */ /* Define this if you want extra debugging. */
#undef FFI_DEBUG #undef FFI_DEBUG
/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
#undef FFI_EXEC_TRAMPOLINE_TABLE
/* Define this if you want to enable pax emulated trampolines */
#undef FFI_MMAP_EXEC_EMUTRAMP_PAX
/* Cannot use malloc on this target, so, we revert to alternative means */ /* Cannot use malloc on this target, so, we revert to alternative means */
#undef FFI_MMAP_EXEC_WRIT #undef FFI_MMAP_EXEC_WRIT
...@@ -33,6 +39,9 @@ ...@@ -33,6 +39,9 @@
*/ */
#undef HAVE_ALLOCA_H #undef HAVE_ALLOCA_H
/* Define if your assembler supports .ascii. */
#undef HAVE_AS_ASCII_PSEUDO_OP
/* Define if your assembler supports .cfi_* directives. */ /* Define if your assembler supports .cfi_* directives. */
#undef HAVE_AS_CFI_PSEUDO_OP #undef HAVE_AS_CFI_PSEUDO_OP
...@@ -43,6 +52,12 @@ ...@@ -43,6 +52,12 @@
*/ */
#undef HAVE_AS_SPARC_UA_PCREL #undef HAVE_AS_SPARC_UA_PCREL
/* Define if your assembler supports .string. */
#undef HAVE_AS_STRING_PSEUDO_OP
/* Define if your assembler supports unwind section type. */
#undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
/* Define if your assembler supports PC relative relocs. */ /* Define if your assembler supports PC relative relocs. */
#undef HAVE_AS_X86_PCREL #undef HAVE_AS_X86_PCREL
...@@ -148,6 +163,9 @@ ...@@ -148,6 +163,9 @@
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
/* Define if symbols are underscored. */
#undef SYMBOL_UNDERSCORE
/* Define this if you are using Purify and want to suppress spurious messages. /* Define this if you are using Purify and want to suppress spurious messages.
*/ */
#undef USING_PURIFY #undef USING_PURIFY
...@@ -167,6 +185,9 @@ ...@@ -167,6 +185,9 @@
# endif # endif
#endif #endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
#ifdef LIBFFI_ASM #ifdef LIBFFI_ASM
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi_common.h - Copyright (c) 1996 Red Hat, Inc. ffi_common.h - Copyright (C) 2011, 2012 Anthony Green
Copyright (C) 2007 Free Software Foundation, Inc Copyright (C) 2007 Free Software Foundation, Inc
Copyright (c) 1996 Red Hat, Inc.
Common internal definitions and macros. Only necessary for building Common internal definitions and macros. Only necessary for building
libffi. libffi.
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
...@@ -74,6 +75,8 @@ void ffi_type_test(ffi_type *a, char *file, int line); ...@@ -74,6 +75,8 @@ void ffi_type_test(ffi_type *a, char *file, int line);
/* Perform machine dependent cif processing */ /* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif); ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
unsigned int nfixedargs, unsigned int ntotalargs);
/* Extended cif, used in callback from assembly routine */ /* Extended cif, used in callback from assembly routine */
typedef struct typedef struct
...@@ -84,7 +87,7 @@ typedef struct ...@@ -84,7 +87,7 @@ typedef struct
} extended_cif; } extended_cif;
/* Terse sized type definitions. */ /* Terse sized type definitions. */
#if defined(_MSC_VER) || defined(__sgi) #if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
typedef unsigned char UINT8; typedef unsigned char UINT8;
typedef signed char SINT8; typedef signed char SINT8;
typedef unsigned short UINT16; typedef unsigned short UINT16;
...@@ -112,11 +115,14 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); ...@@ -112,11 +115,14 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__)));
typedef float FLOAT32; typedef float FLOAT32;
#ifndef __GNUC__
#define __builtin_expect(x, expected_value) (x)
#endif
#define LIKELY(x) __builtin_expect(!!(x),1)
#define UNLIKELY(x) __builtin_expect((x)!=0,0)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
# release, then set age to 0. # release, then set age to 0.
# #
# CURRENT:REVISION:AGE # CURRENT:REVISION:AGE
5:10:0 6:1:0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment