Commit b7b857bb by Andrew Haley Committed by Andrew Haley

Import from libffi 3.0.8:

2009-06-08  Andrew Haley  <aph@redhat.com>

	Import from libffi 3.0.8:

	* doc/libffi.texi: New file.
	* doc/libffi.info: Likewise.
	* doc/stamp-vti: Likewise.
	* man/Makefile.am: New file.
	* man/ffi_call.3: New file.

	* Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S,
	src/dlmalloc.c.
	(nodist_libffi_la_SOURCES): Add X86_FREEBSD.

	* configure.ac: Bump version to 3.0.8.
	parisc*-*-linux*: Add.
	i386-*-freebsd* | i386-*-openbsd*: Add.
	powerpc-*-beos*: Add.
	AM_CONDITIONAL X86_FREEBSD: Add.
	AC_CONFIG_FILES: Add man/Makefile.

	* include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void).

From-SVN: r148309
parent 3dbbb7af
2009-06-08 Andrew Haley <aph@redhat.com> 2009-06-08 Andrew Haley <aph@redhat.com>
Import from libffi 3.0.8:
* doc/libffi.texi: New file.
* doc/libffi.info: Likewise.
* doc/stamp-vti: Likewise.
* man/Makefile.am: New file.
* man/ffi_call.3: New file.
* Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S,
src/dlmalloc.c.
(nodist_libffi_la_SOURCES): Add X86_FREEBSD.
* configure.ac: Bump version to 3.0.8.
parisc*-*-linux*: Add.
i386-*-freebsd* | i386-*-openbsd*: Add.
powerpc-*-beos*: Add.
AM_CONDITIONAL X86_FREEBSD: Add.
AC_CONFIG_FILES: Add man/Makefile.
* include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void).
2009-06-08 Andrew Haley <aph@redhat.com>
* README: Import from libffi 3.0.8. * README: Import from libffi 3.0.8.
2009-06-08 Andrew Haley <aph@redhat.com> 2009-06-08 Andrew Haley <aph@redhat.com>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
AUTOMAKE_OPTIONS = foreign subdir-objects AUTOMAKE_OPTIONS = foreign subdir-objects
ACLOCAL_AMFLAGS = -I .. -I ../config ACLOCAL_AMFLAGS = -I .. -I ../config
SUBDIRS = include testsuite 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/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
...@@ -25,11 +25,13 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ ...@@ -25,11 +25,13 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \ src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \
src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
src/sparc/ffi.c \ src/sparc/ffi.c src/x86/darwin64.S \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \ src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \
src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c
info_TEXINFOS = doc/libffi.texi
## ################################################################ ## ################################################################
...@@ -90,6 +92,9 @@ endif ...@@ -90,6 +92,9 @@ 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
if X86_FREEBSD
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S
endif
if X86_WIN32 if X86_WIN32
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
endif endif
......
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for libffi 2.1. # Generated by GNU Autoconf 2.59 for libffi 3.0.8.
# #
# Report bugs to <http://gcc.gnu.org/bugs.html>. # Report bugs to <http://gcc.gnu.org/bugs.html>.
# #
...@@ -418,8 +418,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} ...@@ -418,8 +418,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='libffi' PACKAGE_NAME='libffi'
PACKAGE_TARNAME='libffi' PACKAGE_TARNAME='libffi'
PACKAGE_VERSION='2.1' PACKAGE_VERSION='3.0.8'
PACKAGE_STRING='libffi 2.1' PACKAGE_STRING='libffi 3.0.8'
PACKAGE_BUGREPORT='http://gcc.gnu.org/bugs.html' PACKAGE_BUGREPORT='http://gcc.gnu.org/bugs.html'
# Factoring default headers for most tests. # Factoring default headers for most tests.
...@@ -459,7 +459,7 @@ ac_includes_default="\ ...@@ -459,7 +459,7 @@ ac_includes_default="\
# include <unistd.h> # include <unistd.h>
#endif" #endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS CCAS CCASFLAGS LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP CPPFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT TESTSUBDIR_TRUE TESTSUBDIR_FALSE AM_RUNTESTFLAGS MIPS_TRUE MIPS_FALSE SPARC_TRUE SPARC_FALSE X86_TRUE X86_FALSE X86_WIN32_TRUE X86_WIN32_FALSE X86_DARWIN_TRUE X86_DARWIN_FALSE ALPHA_TRUE ALPHA_FALSE IA64_TRUE IA64_FALSE M32R_TRUE M32R_FALSE M68K_TRUE M68K_FALSE POWERPC_TRUE POWERPC_FALSE POWERPC_AIX_TRUE POWERPC_AIX_FALSE POWERPC_DARWIN_TRUE POWERPC_DARWIN_FALSE POWERPC_FREEBSD_TRUE POWERPC_FREEBSD_FALSE ARM_TRUE ARM_FALSE LIBFFI_CRIS_TRUE LIBFFI_CRIS_FALSE FRV_TRUE FRV_FALSE S390_TRUE S390_FALSE X86_64_TRUE X86_64_FALSE SH_TRUE SH_FALSE SH64_TRUE SH64_FALSE PA_LINUX_TRUE PA_LINUX_FALSE PA_HPUX_TRUE PA_HPUX_FALSE PA64_HPUX_TRUE PA64_HPUX_FALSE ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS CCAS CCASFLAGS LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP CPPFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT TESTSUBDIR_TRUE TESTSUBDIR_FALSE AM_RUNTESTFLAGS MIPS_TRUE MIPS_FALSE SPARC_TRUE SPARC_FALSE X86_TRUE X86_FALSE X86_FREEBSD_TRUE X86_FREEBSD_FALSE X86_WIN32_TRUE X86_WIN32_FALSE X86_DARWIN_TRUE X86_DARWIN_FALSE ALPHA_TRUE ALPHA_FALSE IA64_TRUE IA64_FALSE M32R_TRUE M32R_FALSE M68K_TRUE M68K_FALSE POWERPC_TRUE POWERPC_FALSE POWERPC_AIX_TRUE POWERPC_AIX_FALSE POWERPC_DARWIN_TRUE POWERPC_DARWIN_FALSE POWERPC_FREEBSD_TRUE POWERPC_FREEBSD_FALSE ARM_TRUE ARM_FALSE LIBFFI_CRIS_TRUE LIBFFI_CRIS_FALSE FRV_TRUE FRV_FALSE S390_TRUE S390_FALSE X86_64_TRUE X86_64_FALSE SH_TRUE SH_FALSE SH64_TRUE SH64_FALSE PA_LINUX_TRUE PA_LINUX_FALSE PA_HPUX_TRUE PA_HPUX_FALSE PA64_HPUX_TRUE PA64_HPUX_FALSE ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS'
ac_subst_files='' ac_subst_files=''
ac_pwd=`pwd` ac_pwd=`pwd`
...@@ -925,7 +925,7 @@ if test "$ac_init_help" = "long"; then ...@@ -925,7 +925,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures libffi 2.1 to adapt to many kinds of systems. \`configure' configures libffi 3.0.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
...@@ -992,7 +992,7 @@ fi ...@@ -992,7 +992,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of libffi 2.1:";; short | recursive ) echo "Configuration of libffi 3.0.8:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
...@@ -1133,7 +1133,7 @@ fi ...@@ -1133,7 +1133,7 @@ fi
test -n "$ac_init_help" && exit 0 test -n "$ac_init_help" && exit 0
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
libffi configure 2.1 libffi configure 3.0.8
generated by GNU Autoconf 2.59 generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
...@@ -1147,7 +1147,7 @@ cat >&5 <<_ACEOF ...@@ -1147,7 +1147,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by libffi $as_me 2.1, which was It was created by libffi $as_me 3.0.8, which was
generated by GNU Autoconf 2.59. Invocation command line was generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@ $ $0 $@
...@@ -1945,7 +1945,7 @@ fi ...@@ -1945,7 +1945,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='libffi' PACKAGE='libffi'
VERSION='2.1' VERSION='3.0.8'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -11025,7 +11025,7 @@ case "$host" in ...@@ -11025,7 +11025,7 @@ case "$host" in
TARGET=FRV; TARGETDIR=frv TARGET=FRV; TARGETDIR=frv
;; ;;
hppa*-*-linux*) hppa*-*-linux* | parisc*-*-linux*)
TARGET=PA_LINUX; TARGETDIR=pa TARGET=PA_LINUX; TARGETDIR=pa
;; ;;
hppa*64-*-hpux*) hppa*64-*-hpux*)
...@@ -11035,6 +11035,9 @@ case "$host" in ...@@ -11035,6 +11035,9 @@ case "$host" in
TARGET=PA_HPUX; TARGETDIR=pa TARGET=PA_HPUX; TARGETDIR=pa
;; ;;
i386-*-freebsd* | i386-*-openbsd*)
TARGET=X86_FREEBSD; TARGETDIR=x86
;;
i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*) i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
TARGET=X86_WIN32; TARGETDIR=x86 TARGET=X86_WIN32; TARGETDIR=x86
;; ;;
...@@ -11067,7 +11070,10 @@ case "$host" in ...@@ -11067,7 +11070,10 @@ case "$host" in
TARGET=MIPS; TARGETDIR=mips TARGET=MIPS; TARGETDIR=mips
;; ;;
powerpc*-*-linux*) powerpc*-*-linux* | powerpc-*-sysv*)
TARGET=POWERPC; TARGETDIR=powerpc
;;
powerpc-*-beos*)
TARGET=POWERPC; TARGETDIR=powerpc TARGET=POWERPC; TARGETDIR=powerpc
;; ;;
powerpc-*-darwin*) powerpc-*-darwin*)
...@@ -11148,6 +11154,16 @@ fi ...@@ -11148,6 +11154,16 @@ fi
if test x$TARGET = xX86_FREEBSD; then
X86_FREEBSD_TRUE=
X86_FREEBSD_FALSE='#'
else
X86_FREEBSD_TRUE='#'
X86_FREEBSD_FALSE=
fi
if test x$TARGET = xX86_WIN32; then if test x$TARGET = xX86_WIN32; then
X86_WIN32_TRUE= X86_WIN32_TRUE=
X86_WIN32_FALSE='#' X86_WIN32_FALSE='#'
...@@ -13445,7 +13461,7 @@ fi ...@@ -13445,7 +13461,7 @@ fi
ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h"
ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile" ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
...@@ -13588,6 +13604,13 @@ echo "$as_me: error: conditional \"X86\" was never defined. ...@@ -13588,6 +13604,13 @@ echo "$as_me: error: conditional \"X86\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;} Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
if test -z "${X86_FREEBSD_TRUE}" && test -z "${X86_FREEBSD_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"X86_FREEBSD\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
echo "$as_me: error: conditional \"X86_FREEBSD\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${X86_WIN32_TRUE}" && test -z "${X86_WIN32_FALSE}"; then if test -z "${X86_WIN32_TRUE}" && test -z "${X86_WIN32_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"X86_WIN32\" was never defined. { { echo "$as_me:$LINENO: error: conditional \"X86_WIN32\" was never defined.
Usually this means the macro was only invoked conditionally." >&5 Usually this means the macro was only invoked conditionally." >&5
...@@ -13999,7 +14022,7 @@ _ASBOX ...@@ -13999,7 +14022,7 @@ _ASBOX
} >&5 } >&5
cat >&5 <<_CSEOF cat >&5 <<_CSEOF
This file was extended by libffi $as_me 2.1, which was This file was extended by libffi $as_me 3.0.8, which was
generated by GNU Autoconf 2.59. Invocation command line was generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
...@@ -14065,7 +14088,7 @@ _ACEOF ...@@ -14065,7 +14088,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\ ac_cs_version="\\
libffi config.status 2.1 libffi config.status 3.0.8
configured by $0, generated by GNU Autoconf 2.59, configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
...@@ -14175,9 +14198,6 @@ ac_configure_args="${multilib_arg} ${ac_configure_args}" ...@@ -14175,9 +14198,6 @@ ac_configure_args="${multilib_arg} ${ac_configure_args}"
multi_basedir="$multi_basedir" multi_basedir="$multi_basedir"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
CC="$CC" CC="$CC"
CXX="$CXX"
GFORTRAN="$GFORTRAN"
GCJ="$GCJ"
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
...@@ -14449,6 +14469,7 @@ do ...@@ -14449,6 +14469,7 @@ do
"include/ffi.h" ) CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;; "include/ffi.h" ) CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
"man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
"include/ffitarget.h" ) CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;; "include/ffitarget.h" ) CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;;
"default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
...@@ -14634,6 +14655,8 @@ s,@SPARC_TRUE@,$SPARC_TRUE,;t t ...@@ -14634,6 +14655,8 @@ s,@SPARC_TRUE@,$SPARC_TRUE,;t t
s,@SPARC_FALSE@,$SPARC_FALSE,;t t s,@SPARC_FALSE@,$SPARC_FALSE,;t t
s,@X86_TRUE@,$X86_TRUE,;t t s,@X86_TRUE@,$X86_TRUE,;t t
s,@X86_FALSE@,$X86_FALSE,;t t s,@X86_FALSE@,$X86_FALSE,;t t
s,@X86_FREEBSD_TRUE@,$X86_FREEBSD_TRUE,;t t
s,@X86_FREEBSD_FALSE@,$X86_FREEBSD_FALSE,;t t
s,@X86_WIN32_TRUE@,$X86_WIN32_TRUE,;t t s,@X86_WIN32_TRUE@,$X86_WIN32_TRUE,;t t
s,@X86_WIN32_FALSE@,$X86_WIN32_FALSE,;t t s,@X86_WIN32_FALSE@,$X86_WIN32_FALSE,;t t
s,@X86_DARWIN_TRUE@,$X86_DARWIN_TRUE,;t t s,@X86_DARWIN_TRUE@,$X86_DARWIN_TRUE,;t t
......
...@@ -2,7 +2,7 @@ dnl Process this with autoconf to create configure ...@@ -2,7 +2,7 @@ dnl Process this with autoconf to create configure
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_INIT([libffi], [2.1], [http://gcc.gnu.org/bugs.html]) AC_INIT([libffi], [3.0.8], [http://gcc.gnu.org/bugs.html])
AC_CONFIG_HEADERS([fficonfig.h]) AC_CONFIG_HEADERS([fficonfig.h])
AM_ENABLE_MULTILIB(, ..) AM_ENABLE_MULTILIB(, ..)
...@@ -63,7 +63,7 @@ case "$host" in ...@@ -63,7 +63,7 @@ case "$host" in
TARGET=FRV; TARGETDIR=frv TARGET=FRV; TARGETDIR=frv
;; ;;
hppa*-*-linux*) hppa*-*-linux* | parisc*-*-linux*)
TARGET=PA_LINUX; TARGETDIR=pa TARGET=PA_LINUX; TARGETDIR=pa
;; ;;
hppa*64-*-hpux*) hppa*64-*-hpux*)
...@@ -73,6 +73,9 @@ case "$host" in ...@@ -73,6 +73,9 @@ case "$host" in
TARGET=PA_HPUX; TARGETDIR=pa TARGET=PA_HPUX; TARGETDIR=pa
;; ;;
i386-*-freebsd* | i386-*-openbsd*)
TARGET=X86_FREEBSD; TARGETDIR=x86
;;
i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*) i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
TARGET=X86_WIN32; TARGETDIR=x86 TARGET=X86_WIN32; TARGETDIR=x86
;; ;;
...@@ -105,7 +108,10 @@ case "$host" in ...@@ -105,7 +108,10 @@ case "$host" in
TARGET=MIPS; TARGETDIR=mips TARGET=MIPS; TARGETDIR=mips
;; ;;
powerpc*-*-linux*) powerpc*-*-linux* | powerpc-*-sysv*)
TARGET=POWERPC; TARGETDIR=powerpc
;;
powerpc-*-beos*)
TARGET=POWERPC; TARGETDIR=powerpc TARGET=POWERPC; TARGETDIR=powerpc
;; ;;
powerpc-*-darwin*) powerpc-*-darwin*)
...@@ -155,6 +161,7 @@ fi ...@@ -155,6 +161,7 @@ fi
AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS) AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
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)
AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN) AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA) AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
...@@ -370,6 +377,6 @@ test -d src/$TARGETDIR || mkdir src/$TARGETDIR ...@@ -370,6 +377,6 @@ test -d src/$TARGETDIR || mkdir src/$TARGETDIR
AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile) AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile)
AC_OUTPUT AC_OUTPUT
@set UPDATED 14 February 2008
@set UPDATED-MONTH February 2008
@set EDITION 3.0.8
@set VERSION 3.0.8
@set UPDATED 14 February 2008
@set UPDATED-MONTH February 2008
@set EDITION 3.0.8
@set VERSION 3.0.8
...@@ -181,6 +181,8 @@ X86_64_TRUE = @X86_64_TRUE@ ...@@ -181,6 +181,8 @@ X86_64_TRUE = @X86_64_TRUE@
X86_DARWIN_FALSE = @X86_DARWIN_FALSE@ X86_DARWIN_FALSE = @X86_DARWIN_FALSE@
X86_DARWIN_TRUE = @X86_DARWIN_TRUE@ X86_DARWIN_TRUE = @X86_DARWIN_TRUE@
X86_FALSE = @X86_FALSE@ X86_FALSE = @X86_FALSE@
X86_FREEBSD_FALSE = @X86_FREEBSD_FALSE@
X86_FREEBSD_TRUE = @X86_FREEBSD_TRUE@
X86_TRUE = @X86_TRUE@ X86_TRUE = @X86_TRUE@
X86_WIN32_FALSE = @X86_WIN32_FALSE@ X86_WIN32_FALSE = @X86_WIN32_FALSE@
X86_WIN32_TRUE = @X86_WIN32_TRUE@ X86_WIN32_TRUE = @X86_WIN32_TRUE@
......
/* -----------------------------------------------------------------*-C-*- /* -----------------------------------------------------------------*-C-*-
libffi @VERSION@ - Copyright (c) 1996-2003, 2007 Red Hat, Inc. libffi @VERSION@ - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
...@@ -354,7 +354,7 @@ void ffi_call(ffi_cif *cif, ...@@ -354,7 +354,7 @@ void ffi_call(ffi_cif *cif,
void **avalue); void **avalue);
/* Useful for eliminating compiler warnings */ /* Useful for eliminating compiler warnings */
#define FFI_FN(f) ((void (*)())f) #define FFI_FN(f) ((void (*)(void))f)
/* ---- Definitions shared with assembly code ---------------------------- */ /* ---- Definitions shared with assembly code ---------------------------- */
......
## Process this with automake to create Makefile.in
AUTOMAKE_OPTIONS=foreign
EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3
man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3
.Dd February 15, 2008
.Dt FFI 3
.Sh NAME
.Nm FFI
.Nd Foreign Function Interface
.Sh LIBRARY
libffi, -lffi
.Sh SYNOPSIS
.In ffi.h
.Ft ffi_status
.Fo ffi_prep_cif
.Fa "ffi_cif *cif"
.Fa "ffi_abi abi"
.Fa "unsigned int nargs"
.Fa "ffi_type *rtype"
.Fa "ffi_type **atypes"
.Fc
.Ft void
.Fo ffi_call
.Fa "ffi_cif *cif"
.Fa "void (*fn)(void)"
.Fa "void *rvalue"
.Fa "void **avalue"
.Fc
.Sh DESCRIPTION
The foreign function interface provides a mechanism by which a function can
generate a call to another function at runtime without requiring knowledge of
the called function's interface at compile time.
.Sh SEE ALSO
.Xr ffi_prep_cif 3 ,
.Xr ffi_call 3
.Dd February 15, 2008
.Dt ffi_call 3
.Sh NAME
.Nm ffi_call
.Nd Invoke a foreign function.
.Sh SYNOPSIS
.In ffi.h
.Ft void
.Fo ffi_call
.Fa "ffi_cif *cif"
.Fa "void (*fn)(void)"
.Fa "void *rvalue"
.Fa "void **avalue"
.Fc
.Sh DESCRIPTION
The
.Nm ffi_call
function provides a simple mechanism for invoking a function without
requiring knowledge of the function's interface at compile time.
.Fa fn
is called with the values retrieved from the pointers in the
.Fa avalue
array. The return value from
.Fa fn
is placed in storage pointed to by
.Fa rvalue .
.Fa cif
contains information describing the data types, sizes and alignments of the
arguments to and return value from
.Fa fn ,
and must be initialized with
.Nm ffi_prep_cif
before it is used with
.Nm ffi_call .
.Pp
.Fa rvalue
must point to storage that is sizeof(long) or larger. For smaller
return value sizes, the
.Nm ffi_arg
or
.Nm ffi_sarg
integral type must be used to hold
the return value.
.Sh EXAMPLES
.Bd -literal
#include <ffi/ffi.h>
#include <stdio.h>
unsigned char
foo(unsigned int, float);
int
main(int argc, const char **argv)
{
ffi_cif cif;
ffi_type *arg_types[2];
void *arg_values[2];
ffi_status status;
// Because the return value from foo() is smaller than sizeof(long), it
// must be passed as ffi_arg or ffi_sarg.
ffi_arg result;
// Specify the data type of each argument. Available types are defined
// in <ffi/ffi.h>.
arg_types[0] = &ffi_type_uint;
arg_types[1] = &ffi_type_float;
// Prepare the ffi_cif structure.
if ((status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
2, &ffi_type_uint8, arg_types)) != FFI_OK)
{
// Handle the ffi_status error.
}
// Specify the values of each argument.
unsigned int arg1 = 42;
float arg2 = 5.1;
arg_values[0] = &arg1;
arg_values[1] = &arg2;
// Invoke the function.
ffi_call(&cif, FFI_FN(foo), &result, arg_values);
// The ffi_arg 'result' now contains the unsigned char returned from foo(),
// which can be accessed by a typecast.
printf("result is %hhu", (unsigned char)result);
return 0;
}
// The target function.
unsigned char
foo(unsigned int x, float y)
{
unsigned char result = x - y;
return result;
}
.Ed
.Sh SEE ALSO
.Xr ffi 3 ,
.Xr ffi_prep_cif 3
.Dd February 15, 2008
.Dt ffi_prep_cif 3
.Sh NAME
.Nm ffi_prep_cif
.Nd Prepare a
.Nm ffi_cif
structure for use with
.Nm ffi_call
.
.Sh SYNOPSIS
.In ffi.h
.Ft ffi_status
.Fo ffi_prep_cif
.Fa "ffi_cif *cif"
.Fa "ffi_abi abi"
.Fa "unsigned int nargs"
.Fa "ffi_type *rtype"
.Fa "ffi_type **atypes"
.Fc
.Sh DESCRIPTION
The
.Nm ffi_prep_cif
function prepares a
.Nm ffi_cif
structure for use with
.Nm ffi_call
.
.Fa abi
specifies a set of calling conventions to use.
.Fa atypes
is an array of
.Fa nargs
pointers to
.Nm ffi_type
structs that describe the data type, size and alignment of each argument.
.Fa rtype
points to an
.Nm ffi_type
that describes the data type, size and alignment of the
return value.
.Sh RETURN VALUES
Upon successful completion,
.Nm ffi_prep_cif
returns
.Nm FFI_OK .
It will return
.Nm FFI_BAD_TYPEDEF
if
.Fa cif
is
.Nm NULL
or
.Fa atypes
or
.Fa rtype
is malformed. If
.Fa abi
does not refer to a valid ABI,
.Nm FFI_BAD_ABI
will be returned. Available ABIs are
defined in
.Nm <ffitarget.h>
.
.Sh SEE ALSO
.Xr ffi 3 ,
.Xr ffi_call 3
...@@ -170,6 +170,8 @@ X86_64_TRUE = @X86_64_TRUE@ ...@@ -170,6 +170,8 @@ X86_64_TRUE = @X86_64_TRUE@
X86_DARWIN_FALSE = @X86_DARWIN_FALSE@ X86_DARWIN_FALSE = @X86_DARWIN_FALSE@
X86_DARWIN_TRUE = @X86_DARWIN_TRUE@ X86_DARWIN_TRUE = @X86_DARWIN_TRUE@
X86_FALSE = @X86_FALSE@ X86_FALSE = @X86_FALSE@
X86_FREEBSD_FALSE = @X86_FREEBSD_FALSE@
X86_FREEBSD_TRUE = @X86_FREEBSD_TRUE@
X86_TRUE = @X86_TRUE@ X86_TRUE = @X86_TRUE@
X86_WIN32_FALSE = @X86_WIN32_FALSE@ X86_WIN32_FALSE = @X86_WIN32_FALSE@
X86_WIN32_TRUE = @X86_WIN32_TRUE@ X86_WIN32_TRUE = @X86_WIN32_TRUE@
......
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