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>
......
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/metag/ffitarget.h src/metag/sysv.S src/moxie/ffi.c \
src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h \
src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \ src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \
src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
src/powerpc/ffi.c src/powerpc/sysv.S \ src/microblaze/ffi.c src/microblaze/sysv.S \
src/powerpc/linux64.S src/powerpc/linux64_closure.S \ src/microblaze/ffitarget.h src/powerpc/ffi.c \
src/powerpc/ppc_closure.S src/powerpc/asm.h \ src/powerpc/sysv.S src/powerpc/linux64.S \
src/powerpc/aix.S src/powerpc/darwin.S \ src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \
src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \ src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \ src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \ src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
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/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ src/sh64/sysv.S src/sh64/ffitarget.h src/sparc/v8.S \
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ src/sparc/v9.S src/sparc/ffitarget.h src/sparc/ffi.c \
src/sparc/ffi.c src/x86/darwin64.S \ src/x86/darwin64.S src/x86/ffi.c src/x86/sysv.S \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/win64.S \ src/x86/win32.S src/x86/darwin.S src/x86/win64.S \
src/x86/darwin.S src/x86/freebsd.S \ src/x86/freebsd.S src/x86/ffi64.c src/x86/unix64.S \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \ src/x86/ffitarget.h src/pa/ffitarget.h src/pa/ffi.c \
src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ src/pa/linux.S src/pa/hpux32.S src/frv/ffi.c src/bfin/ffi.c \
src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \ src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S \
libtool-version ChangeLog.libffi m4/libtool.m4 \ src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c \
m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 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:
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# Free Software Foundation, Inc. # 2011, 2012, 2013 Free Software Foundation, Inc.
timestamp='2009-11-19' timestamp='2012-12-29'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, but # This program is distributed in the hope that it will be useful, but
...@@ -17,26 +17,22 @@ timestamp='2009-11-19' ...@@ -17,26 +17,22 @@ timestamp='2009-11-19'
# General Public License for more details. # 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
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Originally written by Per Bothner. Please send patches (context
# diff format) to <config-patches@gnu.org> and include a ChangeLog
# entry.
# #
# This script attempts to guess a canonical system name similar to # Originally written by Per Bothner.
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
# #
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
...@@ -56,8 +52,9 @@ version="\ ...@@ -56,8 +52,9 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -144,7 +141,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown ...@@ -144,7 +141,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*) *:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or # NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old # switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward # object file format. This provides both forward
...@@ -201,6 +198,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -201,6 +198,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}" echo "${machine}-${os}${release}"
exit ;; exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*) *:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
...@@ -269,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -269,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;; # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*) Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead # Should we change UNAME_MACHINE based on the output of uname instead
...@@ -300,7 +304,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -300,7 +304,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE} echo arm-acorn-riscix${UNAME_RELEASE}
exit ;; exit ;;
arm:riscos:*:*|arm:RISCOS:*:*) arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos echo arm-unknown-riscos
exit ;; exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
...@@ -333,6 +337,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -333,6 +337,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build eval $set_cc_for_build
SUN_ARCH="i386" SUN_ARCH="i386"
...@@ -548,7 +555,7 @@ EOF ...@@ -548,7 +555,7 @@ EOF
echo rs6000-ibm-aix3.2 echo rs6000-ibm-aix3.2
fi fi
exit ;; exit ;;
*:AIX:*:[456]) *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000 IBM_ARCH=rs6000
...@@ -785,21 +792,26 @@ EOF ...@@ -785,21 +792,26 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;; exit ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
case ${UNAME_MACHINE} in UNAME_PROCESSOR=`/usr/bin/uname -p`
pc98) case ${UNAME_PROCESSOR} in
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64) amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*) *)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac esac
exit ;; exit ;;
i*:CYGWIN*:*) i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin echo ${UNAME_MACHINE}-pc-cygwin
exit ;; exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*) *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit ;; exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*) i*:windows32*:*)
# uname -m includes "-pc" on this system. # uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32 echo ${UNAME_MACHINE}-mingw32
...@@ -854,6 +866,13 @@ EOF ...@@ -854,6 +866,13 @@ EOF
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
exit ;; exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
alpha:Linux:*:*) alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;; EV5) UNAME_MACHINE=alphaev5 ;;
...@@ -875,20 +894,29 @@ EOF ...@@ -875,20 +894,29 @@ EOF
then then
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
else else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-gnueabi echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi fi
exit ;; exit ;;
avr32*:Linux:*:*) avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
cris:Linux:*:*) cris:Linux:*:*)
echo cris-axis-linux-gnu echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;; exit ;;
crisv32:Linux:*:*) crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;; exit ;;
frv:Linux:*:*) frv:Linux:*:*)
echo frv-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
i*86:Linux:*:*) i*86:Linux:*:*)
LIBC=gnu LIBC=gnu
...@@ -930,7 +958,7 @@ EOF ...@@ -930,7 +958,7 @@ EOF
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;; ;;
or32:Linux:*:*) or32:Linux:*:*)
echo or32-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
padre:Linux:*:*) padre:Linux:*:*)
echo sparc-unknown-linux-gnu echo sparc-unknown-linux-gnu
...@@ -964,11 +992,14 @@ EOF ...@@ -964,11 +992,14 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*) sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*) vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;; exit ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
...@@ -1175,6 +1206,9 @@ EOF ...@@ -1175,6 +1206,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible. BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku echo i586-pc-haiku
exit ;; exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*) SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE} echo sx4-nec-superux${UNAME_RELEASE}
exit ;; exit ;;
...@@ -1227,7 +1261,10 @@ EOF ...@@ -1227,7 +1261,10 @@ EOF
*:QNX:*:4*) *:QNX:*:4*)
echo i386-pc-qnx echo i386-pc-qnx
exit ;; exit ;;
NSE-?:NONSTOP_KERNEL:*:*) NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE} echo nse-tandem-nsk${UNAME_RELEASE}
exit ;; exit ;;
NSR-?:NONSTOP_KERNEL:*:*) NSR-?:NONSTOP_KERNEL:*:*)
...@@ -1296,11 +1333,11 @@ EOF ...@@ -1296,11 +1333,11 @@ EOF
i*86:AROS:*:*) i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros echo ${UNAME_MACHINE}-pc-aros
exit ;; exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build eval $set_cc_for_build
cat >$dummy.c <<EOF cat >$dummy.c <<EOF
#ifdef _SEQUENT_ #ifdef _SEQUENT_
......
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.
This diff is collapsed.
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.
AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
gcc_cv_as_cfi_pseudo_op, [
gcc_cv_as_cfi_pseudo_op=unknown
AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
[gcc_cv_as_cfi_pseudo_op=yes],
[gcc_cv_as_cfi_pseudo_op=no])
])
if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
[Define if your assembler supports .cfi_* directives.])
fi
])
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.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS=foreign AUTOMAKE_OPTIONS=foreign
EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
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