mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian architectures.
This commit is contained in:
parent
4f06d604c4
commit
736a913321
136 changed files with 28348 additions and 13803 deletions
|
|
@ -196,6 +196,13 @@ Library
|
|||
- Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
|
||||
broken by the fix for security issue #19435. Patch by Zach Byrne.
|
||||
|
||||
Extension Modules
|
||||
-----------------
|
||||
|
||||
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
|
||||
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
|
||||
architectures.
|
||||
|
||||
Build
|
||||
-----
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
diff -r -N -u libffi.orig/autom4te.cache/output.0 libffi/autom4te.cache/output.0
|
||||
diff -r -N -u libffi.orig/configure libffi/configure
|
||||
--- libffi.orig/configure 2013-03-17 15:37:50.000000000 -0700
|
||||
+++ libffi/configure 2013-03-18 15:11:39.611575163 -0700
|
||||
@@ -13368,6 +13368,10 @@
|
||||
diff -urN libffi-3.1/configure libffi/configure
|
||||
--- libffi-3.1/configure 2014-05-19 15:44:03.000000000 +0200
|
||||
+++ libffi/configure 2014-08-09 21:51:07.877871443 +0200
|
||||
@@ -17236,6 +17236,10 @@
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
@ -13,22 +12,22 @@ diff -r -N -u libffi.orig/configure libffi/configure
|
|||
x86_64-*-darwin*)
|
||||
TARGET=X86_DARWIN; TARGETDIR=x86
|
||||
;;
|
||||
@@ -13426,12 +13430,12 @@
|
||||
@@ -17298,12 +17302,12 @@
|
||||
;;
|
||||
|
||||
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
|
||||
- TARGET=MIPS; TARGETDIR=mips
|
||||
+ TARGET=MIPS_IRIX; TARGETDIR=mips
|
||||
;;
|
||||
mips*-*-linux* | mips*-*-openbsd*)
|
||||
mips*-*linux* | mips*-*-openbsd*)
|
||||
# Support 128-bit long double for NewABI.
|
||||
HAVE_LONG_DOUBLE='defined(__mips64)'
|
||||
- TARGET=MIPS; TARGETDIR=mips
|
||||
+ TARGET=MIPS_IRIX; TARGETDIR=mips
|
||||
+ TARGET=MIPS_LINUX; TARGETDIR=mips
|
||||
;;
|
||||
|
||||
powerpc*-*-linux* | powerpc-*-sysv*)
|
||||
@@ -13491,7 +13495,7 @@
|
||||
nios2*-linux*)
|
||||
@@ -17373,7 +17377,7 @@
|
||||
as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
|
@ -37,7 +36,7 @@ diff -r -N -u libffi.orig/configure libffi/configure
|
|||
MIPS_TRUE=
|
||||
MIPS_FALSE='#'
|
||||
else
|
||||
@@ -14862,6 +14866,12 @@
|
||||
@@ -18814,6 +18818,12 @@
|
||||
ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
|
||||
|
||||
|
||||
|
|
@ -50,7 +49,7 @@ diff -r -N -u libffi.orig/configure libffi/configure
|
|||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
# tests run on this system so they can be shared between configure
|
||||
@@ -16047,6 +16057,8 @@
|
||||
@@ -20126,6 +20136,8 @@
|
||||
"testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
|
||||
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
|
||||
"libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
|
||||
|
|
@ -59,9 +58,9 @@ diff -r -N -u libffi.orig/configure libffi/configure
|
|||
|
||||
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
||||
esac
|
||||
diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
|
||||
--- libffi.orig/configure.ac 2013-03-17 15:37:50.000000000 -0700
|
||||
+++ libffi/configure.ac 2013-03-18 15:11:11.392989136 -0700
|
||||
diff -urN libffi-3.1/configure.ac libffi/configure.ac
|
||||
--- libffi-3.1/configure.ac 2014-05-11 15:57:49.000000000 +0200
|
||||
+++ libffi/configure.ac 2014-08-09 21:51:07.877871443 +0200
|
||||
@@ -1,4 +1,7 @@
|
||||
dnl Process this with autoconf to create configure
|
||||
+#
|
||||
|
|
@ -70,33 +69,32 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
|
|||
|
||||
AC_PREREQ(2.68)
|
||||
|
||||
@@ -146,6 +149,10 @@
|
||||
fi
|
||||
@@ -144,6 +147,9 @@
|
||||
AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
|
||||
fi
|
||||
;;
|
||||
|
||||
+ i*86-*-nto-qnx*)
|
||||
+ TARGET=X86; TARGETDIR=x86
|
||||
+ ;;
|
||||
+
|
||||
x86_64-*-darwin*)
|
||||
i?86-*-darwin*)
|
||||
TARGET=X86_DARWIN; TARGETDIR=x86
|
||||
;;
|
||||
@@ -204,12 +211,12 @@
|
||||
@@ -218,12 +224,12 @@
|
||||
;;
|
||||
|
||||
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
|
||||
- TARGET=MIPS; TARGETDIR=mips
|
||||
+ TARGET=MIPS_IRIX; TARGETDIR=mips
|
||||
;;
|
||||
mips*-*-linux* | mips*-*-openbsd*)
|
||||
mips*-*linux* | mips*-*-openbsd*)
|
||||
# Support 128-bit long double for NewABI.
|
||||
HAVE_LONG_DOUBLE='defined(__mips64)'
|
||||
- TARGET=MIPS; TARGETDIR=mips
|
||||
+ TARGET=MIPS_IRIX; TARGETDIR=mips
|
||||
+ TARGET=MIPS_LINUX; TARGETDIR=mips
|
||||
;;
|
||||
|
||||
powerpc*-*-linux* | powerpc-*-sysv*)
|
||||
@@ -269,7 +276,7 @@
|
||||
nios2*-linux*)
|
||||
@@ -293,7 +299,7 @@
|
||||
AC_MSG_ERROR(["libffi has not been ported to $host."])
|
||||
fi
|
||||
|
||||
|
|
@ -105,7 +103,7 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
|
|||
AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
|
||||
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
|
||||
AM_CONDITIONAL(X86, test x$TARGET = xX86)
|
||||
@@ -567,4 +574,8 @@
|
||||
@@ -617,4 +623,8 @@
|
||||
|
||||
AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
|
||||
|
||||
|
|
@ -114,13 +112,13 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
|
|||
+AC_CONFIG_FILES(fficonfig.py)
|
||||
+
|
||||
AC_OUTPUT
|
||||
--- libffi-3.0.11/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ libffi/fficonfig.py.in 2012-03-15 01:04:27.000000000 +0100
|
||||
diff -urN libffi-3.1/fficonfig.py.in libffi/fficonfig.py.in
|
||||
--- libffi-3.1/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ libffi/fficonfig.py.in 2014-08-09 21:43:25.229871827 +0200
|
||||
@@ -0,0 +1,35 @@
|
||||
+ffi_sources = """
|
||||
+src/prep_cif.c
|
||||
+src/closures.c
|
||||
+src/dlmalloc.c
|
||||
+""".split()
|
||||
+
|
||||
+ffi_platforms = {
|
||||
|
|
@ -134,9 +132,10 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
|
|||
+ 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
|
||||
+ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
|
||||
+ 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
|
||||
+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
|
||||
+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
|
||||
+ 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
|
||||
+ 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
|
||||
+ 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
|
||||
+ 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
|
||||
+ 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
|
||||
+ 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
|
||||
|
|
@ -152,9 +151,9 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
|
|||
+ffi_sources += ffi_platforms['@TARGET@']
|
||||
+
|
||||
+ffi_cflags = '@CFLAGS@'
|
||||
diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
|
||||
--- libffi-3.0.11/src/dlmalloc.c 2012-04-12 04:46:06.000000000 +0200
|
||||
+++ libffi/src/dlmalloc.c 2012-06-26 15:15:58.949547461 +0200
|
||||
diff -urN libffi-3.1/src/dlmalloc.c libffi/src/dlmalloc.c
|
||||
--- libffi-3.1/src/dlmalloc.c 2014-04-25 19:45:13.000000000 +0200
|
||||
+++ libffi/src/dlmalloc.c 2014-08-09 21:51:07.881871443 +0200
|
||||
@@ -457,6 +457,11 @@
|
||||
#define LACKS_ERRNO_H
|
||||
#define MALLOC_FAILURE_ACTION
|
||||
|
|
@ -167,25 +166,7 @@ diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
|
|||
#endif /* WIN32 */
|
||||
|
||||
#ifdef __OS2__
|
||||
@@ -3393,7 +3393,7 @@
|
||||
*ss = m->seg; /* Push current record */
|
||||
m->seg.base = tbase;
|
||||
m->seg.size = tsize;
|
||||
- set_segment_flags(&m->seg, mmapped);
|
||||
+ (void)set_segment_flags(&m->seg, mmapped);
|
||||
m->seg.next = ss;
|
||||
|
||||
/* Insert trailing fenceposts */
|
||||
@@ -3553,7 +3553,7 @@
|
||||
if (!is_initialized(m)) { /* first-time initialization */
|
||||
m->seg.base = m->least_addr = tbase;
|
||||
m->seg.size = tsize;
|
||||
- set_segment_flags(&m->seg, mmap_flag);
|
||||
+ (void)set_segment_flags(&m->seg, mmap_flag);
|
||||
m->magic = mparams.magic;
|
||||
init_bins(m);
|
||||
if (is_global(m))
|
||||
@@ -4502,7 +4502,7 @@
|
||||
@@ -4497,7 +4502,7 @@
|
||||
char* tbase = (char*)(CALL_MMAP(tsize));
|
||||
if (tbase != CMFAIL) {
|
||||
m = init_user_mstate(tbase, tsize);
|
||||
|
|
@ -194,7 +175,7 @@ diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
|
|||
set_lock(m, locked);
|
||||
}
|
||||
}
|
||||
@@ -4517,7 +4517,7 @@
|
||||
@@ -4512,7 +4517,7 @@
|
||||
if (capacity > msize + TOP_FOOT_SIZE &&
|
||||
capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
|
||||
m = init_user_mstate((char*)base, capacity);
|
||||
|
|
|
|||
21
Modules/_ctypes/libffi/.gitignore
vendored
21
Modules/_ctypes/libffi/.gitignore
vendored
|
|
@ -1,21 +0,0 @@
|
|||
.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/
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
language: c
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
before_script: sudo apt-get install dejagnu
|
||||
|
||||
script: ./configure && make && make check
|
||||
File diff suppressed because it is too large
Load diff
6000
Modules/_ctypes/libffi/ChangeLog.libffi-3.1
Normal file
6000
Modules/_ctypes/libffi/ChangeLog.libffi-3.1
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,7 @@ The libffi version 1 ChangeLog archive.
|
|||
|
||||
Version 1 of libffi had per-directory ChangeLogs. Current and future
|
||||
versions have a single ChangeLog file in the root directory. The
|
||||
version 1 ChangeLogs have all been concatonated into this file for
|
||||
version 1 ChangeLogs have all been concatenated into this file for
|
||||
future reference only.
|
||||
|
||||
--- libffi ----------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
libffi - Copyright (c) 1996-2012 Anthony Green, Red Hat, Inc and others.
|
||||
libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others.
|
||||
See source files for details.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@ ACLOCAL_AMFLAGS = -I m4
|
|||
|
||||
SUBDIRS = include testsuite man
|
||||
|
||||
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
|
||||
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
|
||||
src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \
|
||||
build-ios.sh src/alpha/ffi.c src/alpha/osf.S \
|
||||
src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
|
||||
src/alpha/ffi.c src/alpha/osf.S \
|
||||
src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S \
|
||||
src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
|
||||
src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \
|
||||
src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \
|
||||
src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \
|
||||
|
|
@ -19,8 +20,12 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
|
|||
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/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
|
||||
src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h \
|
||||
src/microblaze/ffi.c src/microblaze/sysv.S \
|
||||
src/microblaze/ffitarget.h src/powerpc/ffi.c \
|
||||
src/microblaze/ffitarget.h \
|
||||
src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S \
|
||||
src/powerpc/ffi.c src/powerpc/ffi_powerpc.h \
|
||||
src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
|
||||
src/powerpc/sysv.S src/powerpc/linux64.S \
|
||||
src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
|
||||
src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \
|
||||
|
|
@ -38,14 +43,14 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
|
|||
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/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S \
|
||||
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 \
|
||||
generate-darwin-source-and-headers.py \
|
||||
libffi.xcodeproj/project.pbxproj src/arm/trampoline.S \
|
||||
libtool-ldflags
|
||||
libtool-ldflags ChangeLog.libffi-3.1
|
||||
|
||||
info_TEXINFOS = doc/libffi.texi
|
||||
|
||||
|
|
@ -59,39 +64,39 @@ info_TEXINFOS = doc/libffi.texi
|
|||
# values defined in terms of make variables, as is the case for CC and
|
||||
# friends when we are called from the top level Makefile.
|
||||
AM_MAKEFLAGS = \
|
||||
"AR_FLAGS=$(AR_FLAGS)" \
|
||||
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
||||
"CFLAGS=$(CFLAGS)" \
|
||||
"CXXFLAGS=$(CXXFLAGS)" \
|
||||
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
||||
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
|
||||
"JC1FLAGS=$(JC1FLAGS)" \
|
||||
"LDFLAGS=$(LDFLAGS)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
|
||||
"MAKE=$(MAKE)" \
|
||||
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
|
||||
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
|
||||
"SHELL=$(SHELL)" \
|
||||
"exec_prefix=$(exec_prefix)" \
|
||||
"infodir=$(infodir)" \
|
||||
"libdir=$(libdir)" \
|
||||
"mandir=$(mandir)" \
|
||||
"prefix=$(prefix)" \
|
||||
"AR=$(AR)" \
|
||||
"AS=$(AS)" \
|
||||
"CC=$(CC)" \
|
||||
"CXX=$(CXX)" \
|
||||
"LD=$(LD)" \
|
||||
"NM=$(NM)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"DESTDIR=$(DESTDIR)"
|
||||
'AR_FLAGS=$(AR_FLAGS)' \
|
||||
'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
|
||||
'CFLAGS=$(CFLAGS)' \
|
||||
'CXXFLAGS=$(CXXFLAGS)' \
|
||||
'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
|
||||
'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
|
||||
'INSTALL=$(INSTALL)' \
|
||||
'INSTALL_DATA=$(INSTALL_DATA)' \
|
||||
'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
|
||||
'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
|
||||
'JC1FLAGS=$(JC1FLAGS)' \
|
||||
'LDFLAGS=$(LDFLAGS)' \
|
||||
'LIBCFLAGS=$(LIBCFLAGS)' \
|
||||
'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
|
||||
'MAKE=$(MAKE)' \
|
||||
'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
|
||||
'PICFLAG=$(PICFLAG)' \
|
||||
'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
|
||||
'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
|
||||
'SHELL=$(SHELL)' \
|
||||
'exec_prefix=$(exec_prefix)' \
|
||||
'infodir=$(infodir)' \
|
||||
'libdir=$(libdir)' \
|
||||
'mandir=$(mandir)' \
|
||||
'prefix=$(prefix)' \
|
||||
'AR=$(AR)' \
|
||||
'AS=$(AS)' \
|
||||
'CC=$(CC)' \
|
||||
'CXX=$(CXX)' \
|
||||
'LD=$(LD)' \
|
||||
'NM=$(NM)' \
|
||||
'RANLIB=$(RANLIB)' \
|
||||
'DESTDIR=$(DESTDIR)'
|
||||
|
||||
# Subdir rules rely on $(FLAGS_TO_PASS)
|
||||
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
|
||||
|
|
@ -120,10 +125,10 @@ if BFIN
|
|||
nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
|
||||
endif
|
||||
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 src/x86/win32.S
|
||||
endif
|
||||
if X86_FREEBSD
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
|
||||
endif
|
||||
if X86_WIN32
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
|
||||
|
|
@ -133,6 +138,9 @@ nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
|
|||
endif
|
||||
if X86_DARWIN
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
|
||||
if X86_DARWIN32
|
||||
nodist_libffi_la_SOURCES += src/x86/win32.S
|
||||
endif
|
||||
endif
|
||||
if SPARC
|
||||
nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
|
||||
|
|
@ -149,14 +157,20 @@ endif
|
|||
if M68K
|
||||
nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
|
||||
endif
|
||||
if M88K
|
||||
nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S
|
||||
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 NIOS2
|
||||
nodist_libffi_la_SOURCES += src/nios2/sysv.S src/nios2/ffi.c
|
||||
endif
|
||||
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/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
|
||||
endif
|
||||
if POWERPC_AIX
|
||||
nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
|
||||
|
|
@ -165,11 +179,14 @@ if POWERPC_DARWIN
|
|||
nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
|
||||
endif
|
||||
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/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
|
||||
endif
|
||||
if AARCH64
|
||||
nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c
|
||||
endif
|
||||
if ARC
|
||||
nodist_libffi_la_SOURCES += src/arc/arcompact.S src/arc/ffi.c
|
||||
endif
|
||||
if ARM
|
||||
nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
|
||||
if FFI_EXEC_TRAMPOLINE_TABLE
|
||||
|
|
@ -212,14 +229,26 @@ endif
|
|||
if METAG
|
||||
nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
|
||||
endif
|
||||
if VAX
|
||||
nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c
|
||||
endif
|
||||
|
||||
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
|
||||
nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
|
||||
|
||||
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
|
||||
|
||||
AM_CFLAGS =
|
||||
if FFI_DEBUG
|
||||
# Build debug. Define FFI_DEBUG on the commandline so that, when building with
|
||||
# MSVC, it can link against the debug CRT.
|
||||
AM_CFLAGS += -DFFI_DEBUG
|
||||
endif
|
||||
|
||||
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_CCASFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
dist-hook:
|
||||
if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +1,8 @@
|
|||
Status
|
||||
======
|
||||
|
||||
libffi-3.0.13 was released on March 17, 2013. Check the libffi web
|
||||
page for updates: <URL:http://sourceware.org/libffi/>.
|
||||
libffi-3.1 was released on May 19, 2014. Check the libffi web page
|
||||
for updates: <URL:http://sourceware.org/libffi/>.
|
||||
|
||||
|
||||
What is libffi?
|
||||
|
|
@ -43,7 +43,7 @@ Libffi has been ported to many different platforms.
|
|||
For specific configuration details and testing status, please
|
||||
refer to the wiki page here:
|
||||
|
||||
http://www.moxielogic.org/wiki/index.php?title=Libffi_3.0.13
|
||||
http://www.moxielogic.org/wiki/index.php?title=Libffi_3.1
|
||||
|
||||
At the time of release, the following basic configurations have been
|
||||
tested:
|
||||
|
|
@ -51,9 +51,11 @@ tested:
|
|||
|-----------------+------------------+-------------------------|
|
||||
| Architecture | Operating System | Compiler |
|
||||
|-----------------+------------------+-------------------------|
|
||||
| AArch64 (ARM64) | iOS | Clang |
|
||||
| AArch64 | Linux | GCC |
|
||||
| Alpha | Linux | GCC |
|
||||
| Alpha | Tru64 | GCC |
|
||||
| ARC | Linux | GCC |
|
||||
| ARM | Linux | GCC |
|
||||
| ARM | iOS | GCC |
|
||||
| AVR32 | Linux | GCC |
|
||||
|
|
@ -61,15 +63,17 @@ tested:
|
|||
| HPPA | HPUX | GCC |
|
||||
| IA-64 | Linux | GCC |
|
||||
| M68K | FreeMiNT | GCC |
|
||||
| M68K | Linux | GCC |
|
||||
| M68K | Linux | GCC |
|
||||
| M68K | RTEMS | GCC |
|
||||
| M88K | OpenBSD/mvme88k | GCC |
|
||||
| Meta | Linux | GCC |
|
||||
| MicroBlaze | Linux | GCC |
|
||||
| MIPS | IRIX | GCC |
|
||||
| MIPS | Linux | GCC |
|
||||
| MIPS | RTEMS | GCC |
|
||||
| MIPS64 | Linux | GCC |
|
||||
| Moxie | Bare metal | GCC
|
||||
| Moxie | Bare metal | GCC |
|
||||
| Nios II | Linux | GCC |
|
||||
| PowerPC 32-bit | AIX | IBM XL C |
|
||||
| PowerPC 64-bit | AIX | IBM XL C |
|
||||
| PowerPC | AMIGA | GCC |
|
||||
|
|
@ -77,7 +81,8 @@ tested:
|
|||
| PowerPC | Mac OSX | GCC |
|
||||
| PowerPC | FreeBSD | GCC |
|
||||
| PowerPC 64-bit | FreeBSD | GCC |
|
||||
| PowerPC 64-bit | Linux | GCC |
|
||||
| PowerPC 64-bit | Linux ELFv1 | GCC |
|
||||
| PowerPC 64-bit | Linux ELFv2 | GCC |
|
||||
| S390 | Linux | GCC |
|
||||
| S390X | Linux | GCC |
|
||||
| SPARC | Linux | GCC |
|
||||
|
|
@ -87,6 +92,7 @@ tested:
|
|||
| SPARC64 | FreeBSD | GCC |
|
||||
| SPARC64 | Solaris | Oracle Solaris Studio C |
|
||||
| TILE-Gx/TILEPro | Linux | GCC |
|
||||
| VAX | OpenBSD/vax | GCC |
|
||||
| X86 | FreeBSD | GCC |
|
||||
| X86 | GNU HURD | GCC |
|
||||
| X86 | Interix | GCC |
|
||||
|
|
@ -120,6 +126,9 @@ system. Go to the directory you wish to build libffi in and run the
|
|||
"configure" program found in the root directory of the libffi source
|
||||
distribution.
|
||||
|
||||
If you're building libffi directly from version control, configure won't
|
||||
exist yet; run ./autogen.sh first.
|
||||
|
||||
You may want to tell configure where to install the libffi library and
|
||||
header files. To do that, use the --prefix configure switch. Libffi
|
||||
will install under /usr/local by default.
|
||||
|
|
@ -137,13 +146,16 @@ It's also possible to build libffi on Windows platforms with
|
|||
Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
|
||||
wrapper script during configuration like so:
|
||||
|
||||
path/to/configure CC=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
|
||||
path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
|
||||
|
||||
For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64".
|
||||
You may also need to specify --build appropriately. When building with MSVC
|
||||
under a MingW environment, you may need to remove the line in configure
|
||||
that sets 'fix_srcfile_path' to a 'cygpath' command. ('cygpath' is not
|
||||
present in MingW, and is not required when using MingW-style paths.)
|
||||
For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
|
||||
CXX="path/to/msvcc.sh -m64". You may also need to specify --build
|
||||
appropriately.
|
||||
|
||||
When building with MSVC under a MingW environment, you may need to
|
||||
remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
|
||||
command. ('cygpath' is not present in MingW, and is not required when
|
||||
using MingW-style paths.)
|
||||
|
||||
For iOS builds, the 'libffi.xcodeproj' Xcode project is available.
|
||||
|
||||
|
|
@ -161,7 +173,20 @@ To install the library and header files, type "make install".
|
|||
History
|
||||
=======
|
||||
|
||||
See the ChangeLog files for details.
|
||||
See the git log for details at http://github.com/atgreen/libffi.
|
||||
|
||||
3.1 May-19-14
|
||||
Add AArch64 (ARM64) iOS support.
|
||||
Add Nios II support.
|
||||
Add m88k and DEC VAX support.
|
||||
Add support for stdcall, thiscall, and fastcall on non-Windows
|
||||
32-bit x86 targets such as Linux.
|
||||
Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi
|
||||
fixes.
|
||||
Make the testsuite more robust: eliminate several spurious
|
||||
failures, and respect the $CC and $CXX environment variables.
|
||||
Archive off the manually maintained ChangeLog in favor of git
|
||||
log.
|
||||
|
||||
3.0.13 Mar-17-13
|
||||
Add Meta support.
|
||||
|
|
@ -187,7 +212,6 @@ See the ChangeLog files for details.
|
|||
|
||||
3.0.11 Apr-11-12
|
||||
Lots of build fixes.
|
||||
Add Amiga newer MacOS support.
|
||||
Add support for variadic functions (ffi_prep_cif_var).
|
||||
Add Linux/x32 support.
|
||||
Add thiscall, fastcall and MSVC cdecl support on Windows.
|
||||
|
|
@ -339,7 +363,7 @@ See the ChangeLog files for details.
|
|||
Authors & Credits
|
||||
=================
|
||||
|
||||
libffi was originally written by Anthony Green <green@redhat.com>.
|
||||
libffi was originally written by Anthony Green <green@moxielogic.com>.
|
||||
|
||||
The developers of the GNU Compiler Collection project have made
|
||||
innumerable valuable contributions. See the ChangeLog file for
|
||||
|
|
@ -363,10 +387,12 @@ frv Anthony Green
|
|||
ia64 Hans Boehm
|
||||
m32r Kazuhiro Inaoka
|
||||
m68k Andreas Schwab
|
||||
m88k Miod Vallat
|
||||
microblaze Nathan Rossi
|
||||
mips Anthony Green, Casey Marshall
|
||||
mips64 David Daney
|
||||
moxie Anthony Green
|
||||
nios ii Sandra Loosemore
|
||||
pa Randolph Chung, Dave Anglin, Andreas Tobler
|
||||
powerpc Geoffrey Keating, Andreas Tobler,
|
||||
David Edelsohn, John Hornkvist
|
||||
|
|
@ -376,6 +402,7 @@ sh Kaz Kojima
|
|||
sh64 Kaz Kojima
|
||||
sparc Anthony Green, Gordon Irlam
|
||||
tile-gx/tilepro Walter Lee
|
||||
vax Miod Vallat
|
||||
x86 Anthony Green, Jon Beniston
|
||||
x86-64 Bo Thorsen
|
||||
xtensa Chris Zankel
|
||||
|
|
|
|||
334
Modules/_ctypes/libffi/aclocal.m4
vendored
334
Modules/_ctypes/libffi/aclocal.m4
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
|
||||
|
|
@ -837,24 +838,22 @@ AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
|
|||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
|
||||
|
||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.12'
|
||||
[am__api_version='1.13'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.12.2], [],
|
||||
m4_if([$1], [1.13.4], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
|
|
@ -870,21 +869,19 @@ m4_define([_AM_AUTOCONF_VERSION], [])
|
|||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.12.2])dnl
|
||||
[AM_AUTOMAKE_VERSION([1.13.4])dnl
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||
|
||||
# Figure out how to run the assembler. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_PROG_AS
|
||||
# ----------
|
||||
AC_DEFUN([AM_PROG_AS],
|
||||
|
|
@ -899,14 +896,12 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
|
|||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
|
||||
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
|
||||
|
|
@ -954,14 +949,12 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
|
|||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 10
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
|
|
@ -987,13 +980,12 @@ AC_CONFIG_COMMANDS_PRE(
|
|||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 17
|
||||
|
||||
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
|
|
@ -1179,19 +1171,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
|
|||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[{
|
||||
# Autoconf 2.62 quotes --file arguments for eval, but not when files
|
||||
# Older Autoconf quotes --file arguments for eval, but not when files
|
||||
# are listed without --file. Let's play safe and only enable the eval
|
||||
# if we detect the quoting.
|
||||
case $CONFIG_FILES in
|
||||
|
|
@ -1220,7 +1211,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
test -z "$am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
|
|
@ -1256,14 +1247,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 19
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
|
|
@ -1279,7 +1268,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.62])dnl
|
||||
[AC_PREREQ([2.65])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
|
|
@ -1309,8 +1298,7 @@ AC_SUBST([CYGPATH_W])
|
|||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[AC_DIAGNOSE([obsolete],
|
||||
[$0: two- and three-arguments forms are deprecated. For more info, see:
|
||||
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
|
||||
[$0: two- and three-arguments forms are deprecated.])
|
||||
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
|
|
@ -1364,18 +1352,15 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
|||
[_AM_DEPENDENCIES([OBJC])],
|
||||
[m4_define([AC_PROG_OBJC],
|
||||
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
|
||||
dnl Support for Objective C++ was only introduced in Autoconf 2.65,
|
||||
dnl but we still cater to Autoconf 2.62.
|
||||
m4_ifdef([AC_PROG_OBJCXX],
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
|
||||
[_AM_DEPENDENCIES([OBJCXX])],
|
||||
[m4_define([AC_PROG_OBJCXX],
|
||||
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
|
||||
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
|
||||
])
|
||||
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
|
||||
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
|
||||
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
|
||||
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
|
||||
AC_REQUIRE([AM_SILENT_RULES])dnl
|
||||
dnl The testsuite driver may need to know about EXEEXT, so add the
|
||||
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
|
||||
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
|
||||
AC_CONFIG_COMMANDS_PRE(dnl
|
||||
[m4_provide_if([_AM_COMPILER_EXEEXT],
|
||||
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
|
||||
|
|
@ -1409,14 +1394,12 @@ for _am_header in $config_headers :; do
|
|||
done
|
||||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
|
|
@ -1432,14 +1415,12 @@ if test x"${install_sh}" != xset; then
|
|||
fi
|
||||
AC_SUBST([install_sh])])
|
||||
|
||||
# Copyright (C) 2003-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
|
|
@ -1456,14 +1437,12 @@ AC_SUBST([am__leading_dot])])
|
|||
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
||||
# From Jim Meyering
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_MAINTAINER_MODE([DEFAULT-MODE])
|
||||
# ----------------------------------
|
||||
# Control maintainer-specific portions of Makefiles.
|
||||
|
|
@ -1491,18 +1470,14 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
|||
]
|
||||
)
|
||||
|
||||
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
|
|
@ -1545,14 +1520,12 @@ AC_MSG_RESULT([$_am_result])
|
|||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
|
|
@ -1581,14 +1554,12 @@ m4_define([AC_PROG_CC],
|
|||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
|
|
@ -1596,11 +1567,10 @@ AC_DEFUN([AM_MISSING_PROG],
|
|||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
# Define MISSING if not defined so far and test if it is modern enough.
|
||||
# If it is, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
|
|
@ -1613,8 +1583,8 @@ if test x"${MISSING+set}" != xset; then
|
|||
esac
|
||||
fi
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
if eval "$MISSING --is-lightweight"; then
|
||||
am_missing_run="$MISSING "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN(['missing' script is too old or missing])
|
||||
|
|
@ -1623,14 +1593,12 @@ fi
|
|||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
|
|
@ -1656,14 +1624,12 @@ AC_DEFUN([_AM_IF_OPTION],
|
|||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 9
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
|
|
@ -1739,13 +1705,71 @@ AC_CONFIG_COMMANDS_PRE(
|
|||
rm -f conftest.file
|
||||
])
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
# AM_SILENT_RULES([DEFAULT])
|
||||
# --------------------------
|
||||
# Enable less verbose build rules; with the default set to DEFAULT
|
||||
# ("yes" being less verbose, "no" or empty being verbose).
|
||||
AC_DEFUN([AM_SILENT_RULES],
|
||||
[AC_ARG_ENABLE([silent-rules], [dnl
|
||||
AS_HELP_STRING(
|
||||
[--enable-silent-rules],
|
||||
[less verbose build output (undo: "make V=1")])
|
||||
AS_HELP_STRING(
|
||||
[--disable-silent-rules],
|
||||
[verbose build output (undo: "make V=0")])dnl
|
||||
])
|
||||
case $enable_silent_rules in @%:@ (((
|
||||
yes) AM_DEFAULT_VERBOSITY=0;;
|
||||
no) AM_DEFAULT_VERBOSITY=1;;
|
||||
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
|
||||
esac
|
||||
dnl
|
||||
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
|
||||
dnl do not support nested variable expansions.
|
||||
dnl See automake bug#9928 and bug#10237.
|
||||
am_make=${MAKE-make}
|
||||
AC_CACHE_CHECK([whether $am_make supports nested variables],
|
||||
[am_cv_make_support_nested_variables],
|
||||
[if AS_ECHO([['TRUE=$(BAR$(V))
|
||||
BAR0=false
|
||||
BAR1=true
|
||||
V=1
|
||||
am__doit:
|
||||
@$(TRUE)
|
||||
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
|
||||
am_cv_make_support_nested_variables=yes
|
||||
else
|
||||
am_cv_make_support_nested_variables=no
|
||||
fi])
|
||||
if test $am_cv_make_support_nested_variables = yes; then
|
||||
dnl Using '$V' instead of '$(V)' breaks IRIX make.
|
||||
AM_V='$(V)'
|
||||
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
|
||||
else
|
||||
AM_V=$AM_DEFAULT_VERBOSITY
|
||||
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
|
||||
fi
|
||||
AC_SUBST([AM_V])dnl
|
||||
AM_SUBST_NOTMAKE([AM_V])dnl
|
||||
AC_SUBST([AM_DEFAULT_V])dnl
|
||||
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
|
||||
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
|
||||
AM_BACKSLASH='\'
|
||||
AC_SUBST([AM_BACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
|
|
@ -1769,14 +1793,12 @@ fi
|
|||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
|
|
@ -1790,14 +1812,12 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
|||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
|
|
@ -1811,76 +1831,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
|||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
#
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility. Yes, it's still used
|
||||
# in the wild :-( We should find a proper way to deprecate it ...
|
||||
AC_SUBST([AMTAR], ['$${TAR-tar}'])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
|
||||
# We'll loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of '-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
[m4_case([$1],
|
||||
[ustar],
|
||||
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
|
||||
# There is notably a 21 bits limit for the UID and the GID. In fact,
|
||||
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
|
||||
# and bug#13588).
|
||||
am_max_uid=2097151 # 2^21 - 1
|
||||
am_max_gid=$am_max_uid
|
||||
# The $UID and $GID variables are not portable, so we need to resort
|
||||
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
|
||||
# below are definitely unexpected, so allow the users to see them
|
||||
# (that is, avoid stderr redirection).
|
||||
am_uid=`id -u || echo unknown`
|
||||
am_gid=`id -g || echo unknown`
|
||||
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
|
||||
if test $am_uid -le $am_max_uid; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
_am_tools=none
|
||||
fi
|
||||
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
|
||||
if test $am_gid -le $am_max_gid; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
_am_tools=none
|
||||
fi],
|
||||
|
||||
[pax],
|
||||
[],
|
||||
|
||||
[m4_fatal([Unknown tar format])])
|
||||
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
|
||||
# Go ahead even if we have the value already cached. We do so because we
|
||||
# need to set the values for the 'am__tar' and 'am__untar' variables.
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
|
||||
for _am_tool in $_am_tools; do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar; do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works.
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
AM_RUN_LOG([cat conftest.dir/file])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
#!/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"
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2009-10-06.20; # UTC
|
||||
scriptversion=2012-10-14.11; # UTC
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -29,21 +28,224 @@ scriptversion=2009-10-06.20; # UTC
|
|||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
|
|
@ -53,11 +255,13 @@ EOF
|
|||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
|
|
@ -66,8 +270,8 @@ do
|
|||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
|
|
@ -94,10 +298,10 @@ do
|
|||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
|
@ -106,7 +310,7 @@ fi
|
|||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# 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
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
|
|
|
|||
151
Modules/_ctypes/libffi/config.guess
vendored
151
Modules/_ctypes/libffi/config.guess
vendored
|
|
@ -1,10 +1,8 @@
|
|||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2012-12-29'
|
||||
timestamp='2013-06-10'
|
||||
|
||||
# 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
|
||||
|
|
@ -26,7 +24,7 @@ timestamp='2012-12-29'
|
|||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
#
|
||||
# Originally written by Per Bothner.
|
||||
# Originally written by Per Bothner.
|
||||
#
|
||||
# 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
|
||||
|
|
@ -52,9 +50,7 @@ version="\
|
|||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||
2012, 2013 Free Software Foundation, Inc.
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
|
@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
|||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
case "${UNAME_SYSTEM}" in
|
||||
Linux|GNU|GNU/*)
|
||||
# If the system lacks a compiler, then just pick glibc.
|
||||
# We could probably try harder.
|
||||
LIBC=gnu
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat <<-EOF > $dummy.c
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
#elif defined(__dietlibc__)
|
||||
LIBC=dietlibc
|
||||
#else
|
||||
LIBC=gnu
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
|
|
@ -857,21 +874,21 @@ EOF
|
|||
exit ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
|
||||
exit ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
aarch64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
|
|
@ -884,59 +901,54 @@ EOF
|
|||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arc:Linux:*:* | arceb:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
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-${LIBC}eabi
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
hexagon:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
|
|
@ -955,54 +967,63 @@ EOF
|
|||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
;;
|
||||
or1k:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
or32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
echo sparc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
echo hppa64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
||||
esac
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
echo powerpc64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
echo powerpc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc64le:Linux:*:*)
|
||||
echo powerpc64le-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppcle:Linux:*:*)
|
||||
echo powerpcle-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
tile*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
|
|
@ -1235,19 +1256,21 @@ EOF
|
|||
exit ;;
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
if test "$UNAME_PROCESSOR" = unknown ; then
|
||||
UNAME_PROCESSOR=powerpc
|
||||
fi
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
case $UNAME_PROCESSOR in
|
||||
i386) UNAME_PROCESSOR=x86_64 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc64 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
|
|
|
|||
32
Modules/_ctypes/libffi/config.sub
vendored
32
Modules/_ctypes/libffi/config.sub
vendored
|
|
@ -1,10 +1,8 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2012-12-29'
|
||||
timestamp='2013-04-24'
|
||||
|
||||
# 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
|
||||
|
|
@ -70,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||
2012, 2013 Free Software Foundation, Inc.
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
|
@ -256,7 +252,7 @@ case $basic_machine in
|
|||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| be32 | be64 \
|
||||
|
|
@ -290,16 +286,17 @@ case $basic_machine in
|
|||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| open8 \
|
||||
| or32 \
|
||||
| or1k | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
|
|
@ -369,7 +366,7 @@ case $basic_machine in
|
|||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
|
|
@ -407,12 +404,13 @@ case $basic_machine in
|
|||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| orion-* \
|
||||
|
|
@ -1008,7 +1006,7 @@ case $basic_machine in
|
|||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
|
|
@ -1354,7 +1352,7 @@ case $os in
|
|||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
|
|
@ -1500,9 +1498,6 @@ case $os in
|
|||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
|
|
@ -1594,6 +1589,9 @@ case $basic_machine in
|
|||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or1k-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
|
|
|
|||
5747
Modules/_ctypes/libffi/configure
vendored
5747
Modules/_ctypes/libffi/configure
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -5,13 +5,17 @@ dnl Process this with autoconf to create configure
|
|||
|
||||
AC_PREREQ(2.68)
|
||||
|
||||
AC_INIT([libffi], [3.0.13], [http://github.com/atgreen/libffi/issues])
|
||||
AC_INIT([libffi], [3.1], [http://github.com/atgreen/libffi/issues])
|
||||
AC_CONFIG_HEADERS([fficonfig.h])
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
target_alias=${target_alias-$host_alias}
|
||||
|
||||
. ${srcdir}/configure.host
|
||||
case "${host}" in
|
||||
frv*-elf)
|
||||
LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
|
||||
;;
|
||||
esac
|
||||
|
||||
AX_ENABLE_BUILDDIR
|
||||
|
||||
|
|
@ -28,6 +32,7 @@ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
|||
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
||||
save_CFLAGS=$CFLAGS
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
CFLAGS=$save_CFLAGS
|
||||
m4_undefine([_AC_ARG_VAR_PRECIOUS])
|
||||
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
||||
|
|
@ -52,13 +57,13 @@ fi
|
|||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
CFLAGS="$CFLAGS -fexceptions"
|
||||
touch local.exp
|
||||
else
|
||||
cat > local.exp <<EOF
|
||||
set CC_FOR_TARGET "$CC"
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat > local.exp <<EOF
|
||||
set CC_FOR_TARGET "$CC"
|
||||
set CXX_FOR_TARGET "$CXX"
|
||||
EOF
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_CHECK_HEADERS(sys/mman.h)
|
||||
|
|
@ -69,6 +74,7 @@ dnl The -no-testsuite modules omit the test subdir.
|
|||
AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
|
||||
|
||||
TARGETDIR="unknown"
|
||||
HAVE_LONG_DOUBLE_VARIANT=0
|
||||
case "$host" in
|
||||
aarch64*-*-*)
|
||||
TARGET=AARCH64; TARGETDIR=aarch64
|
||||
|
|
@ -80,6 +86,10 @@ case "$host" in
|
|||
HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
|
||||
;;
|
||||
|
||||
arc*-*-*)
|
||||
TARGET=ARC; TARGETDIR=arc
|
||||
;;
|
||||
|
||||
arm*-*-*)
|
||||
TARGET=ARM; TARGETDIR=arm
|
||||
;;
|
||||
|
|
@ -137,6 +147,9 @@ case "$host" in
|
|||
AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
|
||||
fi
|
||||
;;
|
||||
i*86-*-nto-qnx*)
|
||||
TARGET=X86; TARGETDIR=x86
|
||||
;;
|
||||
i?86-*-darwin*)
|
||||
TARGET=X86_DARWIN; TARGETDIR=x86
|
||||
;;
|
||||
|
|
@ -149,10 +162,6 @@ case "$host" in
|
|||
fi
|
||||
;;
|
||||
|
||||
i*86-*-nto-qnx*)
|
||||
TARGET=X86; TARGETDIR=x86
|
||||
;;
|
||||
|
||||
x86_64-*-darwin*)
|
||||
TARGET=X86_DARWIN; TARGETDIR=x86
|
||||
;;
|
||||
|
|
@ -198,6 +207,10 @@ case "$host" in
|
|||
TARGET=M68K; TARGETDIR=m68k
|
||||
;;
|
||||
|
||||
m88k-*-*)
|
||||
TARGET=M88K; TARGETDIR=m88k
|
||||
;;
|
||||
|
||||
microblaze*-*-*)
|
||||
TARGET=MICROBLAZE; TARGETDIR=microblaze
|
||||
;;
|
||||
|
|
@ -213,14 +226,19 @@ case "$host" in
|
|||
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
|
||||
TARGET=MIPS_IRIX; TARGETDIR=mips
|
||||
;;
|
||||
mips*-*-linux* | mips*-*-openbsd*)
|
||||
mips*-*linux* | mips*-*-openbsd*)
|
||||
# Support 128-bit long double for NewABI.
|
||||
HAVE_LONG_DOUBLE='defined(__mips64)'
|
||||
TARGET=MIPS_IRIX; TARGETDIR=mips
|
||||
TARGET=MIPS_LINUX; TARGETDIR=mips
|
||||
;;
|
||||
|
||||
nios2*-linux*)
|
||||
TARGET=NIOS2; TARGETDIR=nios2
|
||||
;;
|
||||
|
||||
powerpc*-*-linux* | powerpc-*-sysv*)
|
||||
TARGET=POWERPC; TARGETDIR=powerpc
|
||||
HAVE_LONG_DOUBLE_VARIANT=1
|
||||
;;
|
||||
powerpc-*-amigaos*)
|
||||
TARGET=POWERPC; TARGETDIR=powerpc
|
||||
|
|
@ -236,6 +254,7 @@ case "$host" in
|
|||
;;
|
||||
powerpc-*-freebsd* | powerpc-*-openbsd*)
|
||||
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
|
||||
HAVE_LONG_DOUBLE_VARIANT=1
|
||||
;;
|
||||
powerpc64-*-freebsd*)
|
||||
TARGET=POWERPC; TARGETDIR=powerpc
|
||||
|
|
@ -263,6 +282,10 @@ case "$host" in
|
|||
TARGET=TILE; TARGETDIR=tile
|
||||
;;
|
||||
|
||||
vax-*-*)
|
||||
TARGET=VAX; TARGETDIR=vax
|
||||
;;
|
||||
|
||||
xtensa*-*)
|
||||
TARGET=XTENSA; TARGETDIR=xtensa
|
||||
;;
|
||||
|
|
@ -284,18 +307,23 @@ AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
|
|||
AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
|
||||
AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
|
||||
AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
|
||||
AM_CONDITIONAL(X86_DARWIN32, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4)
|
||||
AM_CONDITIONAL(X86_DARWIN64, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8)
|
||||
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
|
||||
AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
|
||||
AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
|
||||
AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
|
||||
AM_CONDITIONAL(M88K, test x$TARGET = xM88K)
|
||||
AM_CONDITIONAL(MICROBLAZE, test x$TARGET = xMICROBLAZE)
|
||||
AM_CONDITIONAL(METAG, test x$TARGET = xMETAG)
|
||||
AM_CONDITIONAL(MOXIE, test x$TARGET = xMOXIE)
|
||||
AM_CONDITIONAL(NIOS2, test x$TARGET = xNIOS2)
|
||||
AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
|
||||
AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
|
||||
AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
|
||||
AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD)
|
||||
AM_CONDITIONAL(AARCH64, test x$TARGET = xAARCH64)
|
||||
AM_CONDITIONAL(ARC, test x$TARGET = xARC)
|
||||
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
|
||||
AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32)
|
||||
AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS)
|
||||
|
|
@ -308,6 +336,7 @@ AM_CONDITIONAL(PA_LINUX, test x$TARGET = xPA_LINUX)
|
|||
AM_CONDITIONAL(PA_HPUX, test x$TARGET = xPA_HPUX)
|
||||
AM_CONDITIONAL(PA64_HPUX, test x$TARGET = xPA64_HPUX)
|
||||
AM_CONDITIONAL(TILE, test x$TARGET = xTILE)
|
||||
AM_CONDITIONAL(VAX, test x$TARGET = xVAX)
|
||||
AM_CONDITIONAL(XTENSA, test x$TARGET = xXTENSA)
|
||||
|
||||
AC_HEADER_STDC
|
||||
|
|
@ -320,14 +349,20 @@ AC_CHECK_SIZEOF(long double)
|
|||
# Also AC_SUBST this variable for ffi.h.
|
||||
if test -z "$HAVE_LONG_DOUBLE"; then
|
||||
HAVE_LONG_DOUBLE=0
|
||||
if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
|
||||
if test $ac_cv_sizeof_long_double != 0; then
|
||||
if test $ac_cv_sizeof_long_double != 0; then
|
||||
if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
|
||||
AC_DEFINE(HAVE_LONG_DOUBLE_VARIANT, 1, [Define if you support more than one size of the long double type])
|
||||
HAVE_LONG_DOUBLE=1
|
||||
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
|
||||
else
|
||||
if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
|
||||
HAVE_LONG_DOUBLE=1
|
||||
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(HAVE_LONG_DOUBLE)
|
||||
AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
|
|
@ -413,11 +448,9 @@ AC_ARG_ENABLE(pax_emutramp,
|
|||
[Define this if you want to enable pax emulated trampolines])
|
||||
fi)
|
||||
|
||||
if test x$TARGET = xX86_WIN64; then
|
||||
LT_SYS_SYMBOL_USCORE
|
||||
if test "x$sys_symbol_underscore" = xyes; then
|
||||
AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
|
||||
fi
|
||||
LT_SYS_SYMBOL_USCORE
|
||||
if test "x$sys_symbol_underscore" = xyes; then
|
||||
AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
|
||||
fi
|
||||
|
||||
FFI_EXEC_TRAMPOLINE_TABLE=0
|
||||
|
|
@ -438,12 +471,28 @@ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
|
|||
AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
|
||||
|
||||
if test x$TARGET = xX86_64; then
|
||||
AC_CACHE_CHECK([assembler supports unwind section type],
|
||||
AC_CACHE_CHECK([toolchain supports unwind section type],
|
||||
libffi_cv_as_x86_64_unwind_section_type, [
|
||||
libffi_cv_as_x86_64_unwind_section_type=yes
|
||||
echo '.section .eh_frame,"a",@unwind' > conftest.s
|
||||
if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
|
||||
libffi_cv_as_x86_64_unwind_section_type=no
|
||||
cat > conftest1.s << EOF
|
||||
.text
|
||||
.globl foo
|
||||
foo:
|
||||
jmp bar
|
||||
.section .eh_frame,"a",@unwind
|
||||
bar:
|
||||
EOF
|
||||
|
||||
cat > conftest2.c << EOF
|
||||
extern void foo();
|
||||
int main(){foo();}
|
||||
EOF
|
||||
|
||||
libffi_cv_as_x86_64_unwind_section_type=no
|
||||
# we ensure that we can compile _and_ link an assembly file containing an @unwind section
|
||||
# since the compiler can support it and not the linker (ie old binutils)
|
||||
if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
|
||||
$CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
|
||||
libffi_cv_as_x86_64_unwind_section_type=yes
|
||||
fi
|
||||
])
|
||||
if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
|
||||
|
|
@ -526,14 +575,14 @@ AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
|
|||
AC_ARG_ENABLE(structs,
|
||||
[ --disable-structs omit code for struct support],
|
||||
if test "$enable_structs" = "no"; then
|
||||
AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this is you do not want support for aggregate types.])
|
||||
AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.])
|
||||
fi)
|
||||
AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
|
||||
|
||||
AC_ARG_ENABLE(raw-api,
|
||||
[ --disable-raw-api make the raw api unavailable],
|
||||
if test "$enable_raw_api" = "no"; then
|
||||
AC_DEFINE(FFI_NO_RAW_API, 1, [Define this is you do not want support for the raw API.])
|
||||
AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.])
|
||||
fi)
|
||||
|
||||
AC_ARG_ENABLE(purify-safety,
|
||||
|
|
@ -553,7 +602,7 @@ if test "x$GCC" = "xyes"; then
|
|||
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
||||
toolexeclibdir='$(libdir)'
|
||||
fi
|
||||
multi_os_directory=`$CC -print-multi-os-directory`
|
||||
multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
|
||||
case $multi_os_directory in
|
||||
.) ;; # Avoid trailing /.
|
||||
../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
# configure.host
|
||||
#
|
||||
# This shell script handles all host based configuration for libffi.
|
||||
#
|
||||
|
||||
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
|
||||
case "${host}" in
|
||||
frv*-elf)
|
||||
LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
scriptversion=2013-05-30.07; # UTC
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
|
||||
# Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -28,9 +27,9 @@ scriptversion=2009-04-28.21; # UTC
|
|||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
|
@ -40,11 +39,11 @@ as side-effects.
|
|||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
|
|
@ -57,6 +56,66 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
|
|
@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
|
|
@ -80,18 +142,32 @@ if test "$depmode" = hp; then
|
|||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u="sed s,\\\\\\\\,/,g"
|
||||
depmode=msvisualcpp
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
|
|
@ -114,8 +190,7 @@ gcc3)
|
|||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
|
@ -123,13 +198,17 @@ gcc3)
|
|||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
|
|
@ -137,31 +216,31 @@ gcc)
|
|||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
|
@ -179,8 +258,7 @@ sgi)
|
|||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
|
@ -188,43 +266,41 @@ sgi)
|
|||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> "$depfile"
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
|
|
@ -237,9 +313,7 @@ aix)
|
|||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
|
@ -248,44 +322,100 @@ aix)
|
|||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
|
@ -297,8 +427,8 @@ icc)
|
|||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
|
@ -309,9 +439,8 @@ hp2)
|
|||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
|
|
@ -322,8 +451,7 @@ hp2)
|
|||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
|
@ -333,77 +461,107 @@ hp2)
|
|||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
|
|
@ -422,7 +580,7 @@ dashmstdout)
|
|||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
|
|
@ -442,18 +600,18 @@ dashmstdout)
|
|||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
|
@ -503,12 +661,15 @@ makedepend)
|
|||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
|
|
@ -525,7 +686,7 @@ cpp)
|
|||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
|
|
@ -544,10 +705,10 @@ cpp)
|
|||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
|
|
@ -579,23 +740,23 @@ msvisualcpp)
|
|||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
This is ../libffi/doc/libffi.info, produced by makeinfo version 4.13
|
||||
from ../libffi/doc/libffi.texi.
|
||||
This is libffi.info, produced by makeinfo version 5.1 from libffi.texi.
|
||||
|
||||
This manual is for Libffi, a portable foreign-function interface
|
||||
library.
|
||||
|
|
@ -8,10 +7,9 @@ library.
|
|||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or
|
||||
(at your option) any later version. A copy of the license is
|
||||
included in the section entitled "GNU General Public License".
|
||||
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version. A copy of the license is included
|
||||
in the section entitled "GNU General Public License".
|
||||
|
||||
INFO-DIR-SECTION Development
|
||||
START-INFO-DIR-ENTRY
|
||||
|
|
@ -31,10 +29,9 @@ library.
|
|||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or
|
||||
(at your option) any later version. A copy of the license is
|
||||
included in the section entitled "GNU General Public License".
|
||||
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version. A copy of the license is included
|
||||
in the section entitled "GNU General Public License".
|
||||
|
||||
* Menu:
|
||||
|
||||
|
|
@ -56,25 +53,25 @@ The calling convention is a set of assumptions made by the compiler
|
|||
about where function arguments will be found on entry to a function. A
|
||||
calling convention also specifies where the return value for a function
|
||||
is found. The calling convention is also sometimes called the "ABI" or
|
||||
"Application Binary Interface".
|
||||
"Application Binary Interface".
|
||||
|
||||
Some programs may not know at the time of compilation what arguments
|
||||
are to be passed to a function. For instance, an interpreter may be
|
||||
told at run-time about the number and types of arguments used to call a
|
||||
given function. `Libffi' can be used in such programs to provide a
|
||||
given function. 'Libffi' can be used in such programs to provide a
|
||||
bridge from the interpreter program to compiled code.
|
||||
|
||||
The `libffi' library provides a portable, high level programming
|
||||
The 'libffi' library provides a portable, high level programming
|
||||
interface to various calling conventions. This allows a programmer to
|
||||
call any function specified by a call interface description at run time.
|
||||
|
||||
FFI stands for Foreign Function Interface. A foreign function
|
||||
interface is the popular name for the interface that allows code
|
||||
written in one language to call code written in another language. The
|
||||
`libffi' library really only provides the lowest, machine dependent
|
||||
layer of a fully featured foreign function interface. A layer must
|
||||
exist above `libffi' that handles type conversions for values passed
|
||||
between the two languages.
|
||||
interface is the popular name for the interface that allows code written
|
||||
in one language to call code written in another language. The 'libffi'
|
||||
library really only provides the lowest, machine dependent layer of a
|
||||
fully featured foreign function interface. A layer must exist above
|
||||
'libffi' that handles type conversions for values passed between the two
|
||||
languages.
|
||||
|
||||
|
||||
File: libffi.info, Node: Using libffi, Next: Missing Features, Prev: Introduction, Up: Top
|
||||
|
|
@ -97,45 +94,45 @@ File: libffi.info, Node: The Basics, Next: Simple Example, Up: Using libffi
|
|||
2.1 The Basics
|
||||
==============
|
||||
|
||||
`Libffi' assumes that you have a pointer to the function you wish to
|
||||
'Libffi' assumes that you have a pointer to the function you wish to
|
||||
call and that you know the number and types of arguments to pass it, as
|
||||
well as the return type of the function.
|
||||
|
||||
The first thing you must do is create an `ffi_cif' object that
|
||||
The first thing you must do is create an 'ffi_cif' object that
|
||||
matches the signature of the function you wish to call. This is a
|
||||
separate step because it is common to make multiple calls using a
|
||||
single `ffi_cif'. The "cif" in `ffi_cif' stands for Call InterFace.
|
||||
To prepare a call interface object, use the function `ffi_prep_cif'.
|
||||
separate step because it is common to make multiple calls using a single
|
||||
'ffi_cif'. The "cif" in 'ffi_cif' stands for Call InterFace. To
|
||||
prepare a call interface object, use the function 'ffi_prep_cif'.
|
||||
|
||||
-- Function: ffi_status ffi_prep_cif (ffi_cif *CIF, ffi_abi ABI,
|
||||
unsigned int NARGS, ffi_type *RTYPE, ffi_type **ARGTYPES)
|
||||
This initializes CIF according to the given parameters.
|
||||
|
||||
ABI is the ABI to use; normally `FFI_DEFAULT_ABI' is what you
|
||||
want. *note Multiple ABIs:: for more information.
|
||||
ABI is the ABI to use; normally 'FFI_DEFAULT_ABI' is what you want.
|
||||
*note Multiple ABIs:: for more information.
|
||||
|
||||
NARGS is the number of arguments that this function accepts.
|
||||
|
||||
RTYPE is a pointer to an `ffi_type' structure that describes the
|
||||
RTYPE is a pointer to an 'ffi_type' structure that describes the
|
||||
return type of the function. *Note Types::.
|
||||
|
||||
ARGTYPES is a vector of `ffi_type' pointers. ARGTYPES must have
|
||||
ARGTYPES is a vector of 'ffi_type' pointers. ARGTYPES must have
|
||||
NARGS elements. If NARGS is 0, this argument is ignored.
|
||||
|
||||
`ffi_prep_cif' returns a `libffi' status code, of type
|
||||
`ffi_status'. This will be either `FFI_OK' if everything worked
|
||||
properly; `FFI_BAD_TYPEDEF' if one of the `ffi_type' objects is
|
||||
incorrect; or `FFI_BAD_ABI' if the ABI parameter is invalid.
|
||||
'ffi_prep_cif' returns a 'libffi' status code, of type
|
||||
'ffi_status'. This will be either 'FFI_OK' if everything worked
|
||||
properly; 'FFI_BAD_TYPEDEF' if one of the 'ffi_type' objects is
|
||||
incorrect; or 'FFI_BAD_ABI' if the ABI parameter is invalid.
|
||||
|
||||
If the function being called is variadic (varargs) then
|
||||
`ffi_prep_cif_var' must be used instead of `ffi_prep_cif'.
|
||||
'ffi_prep_cif_var' must be used instead of 'ffi_prep_cif'.
|
||||
|
||||
-- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi
|
||||
varabi, unsigned int NFIXEDARGS, unsigned int varntotalargs,
|
||||
ffi_type *RTYPE, ffi_type **ARGTYPES)
|
||||
-- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi varabi,
|
||||
unsigned int NFIXEDARGS, unsigned int varntotalargs, ffi_type
|
||||
*RTYPE, ffi_type **ARGTYPES)
|
||||
This initializes CIF according to the given parameters for a call
|
||||
to a variadic function. In general it's operation is the same as
|
||||
for `ffi_prep_cif' except that:
|
||||
for 'ffi_prep_cif' except that:
|
||||
|
||||
NFIXEDARGS is the number of fixed arguments, prior to any variadic
|
||||
arguments. It must be greater than zero.
|
||||
|
|
@ -146,27 +143,26 @@ To prepare a call interface object, use the function `ffi_prep_cif'.
|
|||
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 `ffi_prep_cif_var' with
|
||||
Also note that a call to 'ffi_prep_cif_var' with
|
||||
NFIXEDARGS=NOTOTALARGS is NOT equivalent to a call to
|
||||
`ffi_prep_cif'.
|
||||
'ffi_prep_cif'.
|
||||
|
||||
|
||||
To call a function using an initialized `ffi_cif', use the
|
||||
`ffi_call' function:
|
||||
To call a function using an initialized 'ffi_cif', use the 'ffi_call'
|
||||
function:
|
||||
|
||||
-- Function: void ffi_call (ffi_cif *CIF, void *FN, void *RVALUE, void
|
||||
**AVALUES)
|
||||
This calls the function FN according to the description given in
|
||||
CIF. CIF must have already been prepared using `ffi_prep_cif'.
|
||||
CIF. CIF must have already been prepared using 'ffi_prep_cif'.
|
||||
|
||||
RVALUE is a pointer to a chunk of memory that will hold the result
|
||||
of the function call. This must be large enough to hold the
|
||||
result and must be suitably aligned; it is the caller's
|
||||
result, no smaller than the system register size (generally 32 or
|
||||
64 bits), and must be suitably aligned; it is the caller's
|
||||
responsibility to ensure this. If CIF declares that the function
|
||||
returns `void' (using `ffi_type_void'), then RVALUE is ignored.
|
||||
If RVALUE is `NULL', then the return value is discarded.
|
||||
returns 'void' (using 'ffi_type_void'), then RVALUE is ignored.
|
||||
|
||||
AVALUES is a vector of `void *' pointers that point to the memory
|
||||
AVALUES is a vector of 'void *' pointers that point to the memory
|
||||
locations holding the argument values for a call. If CIF declares
|
||||
that the function has no arguments (i.e., NARGS was 0), then
|
||||
AVALUES is ignored. Note that argument values may be modified by
|
||||
|
|
@ -179,7 +175,7 @@ File: libffi.info, Node: Simple Example, Next: Types, Prev: The Basics, Up:
|
|||
2.2 Simple Example
|
||||
==================
|
||||
|
||||
Here is a trivial example that calls `puts' a few times.
|
||||
Here is a trivial example that calls 'puts' a few times.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ffi.h>
|
||||
|
|
@ -190,7 +186,7 @@ Here is a trivial example that calls `puts' a few times.
|
|||
ffi_type *args[1];
|
||||
void *values[1];
|
||||
char *s;
|
||||
int rc;
|
||||
ffi_arg rc;
|
||||
|
||||
/* Initialize the argument info vectors */
|
||||
args[0] = &ffi_type_pointer;
|
||||
|
|
@ -198,7 +194,7 @@ Here is a trivial example that calls `puts' a few times.
|
|||
|
||||
/* Initialize the cif */
|
||||
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
||||
&ffi_type_uint, args) == FFI_OK)
|
||||
&ffi_type_sint, args) == FFI_OK)
|
||||
{
|
||||
s = "Hello World!";
|
||||
ffi_call(&cif, puts, &rc, values);
|
||||
|
|
@ -232,80 +228,80 @@ File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types
|
|||
2.3.1 Primitive Types
|
||||
---------------------
|
||||
|
||||
`Libffi' provides a number of built-in type descriptors that can be
|
||||
used to describe argument and return types:
|
||||
'Libffi' provides a number of built-in type descriptors that can be used
|
||||
to describe argument and return types:
|
||||
|
||||
`ffi_type_void'
|
||||
The type `void'. This cannot be used for argument types, only for
|
||||
'ffi_type_void'
|
||||
The type 'void'. This cannot be used for argument types, only for
|
||||
return values.
|
||||
|
||||
`ffi_type_uint8'
|
||||
'ffi_type_uint8'
|
||||
An unsigned, 8-bit integer type.
|
||||
|
||||
`ffi_type_sint8'
|
||||
'ffi_type_sint8'
|
||||
A signed, 8-bit integer type.
|
||||
|
||||
`ffi_type_uint16'
|
||||
'ffi_type_uint16'
|
||||
An unsigned, 16-bit integer type.
|
||||
|
||||
`ffi_type_sint16'
|
||||
'ffi_type_sint16'
|
||||
A signed, 16-bit integer type.
|
||||
|
||||
`ffi_type_uint32'
|
||||
'ffi_type_uint32'
|
||||
An unsigned, 32-bit integer type.
|
||||
|
||||
`ffi_type_sint32'
|
||||
'ffi_type_sint32'
|
||||
A signed, 32-bit integer type.
|
||||
|
||||
`ffi_type_uint64'
|
||||
'ffi_type_uint64'
|
||||
An unsigned, 64-bit integer type.
|
||||
|
||||
`ffi_type_sint64'
|
||||
'ffi_type_sint64'
|
||||
A signed, 64-bit integer type.
|
||||
|
||||
`ffi_type_float'
|
||||
The C `float' type.
|
||||
'ffi_type_float'
|
||||
The C 'float' type.
|
||||
|
||||
`ffi_type_double'
|
||||
The C `double' type.
|
||||
'ffi_type_double'
|
||||
The C 'double' type.
|
||||
|
||||
`ffi_type_uchar'
|
||||
The C `unsigned char' type.
|
||||
'ffi_type_uchar'
|
||||
The C 'unsigned char' type.
|
||||
|
||||
`ffi_type_schar'
|
||||
The C `signed char' type. (Note that there is not an exact
|
||||
equivalent to the C `char' type in `libffi'; ordinarily you should
|
||||
either use `ffi_type_schar' or `ffi_type_uchar' depending on
|
||||
whether `char' is signed.)
|
||||
'ffi_type_schar'
|
||||
The C 'signed char' type. (Note that there is not an exact
|
||||
equivalent to the C 'char' type in 'libffi'; ordinarily you should
|
||||
either use 'ffi_type_schar' or 'ffi_type_uchar' depending on
|
||||
whether 'char' is signed.)
|
||||
|
||||
`ffi_type_ushort'
|
||||
The C `unsigned short' type.
|
||||
'ffi_type_ushort'
|
||||
The C 'unsigned short' type.
|
||||
|
||||
`ffi_type_sshort'
|
||||
The C `short' type.
|
||||
'ffi_type_sshort'
|
||||
The C 'short' type.
|
||||
|
||||
`ffi_type_uint'
|
||||
The C `unsigned int' type.
|
||||
'ffi_type_uint'
|
||||
The C 'unsigned int' type.
|
||||
|
||||
`ffi_type_sint'
|
||||
The C `int' type.
|
||||
'ffi_type_sint'
|
||||
The C 'int' type.
|
||||
|
||||
`ffi_type_ulong'
|
||||
The C `unsigned long' type.
|
||||
'ffi_type_ulong'
|
||||
The C 'unsigned long' type.
|
||||
|
||||
`ffi_type_slong'
|
||||
The C `long' type.
|
||||
'ffi_type_slong'
|
||||
The C 'long' type.
|
||||
|
||||
`ffi_type_longdouble'
|
||||
On platforms that have a C `long double' type, this is defined.
|
||||
On other platforms, it is not.
|
||||
'ffi_type_longdouble'
|
||||
On platforms that have a C 'long double' type, this is defined. On
|
||||
other platforms, it is not.
|
||||
|
||||
`ffi_type_pointer'
|
||||
A generic `void *' pointer. You should use this for all pointers,
|
||||
'ffi_type_pointer'
|
||||
A generic 'void *' pointer. You should use this for all pointers,
|
||||
regardless of their real type.
|
||||
|
||||
Each of these is of type `ffi_type', so you must take the address
|
||||
when passing to `ffi_prep_cif'.
|
||||
Each of these is of type 'ffi_type', so you must take the address
|
||||
when passing to 'ffi_prep_cif'.
|
||||
|
||||
|
||||
File: libffi.info, Node: Structures, Next: Type Example, Prev: Primitive Types, Up: Types
|
||||
|
|
@ -313,24 +309,24 @@ File: libffi.info, Node: Structures, Next: Type Example, Prev: Primitive Type
|
|||
2.3.2 Structures
|
||||
----------------
|
||||
|
||||
Although `libffi' has no special support for unions or bit-fields, it
|
||||
is perfectly happy passing structures back and forth. You must first
|
||||
describe the structure to `libffi' by creating a new `ffi_type' object
|
||||
Although 'libffi' has no special support for unions or bit-fields, it is
|
||||
perfectly happy passing structures back and forth. You must first
|
||||
describe the structure to 'libffi' by creating a new 'ffi_type' object
|
||||
for it.
|
||||
|
||||
-- Data type: ffi_type
|
||||
The `ffi_type' has the following members:
|
||||
`size_t size'
|
||||
This is set by `libffi'; you should initialize it to zero.
|
||||
The 'ffi_type' has the following members:
|
||||
'size_t size'
|
||||
This is set by 'libffi'; you should initialize it to zero.
|
||||
|
||||
`unsigned short alignment'
|
||||
This is set by `libffi'; you should initialize it to zero.
|
||||
'unsigned short alignment'
|
||||
This is set by 'libffi'; you should initialize it to zero.
|
||||
|
||||
`unsigned short type'
|
||||
For a structure, this should be set to `FFI_TYPE_STRUCT'.
|
||||
'unsigned short type'
|
||||
For a structure, this should be set to 'FFI_TYPE_STRUCT'.
|
||||
|
||||
`ffi_type **elements'
|
||||
This is a `NULL'-terminated array of pointers to `ffi_type'
|
||||
'ffi_type **elements'
|
||||
This is a 'NULL'-terminated array of pointers to 'ffi_type'
|
||||
objects. There is one element per field of the struct.
|
||||
|
||||
|
||||
|
|
@ -339,8 +335,8 @@ File: libffi.info, Node: Type Example, Prev: Structures, Up: Types
|
|||
2.3.3 Type Example
|
||||
------------------
|
||||
|
||||
The following example initializes a `ffi_type' object representing the
|
||||
`tm' struct from Linux's `time.h'.
|
||||
The following example initializes a 'ffi_type' object representing the
|
||||
'tm' struct from Linux's 'time.h'.
|
||||
|
||||
Here is how the struct is defined:
|
||||
|
||||
|
|
@ -359,7 +355,7 @@ The following example initializes a `ffi_type' object representing the
|
|||
__const char *__tm_zone__;
|
||||
};
|
||||
|
||||
Here is the corresponding code to describe this struct to `libffi':
|
||||
Here is the corresponding code to describe this struct to 'libffi':
|
||||
|
||||
{
|
||||
ffi_type tm_type;
|
||||
|
|
@ -367,6 +363,7 @@ The following example initializes a `ffi_type' object representing the
|
|||
int i;
|
||||
|
||||
tm_type.size = tm_type.alignment = 0;
|
||||
tm_type.type = FFI_TYPE_STRUCT;
|
||||
tm_type.elements = &tm_type_elements;
|
||||
|
||||
for (i = 0; i < 9; i++)
|
||||
|
|
@ -387,9 +384,9 @@ File: libffi.info, Node: Multiple ABIs, Next: The Closure API, Prev: Types,
|
|||
=================
|
||||
|
||||
A given platform may provide multiple different ABIs at once. For
|
||||
instance, the x86 platform has both `stdcall' and `fastcall' functions.
|
||||
instance, the x86 platform has both 'stdcall' and 'fastcall' functions.
|
||||
|
||||
`libffi' provides some support for this. However, this is
|
||||
'libffi' provides some support for this. However, this is
|
||||
necessarily platform-specific.
|
||||
|
||||
|
||||
|
|
@ -398,32 +395,32 @@ File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Multip
|
|||
2.5 The Closure API
|
||||
===================
|
||||
|
||||
`libffi' also provides a way to write a generic function - a function
|
||||
'libffi' also provides a way to write a generic function - a function
|
||||
that can accept and decode any combination of arguments. This can be
|
||||
useful when writing an interpreter, or to provide wrappers for
|
||||
arbitrary functions.
|
||||
useful when writing an interpreter, or to provide wrappers for arbitrary
|
||||
functions.
|
||||
|
||||
This facility is called the "closure API". Closures are not
|
||||
supported on all platforms; you can check the `FFI_CLOSURES' define to
|
||||
determine whether they are supported on the current platform.
|
||||
This facility is called the "closure API". Closures are not supported
|
||||
on all platforms; you can check the 'FFI_CLOSURES' define to determine
|
||||
whether they are supported on the current platform.
|
||||
|
||||
Because closures work by assembling a tiny function at runtime, they
|
||||
require special allocation on platforms that have a non-executable
|
||||
heap. Memory management for closures is handled by a pair of functions:
|
||||
require special allocation on platforms that have a non-executable heap.
|
||||
Memory management for closures is handled by a pair of functions:
|
||||
|
||||
-- Function: void *ffi_closure_alloc (size_t SIZE, void **CODE)
|
||||
Allocate a chunk of memory holding SIZE bytes. This returns a
|
||||
pointer to the writable address, and sets *CODE to the
|
||||
corresponding executable address.
|
||||
|
||||
SIZE should be sufficient to hold a `ffi_closure' object.
|
||||
SIZE should be sufficient to hold a 'ffi_closure' object.
|
||||
|
||||
-- Function: void ffi_closure_free (void *WRITABLE)
|
||||
Free memory allocated using `ffi_closure_alloc'. The argument is
|
||||
Free memory allocated using 'ffi_closure_alloc'. The argument is
|
||||
the writable address that was returned.
|
||||
|
||||
Once you have allocated the memory for a closure, you must construct
|
||||
a `ffi_cif' describing the function call. Finally you can prepare the
|
||||
a 'ffi_cif' describing the function call. Finally you can prepare the
|
||||
closure function:
|
||||
|
||||
-- Function: ffi_status ffi_prep_closure_loc (ffi_closure *CLOSURE,
|
||||
|
|
@ -431,40 +428,40 @@ closure function:
|
|||
**ARGS, void *USER_DATA), void *USER_DATA, void *CODELOC)
|
||||
Prepare a closure function.
|
||||
|
||||
CLOSURE is the address of a `ffi_closure' object; this is the
|
||||
writable address returned by `ffi_closure_alloc'.
|
||||
CLOSURE is the address of a 'ffi_closure' object; this is the
|
||||
writable address returned by 'ffi_closure_alloc'.
|
||||
|
||||
CIF is the `ffi_cif' describing the function parameters.
|
||||
CIF is the 'ffi_cif' describing the function parameters.
|
||||
|
||||
USER_DATA is an arbitrary datum that is passed, uninterpreted, to
|
||||
your closure function.
|
||||
|
||||
CODELOC is the executable address returned by `ffi_closure_alloc'.
|
||||
CODELOC is the executable address returned by 'ffi_closure_alloc'.
|
||||
|
||||
FUN is the function which will be called when the closure is
|
||||
invoked. It is called with the arguments:
|
||||
CIF
|
||||
The `ffi_cif' passed to `ffi_prep_closure_loc'.
|
||||
CIF
|
||||
The 'ffi_cif' passed to 'ffi_prep_closure_loc'.
|
||||
|
||||
RET
|
||||
RET
|
||||
A pointer to the memory used for the function's return value.
|
||||
FUN must fill this, unless the function is declared as
|
||||
returning `void'.
|
||||
returning 'void'.
|
||||
|
||||
ARGS
|
||||
ARGS
|
||||
A vector of pointers to memory holding the arguments to the
|
||||
function.
|
||||
|
||||
USER_DATA
|
||||
The same USER_DATA that was passed to `ffi_prep_closure_loc'.
|
||||
USER_DATA
|
||||
The same USER_DATA that was passed to 'ffi_prep_closure_loc'.
|
||||
|
||||
`ffi_prep_closure_loc' will return `FFI_OK' if everything went ok,
|
||||
'ffi_prep_closure_loc' will return 'FFI_OK' if everything went ok,
|
||||
and something else on error.
|
||||
|
||||
After calling `ffi_prep_closure_loc', you can cast CODELOC to the
|
||||
After calling 'ffi_prep_closure_loc', you can cast CODELOC to the
|
||||
appropriate pointer-to-function type.
|
||||
|
||||
You may see old code referring to `ffi_prep_closure'. This function
|
||||
You may see old code referring to 'ffi_prep_closure'. This function
|
||||
is deprecated, as it cannot handle the need for separate writable and
|
||||
executable addresses.
|
||||
|
||||
|
|
@ -474,26 +471,28 @@ File: libffi.info, Node: Closure Example, Prev: The Closure API, Up: Using li
|
|||
2.6 Closure Example
|
||||
===================
|
||||
|
||||
A trivial example that creates a new `puts' by binding `fputs' with
|
||||
`stdin'.
|
||||
A trivial example that creates a new 'puts' by binding 'fputs' with
|
||||
'stdout'.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ffi.h>
|
||||
|
||||
/* Acts like puts with the file given at time of enclosure. */
|
||||
void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[],
|
||||
FILE *stream)
|
||||
void puts_binding(ffi_cif *cif, void *ret, void* args[],
|
||||
void *stream)
|
||||
{
|
||||
*ret = fputs(*(char **)args[0], stream);
|
||||
*(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
|
||||
}
|
||||
|
||||
typedef int (*puts_t)(char *);
|
||||
|
||||
int main()
|
||||
{
|
||||
ffi_cif cif;
|
||||
ffi_type *args[1];
|
||||
ffi_closure *closure;
|
||||
|
||||
int (*bound_puts)(char *);
|
||||
void *bound_puts;
|
||||
int rc;
|
||||
|
||||
/* Allocate closure and bound_puts */
|
||||
|
|
@ -506,13 +505,13 @@ A trivial example that creates a new `puts' by binding `fputs' with
|
|||
|
||||
/* Initialize the cif */
|
||||
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
||||
&ffi_type_uint, args) == FFI_OK)
|
||||
&ffi_type_sint, args) == FFI_OK)
|
||||
{
|
||||
/* Initialize the closure, setting stream to stdout */
|
||||
if (ffi_prep_closure_loc(closure, &cif, puts_binding,
|
||||
stdout, bound_puts) == FFI_OK)
|
||||
{
|
||||
rc = bound_puts("Hello World!");
|
||||
rc = ((puts_t)bound_puts)("Hello World!");
|
||||
/* rc now holds the result of the call to fputs */
|
||||
}
|
||||
}
|
||||
|
|
@ -530,7 +529,7 @@ File: libffi.info, Node: Missing Features, Next: Index, Prev: Using libffi,
|
|||
3 Missing Features
|
||||
******************
|
||||
|
||||
`libffi' is missing a few features. We welcome patches to add support
|
||||
'libffi' is missing a few features. We welcome patches to add support
|
||||
for these.
|
||||
|
||||
* Variadic closures.
|
||||
|
|
@ -560,16 +559,18 @@ Index
|
|||
* closure API: The Closure API. (line 13)
|
||||
* closures: The Closure API. (line 13)
|
||||
* FFI: Introduction. (line 31)
|
||||
* ffi_call: The Basics. (line 63)
|
||||
* ffi_call: The Basics. (line 62)
|
||||
* FFI_CLOSURES: The Closure API. (line 13)
|
||||
* ffi_closure_alloc: The Closure API. (line 19)
|
||||
* ffi_closure_free: The Closure API. (line 26)
|
||||
* FFI_CLOSURES: The Closure API. (line 13)
|
||||
* ffi_prep_cif: The Basics. (line 16)
|
||||
* ffi_prep_cif_var: The Basics. (line 39)
|
||||
* ffi_prep_closure_loc: The Closure API. (line 34)
|
||||
* ffi_status <1>: The Closure API. (line 37)
|
||||
* ffi_status: The Basics. (line 18)
|
||||
* ffi_status: The Basics. (line 16)
|
||||
* ffi_status <1>: The Basics. (line 39)
|
||||
* ffi_status <2>: The Closure API. (line 34)
|
||||
* ffi_type: Structures. (line 11)
|
||||
* ffi_type <1>: Structures. (line 11)
|
||||
* ffi_type_double: Primitive Types. (line 41)
|
||||
* ffi_type_float: Primitive Types. (line 38)
|
||||
* ffi_type_longdouble: Primitive Types. (line 71)
|
||||
|
|
@ -592,25 +593,26 @@ Index
|
|||
* ffi_type_ushort: Primitive Types. (line 53)
|
||||
* ffi_type_void: Primitive Types. (line 10)
|
||||
* Foreign Function Interface: Introduction. (line 31)
|
||||
* void <1>: The Closure API. (line 20)
|
||||
* void: The Basics. (line 65)
|
||||
* void: The Basics. (line 62)
|
||||
* void <1>: The Closure API. (line 19)
|
||||
* void <2>: The Closure API. (line 26)
|
||||
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top712
|
||||
Node: Introduction1460
|
||||
Node: Using libffi3096
|
||||
Node: The Basics3582
|
||||
Node: Simple Example7224
|
||||
Node: Types8251
|
||||
Node: Primitive Types8534
|
||||
Node: Structures10354
|
||||
Node: Type Example11224
|
||||
Node: Multiple ABIs12447
|
||||
Node: The Closure API12818
|
||||
Node: Closure Example15762
|
||||
Node: Missing Features17321
|
||||
Node: Index17774
|
||||
Node: Top682
|
||||
Node: Introduction1429
|
||||
Node: Using libffi3061
|
||||
Node: The Basics3547
|
||||
Node: Simple Example7198
|
||||
Node: Types8229
|
||||
Node: Primitive Types8512
|
||||
Node: Structures10333
|
||||
Node: Type Example11207
|
||||
Node: Multiple ABIs12473
|
||||
Node: The Closure API12844
|
||||
Node: Closure Example15788
|
||||
Node: Missing Features17397
|
||||
Node: Index17850
|
||||
|
||||
End Tag Table
|
||||
|
|
|
|||
|
|
@ -184,11 +184,11 @@ This calls the function @var{fn} according to the description given in
|
|||
|
||||
@var{rvalue} is a pointer to a chunk of memory that will hold the
|
||||
result of the function call. This must be large enough to hold the
|
||||
result and must be suitably aligned; it is the caller's responsibility
|
||||
result, no smaller than the system register size (generally 32 or 64
|
||||
bits), and must be suitably aligned; it is the caller's responsibility
|
||||
to ensure this. If @var{cif} declares that the function returns
|
||||
@code{void} (using @code{ffi_type_void}), then @var{rvalue} is
|
||||
ignored. If @var{rvalue} is @samp{NULL}, then the return value is
|
||||
discarded.
|
||||
ignored.
|
||||
|
||||
@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}
|
||||
|
|
@ -214,7 +214,7 @@ int main()
|
|||
ffi_type *args[1];
|
||||
void *values[1];
|
||||
char *s;
|
||||
int rc;
|
||||
ffi_arg rc;
|
||||
|
||||
/* Initialize the argument info vectors */
|
||||
args[0] = &ffi_type_pointer;
|
||||
|
|
@ -222,7 +222,7 @@ int main()
|
|||
|
||||
/* Initialize the cif */
|
||||
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
||||
&ffi_type_uint, args) == FFI_OK)
|
||||
&ffi_type_sint, args) == FFI_OK)
|
||||
@{
|
||||
s = "Hello World!";
|
||||
ffi_call(&cif, puts, &rc, values);
|
||||
|
|
@ -414,6 +414,7 @@ Here is the corresponding code to describe this struct to
|
|||
int i;
|
||||
|
||||
tm_type.size = tm_type.alignment = 0;
|
||||
tm_type.type = FFI_TYPE_STRUCT;
|
||||
tm_type.elements = &tm_type_elements;
|
||||
|
||||
for (i = 0; i < 9; i++)
|
||||
|
|
@ -533,28 +534,30 @@ writable and executable addresses.
|
|||
@section Closure Example
|
||||
|
||||
A trivial example that creates a new @code{puts} by binding
|
||||
@code{fputs} with @code{stdin}.
|
||||
@code{fputs} with @code{stdout}.
|
||||
|
||||
@example
|
||||
#include <stdio.h>
|
||||
#include <ffi.h>
|
||||
|
||||
/* Acts like puts with the file given at time of enclosure. */
|
||||
void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[],
|
||||
FILE *stream)
|
||||
void puts_binding(ffi_cif *cif, void *ret, void* args[],
|
||||
void *stream)
|
||||
@{
|
||||
*ret = fputs(*(char **)args[0], stream);
|
||||
*(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
|
||||
@}
|
||||
|
||||
typedef int (*puts_t)(char *);
|
||||
|
||||
int main()
|
||||
@{
|
||||
ffi_cif cif;
|
||||
ffi_type *args[1];
|
||||
ffi_closure *closure;
|
||||
|
||||
int (*bound_puts)(char *);
|
||||
void *bound_puts;
|
||||
int rc;
|
||||
|
||||
|
||||
/* Allocate closure and bound_puts */
|
||||
closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
|
||||
|
||||
|
|
@ -565,13 +568,13 @@ int main()
|
|||
|
||||
/* Initialize the cif */
|
||||
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
||||
&ffi_type_uint, args) == FFI_OK)
|
||||
&ffi_type_sint, args) == FFI_OK)
|
||||
@{
|
||||
/* Initialize the closure, setting stream to stdout */
|
||||
if (ffi_prep_closure_loc(closure, &cif, puts_binding,
|
||||
if (ffi_prep_closure_loc(closure, &cif, puts_binding,
|
||||
stdout, bound_puts) == FFI_OK)
|
||||
@{
|
||||
rc = bound_puts("Hello World!");
|
||||
rc = ((puts_t)bound_puts)("Hello World!");
|
||||
/* rc now holds the result of the call to fputs */
|
||||
@}
|
||||
@}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@set UPDATED 16 March 2013
|
||||
@set UPDATED-MONTH March 2013
|
||||
@set EDITION 3.0.13
|
||||
@set VERSION 3.0.13
|
||||
@set UPDATED 25 April 2014
|
||||
@set UPDATED-MONTH April 2014
|
||||
@set EDITION 3.1
|
||||
@set VERSION 3.1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@set UPDATED 16 March 2013
|
||||
@set UPDATED-MONTH March 2013
|
||||
@set EDITION 3.0.13
|
||||
@set VERSION 3.0.13
|
||||
@set UPDATED 25 April 2014
|
||||
@set UPDATED-MONTH April 2014
|
||||
@set EDITION 3.1
|
||||
@set VERSION 3.1
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@
|
|||
/* Cannot use malloc on this target, so, we revert to alternative means */
|
||||
#undef FFI_MMAP_EXEC_WRIT
|
||||
|
||||
/* Define this is you do not want support for the raw API. */
|
||||
/* Define this if you do not want support for the raw API. */
|
||||
#undef FFI_NO_RAW_API
|
||||
|
||||
/* Define this is you do not want support for aggregate types. */
|
||||
/* Define this if you do not want support for aggregate types. */
|
||||
#undef FFI_NO_STRUCTS
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
|
|
@ -73,6 +73,9 @@
|
|||
/* Define if you have the long double type and it is bigger than a double */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define if you support more than one size of the long double type */
|
||||
#undef HAVE_LONG_DOUBLE_VARIANT
|
||||
|
||||
/* Define to 1 if you have the `memcpy' function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
|
|
@ -118,8 +121,7 @@
|
|||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
|
|
@ -152,6 +154,9 @@
|
|||
/* The size of `long double', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_DOUBLE
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@ ffi_platforms = {
|
|||
'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
|
||||
'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
|
||||
'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
|
||||
'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
|
||||
'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
|
||||
'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
|
||||
'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
|
||||
'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
|
||||
'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
|
||||
'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
|
||||
'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
|
||||
|
|
|
|||
209
Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
Normal file
209
Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
#!/usr/bin/env python
|
||||
import subprocess
|
||||
import os
|
||||
import errno
|
||||
import collections
|
||||
import glob
|
||||
import argparse
|
||||
|
||||
class Platform(object):
|
||||
pass
|
||||
|
||||
class simulator_platform(Platform):
|
||||
directory = 'darwin_ios'
|
||||
sdk = 'iphonesimulator'
|
||||
arch = 'i386'
|
||||
triple = 'i386-apple-darwin11'
|
||||
version_min = '-miphoneos-version-min=5.1.1'
|
||||
|
||||
prefix = "#ifdef __i386__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
src_dir = 'x86'
|
||||
src_files = ['darwin.S', 'win32.S', 'ffi.c']
|
||||
|
||||
|
||||
class simulator64_platform(Platform):
|
||||
directory = 'darwin_ios'
|
||||
sdk = 'iphonesimulator'
|
||||
arch = 'x86_64'
|
||||
triple = 'x86_64-apple-darwin13'
|
||||
version_min = '-miphoneos-version-min=7.0'
|
||||
|
||||
prefix = "#ifdef __x86_64__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
src_dir = 'x86'
|
||||
src_files = ['darwin64.S', 'ffi64.c']
|
||||
|
||||
|
||||
class device_platform(Platform):
|
||||
directory = 'darwin_ios'
|
||||
sdk = 'iphoneos'
|
||||
arch = 'armv7'
|
||||
triple = 'arm-apple-darwin11'
|
||||
version_min = '-miphoneos-version-min=5.1.1'
|
||||
|
||||
prefix = "#ifdef __arm__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
src_dir = 'arm'
|
||||
src_files = ['sysv.S', 'trampoline.S', 'ffi.c']
|
||||
|
||||
|
||||
class device64_platform(Platform):
|
||||
directory = 'darwin_ios'
|
||||
sdk = 'iphoneos'
|
||||
arch = 'arm64'
|
||||
triple = 'aarch64-apple-darwin13'
|
||||
version_min = '-miphoneos-version-min=7.0'
|
||||
|
||||
prefix = "#ifdef __arm64__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
src_dir = 'aarch64'
|
||||
src_files = ['sysv.S', 'ffi.c']
|
||||
|
||||
|
||||
class desktop32_platform(Platform):
|
||||
directory = 'darwin_osx'
|
||||
sdk = 'macosx'
|
||||
arch = 'i386'
|
||||
triple = 'i386-apple-darwin10'
|
||||
version_min = '-mmacosx-version-min=10.6'
|
||||
src_dir = 'x86'
|
||||
src_files = ['darwin.S', 'win32.S', 'ffi.c']
|
||||
|
||||
prefix = "#ifdef __i386__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
|
||||
|
||||
class desktop64_platform(Platform):
|
||||
directory = 'darwin_osx'
|
||||
sdk = 'macosx'
|
||||
arch = 'x86_64'
|
||||
triple = 'x86_64-apple-darwin10'
|
||||
version_min = '-mmacosx-version-min=10.6'
|
||||
|
||||
prefix = "#ifdef __x86_64__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
src_dir = 'x86'
|
||||
src_files = ['darwin64.S', 'ffi64.c']
|
||||
|
||||
|
||||
def mkdir_p(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc: # Python >2.5
|
||||
if exc.errno == errno.EEXIST:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
|
||||
mkdir_p(dst_dir)
|
||||
out_filename = filename
|
||||
|
||||
if file_suffix:
|
||||
split_name = os.path.splitext(filename)
|
||||
out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
|
||||
|
||||
with open(os.path.join(src_dir, filename)) as in_file:
|
||||
with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
|
||||
if prefix:
|
||||
out_file.write(prefix)
|
||||
|
||||
out_file.write(in_file.read())
|
||||
|
||||
if suffix:
|
||||
out_file.write(suffix)
|
||||
|
||||
|
||||
def list_files(src_dir, pattern=None, filelist=None):
|
||||
if pattern: filelist = glob.iglob(os.path.join(src_dir, pattern))
|
||||
for file in filelist:
|
||||
yield os.path.basename(file)
|
||||
|
||||
|
||||
def copy_files(src_dir, dst_dir, pattern=None, filelist=None, file_suffix=None, prefix=None, suffix=None):
|
||||
for filename in list_files(src_dir, pattern=pattern, filelist=filelist):
|
||||
move_file(src_dir, dst_dir, filename, file_suffix=file_suffix, prefix=prefix, suffix=suffix)
|
||||
|
||||
|
||||
def copy_src_platform_files(platform):
|
||||
src_dir = os.path.join('src', platform.src_dir)
|
||||
dst_dir = os.path.join(platform.directory, 'src', platform.src_dir)
|
||||
copy_files(src_dir, dst_dir, filelist=platform.src_files, file_suffix=platform.arch, prefix=platform.prefix, suffix=platform.suffix)
|
||||
|
||||
|
||||
def build_target(platform, platform_headers):
|
||||
def xcrun_cmd(cmd):
|
||||
return 'xcrun -sdk %s %s -arch %s' % (platform.sdk, cmd, platform.arch)
|
||||
|
||||
tag='%s-%s' % (platform.sdk, platform.arch)
|
||||
build_dir = 'build_%s' % tag
|
||||
mkdir_p(build_dir)
|
||||
env = dict(CC=xcrun_cmd('clang'),
|
||||
LD=xcrun_cmd('ld'),
|
||||
CFLAGS='%s' % (platform.version_min))
|
||||
working_dir = os.getcwd()
|
||||
try:
|
||||
os.chdir(build_dir)
|
||||
subprocess.check_call(['../configure', '-host', platform.triple], env=env)
|
||||
finally:
|
||||
os.chdir(working_dir)
|
||||
|
||||
for src_dir in [build_dir, os.path.join(build_dir, 'include')]:
|
||||
copy_files(src_dir,
|
||||
os.path.join(platform.directory, 'include'),
|
||||
pattern='*.h',
|
||||
file_suffix=platform.arch,
|
||||
prefix=platform.prefix,
|
||||
suffix=platform.suffix)
|
||||
|
||||
for filename in list_files(src_dir, pattern='*.h'):
|
||||
platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix))
|
||||
|
||||
|
||||
def make_tramp():
|
||||
with open('src/arm/trampoline.S', 'w') as tramp_out:
|
||||
p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)
|
||||
p.wait()
|
||||
|
||||
|
||||
def generate_source_and_headers(generate_osx=True, generate_ios=True):
|
||||
copy_files('src', 'darwin_common/src', pattern='*.c')
|
||||
copy_files('include', 'darwin_common/include', pattern='*.h')
|
||||
|
||||
if generate_ios:
|
||||
make_tramp()
|
||||
copy_src_platform_files(simulator_platform)
|
||||
copy_src_platform_files(simulator64_platform)
|
||||
copy_src_platform_files(device_platform)
|
||||
copy_src_platform_files(device64_platform)
|
||||
if generate_osx:
|
||||
copy_src_platform_files(desktop32_platform)
|
||||
copy_src_platform_files(desktop64_platform)
|
||||
|
||||
platform_headers = collections.defaultdict(set)
|
||||
|
||||
if generate_ios:
|
||||
build_target(simulator_platform, platform_headers)
|
||||
build_target(simulator64_platform, platform_headers)
|
||||
build_target(device_platform, platform_headers)
|
||||
build_target(device64_platform, platform_headers)
|
||||
if generate_osx:
|
||||
build_target(desktop32_platform, platform_headers)
|
||||
build_target(desktop64_platform, platform_headers)
|
||||
|
||||
mkdir_p('darwin_common/include')
|
||||
for header_name, tag_tuples in platform_headers.iteritems():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
with open(os.path.join('darwin_common/include', header_name), 'w') as header:
|
||||
for tag_tuple in tag_tuples:
|
||||
header.write('%s#include <%s_%s%s>\n%s\n' % (tag_tuple[0], basename, tag_tuple[1], suffix, tag_tuple[2]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--only-ios', action='store_true', default=False)
|
||||
parser.add_argument('--only-osx', action='store_true', default=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx)
|
||||
|
|
@ -1,160 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
import errno
|
||||
import collections
|
||||
import sys
|
||||
|
||||
class Platform(object):
|
||||
pass
|
||||
|
||||
sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
|
||||
|
||||
def sdkinfo(sdkname):
|
||||
ret = {}
|
||||
for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout:
|
||||
kv = line.strip().split(': ', 1)
|
||||
if len(kv) == 2:
|
||||
k,v = kv
|
||||
ret[k] = v
|
||||
return ret
|
||||
|
||||
sim_sdk_info = sdkinfo('iphonesimulator')
|
||||
device_sdk_info = sdkinfo('iphoneos')
|
||||
|
||||
def latest_sdks():
|
||||
latest_sim = None
|
||||
latest_device = None
|
||||
for line in subprocess.Popen(['xcodebuild', '-showsdks'], stdout=subprocess.PIPE).stdout:
|
||||
match = sdk_re.match(line)
|
||||
if match:
|
||||
if 'Simulator' in line:
|
||||
latest_sim = match.group(1)
|
||||
elif 'iOS' in line:
|
||||
latest_device = match.group(1)
|
||||
|
||||
return latest_sim, latest_device
|
||||
|
||||
sim_sdk, device_sdk = latest_sdks()
|
||||
|
||||
class simulator_platform(Platform):
|
||||
sdk='iphonesimulator'
|
||||
arch = 'i386'
|
||||
name = 'simulator'
|
||||
triple = 'i386-apple-darwin10'
|
||||
sdkroot = sim_sdk_info['Path']
|
||||
|
||||
prefix = "#if !defined(__arm__) && defined(__i386__)\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
|
||||
class device_platform(Platform):
|
||||
sdk='iphoneos'
|
||||
name = 'ios'
|
||||
arch = 'armv7'
|
||||
triple = 'arm-apple-darwin10'
|
||||
sdkroot = device_sdk_info['Path']
|
||||
|
||||
prefix = "#ifdef __arm__\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
|
||||
|
||||
def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
|
||||
if not os.path.exists(dst_dir):
|
||||
os.makedirs(dst_dir)
|
||||
|
||||
out_filename = filename
|
||||
|
||||
if file_suffix:
|
||||
split_name = os.path.splitext(filename)
|
||||
out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
|
||||
|
||||
with open(os.path.join(src_dir, filename)) as in_file:
|
||||
with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
|
||||
if prefix:
|
||||
out_file.write(prefix)
|
||||
|
||||
out_file.write(in_file.read())
|
||||
|
||||
if suffix:
|
||||
out_file.write(suffix)
|
||||
|
||||
headers_seen = collections.defaultdict(set)
|
||||
|
||||
def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None, suffix=None):
|
||||
for root, dirs, files in os.walk(src_dir, followlinks=True):
|
||||
relroot = os.path.relpath(root,src_dir)
|
||||
|
||||
def move_dir(arch, prefix='', suffix='', files=[]):
|
||||
for file in files:
|
||||
file_suffix = None
|
||||
if file.endswith('.h'):
|
||||
if dest_include_dir:
|
||||
file_suffix = arch
|
||||
if arch:
|
||||
headers_seen[file].add(arch)
|
||||
move_file(root, dest_include_dir, file, arch, prefix=prefix, suffix=suffix)
|
||||
|
||||
elif dest_dir:
|
||||
outroot = os.path.join(dest_dir, relroot)
|
||||
move_file(root, outroot, file, prefix=prefix, suffix=suffix)
|
||||
|
||||
if relroot == '.':
|
||||
move_dir(arch=arch,
|
||||
files=files,
|
||||
prefix=prefix,
|
||||
suffix=suffix)
|
||||
elif relroot == 'arm':
|
||||
move_dir(arch='arm',
|
||||
prefix="#ifdef __arm__\n\n",
|
||||
suffix="\n\n#endif",
|
||||
files=files)
|
||||
elif relroot == 'x86':
|
||||
move_dir(arch='i386',
|
||||
prefix="#if !defined(__arm__) && defined(__i386__)\n\n",
|
||||
suffix="\n\n#endif",
|
||||
files=files)
|
||||
|
||||
def build_target(platform):
|
||||
def xcrun_cmd(cmd):
|
||||
return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip()
|
||||
|
||||
build_dir = 'build_' + platform.name
|
||||
if not os.path.exists(build_dir):
|
||||
os.makedirs(build_dir)
|
||||
env = dict(CC=xcrun_cmd('clang'),
|
||||
LD=xcrun_cmd('ld'),
|
||||
CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=4.0' % (platform.arch, platform.sdkroot))
|
||||
working_dir=os.getcwd()
|
||||
try:
|
||||
os.chdir(build_dir)
|
||||
subprocess.check_call(['../configure', '-host', platform.triple], env=env)
|
||||
move_source_tree('.', None, '../ios/include',
|
||||
arch=platform.arch,
|
||||
prefix=platform.prefix,
|
||||
suffix=platform.suffix)
|
||||
move_source_tree('./include', None, '../ios/include',
|
||||
arch=platform.arch,
|
||||
prefix=platform.prefix,
|
||||
suffix=platform.suffix)
|
||||
finally:
|
||||
os.chdir(working_dir)
|
||||
|
||||
for header_name, archs in headers_seen.iteritems():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
|
||||
def main():
|
||||
move_source_tree('src', 'ios/src', 'ios/include')
|
||||
move_source_tree('include', None, 'ios/include')
|
||||
build_target(simulator_platform)
|
||||
build_target(device_platform)
|
||||
|
||||
for header_name, archs in headers_seen.iteritems():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
with open(os.path.join('ios/include', header_name), 'w') as header:
|
||||
for arch in archs:
|
||||
header.write('#include <%s_%s%s>\n' % (basename, arch, suffix))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
import errno
|
||||
import collections
|
||||
import sys
|
||||
|
||||
class Platform(object):
|
||||
pass
|
||||
|
||||
sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
|
||||
|
||||
def sdkinfo(sdkname):
|
||||
ret = {}
|
||||
for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout:
|
||||
kv = line.strip().split(': ', 1)
|
||||
if len(kv) == 2:
|
||||
k,v = kv
|
||||
ret[k] = v
|
||||
return ret
|
||||
|
||||
desktop_sdk_info = sdkinfo('macosx')
|
||||
|
||||
def latest_sdks():
|
||||
latest_desktop = None
|
||||
for line in subprocess.Popen(['xcodebuild', '-showsdks'], stdout=subprocess.PIPE).stdout:
|
||||
match = sdk_re.match(line)
|
||||
if match:
|
||||
if 'OS X' in line:
|
||||
latest_desktop = match.group(1)
|
||||
|
||||
return latest_desktop
|
||||
|
||||
desktop_sdk = latest_sdks()
|
||||
|
||||
class desktop_platform_32(Platform):
|
||||
sdk='macosx'
|
||||
arch = 'i386'
|
||||
name = 'mac32'
|
||||
triple = 'i386-apple-darwin10'
|
||||
sdkroot = desktop_sdk_info['Path']
|
||||
|
||||
prefix = "#if defined(__i386__) && !defined(__x86_64__)\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
|
||||
class desktop_platform_64(Platform):
|
||||
sdk='macosx'
|
||||
arch = 'x86_64'
|
||||
name = 'mac'
|
||||
triple = 'x86_64-apple-darwin10'
|
||||
sdkroot = desktop_sdk_info['Path']
|
||||
|
||||
prefix = "#if !defined(__i386__) && defined(__x86_64__)\n\n"
|
||||
suffix = "\n\n#endif"
|
||||
|
||||
def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
|
||||
if not os.path.exists(dst_dir):
|
||||
os.makedirs(dst_dir)
|
||||
|
||||
out_filename = filename
|
||||
|
||||
if file_suffix:
|
||||
split_name = os.path.splitext(filename)
|
||||
out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
|
||||
|
||||
with open(os.path.join(src_dir, filename)) as in_file:
|
||||
with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
|
||||
if prefix:
|
||||
out_file.write(prefix)
|
||||
|
||||
out_file.write(in_file.read())
|
||||
|
||||
if suffix:
|
||||
out_file.write(suffix)
|
||||
|
||||
headers_seen = collections.defaultdict(set)
|
||||
|
||||
def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None, suffix=None):
|
||||
for root, dirs, files in os.walk(src_dir, followlinks=True):
|
||||
relroot = os.path.relpath(root,src_dir)
|
||||
|
||||
def move_dir(arch, prefix='', suffix='', files=[]):
|
||||
for file in files:
|
||||
file_suffix = None
|
||||
if file.endswith('.h'):
|
||||
if dest_include_dir:
|
||||
file_suffix = arch
|
||||
if arch:
|
||||
headers_seen[file].add(arch)
|
||||
move_file(root, dest_include_dir, file, arch, prefix=prefix, suffix=suffix)
|
||||
|
||||
elif dest_dir:
|
||||
outroot = os.path.join(dest_dir, relroot)
|
||||
move_file(root, outroot, file, prefix=prefix, suffix=suffix)
|
||||
|
||||
if relroot == '.':
|
||||
move_dir(arch=arch,
|
||||
files=files,
|
||||
prefix=prefix,
|
||||
suffix=suffix)
|
||||
elif relroot == 'x86':
|
||||
move_dir(arch='i386',
|
||||
prefix="#if defined(__i386__) && !defined(__x86_64__)\n\n",
|
||||
suffix="\n\n#endif",
|
||||
files=files)
|
||||
move_dir(arch='x86_64',
|
||||
prefix="#if !defined(__i386__) && defined(__x86_64__)\n\n",
|
||||
suffix="\n\n#endif",
|
||||
files=files)
|
||||
|
||||
def build_target(platform):
|
||||
def xcrun_cmd(cmd):
|
||||
return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip()
|
||||
|
||||
build_dir = 'build_' + platform.name
|
||||
if not os.path.exists(build_dir):
|
||||
os.makedirs(build_dir)
|
||||
env = dict(CC=xcrun_cmd('clang'),
|
||||
LD=xcrun_cmd('ld'),
|
||||
CFLAGS='-arch %s -isysroot %s -mmacosx-version-min=10.6' % (platform.arch, platform.sdkroot))
|
||||
working_dir=os.getcwd()
|
||||
try:
|
||||
os.chdir(build_dir)
|
||||
subprocess.check_call(['../configure', '-host', platform.triple], env=env)
|
||||
move_source_tree('.', None, '../osx/include',
|
||||
arch=platform.arch,
|
||||
prefix=platform.prefix,
|
||||
suffix=platform.suffix)
|
||||
move_source_tree('./include', None, '../osx/include',
|
||||
arch=platform.arch,
|
||||
prefix=platform.prefix,
|
||||
suffix=platform.suffix)
|
||||
finally:
|
||||
os.chdir(working_dir)
|
||||
|
||||
for header_name, archs in headers_seen.iteritems():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
|
||||
def main():
|
||||
move_source_tree('src', 'osx/src', 'osx/include')
|
||||
move_source_tree('include', None, 'osx/include')
|
||||
build_target(desktop_platform_32)
|
||||
build_target(desktop_platform_64)
|
||||
|
||||
for header_name, archs in headers_seen.iteritems():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
with open(os.path.join('osx/include', header_name), 'w') as header:
|
||||
for arch in archs:
|
||||
header.write('#include <%s_%s%s>\n' % (basename, arch, suffix))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.12.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.4 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
@ -15,23 +15,51 @@
|
|||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
|
@ -52,7 +80,7 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = include
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/ffi.h.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
|
||||
|
|
@ -75,6 +103,18 @@ mkinstalldirs = $(install_sh) -d
|
|||
CONFIG_HEADER = $(top_builddir)/fficonfig.h
|
||||
CONFIG_CLEAN_FILES = ffi.h ffitarget.h
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
|
@ -111,12 +151,30 @@ am__uninstall_files_from_dir = { \
|
|||
}
|
||||
am__installdirs = "$(DESTDIR)$(includesdir)"
|
||||
HEADERS = $(nodist_includes_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
|
||||
AR = @AR@
|
||||
|
|
@ -132,6 +190,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
|
@ -147,6 +209,7 @@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
|
|||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
|
||||
HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
|
@ -193,6 +256,7 @@ abs_top_builddir = @abs_top_builddir@
|
|||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
|
|
@ -315,26 +379,15 @@ uninstall-nodist_includesHEADERS:
|
|||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(includesdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
|
@ -346,15 +399,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
|
@ -363,9 +412,10 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
|
|
@ -517,18 +567,19 @@ uninstall-am: uninstall-nodist_includesHEADERS
|
|||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool cscopelist ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-nodist_includesHEADERS \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-nodist_includesHEADERS
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool cscopelist-am ctags ctags-am distclean \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man \
|
||||
install-nodist_includesHEADERS install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-nodist_includesHEADERS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
|
|
|||
|
|
@ -221,6 +221,11 @@ typedef struct {
|
|||
#endif
|
||||
} ffi_cif;
|
||||
|
||||
#if HAVE_LONG_DOUBLE_VARIANT
|
||||
/* Used to adjust size/alignment of ffi types. */
|
||||
void ffi_prep_types (ffi_abi abi);
|
||||
# endif
|
||||
|
||||
/* Used internally, but overridden by some architectures */
|
||||
ffi_status ffi_prep_cif_core(ffi_cif *cif,
|
||||
ffi_abi abi,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffi_common.h - Copyright (C) 2011, 2012 Anthony Green
|
||||
ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green
|
||||
Copyright (C) 2007 Free Software Foundation, Inc
|
||||
Copyright (c) 1996 Red Hat, Inc.
|
||||
|
||||
|
|
@ -19,10 +19,14 @@ extern "C" {
|
|||
/* Do not move this. Some versions of AIX are very picky about where
|
||||
this is positioned. */
|
||||
#ifdef __GNUC__
|
||||
/* mingw64 defines this already in malloc.h. */
|
||||
#ifndef alloca
|
||||
# define alloca __builtin_alloca
|
||||
#endif
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
/* mingw64 defines this already in malloc.h. */
|
||||
# ifndef alloca
|
||||
# define alloca __builtin_alloca
|
||||
# endif
|
||||
# endif
|
||||
# define MAYBE_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
# define MAYBE_UNUSED
|
||||
|
|
@ -30,17 +34,17 @@ extern "C" {
|
|||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
# pragma alloca
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
# ifdef _MSC_VER
|
||||
# define alloca _alloca
|
||||
# else
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Check for the existence of memcpy. */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
scriptversion=2011-11-20.07; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
|
|
@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
|
|||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
|
|
@ -156,6 +156,10 @@ while test $# -ne 0; do
|
|||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
|
@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
@ -194,13 +202,17 @@ if test $# -eq 0; then
|
|||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
|
|
@ -228,9 +240,9 @@ fi
|
|||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
|
|
@ -252,12 +264,7 @@ do
|
|||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
|
|
@ -347,7 +354,7 @@ do
|
|||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
|
|
@ -385,7 +392,7 @@ do
|
|||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
|
|
@ -403,7 +410,7 @@ do
|
|||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
toolexeclibdir=@toolexeclibdir@
|
||||
includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
|
||||
|
||||
Name: @PACKAGE_NAME@
|
||||
Description: Library supporting Foreign Function Interfaces
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -lffi
|
||||
Libs: -L${toolexeclibdir} -lffi
|
||||
Cflags: -I${includedir}
|
||||
|
|
|
|||
|
|
@ -7,473 +7,448 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
6C43CBDC1534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBD1534F76F00162364 /* ffi.c */; };
|
||||
6C43CBDD1534F76F00162364 /* sysv.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBF1534F76F00162364 /* sysv.S */; };
|
||||
6C43CBDE1534F76F00162364 /* trampoline.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC01534F76F00162364 /* trampoline.S */; };
|
||||
6C43CBE61534F76F00162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC91534F76F00162364 /* darwin.S */; };
|
||||
6C43CBE81534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBCB1534F76F00162364 /* ffi.c */; };
|
||||
6C43CC1F1534F77800162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC051534F77800162364 /* darwin.S */; };
|
||||
6C43CC201534F77800162364 /* darwin64.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC061534F77800162364 /* darwin64.S */; };
|
||||
6C43CC211534F77800162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC071534F77800162364 /* ffi.c */; };
|
||||
6C43CC221534F77800162364 /* ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC081534F77800162364 /* ffi64.c */; };
|
||||
6C43CC2F1534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; };
|
||||
6C43CC301534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; };
|
||||
6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; };
|
||||
6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; };
|
||||
6C43CC371534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; };
|
||||
6C43CC381534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; };
|
||||
6C43CC391534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; };
|
||||
6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; };
|
||||
6C43CC3B1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; };
|
||||
6C43CC3C1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; };
|
||||
6C43CC971535032600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8D1535032600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CC981535032600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8E1535032600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CC991535032600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8F1535032600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC901535032600162364 /* ffi_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CC9B1535032600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC911535032600162364 /* fficonfig.h */; };
|
||||
6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC921535032600162364 /* fficonfig_i386.h */; };
|
||||
6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC931535032600162364 /* fficonfig_x86_64.h */; };
|
||||
6C43CC9E1535032600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC941535032600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC951535032600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC961535032600162364 /* ffitarget_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCAD1535039600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA21535039600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA31535039600162364 /* ffi_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCAF1535039600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA41535039600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCB01535039600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA51535039600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCB11535039600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA61535039600162364 /* fficonfig.h */; };
|
||||
6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA71535039600162364 /* fficonfig_armv7.h */; };
|
||||
6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA81535039600162364 /* fficonfig_i386.h */; };
|
||||
6C43CCB41535039600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA91535039600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAA1535039600162364 /* ffitarget_arm.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAB1535039600162364 /* ffitarget_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAC1535039600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
DBFA714A187F1D8600A76262 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; };
|
||||
DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713F187F1D8600A76262 /* ffi_common.h */; };
|
||||
DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7140187F1D8600A76262 /* fficonfig.h */; };
|
||||
DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; };
|
||||
DBFA714E187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
|
||||
DBFA714F187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
|
||||
DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
|
||||
DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
|
||||
DBFA7158187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
|
||||
DBFA7159187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
|
||||
DBFA715A187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
|
||||
DBFA715B187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
|
||||
DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; };
|
||||
DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; };
|
||||
DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; };
|
||||
DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; };
|
||||
DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */; };
|
||||
DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */; };
|
||||
DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7174187F1D9B00A76262 /* darwin_i386.S */; };
|
||||
DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; };
|
||||
DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; };
|
||||
DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7182187F1DA100A76262 /* ffi_i386.h */; };
|
||||
DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; };
|
||||
DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7184187F1DA100A76262 /* fficonfig_i386.h */; };
|
||||
DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; };
|
||||
DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7186187F1DA100A76262 /* ffitarget_i386.h */; };
|
||||
DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; };
|
||||
DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */; };
|
||||
DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* darwin_i386.S */; };
|
||||
DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; };
|
||||
DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
DB13B1641849DF1E0010F42D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 8;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
6C43CB3D1534E9D100162364 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6C43CBBD1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
|
||||
6C43CBBF1534F76F00162364 /* sysv.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv.S; sourceTree = "<group>"; };
|
||||
6C43CBC01534F76F00162364 /* trampoline.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline.S; sourceTree = "<group>"; };
|
||||
6C43CBC91534F76F00162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
|
||||
6C43CBCB1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
|
||||
6C43CC051534F77800162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
|
||||
6C43CC061534F77800162364 /* darwin64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64.S; sourceTree = "<group>"; };
|
||||
6C43CC071534F77800162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
|
||||
6C43CC081534F77800162364 /* ffi64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64.c; sourceTree = "<group>"; };
|
||||
6C43CC281534F7BE00162364 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = closures.c; path = src/closures.c; sourceTree = SOURCE_ROOT; };
|
||||
6C43CC2B1534F7BE00162364 /* java_raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = java_raw_api.c; path = src/java_raw_api.c; sourceTree = SOURCE_ROOT; };
|
||||
6C43CC2C1534F7BE00162364 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prep_cif.c; path = src/prep_cif.c; sourceTree = SOURCE_ROOT; };
|
||||
6C43CC2D1534F7BE00162364 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = raw_api.c; path = src/raw_api.c; sourceTree = SOURCE_ROOT; };
|
||||
6C43CC2E1534F7BE00162364 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = types.c; path = src/types.c; sourceTree = SOURCE_ROOT; };
|
||||
6C43CC8D1535032600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
|
||||
6C43CC8E1535032600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
|
||||
6C43CC8F1535032600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
|
||||
6C43CC901535032600162364 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
|
||||
6C43CC911535032600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
|
||||
6C43CC921535032600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
|
||||
6C43CC931535032600162364 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
|
||||
6C43CC941535032600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
|
||||
6C43CC951535032600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
|
||||
6C43CC961535032600162364 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
|
||||
6C43CCA21535039600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
|
||||
6C43CCA31535039600162364 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = "<group>"; };
|
||||
6C43CCA41535039600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
|
||||
6C43CCA51535039600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
|
||||
6C43CCA61535039600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
|
||||
6C43CCA71535039600162364 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = "<group>"; };
|
||||
6C43CCA81535039600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
|
||||
6C43CCA91535039600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
|
||||
6C43CCAA1535039600162364 /* ffitarget_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm.h; sourceTree = "<group>"; };
|
||||
6C43CCAB1535039600162364 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = "<group>"; };
|
||||
6C43CCAC1535039600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
|
||||
F6F980BA147386130008F121 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DB13B1661849DF1E0010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DB13B1911849DF510010F42D /* ffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = ffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DBFA713E187F1D8600A76262 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
|
||||
DBFA713F187F1D8600A76262 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
|
||||
DBFA7140187F1D8600A76262 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
|
||||
DBFA7141187F1D8600A76262 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
|
||||
DBFA7143187F1D8600A76262 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = closures.c; sourceTree = "<group>"; };
|
||||
DBFA7145187F1D8600A76262 /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlmalloc.c; sourceTree = "<group>"; };
|
||||
DBFA7147187F1D8600A76262 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = "<group>"; };
|
||||
DBFA7148187F1D8600A76262 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_api.c; sourceTree = "<group>"; };
|
||||
DBFA7149187F1D8600A76262 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = "<group>"; };
|
||||
DBFA715E187F1D9B00A76262 /* ffi_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm64.h; sourceTree = "<group>"; };
|
||||
DBFA715F187F1D9B00A76262 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = "<group>"; };
|
||||
DBFA7160187F1D9B00A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
|
||||
DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
|
||||
DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm64.h; sourceTree = "<group>"; };
|
||||
DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = "<group>"; };
|
||||
DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
|
||||
DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
|
||||
DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm64.h; sourceTree = "<group>"; };
|
||||
DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = "<group>"; };
|
||||
DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
|
||||
DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
|
||||
DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_arm64.c; sourceTree = "<group>"; };
|
||||
DBFA716D187F1D9B00A76262 /* sysv_arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_arm64.S; sourceTree = "<group>"; };
|
||||
DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = "<group>"; };
|
||||
DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = "<group>"; };
|
||||
DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline_armv7.S; sourceTree = "<group>"; };
|
||||
DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
|
||||
DBFA7174187F1D9B00A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
|
||||
DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
|
||||
DBFA7176187F1D9B00A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
|
||||
DBFA7182187F1DA100A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
|
||||
DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
|
||||
DBFA7184187F1DA100A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
|
||||
DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
|
||||
DBFA7186187F1DA100A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
|
||||
DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
|
||||
DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
|
||||
DBFA718B187F1DA100A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
|
||||
DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
|
||||
DBFA718D187F1DA100A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
6C43CB3A1534E9D100162364 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F6F980B7147386130008F121 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
6C43CBAF1534F76F00162364 /* iOS */ = {
|
||||
DB13B15B1849DEB70010F42D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CCA11535039600162364 /* include */,
|
||||
6C43CBBB1534F76F00162364 /* src */,
|
||||
DBFA713C187F1D8600A76262 /* darwin_common */,
|
||||
DBFA715C187F1D9B00A76262 /* darwin_ios */,
|
||||
DBFA7180187F1DA100A76262 /* darwin_osx */,
|
||||
DB13B1671849DF1E0010F42D /* Products */,
|
||||
);
|
||||
name = iOS;
|
||||
path = ios;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CBBB1534F76F00162364 /* src */ = {
|
||||
DB13B1671849DF1E0010F42D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CBC81534F76F00162364 /* x86 */,
|
||||
6C43CBBC1534F76F00162364 /* arm */,
|
||||
DB13B1661849DF1E0010F42D /* libffi.a */,
|
||||
DB13B1911849DF510010F42D /* ffi.dylib */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA713C187F1D8600A76262 /* darwin_common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA713D187F1D8600A76262 /* include */,
|
||||
DBFA7142187F1D8600A76262 /* src */,
|
||||
);
|
||||
path = "darwin_common";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA713D187F1D8600A76262 /* include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA713E187F1D8600A76262 /* ffi.h */,
|
||||
DBFA713F187F1D8600A76262 /* ffi_common.h */,
|
||||
DBFA7140187F1D8600A76262 /* fficonfig.h */,
|
||||
DBFA7141187F1D8600A76262 /* ffitarget.h */,
|
||||
);
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA7142187F1D8600A76262 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA7143187F1D8600A76262 /* closures.c */,
|
||||
DBFA7145187F1D8600A76262 /* dlmalloc.c */,
|
||||
DBFA7147187F1D8600A76262 /* prep_cif.c */,
|
||||
DBFA7148187F1D8600A76262 /* raw_api.c */,
|
||||
DBFA7149187F1D8600A76262 /* types.c */,
|
||||
);
|
||||
path = src;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CBBC1534F76F00162364 /* arm */ = {
|
||||
DBFA715C187F1D9B00A76262 /* darwin_ios */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CBBD1534F76F00162364 /* ffi.c */,
|
||||
6C43CBBF1534F76F00162364 /* sysv.S */,
|
||||
6C43CBC01534F76F00162364 /* trampoline.S */,
|
||||
DBFA715D187F1D9B00A76262 /* include */,
|
||||
DBFA716A187F1D9B00A76262 /* src */,
|
||||
);
|
||||
path = "darwin_ios";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA715D187F1D9B00A76262 /* include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA715E187F1D9B00A76262 /* ffi_arm64.h */,
|
||||
DBFA715F187F1D9B00A76262 /* ffi_armv7.h */,
|
||||
DBFA7160187F1D9B00A76262 /* ffi_i386.h */,
|
||||
DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */,
|
||||
DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */,
|
||||
DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */,
|
||||
DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */,
|
||||
DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */,
|
||||
DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */,
|
||||
DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */,
|
||||
DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */,
|
||||
DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */,
|
||||
);
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA716A187F1D9B00A76262 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA716B187F1D9B00A76262 /* aarch64 */,
|
||||
DBFA716E187F1D9B00A76262 /* arm */,
|
||||
DBFA7172187F1D9B00A76262 /* x86 */,
|
||||
);
|
||||
path = src;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA716B187F1D9B00A76262 /* aarch64 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA716C187F1D9B00A76262 /* ffi_arm64.c */,
|
||||
DBFA716D187F1D9B00A76262 /* sysv_arm64.S */,
|
||||
);
|
||||
path = aarch64;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA716E187F1D9B00A76262 /* arm */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA716F187F1D9B00A76262 /* ffi_armv7.c */,
|
||||
DBFA7170187F1D9B00A76262 /* sysv_armv7.S */,
|
||||
DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */,
|
||||
);
|
||||
path = arm;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CBC81534F76F00162364 /* x86 */ = {
|
||||
DBFA7172187F1D9B00A76262 /* x86 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CBC91534F76F00162364 /* darwin.S */,
|
||||
6C43CBCB1534F76F00162364 /* ffi.c */,
|
||||
DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */,
|
||||
DBFA7174187F1D9B00A76262 /* darwin_i386.S */,
|
||||
DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */,
|
||||
DBFA7176187F1D9B00A76262 /* ffi_i386.c */,
|
||||
);
|
||||
path = x86;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CBF01534F77800162364 /* OS X */ = {
|
||||
DBFA7180187F1DA100A76262 /* darwin_osx */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CC8C1535032600162364 /* include */,
|
||||
6C43CBFC1534F77800162364 /* src */,
|
||||
DBFA7181187F1DA100A76262 /* include */,
|
||||
DBFA7188187F1DA100A76262 /* src */,
|
||||
);
|
||||
name = "OS X";
|
||||
path = osx;
|
||||
path = "darwin_osx";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CBFC1534F77800162364 /* src */ = {
|
||||
DBFA7181187F1DA100A76262 /* include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CC041534F77800162364 /* x86 */,
|
||||
DBFA7182187F1DA100A76262 /* ffi_i386.h */,
|
||||
DBFA7183187F1DA100A76262 /* ffi_x86_64.h */,
|
||||
DBFA7184187F1DA100A76262 /* fficonfig_i386.h */,
|
||||
DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */,
|
||||
DBFA7186187F1DA100A76262 /* ffitarget_i386.h */,
|
||||
DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */,
|
||||
);
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DBFA7188187F1DA100A76262 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DBFA7189187F1DA100A76262 /* x86 */,
|
||||
);
|
||||
path = src;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CC041534F77800162364 /* x86 */ = {
|
||||
DBFA7189187F1DA100A76262 /* x86 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CC051534F77800162364 /* darwin.S */,
|
||||
6C43CC061534F77800162364 /* darwin64.S */,
|
||||
6C43CC071534F77800162364 /* ffi.c */,
|
||||
6C43CC081534F77800162364 /* ffi64.c */,
|
||||
DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */,
|
||||
DBFA718B187F1DA100A76262 /* darwin_i386.S */,
|
||||
DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */,
|
||||
DBFA718D187F1DA100A76262 /* ffi_i386.c */,
|
||||
);
|
||||
path = x86;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CC3D1534F7C400162364 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CC281534F7BE00162364 /* closures.c */,
|
||||
6C43CC2B1534F7BE00162364 /* java_raw_api.c */,
|
||||
6C43CC2C1534F7BE00162364 /* prep_cif.c */,
|
||||
6C43CC2D1534F7BE00162364 /* raw_api.c */,
|
||||
6C43CC2E1534F7BE00162364 /* types.c */,
|
||||
);
|
||||
name = src;
|
||||
path = ios;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CC8C1535032600162364 /* include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CC8D1535032600162364 /* ffi.h */,
|
||||
6C43CC8E1535032600162364 /* ffi_common.h */,
|
||||
6C43CC8F1535032600162364 /* ffi_i386.h */,
|
||||
6C43CC901535032600162364 /* ffi_x86_64.h */,
|
||||
6C43CC911535032600162364 /* fficonfig.h */,
|
||||
6C43CC921535032600162364 /* fficonfig_i386.h */,
|
||||
6C43CC931535032600162364 /* fficonfig_x86_64.h */,
|
||||
6C43CC941535032600162364 /* ffitarget.h */,
|
||||
6C43CC951535032600162364 /* ffitarget_i386.h */,
|
||||
6C43CC961535032600162364 /* ffitarget_x86_64.h */,
|
||||
);
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6C43CCA11535039600162364 /* include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CCA21535039600162364 /* ffi.h */,
|
||||
6C43CCA31535039600162364 /* ffi_armv7.h */,
|
||||
6C43CCA41535039600162364 /* ffi_common.h */,
|
||||
6C43CCA51535039600162364 /* ffi_i386.h */,
|
||||
6C43CCA61535039600162364 /* fficonfig.h */,
|
||||
6C43CCA71535039600162364 /* fficonfig_armv7.h */,
|
||||
6C43CCA81535039600162364 /* fficonfig_i386.h */,
|
||||
6C43CCA91535039600162364 /* ffitarget.h */,
|
||||
6C43CCAA1535039600162364 /* ffitarget_arm.h */,
|
||||
6C43CCAB1535039600162364 /* ffitarget_armv7.h */,
|
||||
6C43CCAC1535039600162364 /* ffitarget_i386.h */,
|
||||
);
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F6B0839514721EE50031D8A1 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6C43CC3D1534F7C400162364 /* src */,
|
||||
6C43CBAF1534F76F00162364 /* iOS */,
|
||||
6C43CBF01534F77800162364 /* OS X */,
|
||||
F6F980C6147386260008F121 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F6F980C6147386260008F121 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F6F980BA147386130008F121 /* libffi.a */,
|
||||
6C43CB3D1534E9D100162364 /* libffi.a */,
|
||||
);
|
||||
name = Products;
|
||||
path = ../..;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
6C43CB3B1534E9D100162364 /* Headers */ = {
|
||||
DB13B18F1849DF510010F42D /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6C43CC971535032600162364 /* ffi.h in Headers */,
|
||||
6C43CC981535032600162364 /* ffi_common.h in Headers */,
|
||||
6C43CC991535032600162364 /* ffi_i386.h in Headers */,
|
||||
6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */,
|
||||
6C43CC9E1535032600162364 /* ffitarget.h in Headers */,
|
||||
6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */,
|
||||
6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */,
|
||||
6C43CC9B1535032600162364 /* fficonfig.h in Headers */,
|
||||
6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */,
|
||||
6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F6F980B8147386130008F121 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6C43CCAD1535039600162364 /* ffi.h in Headers */,
|
||||
6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */,
|
||||
6C43CCAF1535039600162364 /* ffi_common.h in Headers */,
|
||||
6C43CCB01535039600162364 /* ffi_i386.h in Headers */,
|
||||
6C43CCB41535039600162364 /* ffitarget.h in Headers */,
|
||||
6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */,
|
||||
6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */,
|
||||
6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */,
|
||||
6C43CCB11535039600162364 /* fficonfig.h in Headers */,
|
||||
6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */,
|
||||
6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */,
|
||||
DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */,
|
||||
DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */,
|
||||
DBFA714A187F1D8600A76262 /* ffi.h in Headers */,
|
||||
DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */,
|
||||
DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */,
|
||||
DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */,
|
||||
DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */,
|
||||
DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */,
|
||||
DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */,
|
||||
DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
6C43CB3C1534E9D100162364 /* libffi OS X */ = {
|
||||
DB13B1651849DF1E0010F42D /* libffi-iOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */;
|
||||
buildConfigurationList = DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */;
|
||||
buildPhases = (
|
||||
6C43CC401534FF3B00162364 /* Generate Source and Headers */,
|
||||
6C43CB391534E9D100162364 /* Sources */,
|
||||
6C43CB3A1534E9D100162364 /* Frameworks */,
|
||||
6C43CB3B1534E9D100162364 /* Headers */,
|
||||
DB13B3051849E01C0010F42D /* ShellScript */,
|
||||
DB13B1621849DF1E0010F42D /* Sources */,
|
||||
DB13B1641849DF1E0010F42D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "libffi OS X";
|
||||
productName = "ffi OS X";
|
||||
productReference = 6C43CB3D1534E9D100162364 /* libffi.a */;
|
||||
name = "libffi-iOS";
|
||||
productName = ffi;
|
||||
productReference = DB13B1661849DF1E0010F42D /* libffi.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
F6F980B9147386130008F121 /* libffi iOS */ = {
|
||||
DB13B1901849DF510010F42D /* libffi-Mac */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */;
|
||||
buildConfigurationList = DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */;
|
||||
buildPhases = (
|
||||
6C43CC3E1534F8E200162364 /* Generate Trampoline */,
|
||||
6C43CC3F1534FF1B00162364 /* Generate Source and Headers */,
|
||||
F6F980B6147386130008F121 /* Sources */,
|
||||
F6F980B7147386130008F121 /* Frameworks */,
|
||||
F6F980B8147386130008F121 /* Headers */,
|
||||
DB13B3061849E0490010F42D /* ShellScript */,
|
||||
DB13B18D1849DF510010F42D /* Sources */,
|
||||
DB13B18F1849DF510010F42D /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "libffi iOS";
|
||||
name = "libffi-Mac";
|
||||
productName = ffi;
|
||||
productReference = F6F980BA147386130008F121 /* libffi.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
productReference = DB13B1911849DF510010F42D /* ffi.dylib */;
|
||||
productType = "com.apple.product-type.library.dynamic";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
F6B0839714721EE50031D8A1 /* Project object */ = {
|
||||
DB13B15C1849DEB70010F42D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0430;
|
||||
LastUpgradeCheck = 0510;
|
||||
};
|
||||
buildConfigurationList = F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */;
|
||||
buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = F6B0839514721EE50031D8A1;
|
||||
productRefGroup = F6B0839514721EE50031D8A1;
|
||||
mainGroup = DB13B15B1849DEB70010F42D;
|
||||
productRefGroup = DB13B1671849DF1E0010F42D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
F6F980B9147386130008F121 /* libffi iOS */,
|
||||
6C43CB3C1534E9D100162364 /* libffi OS X */,
|
||||
DB13B1651849DF1E0010F42D /* libffi-iOS */,
|
||||
DB13B1901849DF510010F42D /* libffi-Mac */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
6C43CC3E1534F8E200162364 /* Generate Trampoline */ = {
|
||||
DB13B3051849E01C0010F42D /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Generate Trampoline";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /usr/bin/python;
|
||||
shellScript = "import subprocess\nimport re\nimport os\nimport errno\nimport sys\n\ndef main():\n with open('src/arm/trampoline.S', 'w') as tramp_out:\n p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)\n p.wait()\n\nif __name__ == '__main__':\n main()";
|
||||
};
|
||||
6C43CC3F1534FF1B00162364 /* Generate Source and Headers */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Generate Source and Headers";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/usr/bin/python generate-ios-source-and-headers.py";
|
||||
shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-ios";
|
||||
};
|
||||
6C43CC401534FF3B00162364 /* Generate Source and Headers */ = {
|
||||
DB13B3061849E0490010F42D /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Generate Source and Headers";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/usr/bin/python generate-osx-source-and-headers.py";
|
||||
shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
6C43CB391534E9D100162364 /* Sources */ = {
|
||||
DB13B1621849DF1E0010F42D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6C43CC1F1534F77800162364 /* darwin.S in Sources */,
|
||||
6C43CC201534F77800162364 /* darwin64.S in Sources */,
|
||||
6C43CC211534F77800162364 /* ffi.c in Sources */,
|
||||
6C43CC221534F77800162364 /* ffi64.c in Sources */,
|
||||
6C43CC301534F7BE00162364 /* closures.c in Sources */,
|
||||
6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */,
|
||||
6C43CC381534F7BE00162364 /* prep_cif.c in Sources */,
|
||||
6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */,
|
||||
6C43CC3C1534F7BE00162364 /* types.c in Sources */,
|
||||
DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */,
|
||||
DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */,
|
||||
DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */,
|
||||
DBFA714E187F1D8600A76262 /* closures.c in Sources */,
|
||||
DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */,
|
||||
DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */,
|
||||
DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */,
|
||||
DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */,
|
||||
DBFA7158187F1D8600A76262 /* raw_api.c in Sources */,
|
||||
DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */,
|
||||
DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */,
|
||||
DBFA715A187F1D8600A76262 /* types.c in Sources */,
|
||||
DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F6F980B6147386130008F121 /* Sources */ = {
|
||||
DB13B18D1849DF510010F42D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6C43CBDC1534F76F00162364 /* ffi.c in Sources */,
|
||||
6C43CBDD1534F76F00162364 /* sysv.S in Sources */,
|
||||
6C43CBDE1534F76F00162364 /* trampoline.S in Sources */,
|
||||
6C43CBE61534F76F00162364 /* darwin.S in Sources */,
|
||||
6C43CBE81534F76F00162364 /* ffi.c in Sources */,
|
||||
6C43CC2F1534F7BE00162364 /* closures.c in Sources */,
|
||||
6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */,
|
||||
6C43CC371534F7BE00162364 /* prep_cif.c in Sources */,
|
||||
6C43CC391534F7BE00162364 /* raw_api.c in Sources */,
|
||||
6C43CC3B1534F7BE00162364 /* types.c in Sources */,
|
||||
DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */,
|
||||
DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */,
|
||||
DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */,
|
||||
DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */,
|
||||
DBFA715B187F1D8600A76262 /* types.c in Sources */,
|
||||
DBFA7159187F1D8600A76262 /* raw_api.c in Sources */,
|
||||
DBFA714F187F1D8600A76262 /* closures.c in Sources */,
|
||||
DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
6C43CB4B1534E9D100162364 /* Debug */ = {
|
||||
DB13B1601849DEB70010F42D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
DSTROOT = /tmp/ffi.dst;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"",
|
||||
"darwin_common/include",
|
||||
);
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_NAME = ffi;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6C43CB4C1534E9D100162364 /* Release */ = {
|
||||
DB13B1611849DEB70010F42D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DSTROOT = /tmp/ffi.dst;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"",
|
||||
"darwin_common/include",
|
||||
);
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
PRODUCT_NAME = ffi;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F6B083AB14721EE50031D8A1 /* Debug */ = {
|
||||
DB13B1871849DF1E0010F42D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DSTROOT = /tmp/ffi.dst;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
|
|
@ -482,98 +457,181 @@
|
|||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VALUE = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = ios/include;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"darwin_ios/include",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = ffi;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F6B083AC14721EE50031D8A1 /* Release */ = {
|
||||
DB13B1881849DF1E0010F42D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DSTROOT = /tmp/ffi.dst;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "";
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VALUE = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = ios/include;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"darwin_ios/include",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = ffi;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F6F980C2147386130008F121 /* Debug */ = {
|
||||
DB13B1B11849DF520010F42D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
armv6,
|
||||
armv7,
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
DSTROOT = /tmp/ffi.dst;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"darwin_osx/include",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
|
||||
PRODUCT_NAME = ffi;
|
||||
SKIP_INSTALL = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F6F980C3147386130008F121 /* Release */ = {
|
||||
DB13B1B21849DF520010F42D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
armv6,
|
||||
armv7,
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"darwin_osx/include",
|
||||
);
|
||||
DSTROOT = /tmp/ffi.dst;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
|
||||
PRODUCT_NAME = ffi;
|
||||
SKIP_INSTALL = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */ = {
|
||||
DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6C43CB4B1534E9D100162364 /* Debug */,
|
||||
6C43CB4C1534E9D100162364 /* Release */,
|
||||
DB13B1601849DEB70010F42D /* Debug */,
|
||||
DB13B1611849DEB70010F42D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */ = {
|
||||
DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F6B083AB14721EE50031D8A1 /* Debug */,
|
||||
F6B083AC14721EE50031D8A1 /* Release */,
|
||||
DB13B1871849DF1E0010F42D /* Debug */,
|
||||
DB13B1881849DF1E0010F42D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */ = {
|
||||
DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F6F980C2147386130008F121 /* Debug */,
|
||||
F6F980C3147386130008F121 /* Release */,
|
||||
DB13B1B11849DF520010F42D /* Debug */,
|
||||
DB13B1B21849DF520010F42D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = F6B0839714721EE50031D8A1 /* Project object */;
|
||||
rootObject = DB13B15C1849DEB70010F42D /* Project object */;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@
|
|||
# release, then set age to 0.
|
||||
#
|
||||
# CURRENT:REVISION:AGE
|
||||
6:1:0
|
||||
6:2:0
|
||||
|
|
|
|||
5327
Modules/_ctypes/libffi/ltmain.sh
Executable file → Normal file
5327
Modules/_ctypes/libffi/ltmain.sh
Executable file → Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -155,7 +155,7 @@ case $host_cpu in
|
|||
sparc*)
|
||||
AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
|
||||
cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
|
||||
cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
|
||||
cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters`
|
||||
case $cputype in
|
||||
*ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
|
||||
*ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
|
||||
|
|
|
|||
1969
Modules/_ctypes/libffi/m4/libtool.m4
vendored
1969
Modules/_ctypes/libffi/m4/libtool.m4
vendored
File diff suppressed because it is too large
Load diff
72
Modules/_ctypes/libffi/m4/ltoptions.m4
vendored
72
Modules/_ctypes/libffi/m4/ltoptions.m4
vendored
|
|
@ -1,14 +1,14 @@
|
|||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
# serial 8 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
|
@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
|
|||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
[m4_warning([Unknown $1 option '$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
|
|
@ -75,13 +75,13 @@ m4_if([$1],[LT_INIT],[
|
|||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
|||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
put the 'dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
|
|
@ -148,7 +148,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
|||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
put the 'win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
|
|
@ -157,9 +157,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
|||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
# implement the --enable-shared flag, and supports the 'shared' and
|
||||
# 'disable-shared' LT_INIT options.
|
||||
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
|
|
@ -172,14 +172,14 @@ AC_ARG_ENABLE([shared],
|
|||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
|
@ -211,9 +211,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
|||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
# implement the --enable-static flag, and support the 'static' and
|
||||
# 'disable-static' LT_INIT options.
|
||||
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
|
|
@ -226,14 +226,14 @@ AC_ARG_ENABLE([static],
|
|||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
|
@ -265,9 +265,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
|||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
# implement the --enable-fast-install flag, and support the 'fast-install'
|
||||
# and 'disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
|
|
@ -280,14 +280,14 @@ AC_ARG_ENABLE([fast-install],
|
|||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
|
@ -304,14 +304,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
|||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
the 'fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
the 'disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
|
|
@ -321,9 +321,9 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
|||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
|
|
@ -334,19 +334,17 @@ m4_define([_LT_WITH_PIC],
|
|||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for lt_pkg in $withval; do
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
[pic_mode=m4_default([$1], [default])])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
|
@ -359,7 +357,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
|
|||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
put the 'pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
|
|
|
|||
7
Modules/_ctypes/libffi/m4/ltsugar.m4
vendored
7
Modules/_ctypes/libffi/m4/ltsugar.m4
vendored
|
|
@ -1,6 +1,7 @@
|
|||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
|
|
@ -33,7 +34,7 @@ m4_define([_lt_join],
|
|||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
# Autoconf-2.59, which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
|
|
@ -44,7 +45,7 @@ m4_define([lt_unquote], $1)
|
|||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
|
|
|
|||
12
Modules/_ctypes/libffi/m4/ltversion.m4
vendored
12
Modules/_ctypes/libffi/m4/ltversion.m4
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
|
|
@ -9,15 +9,15 @@
|
|||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3337 ltversion.m4
|
||||
# serial 4038 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2.418])
|
||||
m4_define([LT_PACKAGE_REVISION], [2.4.2.418])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.2'
|
||||
macro_revision='1.3337'
|
||||
[macro_version='2.4.2.418'
|
||||
macro_revision='2.4.2.418'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
||||
|
|
|
|||
7
Modules/_ctypes/libffi/m4/lt~obsolete.m4
vendored
7
Modules/_ctypes/libffi/m4/lt~obsolete.m4
vendored
|
|
@ -1,6 +1,7 @@
|
|||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
|
|
@ -25,7 +26,7 @@
|
|||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.12.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.4 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
@ -14,23 +14,51 @@
|
|||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
|
@ -51,7 +79,7 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = man
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
|
||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
|
|
@ -73,6 +101,18 @@ mkinstalldirs = $(install_sh) -d
|
|||
CONFIG_HEADER = $(top_builddir)/fficonfig.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
|
@ -111,10 +151,12 @@ man3dir = $(mandir)/man3
|
|||
am__installdirs = "$(DESTDIR)$(man3dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
|
||||
AR = @AR@
|
||||
|
|
@ -130,6 +172,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
|
@ -145,6 +191,7 @@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
|
|||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
|
||||
HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
|
@ -191,6 +238,7 @@ abs_top_builddir = @abs_top_builddir@
|
|||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
|
|
@ -330,29 +378,14 @@ uninstall-man3:
|
|||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
tags TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@list='$(MANS)'; if test -n "$$list"; then \
|
||||
list=`for p in $$list; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
|
||||
if test -n "$$list" && \
|
||||
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
|
||||
echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
|
||||
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
|
||||
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
|
||||
echo " typically 'make maintainer-clean' will remove them" >&2; \
|
||||
exit 1; \
|
||||
else :; fi; \
|
||||
else :; fi
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
@ -490,16 +523,17 @@ uninstall-man: uninstall-man3
|
|||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-man3 \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
uninstall uninstall-am uninstall-man uninstall-man3
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-man3 install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags-am uninstall uninstall-am uninstall-man \
|
||||
uninstall-man3
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
|
||||
scriptversion=2005-06-29.22
|
||||
scriptversion=2010-08-21.06; # UTC
|
||||
|
||||
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -18,8 +17,7 @@ scriptversion=2005-06-29.22
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
|
|
@ -30,16 +28,26 @@ scriptversion=2005-06-29.22
|
|||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
|
||||
# is contrary to our usage. Disable this feature.
|
||||
alias -g '${1+"$@"}'='"$@"'
|
||||
setopt NO_GLOB_SUBST
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No file. Try \`$0 --help' for more information." 1>&2
|
||||
echo "$0: No file. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: mdate-sh [--help] [--version] FILE
|
||||
|
||||
Pretty-print the modification time of FILE.
|
||||
Pretty-print the modification day of FILE, in the format:
|
||||
1 January 1970
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
|
|
@ -51,6 +59,13 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
error ()
|
||||
{
|
||||
echo "$0: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
|
|
@ -60,7 +75,7 @@ LC_TIME=C
|
|||
export LC_TIME
|
||||
|
||||
# GNU ls changes its time format in response to the TIME_STYLE
|
||||
# variable. Since we cannot assume `unset' works, revert this
|
||||
# variable. Since we cannot assume 'unset' works, revert this
|
||||
# variable to its documented default.
|
||||
if test "${TIME_STYLE+set}" = set; then
|
||||
TIME_STYLE=posix-long-iso
|
||||
|
|
@ -75,27 +90,32 @@ if ls -L /dev/null 1>/dev/null 2>&1; then
|
|||
else
|
||||
ls_command='ls -l -d'
|
||||
fi
|
||||
# Avoid user/group names that might have spaces, when possible.
|
||||
if ls -n /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command="$ls_command -n"
|
||||
fi
|
||||
|
||||
# A `ls -l' line looks as follows on OS/2.
|
||||
# A 'ls -l' line looks as follows on OS/2.
|
||||
# drwxrwx--- 0 Aug 11 2001 foo
|
||||
# This differs from Unix, which adds ownership information.
|
||||
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
|
||||
#
|
||||
# To find the date, we split the line on spaces and iterate on words
|
||||
# until we find a month. This cannot work with files whose owner is a
|
||||
# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
|
||||
# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
|
||||
# will be owned by a user whose name is a month. So we first look at
|
||||
# the extended ls output of the root directory to decide how many
|
||||
# words should be skipped to get the date.
|
||||
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
set x`ls -l -d /`
|
||||
set x`$ls_command /`
|
||||
|
||||
# Find which argument is the month.
|
||||
month=
|
||||
command=
|
||||
until test $month
|
||||
do
|
||||
test $# -gt 0 || error "failed parsing '$ls_command /' output"
|
||||
shift
|
||||
# Add another shift to the command.
|
||||
command="$command shift;"
|
||||
|
|
@ -115,8 +135,10 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
test -n "$month" || error "failed parsing '$ls_command /' output"
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
set dummy x`eval "$ls_command \"\$save_arg1\""`
|
||||
set dummy x`eval "$ls_command \"\\\$save_arg1\""`
|
||||
|
||||
# Remove all preceding arguments
|
||||
eval $command
|
||||
|
|
@ -197,5 +219,6 @@ echo $day $month $year
|
|||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
scriptversion=2012-06-26.16; # UTC
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2008, 2009 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC
|
|||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||
\`g' are ignored when checking the name.
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
|
|
@ -100,272 +70,141 @@ Send bug reports to <bug-automake@gnu.org>."
|
|||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# normalize program name to check for.
|
||||
program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program). This is about non-GNU programs, so use $1 not
|
||||
# $program.
|
||||
case $1 in
|
||||
lex*|yacc*)
|
||||
# Not GNU programs, they don't have --version.
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'automa4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
tar*)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $program in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison*|yacc*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex*|flex*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar*)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
# format and translated into something sensible for cl or ml.
|
||||
#
|
||||
|
||||
args_orig=$@
|
||||
args="-nologo -W3"
|
||||
md=-MD
|
||||
cl="cl"
|
||||
|
|
@ -72,14 +73,35 @@ do
|
|||
shift 1
|
||||
;;
|
||||
-O*)
|
||||
# If we're optimizing, make sure we explicitly turn on some optimizations
|
||||
# that are implicitly disabled by debug symbols (-Zi).
|
||||
args="$args $1 -OPT:REF -OPT:ICF -INCREMENTAL:NO"
|
||||
# Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG
|
||||
# case below) are not compatible with optimization flags and will
|
||||
# cause the build to fail. Therefore, drop the optimization flag if
|
||||
# -DFFI_DEBUG is also set.
|
||||
case $args_orig in
|
||||
*-DFFI_DEBUG*)
|
||||
args="$args"
|
||||
;;
|
||||
*)
|
||||
# The ax_cc_maxopt.m4 macro from the upstream autoconf-archive
|
||||
# project doesn't support MSVC and therefore ends up trying to
|
||||
# use -O3. Use the equivalent "max optimization" flag for MSVC
|
||||
# instead of erroring out.
|
||||
case $1 in
|
||||
-O3)
|
||||
args="$args -O2"
|
||||
;;
|
||||
*)
|
||||
args="$args $1"
|
||||
;;
|
||||
esac
|
||||
opt="true"
|
||||
;;
|
||||
esac
|
||||
shift 1
|
||||
;;
|
||||
-g)
|
||||
# Enable debug symbol generation.
|
||||
args="$args -Zi -DEBUG"
|
||||
args="$args -Zi"
|
||||
shift 1
|
||||
;;
|
||||
-DFFI_DEBUG)
|
||||
|
|
@ -126,6 +148,10 @@ do
|
|||
# to do here.
|
||||
shift 1
|
||||
;;
|
||||
-pedantic)
|
||||
# libffi tests -pedantic with -Wall, so drop it also.
|
||||
shift 1
|
||||
;;
|
||||
-Werror)
|
||||
args="$args -WX"
|
||||
shift 1
|
||||
|
|
@ -170,6 +196,13 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
# If -Zi is specified, certain optimizations are implicitly disabled
|
||||
# by MSVC. Add back those optimizations if this is an optimized build.
|
||||
# NOTE: These arguments must come after all others.
|
||||
if [ -n "$opt" ]; then
|
||||
args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"
|
||||
fi
|
||||
|
||||
if [ -n "$assembly" ]; then
|
||||
if [ -z "$outdir" ]; then
|
||||
outdir="."
|
||||
|
|
@ -189,7 +222,10 @@ if [ -n "$assembly" ]; then
|
|||
else
|
||||
args="$md $args"
|
||||
echo "$cl $args"
|
||||
eval "\"$cl\" $args"
|
||||
# Return an error code of 1 if an invalid command line parameter is passed
|
||||
# instead of just ignoring it.
|
||||
eval "(\"$cl\" $args 2>&1 1>&3 | \
|
||||
awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1"
|
||||
result=$?
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
#include <stdlib.h>
|
||||
|
||||
/* Stack alignment requirement in bytes */
|
||||
#if defined (__APPLE__)
|
||||
#define AARCH64_STACK_ALIGN 1
|
||||
#else
|
||||
#define AARCH64_STACK_ALIGN 16
|
||||
#endif
|
||||
|
||||
#define N_X_ARG_REG 8
|
||||
#define N_V_ARG_REG 8
|
||||
|
|
@ -49,6 +53,23 @@ struct call_context
|
|||
} v [AARCH64_N_VREG];
|
||||
};
|
||||
|
||||
#if defined (__clang__) && defined (__APPLE__)
|
||||
extern void
|
||||
sys_icache_invalidate (void *start, size_t len);
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
ffi_clear_cache (void *start, void *end)
|
||||
{
|
||||
#if defined (__clang__) && defined (__APPLE__)
|
||||
sys_icache_invalidate (start, (char *)end - (char *)start);
|
||||
#elif defined (__GNUC__)
|
||||
__builtin___clear_cache (start, end);
|
||||
#else
|
||||
#error "Missing builtin to flush instruction cache"
|
||||
#endif
|
||||
}
|
||||
|
||||
static void *
|
||||
get_x_addr (struct call_context *context, unsigned n)
|
||||
{
|
||||
|
|
@ -94,8 +115,10 @@ get_basic_type_addr (unsigned short type, struct call_context *context,
|
|||
return get_s_addr (context, n);
|
||||
case FFI_TYPE_DOUBLE:
|
||||
return get_d_addr (context, n);
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
return get_v_addr (context, n);
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT16:
|
||||
|
|
@ -107,6 +130,8 @@ get_basic_type_addr (unsigned short type, struct call_context *context,
|
|||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
return get_x_addr (context, n);
|
||||
case FFI_TYPE_VOID:
|
||||
return NULL;
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
return NULL;
|
||||
|
|
@ -123,15 +148,26 @@ get_basic_type_alignment (unsigned short type)
|
|||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
return sizeof (UINT64);
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
return sizeof (long double);
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
#if defined (__APPLE__)
|
||||
return sizeof (UINT8);
|
||||
#endif
|
||||
case FFI_TYPE_UINT16:
|
||||
case FFI_TYPE_SINT16:
|
||||
#if defined (__APPLE__)
|
||||
return sizeof (UINT16);
|
||||
#endif
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_INT:
|
||||
case FFI_TYPE_SINT32:
|
||||
#if defined (__APPLE__)
|
||||
return sizeof (UINT32);
|
||||
#endif
|
||||
case FFI_TYPE_POINTER:
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
|
|
@ -154,8 +190,10 @@ get_basic_type_size (unsigned short type)
|
|||
return sizeof (UINT32);
|
||||
case FFI_TYPE_DOUBLE:
|
||||
return sizeof (UINT64);
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
return sizeof (long double);
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
return sizeof (UINT8);
|
||||
case FFI_TYPE_SINT8:
|
||||
|
|
@ -186,7 +224,7 @@ ffi_call_SYSV (unsigned (*)(struct call_context *context, unsigned char *,
|
|||
extended_cif *),
|
||||
struct call_context *context,
|
||||
extended_cif *,
|
||||
unsigned,
|
||||
size_t,
|
||||
void (*fn)(void));
|
||||
|
||||
extern void
|
||||
|
|
@ -305,7 +343,9 @@ is_register_candidate (ffi_type *ty)
|
|||
case FFI_TYPE_VOID:
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_UINT16:
|
||||
case FFI_TYPE_UINT32:
|
||||
|
|
@ -367,16 +407,24 @@ struct arg_state
|
|||
{
|
||||
unsigned ngrn; /* Next general-purpose register number. */
|
||||
unsigned nsrn; /* Next vector register number. */
|
||||
unsigned nsaa; /* Next stack offset. */
|
||||
size_t nsaa; /* Next stack offset. */
|
||||
|
||||
#if defined (__APPLE__)
|
||||
unsigned allocating_variadic;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Initialize a procedure call argument marshalling state. */
|
||||
static void
|
||||
arg_init (struct arg_state *state, unsigned call_frame_size)
|
||||
arg_init (struct arg_state *state, size_t call_frame_size)
|
||||
{
|
||||
state->ngrn = 0;
|
||||
state->nsrn = 0;
|
||||
state->nsaa = 0;
|
||||
|
||||
#if defined (__APPLE__)
|
||||
state->allocating_variadic = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Return the number of available consecutive core argument
|
||||
|
|
@ -400,35 +448,35 @@ available_v (struct arg_state *state)
|
|||
static void *
|
||||
allocate_to_x (struct call_context *context, struct arg_state *state)
|
||||
{
|
||||
FFI_ASSERT (state->ngrn < N_X_ARG_REG)
|
||||
FFI_ASSERT (state->ngrn < N_X_ARG_REG);
|
||||
return get_x_addr (context, (state->ngrn)++);
|
||||
}
|
||||
|
||||
static void *
|
||||
allocate_to_s (struct call_context *context, struct arg_state *state)
|
||||
{
|
||||
FFI_ASSERT (state->nsrn < N_V_ARG_REG)
|
||||
FFI_ASSERT (state->nsrn < N_V_ARG_REG);
|
||||
return get_s_addr (context, (state->nsrn)++);
|
||||
}
|
||||
|
||||
static void *
|
||||
allocate_to_d (struct call_context *context, struct arg_state *state)
|
||||
{
|
||||
FFI_ASSERT (state->nsrn < N_V_ARG_REG)
|
||||
FFI_ASSERT (state->nsrn < N_V_ARG_REG);
|
||||
return get_d_addr (context, (state->nsrn)++);
|
||||
}
|
||||
|
||||
static void *
|
||||
allocate_to_v (struct call_context *context, struct arg_state *state)
|
||||
{
|
||||
FFI_ASSERT (state->nsrn < N_V_ARG_REG)
|
||||
FFI_ASSERT (state->nsrn < N_V_ARG_REG);
|
||||
return get_v_addr (context, (state->nsrn)++);
|
||||
}
|
||||
|
||||
/* Allocate an aligned slot on the stack and return a pointer to it. */
|
||||
static void *
|
||||
allocate_to_stack (struct arg_state *state, void *stack, unsigned alignment,
|
||||
unsigned size)
|
||||
allocate_to_stack (struct arg_state *state, void *stack, size_t alignment,
|
||||
size_t size)
|
||||
{
|
||||
void *allocation;
|
||||
|
||||
|
|
@ -436,7 +484,12 @@ allocate_to_stack (struct arg_state *state, void *stack, unsigned alignment,
|
|||
alignment of the argument's type. */
|
||||
state->nsaa = ALIGN (state->nsaa, alignment);
|
||||
state->nsaa = ALIGN (state->nsaa, alignment);
|
||||
#if defined (__APPLE__)
|
||||
if (state->allocating_variadic)
|
||||
state->nsaa = ALIGN (state->nsaa, 8);
|
||||
#else
|
||||
state->nsaa = ALIGN (state->nsaa, 8);
|
||||
#endif
|
||||
|
||||
allocation = stack + state->nsaa;
|
||||
|
||||
|
|
@ -447,7 +500,7 @@ allocate_to_stack (struct arg_state *state, void *stack, unsigned alignment,
|
|||
static void
|
||||
copy_basic_type (void *dest, void *source, unsigned short type)
|
||||
{
|
||||
/* This is neccessary to ensure that basic types are copied
|
||||
/* This is necessary to ensure that basic types are copied
|
||||
sign extended to 64-bits as libffi expects. */
|
||||
switch (type)
|
||||
{
|
||||
|
|
@ -457,9 +510,11 @@ copy_basic_type (void *dest, void *source, unsigned short type)
|
|||
case FFI_TYPE_DOUBLE:
|
||||
*(double *) dest = *(double *) source;
|
||||
break;
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
*(long double *) dest = *(long double *) source;
|
||||
break;
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
*(ffi_arg *) dest = *(UINT8 *) source;
|
||||
break;
|
||||
|
|
@ -486,6 +541,8 @@ copy_basic_type (void *dest, void *source, unsigned short type)
|
|||
case FFI_TYPE_SINT64:
|
||||
*(ffi_sarg *) dest = *(SINT64 *) source;
|
||||
break;
|
||||
case FFI_TYPE_VOID:
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
|
|
@ -514,7 +571,6 @@ copy_hfa_to_reg_or_stack (void *memory,
|
|||
{
|
||||
int i;
|
||||
unsigned short type = get_homogeneous_type (ty);
|
||||
unsigned elems = element_count (ty);
|
||||
for (i = 0; i < elems; i++)
|
||||
{
|
||||
void *reg = allocate_to_v (context, state);
|
||||
|
|
@ -548,11 +604,13 @@ allocate_to_register_or_stack (struct call_context *context,
|
|||
return allocate_to_d (context, state);
|
||||
state->nsrn = N_V_ARG_REG;
|
||||
break;
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
if (state->nsrn < N_V_ARG_REG)
|
||||
return allocate_to_v (context, state);
|
||||
state->nsrn = N_V_ARG_REG;
|
||||
break;
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT16:
|
||||
|
|
@ -615,7 +673,9 @@ aarch64_prep_args (struct call_context *context, unsigned char *stack,
|
|||
appropriate register, or if none are available, to the stack. */
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT16:
|
||||
|
|
@ -676,6 +736,16 @@ aarch64_prep_args (struct call_context *context, unsigned char *stack,
|
|||
FFI_ASSERT (0);
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined (__APPLE__)
|
||||
if (i + 1 == ecif->cif->aarch64_nfixedargs)
|
||||
{
|
||||
state.ngrn = N_X_ARG_REG;
|
||||
state.nsrn = N_V_ARG_REG;
|
||||
|
||||
state.allocating_variadic = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return ecif->cif->aarch64_flags;
|
||||
|
|
@ -712,6 +782,20 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
|||
return FFI_OK;
|
||||
}
|
||||
|
||||
#if defined (__APPLE__)
|
||||
|
||||
/* Perform Apple-specific cif processing for variadic calls */
|
||||
ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
|
||||
unsigned int nfixedargs,
|
||||
unsigned int ntotalargs)
|
||||
{
|
||||
cif->aarch64_nfixedargs = nfixedargs;
|
||||
|
||||
return ffi_prep_cif_machdep(cif);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Call a function with the provided arguments and capture the return
|
||||
value. */
|
||||
void
|
||||
|
|
@ -728,7 +812,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
case FFI_SYSV:
|
||||
{
|
||||
struct call_context context;
|
||||
unsigned stack_bytes;
|
||||
size_t stack_bytes;
|
||||
|
||||
/* Figure out the total amount of stack space we need, the
|
||||
above call frame space needs to be 16 bytes aligned to
|
||||
|
|
@ -745,7 +829,9 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
case FFI_TYPE_VOID:
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
#endif
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT16:
|
||||
|
|
@ -778,7 +864,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
}
|
||||
else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG)
|
||||
{
|
||||
unsigned size = ALIGN (cif->rtype->size, sizeof (UINT64));
|
||||
size_t size = ALIGN (cif->rtype->size, sizeof (UINT64));
|
||||
memcpy (rvalue, get_x_addr (&context, 0), size);
|
||||
}
|
||||
else
|
||||
|
|
@ -824,7 +910,7 @@ static unsigned char trampoline [] =
|
|||
memcpy (__tramp + 12, &__fun, sizeof (__fun)); \
|
||||
memcpy (__tramp + 20, &__ctx, sizeof (__ctx)); \
|
||||
memcpy (__tramp + 28, &__flags, sizeof (__flags)); \
|
||||
__clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \
|
||||
ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \
|
||||
})
|
||||
|
||||
ffi_status
|
||||
|
|
@ -857,13 +943,13 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
|||
the stack at the point ffi_closure_SYSV() was invoked.
|
||||
|
||||
On the return path the assembler wrapper will reload call context
|
||||
regsiters.
|
||||
registers.
|
||||
|
||||
ffi_closure_SYSV_inner() marshalls the call context into ffi value
|
||||
desriptors, invokes the wrapped function, then marshalls the return
|
||||
descriptors, invokes the wrapped function, then marshalls the return
|
||||
value back into the call context. */
|
||||
|
||||
void
|
||||
void FFI_HIDDEN
|
||||
ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
||||
void *stack)
|
||||
{
|
||||
|
|
@ -897,10 +983,12 @@ ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
|||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
avalue[i] = allocate_to_register_or_stack (context, stack,
|
||||
&state, ty->type);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
if (is_hfa (ty))
|
||||
|
|
@ -924,7 +1012,7 @@ ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
|||
therefore the structure is not represented as
|
||||
a contiguous sequence of bytes in our saved
|
||||
register context. We need to fake up a copy
|
||||
of the structure layed out in memory
|
||||
of the structure laid out in memory
|
||||
correctly. The fake can be tossed once the
|
||||
closure function has returned hence alloca()
|
||||
is sufficient. */
|
||||
|
|
@ -945,7 +1033,7 @@ ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
|||
therefore the structure is not represented as
|
||||
a contiguous sequence of bytes in our saved
|
||||
register context. We need to fake up a copy
|
||||
of the structure layed out in memory
|
||||
of the structure laid out in memory
|
||||
correctly. The fake can be tossed once the
|
||||
closure function has returned hence alloca()
|
||||
is sufficient. */
|
||||
|
|
@ -958,11 +1046,13 @@ ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
|||
break;
|
||||
}
|
||||
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
memcpy (&avalue[i],
|
||||
allocate_to_v (context, &state),
|
||||
sizeof (*avalue));
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
|
|
@ -1033,7 +1123,9 @@ ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
|||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
#endif
|
||||
{
|
||||
void *addr = get_basic_type_addr (cif->rtype->type, context, 0);
|
||||
copy_basic_type (addr, rvalue, cif->rtype->type);
|
||||
|
|
@ -1042,19 +1134,19 @@ ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
|
|||
case FFI_TYPE_STRUCT:
|
||||
if (is_hfa (cif->rtype))
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
unsigned short type = get_homogeneous_type (cif->rtype);
|
||||
unsigned elems = element_count (cif->rtype);
|
||||
for (i = 0; i < elems; i++)
|
||||
for (j = 0; j < elems; j++)
|
||||
{
|
||||
void *reg = get_basic_type_addr (type, context, i);
|
||||
void *reg = get_basic_type_addr (type, context, j);
|
||||
copy_basic_type (reg, rvalue, type);
|
||||
rvalue += get_basic_type_size (type);
|
||||
}
|
||||
}
|
||||
else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG)
|
||||
{
|
||||
unsigned size = ALIGN (cif->rtype->size, sizeof (UINT64)) ;
|
||||
size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)) ;
|
||||
memcpy (get_x_addr (context, 0), rvalue, size);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -47,8 +47,12 @@ typedef enum ffi_abi
|
|||
|
||||
/* ---- Internal ---- */
|
||||
|
||||
|
||||
#if defined (__APPLE__)
|
||||
#define FFI_TARGET_SPECIFIC_VARIADIC
|
||||
#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags; unsigned aarch64_nfixedargs
|
||||
#else
|
||||
#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags
|
||||
#endif
|
||||
|
||||
#define AARCH64_FFI_WITH_V_BIT 0
|
||||
|
||||
|
|
|
|||
|
|
@ -23,14 +23,33 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
|
||||
#ifdef HAVE_MACHINE_ASM_H
|
||||
#include <machine/asm.h>
|
||||
#else
|
||||
#ifdef __USER_LABEL_PREFIX__
|
||||
#define CONCAT1(a, b) CONCAT2(a, b)
|
||||
#define CONCAT2(a, b) a ## b
|
||||
|
||||
/* Use the right prefix for global labels. */
|
||||
#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
|
||||
#else
|
||||
#define CNAME(x) x
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
|
||||
#define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
|
||||
#define cfi_restore(reg) .cfi_restore reg
|
||||
#define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
|
||||
|
||||
.text
|
||||
.globl ffi_call_SYSV
|
||||
.type ffi_call_SYSV, #function
|
||||
.globl CNAME(ffi_call_SYSV)
|
||||
#ifdef __ELF__
|
||||
.type CNAME(ffi_call_SYSV), #function
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
.align 2
|
||||
#endif
|
||||
|
||||
/* ffi_call_SYSV()
|
||||
|
||||
|
|
@ -53,7 +72,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
extended_cif *),
|
||||
struct call_context *context,
|
||||
extended_cif *,
|
||||
unsigned required_stack_size,
|
||||
size_t required_stack_size,
|
||||
void (*fn)(void));
|
||||
|
||||
Therefore on entry we have:
|
||||
|
|
@ -82,7 +101,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
#define ffi_call_SYSV_FS (8 * 4)
|
||||
|
||||
.cfi_startproc
|
||||
ffi_call_SYSV:
|
||||
CNAME(ffi_call_SYSV):
|
||||
stp x29, x30, [sp, #-16]!
|
||||
cfi_adjust_cfa_offset (16)
|
||||
cfi_rel_offset (x29, 0)
|
||||
|
|
@ -92,11 +111,11 @@ ffi_call_SYSV:
|
|||
cfi_def_cfa_register (x29)
|
||||
sub sp, sp, #ffi_call_SYSV_FS
|
||||
|
||||
stp x21, x22, [sp, 0]
|
||||
stp x21, x22, [sp, #0]
|
||||
cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS)
|
||||
cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS)
|
||||
|
||||
stp x23, x24, [sp, 16]
|
||||
stp x23, x24, [sp, #16]
|
||||
cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS)
|
||||
cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS)
|
||||
|
||||
|
|
@ -180,7 +199,9 @@ ffi_call_SYSV:
|
|||
ret
|
||||
|
||||
.cfi_endproc
|
||||
.size ffi_call_SYSV, .-ffi_call_SYSV
|
||||
#ifdef __ELF__
|
||||
.size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
|
||||
#endif
|
||||
|
||||
#define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE)
|
||||
|
||||
|
|
@ -222,22 +243,25 @@ ffi_call_SYSV:
|
|||
Voila! */
|
||||
|
||||
.text
|
||||
.globl ffi_closure_SYSV
|
||||
.globl CNAME(ffi_closure_SYSV)
|
||||
#ifdef __APPLE__
|
||||
.align 2
|
||||
#endif
|
||||
.cfi_startproc
|
||||
ffi_closure_SYSV:
|
||||
CNAME(ffi_closure_SYSV):
|
||||
stp x29, x30, [sp, #-16]!
|
||||
cfi_adjust_cfa_offset (16)
|
||||
cfi_rel_offset (x29, 0)
|
||||
cfi_rel_offset (x30, 8)
|
||||
|
||||
mov x29, sp
|
||||
cfi_def_cfa_register (x29)
|
||||
|
||||
sub sp, sp, #ffi_closure_SYSV_FS
|
||||
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
||||
|
||||
stp x21, x22, [x29, #-16]
|
||||
cfi_rel_offset (x21, 0)
|
||||
cfi_rel_offset (x22, 8)
|
||||
cfi_rel_offset (x21, -16)
|
||||
cfi_rel_offset (x22, -8)
|
||||
|
||||
/* Load x21 with &call_context. */
|
||||
mov x21, sp
|
||||
|
|
@ -270,7 +294,7 @@ ffi_closure_SYSV:
|
|||
trampoline was called. */
|
||||
add x2, x29, #16
|
||||
|
||||
bl ffi_closure_SYSV_inner
|
||||
bl CNAME(ffi_closure_SYSV_inner)
|
||||
|
||||
/* Figure out if we should touch the vector registers. */
|
||||
ldr x0, [x22, #8]
|
||||
|
|
@ -287,7 +311,7 @@ ffi_closure_SYSV:
|
|||
ldp x2, x3, [x21, #16]
|
||||
ldp x4, x5, [x21, #32]
|
||||
ldp x6, x7, [x21, #48]
|
||||
/* Note nothing usefull is returned in x8. */
|
||||
/* Note nothing useful is returned in x8. */
|
||||
|
||||
/* We are done, unwind our frame. */
|
||||
ldp x21, x22, [x29, #-16]
|
||||
|
|
@ -295,7 +319,7 @@ ffi_closure_SYSV:
|
|||
cfi_restore (x22)
|
||||
|
||||
mov sp, x29
|
||||
cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS)
|
||||
cfi_def_cfa_register (sp)
|
||||
|
||||
ldp x29, x30, [sp], #16
|
||||
cfi_adjust_cfa_offset (-16)
|
||||
|
|
@ -304,4 +328,6 @@ ffi_closure_SYSV:
|
|||
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size ffi_closure_SYSV, .-ffi_closure_SYSV
|
||||
#ifdef __ELF__
|
||||
.size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV)
|
||||
#endif
|
||||
|
|
|
|||
135
Modules/_ctypes/libffi/src/arc/arcompact.S
Normal file
135
Modules/_ctypes/libffi/src/arc/arcompact.S
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
arcompact.S - Copyright (c) 2013 Synposys, Inc. (www.synopsys.com)
|
||||
|
||||
ARCompact Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#define LIBFFI_ASM
|
||||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
#ifdef HAVE_MACHINE_ASM_H
|
||||
#include <machine/asm.h>
|
||||
#else
|
||||
#define CNAME(x) x
|
||||
#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x):
|
||||
#endif
|
||||
|
||||
.text
|
||||
|
||||
/* R0: ffi_prep_args */
|
||||
/* R1: &ecif */
|
||||
/* R2: cif->bytes */
|
||||
/* R3: fig->flags */
|
||||
/* R4: ecif.rvalue */
|
||||
/* R5: fn */
|
||||
ENTRY(ffi_call_ARCompact)
|
||||
/* Save registers. */
|
||||
st.a fp, [sp, -4] /* fp + 20, fp */
|
||||
push_s blink /* fp + 16, blink */
|
||||
st.a r4, [sp, -4] /* fp + 12, ecif.rvalue */
|
||||
push_s r3 /* fp + 8, fig->flags */
|
||||
st.a r5, [sp, -4] /* fp + 4, fn */
|
||||
push_s r2 /* fp + 0, cif->bytes */
|
||||
mov fp, sp
|
||||
|
||||
/* Make room for all of the new args. */
|
||||
sub sp, sp, r2
|
||||
|
||||
/* Place all of the ffi_prep_args in position. */
|
||||
/* ffi_prep_args(char *stack, extended_cif *ecif) */
|
||||
/* R1 already set. */
|
||||
|
||||
/* And call. */
|
||||
jl_s.d [r0]
|
||||
mov_s r0, sp
|
||||
|
||||
ld.ab r12, [fp, 4] /* cif->bytes */
|
||||
ld.ab r11, [fp, 4] /* fn */
|
||||
|
||||
/* Move first 8 parameters in registers... */
|
||||
ld_s r0, [sp]
|
||||
ld_s r1, [sp, 4]
|
||||
ld_s r2, [sp, 8]
|
||||
ld_s r3, [sp, 12]
|
||||
ld r4, [sp, 16]
|
||||
ld r5, [sp, 20]
|
||||
ld r6, [sp, 24]
|
||||
ld r7, [sp, 28]
|
||||
|
||||
/* ...and adjust the stack. */
|
||||
min r12, r12, 32
|
||||
|
||||
/* Call the function. */
|
||||
jl.d [r11]
|
||||
add sp, sp, r12
|
||||
|
||||
mov sp, fp
|
||||
pop_s r3 /* fig->flags, return type */
|
||||
pop_s r2 /* ecif.rvalue, pointer for return value */
|
||||
|
||||
/* If the return value pointer is NULL, assume no return value. */
|
||||
breq.d r2, 0, epilogue
|
||||
pop_s blink
|
||||
|
||||
/* Return INT. */
|
||||
brne r3, FFI_TYPE_INT, return_double
|
||||
b.d epilogue
|
||||
st_s r0, [r2]
|
||||
|
||||
return_double:
|
||||
brne r3, FFI_TYPE_DOUBLE, epilogue
|
||||
st_s r0, [r2]
|
||||
st_s r1, [r2,4]
|
||||
|
||||
epilogue:
|
||||
j_s.d [blink]
|
||||
ld.ab fp, [sp, 4]
|
||||
|
||||
ENTRY(ffi_closure_ARCompact)
|
||||
st.a r0, [sp, -32]
|
||||
st_s r1, [sp, 4]
|
||||
st_s r2, [sp, 8]
|
||||
st_s r3, [sp, 12]
|
||||
st r4, [sp, 16]
|
||||
st r5, [sp, 20]
|
||||
st r6, [sp, 24]
|
||||
st r7, [sp, 28]
|
||||
|
||||
/* pointer to arguments */
|
||||
mov_s r2, sp
|
||||
|
||||
/* return value goes here */
|
||||
sub sp, sp, 8
|
||||
mov_s r1, sp
|
||||
|
||||
push_s blink
|
||||
|
||||
bl.d ffi_closure_inner_ARCompact
|
||||
mov_s r0, r8 /* codeloc, set by trampoline */
|
||||
|
||||
pop_s blink
|
||||
|
||||
/* set return value to r1:r0 */
|
||||
pop_s r0
|
||||
pop_s r1
|
||||
j_s.d [blink]
|
||||
add_s sp, sp, 32
|
||||
268
Modules/_ctypes/libffi/src/arc/ffi.c
Normal file
268
Modules/_ctypes/libffi/src/arc/ffi.c
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com)
|
||||
|
||||
ARC Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#include <ffi.h>
|
||||
#include <ffi_common.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sys/cachectl.h>
|
||||
|
||||
/* for little endian ARC, the code is in fact stored as mixed endian for
|
||||
performance reasons */
|
||||
#if __BIG_ENDIAN__
|
||||
#define CODE_ENDIAN(x) (x)
|
||||
#else
|
||||
#define CODE_ENDIAN(x) ( (((uint32_t) (x)) << 16) | (((uint32_t) (x)) >> 16))
|
||||
#endif
|
||||
|
||||
/* ffi_prep_args is called by the assembly routine once stack
|
||||
space has been allocated for the function's arguments. */
|
||||
|
||||
void
|
||||
ffi_prep_args (char *stack, extended_cif * ecif)
|
||||
{
|
||||
unsigned int i;
|
||||
int tmp;
|
||||
void **p_argv;
|
||||
char *argp;
|
||||
ffi_type **p_arg;
|
||||
|
||||
tmp = 0;
|
||||
argp = stack;
|
||||
|
||||
if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
|
||||
{
|
||||
*(void **) argp = ecif->rvalue;
|
||||
argp += 4;
|
||||
}
|
||||
|
||||
p_argv = ecif->avalue;
|
||||
|
||||
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
|
||||
(i != 0); i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
int alignment;
|
||||
|
||||
/* align alignment to 4 */
|
||||
alignment = (((*p_arg)->alignment - 1) | 3) + 1;
|
||||
|
||||
/* Align if necessary. */
|
||||
if ((alignment - 1) & (unsigned) argp)
|
||||
argp = (char *) ALIGN (argp, alignment);
|
||||
|
||||
z = (*p_arg)->size;
|
||||
if (z < sizeof (int))
|
||||
{
|
||||
z = sizeof (int);
|
||||
|
||||
switch ((*p_arg)->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *) argp = (signed int) *(SINT8 *) (*p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *) argp = (signed int) *(SINT16 *) (*p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
memcpy (argp, *p_argv, (*p_arg)->size);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
}
|
||||
else if (z == sizeof (int))
|
||||
{
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((*p_arg)->type == FFI_TYPE_STRUCT)
|
||||
{
|
||||
memcpy (argp, *p_argv, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Double or long long 64bit. */
|
||||
memcpy (argp, *p_argv, z);
|
||||
}
|
||||
}
|
||||
p_argv++;
|
||||
argp += z;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Perform machine dependent cif processing. */
|
||||
ffi_status
|
||||
ffi_prep_cif_machdep (ffi_cif * cif)
|
||||
{
|
||||
/* Set the return type flag. */
|
||||
switch (cif->rtype->type)
|
||||
{
|
||||
case FFI_TYPE_VOID:
|
||||
cif->flags = (unsigned) cif->rtype->type;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
cif->flags = (unsigned) cif->rtype->type;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
cif->flags = FFI_TYPE_DOUBLE;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_FLOAT:
|
||||
default:
|
||||
cif->flags = FFI_TYPE_INT;
|
||||
break;
|
||||
}
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
extern void ffi_call_ARCompact (void (*)(char *, extended_cif *),
|
||||
extended_cif *, unsigned, unsigned,
|
||||
unsigned *, void (*fn) (void));
|
||||
|
||||
void
|
||||
ffi_call (ffi_cif * cif, void (*fn) (void), void *rvalue, void **avalue)
|
||||
{
|
||||
extended_cif ecif;
|
||||
|
||||
ecif.cif = cif;
|
||||
ecif.avalue = avalue;
|
||||
|
||||
/* If the return value is a struct and we don't have
|
||||
a return value address then we need to make one. */
|
||||
if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT))
|
||||
{
|
||||
ecif.rvalue = alloca (cif->rtype->size);
|
||||
}
|
||||
else
|
||||
ecif.rvalue = rvalue;
|
||||
|
||||
switch (cif->abi)
|
||||
{
|
||||
case FFI_ARCOMPACT:
|
||||
ffi_call_ARCompact (ffi_prep_args, &ecif, cif->bytes,
|
||||
cif->flags, ecif.rvalue, fn);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
ffi_closure_inner_ARCompact (ffi_closure * closure, void *rvalue,
|
||||
ffi_arg * args)
|
||||
{
|
||||
void **arg_area, **p_argv;
|
||||
ffi_cif *cif = closure->cif;
|
||||
char *argp = (char *) args;
|
||||
ffi_type **p_argt;
|
||||
int i;
|
||||
|
||||
arg_area = (void **) alloca (cif->nargs * sizeof (void *));
|
||||
|
||||
/* handle hidden argument */
|
||||
if (cif->flags == FFI_TYPE_STRUCT)
|
||||
{
|
||||
rvalue = *(void **) argp;
|
||||
argp += 4;
|
||||
}
|
||||
|
||||
p_argv = arg_area;
|
||||
|
||||
for (i = 0, p_argt = cif->arg_types; i < cif->nargs;
|
||||
i++, p_argt++, p_argv++)
|
||||
{
|
||||
size_t z;
|
||||
int alignment;
|
||||
|
||||
/* align alignment to 4 */
|
||||
alignment = (((*p_argt)->alignment - 1) | 3) + 1;
|
||||
|
||||
/* Align if necessary. */
|
||||
if ((alignment - 1) & (unsigned) argp)
|
||||
argp = (char *) ALIGN (argp, alignment);
|
||||
|
||||
z = (*p_argt)->size;
|
||||
*p_argv = (void *) argp;
|
||||
argp += z;
|
||||
}
|
||||
|
||||
(closure->fun) (cif, rvalue, arg_area, closure->user_data);
|
||||
|
||||
return cif->flags;
|
||||
}
|
||||
|
||||
extern void ffi_closure_ARCompact (void);
|
||||
|
||||
ffi_status
|
||||
ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif,
|
||||
void (*fun) (ffi_cif *, void *, void **, void *),
|
||||
void *user_data, void *codeloc)
|
||||
{
|
||||
uint32_t *tramp = (uint32_t *) & (closure->tramp[0]);
|
||||
|
||||
switch (cif->abi)
|
||||
{
|
||||
case FFI_ARCOMPACT:
|
||||
FFI_ASSERT (tramp == codeloc);
|
||||
tramp[0] = CODE_ENDIAN (0x200a1fc0); /* mov r8, pcl */
|
||||
tramp[1] = CODE_ENDIAN (0x20200f80); /* j [long imm] */
|
||||
tramp[2] = CODE_ENDIAN (ffi_closure_ARCompact);
|
||||
break;
|
||||
|
||||
default:
|
||||
return FFI_BAD_ABI;
|
||||
}
|
||||
|
||||
closure->cif = cif;
|
||||
closure->fun = fun;
|
||||
closure->user_data = user_data;
|
||||
cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, BCACHE);
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
53
Modules/_ctypes/libffi/src/arc/ffitarget.h
Normal file
53
Modules/_ctypes/libffi/src/arc/ffitarget.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffitarget.h - Copyright (c) 2012 Anthony Green
|
||||
Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com)
|
||||
Target configuration macros for ARC.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#ifndef LIBFFI_TARGET_H
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifndef LIBFFI_H
|
||||
#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
|
||||
#endif
|
||||
|
||||
/* ---- Generic type definitions ----------------------------------------- */
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
typedef unsigned long ffi_arg;
|
||||
typedef signed long ffi_sarg;
|
||||
|
||||
typedef enum ffi_abi
|
||||
{
|
||||
FFI_FIRST_ABI = 0,
|
||||
FFI_ARCOMPACT,
|
||||
FFI_LAST_ABI,
|
||||
FFI_DEFAULT_ABI = FFI_ARCOMPACT
|
||||
} ffi_abi;
|
||||
#endif
|
||||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_TRAMPOLINE_SIZE 12
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
|
||||
#endif
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 2011 Free Software Foundation
|
||||
Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
|
||||
|
||||
ARM Foreign Function Interface
|
||||
|
||||
ARM Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
|
@ -37,6 +37,87 @@
|
|||
static int vfp_type_p (ffi_type *);
|
||||
static void layout_vfp_args (ffi_cif *);
|
||||
|
||||
int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space);
|
||||
int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space);
|
||||
|
||||
static char* ffi_align(ffi_type **p_arg, char *argp)
|
||||
{
|
||||
/* Align if necessary */
|
||||
register size_t alignment = (*p_arg)->alignment;
|
||||
if (alignment < 4)
|
||||
{
|
||||
alignment = 4;
|
||||
}
|
||||
#ifdef _WIN32_WCE
|
||||
if (alignment > 4)
|
||||
{
|
||||
alignment = 4;
|
||||
}
|
||||
#endif
|
||||
if ((alignment - 1) & (unsigned) argp)
|
||||
{
|
||||
argp = (char *) ALIGN(argp, alignment);
|
||||
}
|
||||
|
||||
if ((*p_arg)->type == FFI_TYPE_STRUCT)
|
||||
{
|
||||
argp = (char *) ALIGN(argp, 4);
|
||||
}
|
||||
return argp;
|
||||
}
|
||||
|
||||
static size_t ffi_put_arg(ffi_type **arg_type, void **arg, char *stack)
|
||||
{
|
||||
register char* argp = stack;
|
||||
register ffi_type **p_arg = arg_type;
|
||||
register void **p_argv = arg;
|
||||
register size_t z = (*p_arg)->size;
|
||||
if (z < sizeof(int))
|
||||
{
|
||||
z = sizeof(int);
|
||||
switch ((*p_arg)->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
memcpy(argp, *p_argv, (*p_arg)->size);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT(0);
|
||||
}
|
||||
}
|
||||
else if (z == sizeof(int))
|
||||
{
|
||||
if ((*p_arg)->type == FFI_TYPE_FLOAT)
|
||||
*(float *) argp = *(float *)(* p_argv);
|
||||
else
|
||||
*(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
|
||||
}
|
||||
else if (z == sizeof(double) && (*p_arg)->type == FFI_TYPE_DOUBLE)
|
||||
{
|
||||
*(double *) argp = *(double *)(* p_argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(argp, *p_argv, z);
|
||||
}
|
||||
return z;
|
||||
}
|
||||
/* ffi_prep_args is called by the assembly routine once stack space
|
||||
has been allocated for the function's arguments
|
||||
|
||||
|
|
@ -44,14 +125,14 @@ static void layout_vfp_args (ffi_cif *);
|
|||
value is cif->vfp_used (word bitset of VFP regs used for passing
|
||||
arguments). These are only used for the VFP hard-float ABI.
|
||||
*/
|
||||
int ffi_prep_args(char *stack, extended_cif *ecif, float *vfp_space)
|
||||
int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space)
|
||||
{
|
||||
register unsigned int i, vi = 0;
|
||||
register unsigned int i;
|
||||
register void **p_argv;
|
||||
register char *argp;
|
||||
register ffi_type **p_arg;
|
||||
|
||||
argp = stack;
|
||||
|
||||
|
||||
if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
|
||||
*(void **) argp = ecif->rvalue;
|
||||
|
|
@ -62,81 +143,89 @@ int ffi_prep_args(char *stack, extended_cif *ecif, float *vfp_space)
|
|||
|
||||
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
|
||||
(i != 0);
|
||||
i--, p_arg++)
|
||||
i--, p_arg++, p_argv++)
|
||||
{
|
||||
size_t z;
|
||||
size_t alignment;
|
||||
|
||||
/* Allocated in VFP registers. */
|
||||
if (ecif->cif->abi == FFI_VFP
|
||||
&& vi < ecif->cif->vfp_nargs && vfp_type_p (*p_arg))
|
||||
{
|
||||
float* vfp_slot = vfp_space + ecif->cif->vfp_args[vi++];
|
||||
if ((*p_arg)->type == FFI_TYPE_FLOAT)
|
||||
*((float*)vfp_slot) = *((float*)*p_argv);
|
||||
else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
|
||||
*((double*)vfp_slot) = *((double*)*p_argv);
|
||||
else
|
||||
memcpy(vfp_slot, *p_argv, (*p_arg)->size);
|
||||
p_argv++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Align if necessary */
|
||||
alignment = (*p_arg)->alignment;
|
||||
#ifdef _WIN32_WCE
|
||||
if (alignment > 4)
|
||||
alignment = 4;
|
||||
#endif
|
||||
if ((alignment - 1) & (unsigned) argp) {
|
||||
argp = (char *) ALIGN(argp, alignment);
|
||||
}
|
||||
|
||||
if ((*p_arg)->type == FFI_TYPE_STRUCT)
|
||||
argp = (char *) ALIGN(argp, 4);
|
||||
|
||||
z = (*p_arg)->size;
|
||||
if (z < sizeof(int))
|
||||
{
|
||||
z = sizeof(int);
|
||||
switch ((*p_arg)->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
memcpy(argp, *p_argv, (*p_arg)->size);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT(0);
|
||||
}
|
||||
}
|
||||
else if (z == sizeof(int))
|
||||
{
|
||||
*(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(argp, *p_argv, z);
|
||||
}
|
||||
p_argv++;
|
||||
argp += z;
|
||||
argp = ffi_align(p_arg, argp);
|
||||
argp += ffi_put_arg(p_arg, p_argv, argp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
|
||||
{
|
||||
// make sure we are using FFI_VFP
|
||||
FFI_ASSERT(ecif->cif->abi == FFI_VFP);
|
||||
|
||||
register unsigned int i, vi = 0;
|
||||
register void **p_argv;
|
||||
register char *argp, *regp, *eo_regp;
|
||||
register ffi_type **p_arg;
|
||||
char stack_used = 0;
|
||||
char done_with_regs = 0;
|
||||
char is_vfp_type;
|
||||
|
||||
/* the first 4 words on the stack are used for values passed in core
|
||||
* registers. */
|
||||
regp = stack;
|
||||
eo_regp = argp = regp + 16;
|
||||
|
||||
|
||||
/* if the function returns an FFI_TYPE_STRUCT in memory, that address is
|
||||
* passed in r0 to the function */
|
||||
if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
|
||||
*(void **) regp = ecif->rvalue;
|
||||
regp += 4;
|
||||
}
|
||||
|
||||
p_argv = ecif->avalue;
|
||||
|
||||
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
|
||||
(i != 0);
|
||||
i--, p_arg++, p_argv++)
|
||||
{
|
||||
is_vfp_type = vfp_type_p (*p_arg);
|
||||
|
||||
/* Allocated in VFP registers. */
|
||||
if(vi < ecif->cif->vfp_nargs && is_vfp_type)
|
||||
{
|
||||
char *vfp_slot = (char *)(vfp_space + ecif->cif->vfp_args[vi++]);
|
||||
ffi_put_arg(p_arg, p_argv, vfp_slot);
|
||||
continue;
|
||||
}
|
||||
/* Try allocating in core registers. */
|
||||
else if (!done_with_regs && !is_vfp_type)
|
||||
{
|
||||
char *tregp = ffi_align(p_arg, regp);
|
||||
size_t size = (*p_arg)->size;
|
||||
size = (size < 4)? 4 : size; // pad
|
||||
/* Check if there is space left in the aligned register area to place
|
||||
* the argument */
|
||||
if(tregp + size <= eo_regp)
|
||||
{
|
||||
regp = tregp + ffi_put_arg(p_arg, p_argv, tregp);
|
||||
done_with_regs = (regp == argp);
|
||||
// ensure we did not write into the stack area
|
||||
FFI_ASSERT(regp <= argp);
|
||||
continue;
|
||||
}
|
||||
/* In case there are no arguments in the stack area yet,
|
||||
the argument is passed in the remaining core registers and on the
|
||||
stack. */
|
||||
else if (!stack_used)
|
||||
{
|
||||
stack_used = 1;
|
||||
done_with_regs = 1;
|
||||
argp = tregp + ffi_put_arg(p_arg, p_argv, tregp);
|
||||
FFI_ASSERT(eo_regp < argp);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* Base case, arguments are passed on the stack */
|
||||
stack_used = 1;
|
||||
argp = ffi_align(p_arg, argp);
|
||||
argp += ffi_put_arg(p_arg, p_argv, argp);
|
||||
}
|
||||
/* Indicate the VFP registers used. */
|
||||
return ecif->cif->vfp_used;
|
||||
}
|
||||
|
|
@ -227,7 +316,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
ecif.avalue = avalue;
|
||||
|
||||
/* If the return value is a struct and we don't have a return */
|
||||
/* value address then we need to make one */
|
||||
/* value address then we need to make one */
|
||||
|
||||
if ((rvalue == NULL) &&
|
||||
(cif->flags == FFI_TYPE_STRUCT))
|
||||
|
|
@ -261,9 +350,17 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
break;
|
||||
}
|
||||
if (small_struct)
|
||||
memcpy (rvalue, &temp, cif->rtype->size);
|
||||
{
|
||||
FFI_ASSERT(rvalue != NULL);
|
||||
memcpy (rvalue, &temp, cif->rtype->size);
|
||||
}
|
||||
|
||||
else if (vfp_struct)
|
||||
memcpy (rvalue, ecif.rvalue, cif->rtype->size);
|
||||
{
|
||||
FFI_ASSERT(rvalue != NULL);
|
||||
memcpy (rvalue, ecif.rvalue, cif->rtype->size);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** private members **/
|
||||
|
|
@ -271,18 +368,18 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
|
||||
void** args, ffi_cif* cif, float *vfp_stack);
|
||||
|
||||
static void ffi_prep_incoming_args_VFP (char *stack, void **ret,
|
||||
void** args, ffi_cif* cif, float *vfp_stack);
|
||||
|
||||
void ffi_closure_SYSV (ffi_closure *);
|
||||
|
||||
void ffi_closure_VFP (ffi_closure *);
|
||||
|
||||
/* This function is jumped to by the trampoline */
|
||||
|
||||
unsigned int
|
||||
ffi_closure_SYSV_inner(
|
||||
ffi_closure *closure,
|
||||
void **respp,
|
||||
void *args,
|
||||
void *vfp_args)
|
||||
unsigned int FFI_HIDDEN
|
||||
ffi_closure_inner (ffi_closure *closure,
|
||||
void **respp, void *args, void *vfp_args)
|
||||
{
|
||||
// our various things...
|
||||
ffi_cif *cif;
|
||||
|
|
@ -296,8 +393,10 @@ ffi_closure_SYSV_inner(
|
|||
* value on the stack; and if the function returns
|
||||
* a structure, it will re-set RESP to point to the
|
||||
* structure return address. */
|
||||
|
||||
ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args);
|
||||
if (cif->abi == FFI_VFP)
|
||||
ffi_prep_incoming_args_VFP(args, respp, arg_area, cif, vfp_args);
|
||||
else
|
||||
ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args);
|
||||
|
||||
(closure->fun) (cif, *respp, arg_area, closure->user_data);
|
||||
|
||||
|
|
@ -312,7 +411,7 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
|
|||
float *vfp_stack)
|
||||
/*@=exportheader@*/
|
||||
{
|
||||
register unsigned int i, vi = 0;
|
||||
register unsigned int i;
|
||||
register void **p_argv;
|
||||
register char *argp;
|
||||
register ffi_type **p_arg;
|
||||
|
|
@ -329,27 +428,8 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
|
|||
for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
size_t alignment;
|
||||
|
||||
if (cif->abi == FFI_VFP
|
||||
&& vi < cif->vfp_nargs && vfp_type_p (*p_arg))
|
||||
{
|
||||
*p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]);
|
||||
continue;
|
||||
}
|
||||
|
||||
alignment = (*p_arg)->alignment;
|
||||
if (alignment < 4)
|
||||
alignment = 4;
|
||||
#ifdef _WIN32_WCE
|
||||
else
|
||||
if (alignment > 4)
|
||||
alignment = 4;
|
||||
#endif
|
||||
/* Align if necessary */
|
||||
if ((alignment - 1) & (unsigned) argp) {
|
||||
argp = (char *) ALIGN(argp, alignment);
|
||||
}
|
||||
argp = ffi_align(p_arg, argp);
|
||||
|
||||
z = (*p_arg)->size;
|
||||
|
||||
|
|
@ -364,6 +444,95 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
|
|||
return;
|
||||
}
|
||||
|
||||
/*@-exportheader@*/
|
||||
static void
|
||||
ffi_prep_incoming_args_VFP(char *stack, void **rvalue,
|
||||
void **avalue, ffi_cif *cif,
|
||||
/* Used only under VFP hard-float ABI. */
|
||||
float *vfp_stack)
|
||||
/*@=exportheader@*/
|
||||
{
|
||||
register unsigned int i, vi = 0;
|
||||
register void **p_argv;
|
||||
register char *argp, *regp, *eo_regp;
|
||||
register ffi_type **p_arg;
|
||||
char done_with_regs = 0;
|
||||
char stack_used = 0;
|
||||
char is_vfp_type;
|
||||
|
||||
FFI_ASSERT(cif->abi == FFI_VFP);
|
||||
regp = stack;
|
||||
eo_regp = argp = regp + 16;
|
||||
|
||||
if ( cif->flags == FFI_TYPE_STRUCT ) {
|
||||
*rvalue = *(void **) regp;
|
||||
regp += 4;
|
||||
}
|
||||
|
||||
p_argv = avalue;
|
||||
|
||||
for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
is_vfp_type = vfp_type_p (*p_arg);
|
||||
|
||||
if(vi < cif->vfp_nargs && is_vfp_type)
|
||||
{
|
||||
*p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]);
|
||||
continue;
|
||||
}
|
||||
else if (!done_with_regs && !is_vfp_type)
|
||||
{
|
||||
char* tregp = ffi_align(p_arg, regp);
|
||||
|
||||
z = (*p_arg)->size;
|
||||
z = (z < 4)? 4 : z; // pad
|
||||
|
||||
/* if the arguments either fits into the registers or uses registers
|
||||
* and stack, while we haven't read other things from the stack */
|
||||
if(tregp + z <= eo_regp || !stack_used)
|
||||
{
|
||||
/* because we're little endian, this is what it turns into. */
|
||||
*p_argv = (void*) tregp;
|
||||
|
||||
p_argv++;
|
||||
regp = tregp + z;
|
||||
// if we read past the last core register, make sure we have not read
|
||||
// from the stack before and continue reading after regp
|
||||
if(regp > eo_regp)
|
||||
{
|
||||
if(stack_used)
|
||||
{
|
||||
abort(); // we should never read past the end of the register
|
||||
// are if the stack is already in use
|
||||
}
|
||||
argp = regp;
|
||||
}
|
||||
if(regp >= eo_regp)
|
||||
{
|
||||
done_with_regs = 1;
|
||||
stack_used = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
stack_used = 1;
|
||||
|
||||
argp = ffi_align(p_arg, argp);
|
||||
|
||||
z = (*p_arg)->size;
|
||||
|
||||
/* because we're little endian, this is what it turns into. */
|
||||
|
||||
*p_argv = (void*) argp;
|
||||
|
||||
p_argv++;
|
||||
argp += z;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* How to make a trampoline. */
|
||||
|
||||
extern unsigned int ffi_arm_trampoline[3];
|
||||
|
|
@ -381,7 +550,7 @@ typedef struct ffi_trampoline_table ffi_trampoline_table;
|
|||
typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
|
||||
|
||||
struct ffi_trampoline_table {
|
||||
/* contigious writable and executable pages */
|
||||
/* contiguous writable and executable pages */
|
||||
vm_address_t config_page;
|
||||
vm_address_t trampoline_page;
|
||||
|
||||
|
|
@ -421,7 +590,7 @@ ffi_trampoline_table_alloc ()
|
|||
{
|
||||
ffi_trampoline_table *table = NULL;
|
||||
|
||||
/* Loop until we can allocate two contigious pages */
|
||||
/* Loop until we can allocate two contiguous pages */
|
||||
while (table == NULL) {
|
||||
vm_address_t config_page = 0x0;
|
||||
kern_return_t kt;
|
||||
|
|
@ -617,7 +786,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
|||
#endif
|
||||
else
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
|
||||
#if FFI_EXEC_TRAMPOLINE_TABLE
|
||||
void **config = FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc);
|
||||
config[0] = closure;
|
||||
|
|
@ -700,9 +869,9 @@ static int vfp_type_p (ffi_type *t)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void place_vfp_arg (ffi_cif *cif, ffi_type *t)
|
||||
static int place_vfp_arg (ffi_cif *cif, ffi_type *t)
|
||||
{
|
||||
int reg = cif->vfp_reg_free;
|
||||
short reg = cif->vfp_reg_free;
|
||||
int nregs = t->size / sizeof (float);
|
||||
int align = ((t->type == FFI_TYPE_STRUCT_VFP_FLOAT
|
||||
|| t->type == FFI_TYPE_FLOAT) ? 1 : 2);
|
||||
|
|
@ -733,9 +902,13 @@ static void place_vfp_arg (ffi_cif *cif, ffi_type *t)
|
|||
reg += 1;
|
||||
cif->vfp_reg_free = reg;
|
||||
}
|
||||
return;
|
||||
return 0;
|
||||
next_reg: ;
|
||||
}
|
||||
// done, mark all regs as used
|
||||
cif->vfp_reg_free = 16;
|
||||
cif->vfp_used = 0xFFFF;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void layout_vfp_args (ffi_cif *cif)
|
||||
|
|
@ -750,7 +923,9 @@ static void layout_vfp_args (ffi_cif *cif)
|
|||
for (i = 0; i < cif->nargs; i++)
|
||||
{
|
||||
ffi_type *t = cif->arg_types[i];
|
||||
if (vfp_type_p (t))
|
||||
place_vfp_arg (cif, t);
|
||||
if (vfp_type_p (t) && place_vfp_arg (cif, t) == 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ EOF
|
|||
}
|
||||
|
||||
|
||||
# WARNING - Don't modify the trampoline code size without also updating the relevent libffi code
|
||||
# WARNING - Don't modify the trampoline code size without also updating the relevant libffi code
|
||||
trampoline () {
|
||||
cat << END
|
||||
|
||||
|
|
|
|||
|
|
@ -109,42 +109,27 @@
|
|||
#define UNWIND @
|
||||
#endif
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
|
||||
.macro ARM_FUNC_START name
|
||||
.text
|
||||
.align 0
|
||||
.thumb
|
||||
.thumb_func
|
||||
#ifdef __APPLE__
|
||||
ENTRY($0)
|
||||
#define ARM_FUNC_START(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
.thumb; \
|
||||
.thumb_func; \
|
||||
ENTRY(name); \
|
||||
bx pc; \
|
||||
nop; \
|
||||
.arm; \
|
||||
UNWIND .fnstart; \
|
||||
_L__##name:
|
||||
#else
|
||||
ENTRY(\name)
|
||||
#endif
|
||||
bx pc
|
||||
nop
|
||||
.arm
|
||||
#define ARM_FUNC_START(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
.arm; \
|
||||
ENTRY(name); \
|
||||
UNWIND .fnstart
|
||||
/* A hook to tell gdb that we've switched to ARM mode. Also used to call
|
||||
directly from other local arm routines. */
|
||||
#ifdef __APPLE__
|
||||
_L__$0:
|
||||
#else
|
||||
_L__\name:
|
||||
#endif
|
||||
.endm
|
||||
#else
|
||||
.macro ARM_FUNC_START name
|
||||
.text
|
||||
.align 0
|
||||
.arm
|
||||
#ifdef __APPLE__
|
||||
ENTRY($0)
|
||||
#else
|
||||
ENTRY(\name)
|
||||
#endif
|
||||
UNWIND .fnstart
|
||||
.endm
|
||||
#endif
|
||||
|
||||
.macro RETLDM regs=, cond=, dirn=ia
|
||||
|
|
@ -171,7 +156,7 @@ _L__\name:
|
|||
@ sp+0: ecif.rvalue
|
||||
|
||||
@ This assumes we are using gas.
|
||||
ARM_FUNC_START ffi_call_SYSV
|
||||
ARM_FUNC_START(ffi_call_SYSV)
|
||||
@ Save registers
|
||||
stmfd sp!, {r0-r3, fp, lr}
|
||||
UNWIND .save {r0-r3, fp, lr}
|
||||
|
|
@ -187,7 +172,7 @@ ARM_FUNC_START ffi_call_SYSV
|
|||
@ r1 already set
|
||||
|
||||
@ Call ffi_prep_args(stack, &ecif)
|
||||
bl CNAME(ffi_prep_args)
|
||||
bl CNAME(ffi_prep_args_SYSV)
|
||||
|
||||
@ move first 4 parameters in registers
|
||||
ldmia sp, {r0-r3}
|
||||
|
|
@ -228,7 +213,7 @@ ARM_FUNC_START ffi_call_SYSV
|
|||
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
|
||||
cmpne r3, #FFI_TYPE_DOUBLE
|
||||
#endif
|
||||
stmeqia r2, {r0, r1}
|
||||
stmiaeq r2, {r0, r1}
|
||||
|
||||
#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
|
||||
beq LSYM(Lepilogue)
|
||||
|
|
@ -260,13 +245,13 @@ LSYM(Lepilogue):
|
|||
|
||||
/*
|
||||
unsigned int FFI_HIDDEN
|
||||
ffi_closure_SYSV_inner (closure, respp, args)
|
||||
ffi_closure_inner (closure, respp, args)
|
||||
ffi_closure *closure;
|
||||
void **respp;
|
||||
void *args;
|
||||
*/
|
||||
|
||||
ARM_FUNC_START ffi_closure_SYSV
|
||||
ARM_FUNC_START(ffi_closure_SYSV)
|
||||
UNWIND .pad #16
|
||||
add ip, sp, #16
|
||||
stmfd sp!, {ip, lr}
|
||||
|
|
@ -276,7 +261,7 @@ ARM_FUNC_START ffi_closure_SYSV
|
|||
sub sp, sp, #16
|
||||
str sp, [sp, #8]
|
||||
add r1, sp, #8
|
||||
bl CNAME(ffi_closure_SYSV_inner)
|
||||
bl CNAME(ffi_closure_inner)
|
||||
cmp r0, #FFI_TYPE_INT
|
||||
beq .Lretint
|
||||
|
||||
|
|
@ -345,7 +330,7 @@ ARM_FUNC_START ffi_closure_SYSV
|
|||
@ r3: fig->flags
|
||||
@ sp+0: ecif.rvalue
|
||||
|
||||
ARM_FUNC_START ffi_call_VFP
|
||||
ARM_FUNC_START(ffi_call_VFP)
|
||||
@ Save registers
|
||||
stmfd sp!, {r0-r3, fp, lr}
|
||||
UNWIND .save {r0-r3, fp, lr}
|
||||
|
|
@ -364,10 +349,11 @@ ARM_FUNC_START ffi_call_VFP
|
|||
sub r2, fp, #64 @ VFP scratch space
|
||||
|
||||
@ Call ffi_prep_args(stack, &ecif, vfp_space)
|
||||
bl CNAME(ffi_prep_args)
|
||||
bl CNAME(ffi_prep_args_VFP)
|
||||
|
||||
@ Load VFP register args if needed
|
||||
cmp r0, #0
|
||||
mov ip, fp
|
||||
beq LSYM(Lbase_args)
|
||||
|
||||
@ Load only d0 if possible
|
||||
|
|
@ -433,7 +419,7 @@ LSYM(Lepilogue_vfp):
|
|||
.size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
|
||||
|
||||
|
||||
ARM_FUNC_START ffi_closure_VFP
|
||||
ARM_FUNC_START(ffi_closure_VFP)
|
||||
fstmfdd sp!, {d0-d7}
|
||||
@ r0-r3, then d0-d7
|
||||
UNWIND .pad #80
|
||||
|
|
@ -446,7 +432,7 @@ ARM_FUNC_START ffi_closure_VFP
|
|||
sub sp, sp, #72
|
||||
str sp, [sp, #64]
|
||||
add r1, sp, #64
|
||||
bl CNAME(ffi_closure_SYSV_inner)
|
||||
bl CNAME(ffi_closure_inner)
|
||||
|
||||
cmp r0, #FFI_TYPE_INT
|
||||
beq .Lretint_vfp
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
|
||||
ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
|
||||
Paulo Pizarro <paulo.pizarro@gmail.com>
|
||||
|
||||
Blackfin Foreign Function Interface
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
|
||||
sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
|
||||
Paulo Pizarro <paulo.pizarro@gmail.com>
|
||||
|
||||
Blackfin Foreign Function Interface
|
||||
|
||||
|
|
@ -32,7 +33,7 @@
|
|||
.align 4
|
||||
|
||||
/*
|
||||
There is a "feature" in the bfin toolchain that it puts a _ before funcion names
|
||||
There is a "feature" in the bfin toolchain that it puts a _ before function names
|
||||
that's why the function here it's called _ffi_call_SYSV and not ffi_call_SYSV
|
||||
*/
|
||||
.global _ffi_call_SYSV;
|
||||
|
|
@ -40,25 +41,26 @@
|
|||
.func ffi_call_SYSV
|
||||
|
||||
/*
|
||||
cif->bytes = R0 (fp+8)
|
||||
&ecif = R1 (fp+12)
|
||||
ffi_prep_args = R2 (fp+16)
|
||||
ret_type = stack (fp+20)
|
||||
ecif.rvalue = stack (fp+24)
|
||||
fn = stack (fp+28)
|
||||
got (fp+32)
|
||||
There is room for improvement here (we can use temporary registers
|
||||
instead of saving the values in the memory)
|
||||
REGS:
|
||||
P5 => Stack pointer (function arguments)
|
||||
R5 => cif->bytes
|
||||
R4 => ret->type
|
||||
cif->bytes = R0 (fp+8)
|
||||
&ecif = R1 (fp+12)
|
||||
ffi_prep_args = R2 (fp+16)
|
||||
ret_type = stack (fp+20)
|
||||
ecif.rvalue = stack (fp+24)
|
||||
fn = stack (fp+28)
|
||||
got (fp+32)
|
||||
|
||||
FP-20 = P3
|
||||
FP-16 = SP (parameters area)
|
||||
FP-12 = SP (temp)
|
||||
FP-08 = function return part 1 [R0]
|
||||
FP-04 = function return part 2 [R1]
|
||||
There is room for improvement here (we can use temporary registers
|
||||
instead of saving the values in the memory)
|
||||
REGS:
|
||||
P5 => Stack pointer (function arguments)
|
||||
R5 => cif->bytes
|
||||
R4 => ret->type
|
||||
|
||||
FP-20 = P3
|
||||
FP-16 = SP (parameters area)
|
||||
FP-12 = SP (temp)
|
||||
FP-08 = function return part 1 [R0]
|
||||
FP-04 = function return part 2 [R1]
|
||||
*/
|
||||
|
||||
_ffi_call_SYSV:
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include <ffi_common.h>
|
||||
|
||||
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
|
||||
# if __gnu_linux__
|
||||
# if __gnu_linux__ && !defined(__ANDROID__)
|
||||
/* This macro indicates it may be forbidden to map anonymous memory
|
||||
with both write and execute permission. Code compiled when this
|
||||
option is defined will attempt to map such pages once, but if it
|
||||
|
|
@ -181,10 +181,26 @@ static int emutramp_enabled = -1;
|
|||
static int
|
||||
emutramp_enabled_check (void)
|
||||
{
|
||||
if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL)
|
||||
return 1;
|
||||
else
|
||||
char *buf = NULL;
|
||||
size_t len = 0;
|
||||
FILE *f;
|
||||
int ret;
|
||||
f = fopen ("/proc/self/status", "r");
|
||||
if (f == NULL)
|
||||
return 0;
|
||||
ret = 0;
|
||||
|
||||
while (getline (&buf, &len, f) != -1)
|
||||
if (!strncmp (buf, "PaX:", 4))
|
||||
{
|
||||
char emutramp;
|
||||
if (sscanf (buf, "%*s %*c%c", &emutramp) == 1)
|
||||
ret = (emutramp == 'E');
|
||||
break;
|
||||
}
|
||||
free (buf);
|
||||
fclose (f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
|
||||
|
|
@ -264,7 +280,7 @@ static int
|
|||
open_temp_exec_file_dir (const char *dir)
|
||||
{
|
||||
static const char suffix[] = "/ffiXXXXXX";
|
||||
int lendir = strlen (dir);
|
||||
size_t lendir = strlen (dir);
|
||||
char *tempname = __builtin_alloca (lendir + sizeof (suffix));
|
||||
|
||||
if (!tempname)
|
||||
|
|
@ -382,7 +398,7 @@ open_temp_exec_file_opts_next (void)
|
|||
}
|
||||
|
||||
/* Return a file descriptor of a temporary zero-sized file in a
|
||||
writable and exexutable filesystem. */
|
||||
writable and executable filesystem. */
|
||||
static int
|
||||
open_temp_exec_file (void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1260,7 +1260,7 @@ extern void* sbrk(ptrdiff_t);
|
|||
#define SIZE_T_BITSIZE (sizeof(size_t) << 3)
|
||||
|
||||
/* Some constants coerced to size_t */
|
||||
/* Annoying but necessary to avoid errors on some plaftorms */
|
||||
/* Annoying but necessary to avoid errors on some platforms */
|
||||
#define SIZE_T_ZERO ((size_t)0)
|
||||
#define SIZE_T_ONE ((size_t)1)
|
||||
#define SIZE_T_TWO ((size_t)2)
|
||||
|
|
@ -1414,7 +1414,7 @@ static int win32munmap(void* ptr, size_t size) {
|
|||
#define CALL_MORECORE(S) MFAIL
|
||||
#endif /* HAVE_MORECORE */
|
||||
|
||||
/* mstate bit set if continguous morecore disabled or failed */
|
||||
/* mstate bit set if contiguous morecore disabled or failed */
|
||||
#define USE_NONCONTIGUOUS_BIT (4U)
|
||||
|
||||
/* segment bit set in create_mspace_with_base */
|
||||
|
|
@ -1666,7 +1666,7 @@ struct malloc_chunk {
|
|||
typedef struct malloc_chunk mchunk;
|
||||
typedef struct malloc_chunk* mchunkptr;
|
||||
typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */
|
||||
typedef unsigned int bindex_t; /* Described below */
|
||||
typedef size_t bindex_t; /* Described below */
|
||||
typedef unsigned int binmap_t; /* Described below */
|
||||
typedef unsigned int flag_t; /* The type of various bit flag sets */
|
||||
|
||||
|
|
@ -3095,8 +3095,8 @@ static void internal_malloc_stats(mstate m) {
|
|||
and choose its bk node as its replacement.
|
||||
2. If x was the last node of its size, but not a leaf node, it must
|
||||
be replaced with a leaf node (not merely one with an open left or
|
||||
right), to make sure that lefts and rights of descendents
|
||||
correspond properly to bit masks. We use the rightmost descendent
|
||||
right), to make sure that lefts and rights of descendants
|
||||
correspond properly to bit masks. We use the rightmost descendant
|
||||
of x. We could use any other leaf, but this is easy to locate and
|
||||
tends to counteract removal of leftmosts elsewhere, and so keeps
|
||||
paths shorter than minimally guaranteed. This doesn't loop much
|
||||
|
|
@ -5096,10 +5096,10 @@ int mspace_mallopt(int param_number, int value) {
|
|||
Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
|
||||
* Use last_remainder in more cases.
|
||||
* Pack bins using idea from colin@nyx10.cs.du.edu
|
||||
* Use ordered bins instead of best-fit threshhold
|
||||
* Use ordered bins instead of best-fit threshold
|
||||
* Eliminate block-local decls to simplify tracing and debugging.
|
||||
* Support another case of realloc via move into top
|
||||
* Fix error occuring when initial sbrk_base not word-aligned.
|
||||
* Fix error occurring when initial sbrk_base not word-aligned.
|
||||
* Rely on page size for units instead of SBRK_UNIT to
|
||||
avoid surprises about sbrk alignment conventions.
|
||||
* Add mallinfo, mallopt. Thanks to Raymond Nijssen
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
the closure (in the "trampoline" area), but we replace the gp
|
||||
pointer with a pointer to the closure itself. We also add the real
|
||||
gp pointer to the closure. This allows the function entry code to
|
||||
both retrieve the user data, and to restire the correct gp pointer. */
|
||||
both retrieve the user data, and to restore the correct gp pointer. */
|
||||
|
||||
extern void ffi_closure_unix ();
|
||||
|
||||
|
|
|
|||
400
Modules/_ctypes/libffi/src/m88k/ffi.c
Normal file
400
Modules/_ctypes/libffi/src/m88k/ffi.c
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* m88k Foreign Function Interface
|
||||
*
|
||||
* This file attempts to provide all the FFI entry points which can reliably
|
||||
* be implemented in C.
|
||||
*
|
||||
* Only OpenBSD/m88k is currently supported; other platforms (such as
|
||||
* Motorola's SysV/m88k) could be supported with the following tweaks:
|
||||
*
|
||||
* - non-OpenBSD systems use an `outgoing parameter area' as part of the
|
||||
* 88BCS calling convention, which is not supported under OpenBSD from
|
||||
* release 3.6 onwards. Supporting it should be as easy as taking it
|
||||
* into account when adjusting the stack, in the assembly code.
|
||||
*
|
||||
* - the logic deciding whether a function argument gets passed through
|
||||
* registers, or on the stack, has changed several times in OpenBSD in
|
||||
* edge cases (especially for structs larger than 32 bytes being passed
|
||||
* by value). The code below attemps to match the logic used by the
|
||||
* system compiler of OpenBSD 5.3, i.e. gcc 3.3.6 with many m88k backend
|
||||
* fixes.
|
||||
*/
|
||||
|
||||
#include <ffi.h>
|
||||
#include <ffi_common.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void ffi_call_OBSD (unsigned int, extended_cif *, unsigned int, void *,
|
||||
void (*fn) ());
|
||||
void *ffi_prep_args (void *, extended_cif *);
|
||||
void ffi_closure_OBSD (ffi_closure *);
|
||||
void ffi_closure_struct_OBSD (ffi_closure *);
|
||||
unsigned int ffi_closure_OBSD_inner (ffi_closure *, void *, unsigned int *,
|
||||
char *);
|
||||
void ffi_cacheflush_OBSD (unsigned int, unsigned int);
|
||||
|
||||
#define CIF_FLAGS_INT (1 << 0)
|
||||
#define CIF_FLAGS_DINT (1 << 1)
|
||||
|
||||
/*
|
||||
* Foreign Function Interface API
|
||||
*/
|
||||
|
||||
/* ffi_prep_args is called by the assembly routine once stack space has
|
||||
been allocated for the function's arguments. */
|
||||
|
||||
void *
|
||||
ffi_prep_args (void *stack, extended_cif *ecif)
|
||||
{
|
||||
unsigned int i;
|
||||
void **p_argv;
|
||||
char *argp, *stackp;
|
||||
unsigned int *regp;
|
||||
unsigned int regused;
|
||||
ffi_type **p_arg;
|
||||
void *struct_value_ptr;
|
||||
|
||||
regp = (unsigned int *)stack;
|
||||
stackp = (char *)(regp + 8);
|
||||
regused = 0;
|
||||
|
||||
if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& !ecif->cif->flags)
|
||||
struct_value_ptr = ecif->rvalue;
|
||||
else
|
||||
struct_value_ptr = NULL;
|
||||
|
||||
p_argv = ecif->avalue;
|
||||
|
||||
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
unsigned short t, a;
|
||||
|
||||
z = (*p_arg)->size;
|
||||
t = (*p_arg)->type;
|
||||
a = (*p_arg)->alignment;
|
||||
|
||||
/*
|
||||
* Figure out whether the argument can be passed through registers
|
||||
* or on the stack.
|
||||
* The rule is that registers can only receive simple types not larger
|
||||
* than 64 bits, or structs the exact size of a register and aligned to
|
||||
* the size of a register.
|
||||
*/
|
||||
if (t == FFI_TYPE_STRUCT)
|
||||
{
|
||||
if (z == sizeof (int) && a == sizeof (int) && regused < 8)
|
||||
argp = (char *)regp;
|
||||
else
|
||||
argp = stackp;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (z > sizeof (int) && regused < 8 - 1)
|
||||
{
|
||||
/* align to an even register pair */
|
||||
if (regused & 1)
|
||||
{
|
||||
regp++;
|
||||
regused++;
|
||||
}
|
||||
}
|
||||
if (regused < 8)
|
||||
argp = (char *)regp;
|
||||
else
|
||||
argp = stackp;
|
||||
}
|
||||
|
||||
/* Enforce proper stack alignment of 64-bit types */
|
||||
if (argp == stackp && a > sizeof (int))
|
||||
{
|
||||
stackp = (char *) ALIGN(stackp, a);
|
||||
argp = stackp;
|
||||
}
|
||||
|
||||
switch (t)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_INT:
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_POINTER:
|
||||
*(unsigned int *) argp = *(unsigned int *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_DOUBLE:
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_STRUCT:
|
||||
memcpy (argp, *p_argv, z);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
|
||||
/* Align if necessary. */
|
||||
if ((sizeof (int) - 1) & z)
|
||||
z = ALIGN(z, sizeof (int));
|
||||
|
||||
p_argv++;
|
||||
|
||||
/* Be careful, once all registers are filled, and about to continue
|
||||
on stack, regp == stackp. Therefore the check for regused as well. */
|
||||
if (argp == (char *)regp && regused < 8)
|
||||
{
|
||||
regp += z / sizeof (int);
|
||||
regused += z / sizeof (int);
|
||||
}
|
||||
else
|
||||
stackp += z;
|
||||
}
|
||||
|
||||
return struct_value_ptr;
|
||||
}
|
||||
|
||||
/* Perform machine dependent cif processing */
|
||||
ffi_status
|
||||
ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
{
|
||||
/* Set the return type flag */
|
||||
switch (cif->rtype->type)
|
||||
{
|
||||
case FFI_TYPE_VOID:
|
||||
cif->flags = 0;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
if (cif->rtype->size == sizeof (int) &&
|
||||
cif->rtype->alignment == sizeof (int))
|
||||
cif->flags = CIF_FLAGS_INT;
|
||||
else
|
||||
cif->flags = 0;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_DOUBLE:
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_UINT64:
|
||||
cif->flags = CIF_FLAGS_DINT;
|
||||
break;
|
||||
|
||||
default:
|
||||
cif->flags = CIF_FLAGS_INT;
|
||||
break;
|
||||
}
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
void
|
||||
ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
|
||||
{
|
||||
extended_cif ecif;
|
||||
|
||||
ecif.cif = cif;
|
||||
ecif.avalue = avalue;
|
||||
|
||||
/* If the return value is a struct and we don't have a return value
|
||||
address then we need to make one. */
|
||||
|
||||
if (rvalue == NULL
|
||||
&& cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& (cif->rtype->size != sizeof (int)
|
||||
|| cif->rtype->alignment != sizeof (int)))
|
||||
ecif.rvalue = alloca (cif->rtype->size);
|
||||
else
|
||||
ecif.rvalue = rvalue;
|
||||
|
||||
switch (cif->abi)
|
||||
{
|
||||
case FFI_OBSD:
|
||||
ffi_call_OBSD (cif->bytes, &ecif, cif->flags, ecif.rvalue, fn);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Closure API
|
||||
*/
|
||||
|
||||
static void
|
||||
ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp,
|
||||
char *stackp)
|
||||
{
|
||||
unsigned int i;
|
||||
void **p_argv;
|
||||
char *argp;
|
||||
unsigned int regused;
|
||||
ffi_type **p_arg;
|
||||
|
||||
regused = 0;
|
||||
|
||||
p_argv = avalue;
|
||||
|
||||
for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
unsigned short t, a;
|
||||
|
||||
z = (*p_arg)->size;
|
||||
t = (*p_arg)->type;
|
||||
a = (*p_arg)->alignment;
|
||||
|
||||
/*
|
||||
* Figure out whether the argument has been passed through registers
|
||||
* or on the stack.
|
||||
* The rule is that registers can only receive simple types not larger
|
||||
* than 64 bits, or structs the exact size of a register and aligned to
|
||||
* the size of a register.
|
||||
*/
|
||||
if (t == FFI_TYPE_STRUCT)
|
||||
{
|
||||
if (z == sizeof (int) && a == sizeof (int) && regused < 8)
|
||||
argp = (char *)regp;
|
||||
else
|
||||
argp = stackp;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (z > sizeof (int) && regused < 8 - 1)
|
||||
{
|
||||
/* align to an even register pair */
|
||||
if (regused & 1)
|
||||
{
|
||||
regp++;
|
||||
regused++;
|
||||
}
|
||||
}
|
||||
if (regused < 8)
|
||||
argp = (char *)regp;
|
||||
else
|
||||
argp = stackp;
|
||||
}
|
||||
|
||||
/* Enforce proper stack alignment of 64-bit types */
|
||||
if (argp == stackp && a > sizeof (int))
|
||||
{
|
||||
stackp = (char *) ALIGN(stackp, a);
|
||||
argp = stackp;
|
||||
}
|
||||
|
||||
if (z < sizeof (int) && t != FFI_TYPE_STRUCT)
|
||||
*p_argv = (void *) (argp + sizeof (int) - z);
|
||||
else
|
||||
*p_argv = (void *) argp;
|
||||
|
||||
/* Align if necessary */
|
||||
if ((sizeof (int) - 1) & z)
|
||||
z = ALIGN(z, sizeof (int));
|
||||
|
||||
p_argv++;
|
||||
|
||||
/* Be careful, once all registers are exhausted, and about to fetch from
|
||||
stack, regp == stackp. Therefore the check for regused as well. */
|
||||
if (argp == (char *)regp && regused < 8)
|
||||
{
|
||||
regp += z / sizeof (int);
|
||||
regused += z / sizeof (int);
|
||||
}
|
||||
else
|
||||
stackp += z;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
ffi_closure_OBSD_inner (ffi_closure *closure, void *resp, unsigned int *regp,
|
||||
char *stackp)
|
||||
{
|
||||
ffi_cif *cif;
|
||||
void **arg_area;
|
||||
|
||||
cif = closure->cif;
|
||||
arg_area = (void**) alloca (cif->nargs * sizeof (void *));
|
||||
|
||||
ffi_prep_closure_args_OBSD(cif, arg_area, regp, stackp);
|
||||
|
||||
(closure->fun) (cif, resp, arg_area, closure->user_data);
|
||||
|
||||
return cif->flags;
|
||||
}
|
||||
|
||||
ffi_status
|
||||
ffi_prep_closure_loc (ffi_closure* closure, ffi_cif* cif,
|
||||
void (*fun)(ffi_cif*,void*,void**,void*),
|
||||
void *user_data, void *codeloc)
|
||||
{
|
||||
unsigned int *tramp = (unsigned int *) codeloc;
|
||||
void *fn;
|
||||
|
||||
FFI_ASSERT (cif->abi == FFI_OBSD);
|
||||
|
||||
if (cif->rtype->type == FFI_TYPE_STRUCT && !cif->flags)
|
||||
fn = &ffi_closure_struct_OBSD;
|
||||
else
|
||||
fn = &ffi_closure_OBSD;
|
||||
|
||||
/* or.u %r10, %r0, %hi16(fn) */
|
||||
tramp[0] = 0x5d400000 | (((unsigned int)fn) >> 16);
|
||||
/* or.u %r13, %r0, %hi16(closure) */
|
||||
tramp[1] = 0x5da00000 | ((unsigned int)closure >> 16);
|
||||
/* or %r10, %r10, %lo16(fn) */
|
||||
tramp[2] = 0x594a0000 | (((unsigned int)fn) & 0xffff);
|
||||
/* jmp.n %r10 */
|
||||
tramp[3] = 0xf400c40a;
|
||||
/* or %r13, %r13, %lo16(closure) */
|
||||
tramp[4] = 0x59ad0000 | ((unsigned int)closure & 0xffff);
|
||||
|
||||
ffi_cacheflush_OBSD((unsigned int)codeloc, FFI_TRAMPOLINE_SIZE);
|
||||
|
||||
closure->cif = cif;
|
||||
closure->user_data = user_data;
|
||||
closure->fun = fun;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
49
Modules/_ctypes/libffi/src/m88k/ffitarget.h
Normal file
49
Modules/_ctypes/libffi/src/m88k/ffitarget.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* m88k Foreign Function Interface
|
||||
*/
|
||||
|
||||
#ifndef LIBFFI_TARGET_H
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
typedef unsigned long ffi_arg;
|
||||
typedef signed long ffi_sarg;
|
||||
|
||||
typedef enum ffi_abi {
|
||||
FFI_FIRST_ABI = 0,
|
||||
FFI_OBSD,
|
||||
FFI_DEFAULT_ABI = FFI_OBSD,
|
||||
FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
|
||||
} ffi_abi;
|
||||
#endif
|
||||
|
||||
/* ---- Definitions for closures ----------------------------------------- */
|
||||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_TRAMPOLINE_SIZE 0x14
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
|
||||
#endif
|
||||
209
Modules/_ctypes/libffi/src/m88k/obsd.S
Normal file
209
Modules/_ctypes/libffi/src/m88k/obsd.S
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* m88k Foreign Function Interface
|
||||
*/
|
||||
|
||||
#define LIBFFI_ASM
|
||||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
|
||||
.text
|
||||
|
||||
/*
|
||||
* ffi_cacheflush_OBSD(unsigned int addr, %r2
|
||||
* unsigned int size); %r3
|
||||
*/
|
||||
.align 4
|
||||
.globl ffi_cacheflush_OBSD
|
||||
.type ffi_cacheflush_OBSD,@function
|
||||
ffi_cacheflush_OBSD:
|
||||
tb0 0, %r0, 451
|
||||
or %r0, %r0, %r0
|
||||
jmp %r1
|
||||
.size ffi_cacheflush_OBSD, . - ffi_cacheflush_OBSD
|
||||
|
||||
/*
|
||||
* ffi_call_OBSD(unsigned bytes, %r2
|
||||
* extended_cif *ecif, %r3
|
||||
* unsigned flags, %r4
|
||||
* void *rvalue, %r5
|
||||
* void (*fn)()); %r6
|
||||
*/
|
||||
.align 4
|
||||
.globl ffi_call_OBSD
|
||||
.type ffi_call_OBSD,@function
|
||||
ffi_call_OBSD:
|
||||
subu %r31, %r31, 32
|
||||
st %r30, %r31, 4
|
||||
st %r1, %r31, 0
|
||||
addu %r30, %r31, 32
|
||||
|
||||
| Save the few arguments we'll need after ffi_prep_args()
|
||||
st.d %r4, %r31, 8
|
||||
st %r6, %r31, 16
|
||||
|
||||
| Allocate room for the image of r2-r9, and the stack space for
|
||||
| the args (rounded to a 16-byte boundary)
|
||||
addu %r2, %r2, (8 * 4) + 15
|
||||
clr %r2, %r2, 4<0>
|
||||
subu %r31, %r31, %r2
|
||||
|
||||
| Fill register and stack image
|
||||
or %r2, %r31, %r0
|
||||
#ifdef PIC
|
||||
bsr ffi_prep_args#plt
|
||||
#else
|
||||
bsr ffi_prep_args
|
||||
#endif
|
||||
|
||||
| Save pointer to return struct address, if any
|
||||
or %r12, %r2, %r0
|
||||
|
||||
| Get function pointer
|
||||
subu %r4, %r30, 32
|
||||
ld %r1, %r4, 16
|
||||
|
||||
| Fetch the register arguments
|
||||
ld.d %r2, %r31, (0 * 4)
|
||||
ld.d %r4, %r31, (2 * 4)
|
||||
ld.d %r6, %r31, (4 * 4)
|
||||
ld.d %r8, %r31, (6 * 4)
|
||||
addu %r31, %r31, (8 * 4)
|
||||
|
||||
| Invoke the function
|
||||
jsr %r1
|
||||
|
||||
| Restore stack now that we don't need the args anymore
|
||||
subu %r31, %r30, 32
|
||||
|
||||
| Figure out what to return as the function's return value
|
||||
ld %r5, %r31, 12 | rvalue
|
||||
ld %r4, %r31, 8 | flags
|
||||
|
||||
bcnd eq0, %r5, 9f
|
||||
|
||||
bb0 0, %r4, 1f | CIF_FLAGS_INT
|
||||
st %r2, %r5, 0
|
||||
br 9f
|
||||
|
||||
1:
|
||||
bb0 1, %r4, 1f | CIF_FLAGS_DINT
|
||||
st.d %r2, %r5, 0
|
||||
br 9f
|
||||
|
||||
1:
|
||||
9:
|
||||
ld %r1, %r31, 0
|
||||
ld %r30, %r31, 4
|
||||
jmp.n %r1
|
||||
addu %r31, %r31, 32
|
||||
.size ffi_call_OBSD, . - ffi_call_OBSD
|
||||
|
||||
/*
|
||||
* ffi_closure_OBSD(ffi_closure *closure); %r13
|
||||
*/
|
||||
.align 4
|
||||
.globl ffi_closure_OBSD
|
||||
.type ffi_closure_OBSD, @function
|
||||
ffi_closure_OBSD:
|
||||
subu %r31, %r31, 16
|
||||
st %r30, %r31, 4
|
||||
st %r1, %r31, 0
|
||||
addu %r30, %r31, 16
|
||||
|
||||
| Make room on the stack for saved register arguments and return
|
||||
| value
|
||||
subu %r31, %r31, (8 * 4) + (2 * 4)
|
||||
st.d %r2, %r31, (0 * 4)
|
||||
st.d %r4, %r31, (2 * 4)
|
||||
st.d %r6, %r31, (4 * 4)
|
||||
st.d %r8, %r31, (6 * 4)
|
||||
|
||||
| Invoke the closure function
|
||||
or %r5, %r30, 0 | calling stack
|
||||
addu %r4, %r31, 0 | saved registers
|
||||
addu %r3, %r31, (8 * 4) | return value
|
||||
or %r2, %r13, %r0 | closure
|
||||
#ifdef PIC
|
||||
bsr ffi_closure_OBSD_inner#plt
|
||||
#else
|
||||
bsr ffi_closure_OBSD_inner
|
||||
#endif
|
||||
|
||||
| Figure out what to return as the function's return value
|
||||
bb0 0, %r2, 1f | CIF_FLAGS_INT
|
||||
ld %r2, %r31, (8 * 4)
|
||||
br 9f
|
||||
|
||||
1:
|
||||
bb0 1, %r2, 1f | CIF_FLAGS_DINT
|
||||
ld.d %r2, %r31, (8 * 4)
|
||||
br 9f
|
||||
|
||||
1:
|
||||
9:
|
||||
subu %r31, %r30, 16
|
||||
ld %r1, %r31, 0
|
||||
ld %r30, %r31, 4
|
||||
jmp.n %r1
|
||||
addu %r31, %r31, 16
|
||||
.size ffi_closure_OBSD,.-ffi_closure_OBSD
|
||||
|
||||
/*
|
||||
* ffi_closure_struct_OBSD(ffi_closure *closure); %r13
|
||||
*/
|
||||
.align 4
|
||||
.globl ffi_closure_struct_OBSD
|
||||
.type ffi_closure_struct_OBSD, @function
|
||||
ffi_closure_struct_OBSD:
|
||||
subu %r31, %r31, 16
|
||||
st %r30, %r31, 4
|
||||
st %r1, %r31, 0
|
||||
addu %r30, %r31, 16
|
||||
|
||||
| Make room on the stack for saved register arguments
|
||||
subu %r31, %r31, (8 * 4)
|
||||
st.d %r2, %r31, (0 * 4)
|
||||
st.d %r4, %r31, (2 * 4)
|
||||
st.d %r6, %r31, (4 * 4)
|
||||
st.d %r8, %r31, (6 * 4)
|
||||
|
||||
| Invoke the closure function
|
||||
or %r5, %r30, 0 | calling stack
|
||||
addu %r4, %r31, 0 | saved registers
|
||||
or %r3, %r12, 0 | return value
|
||||
or %r2, %r13, %r0 | closure
|
||||
#ifdef PIC
|
||||
bsr ffi_closure_OBSD_inner#plt
|
||||
#else
|
||||
bsr ffi_closure_OBSD_inner
|
||||
#endif
|
||||
|
||||
subu %r31, %r30, 16
|
||||
ld %r1, %r31, 0
|
||||
ld %r30, %r31, 4
|
||||
jmp.n %r1
|
||||
addu %r31, %r31, 16
|
||||
.size ffi_closure_struct_OBSD,.-ffi_closure_struct_OBSD
|
||||
|
|
@ -183,7 +183,7 @@ void ffi_closure_call_SYSV(void* register_args, void* stack_args,
|
|||
ffi_type** arg_types = cif->arg_types;
|
||||
|
||||
/* re-allocate data for the args. This needs to be done in order to keep
|
||||
* multi-word objects (e.g. structs) in contigious memory. Callers are not
|
||||
* multi-word objects (e.g. structs) in contiguous memory. Callers are not
|
||||
* required to store the value of args in the lower 6 words in the stack
|
||||
* (although they are allocated in the stack).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ ffi_call_SYSV:
|
|||
rsubi r11, r23, 8
|
||||
beqi r11, ffi_call_SYSV_store64
|
||||
|
||||
/* Didnt match anything */
|
||||
/* Didn't match anything */
|
||||
bri ffi_call_SYSV_end
|
||||
|
||||
ffi_call_SYSV_store64:
|
||||
|
|
@ -210,7 +210,7 @@ ffi_closure_SYSV:
|
|||
addik r7, r12, 0 /* closure object */
|
||||
addik r1, r1, -8 /* allocate return value */
|
||||
addik r8, r1, 0 /* void* rvalue */
|
||||
addik r1, r1, -8 /* allocate for reutrn type/size values */
|
||||
addik r1, r1, -8 /* allocate for return type/size values */
|
||||
addik r9, r1, 0 /* void* rtype */
|
||||
addik r10, r1, 4 /* void* rsize */
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ ffi_closure_SYSV_prepare_return:
|
|||
rsubi r11, r10, 8
|
||||
beqi r11, ffi_closure_SYSV_store64
|
||||
|
||||
/* Didnt match anything */
|
||||
/* Didn't match anything */
|
||||
bri ffi_closure_SYSV_end
|
||||
|
||||
ffi_closure_SYSV_store64:
|
||||
|
|
|
|||
|
|
@ -170,7 +170,14 @@ static void ffi_prep_args(char *stack,
|
|||
break;
|
||||
|
||||
case FFI_TYPE_UINT32:
|
||||
#ifdef FFI_MIPS_N32
|
||||
/* The N32 ABI requires that 32-bit integers
|
||||
be sign-extended to 64-bits, regardless of
|
||||
whether they are signed or unsigned. */
|
||||
*(ffi_arg *)argp = *(SINT32 *)(* p_argv);
|
||||
#else
|
||||
*(ffi_arg *)argp = *(UINT32 *)(* p_argv);
|
||||
#endif
|
||||
break;
|
||||
|
||||
/* This can only happen with 64bit slots. */
|
||||
|
|
|
|||
|
|
@ -108,10 +108,8 @@ loadregs:
|
|||
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
|
||||
|
||||
and t4, t6, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg1_floatp
|
||||
REG_L a0, 0*FFI_SIZEOF_ARG(t9)
|
||||
b arg1_next
|
||||
arg1_floatp:
|
||||
beqz t4, arg1_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg1_doublep
|
||||
l.s $f12, 0*FFI_SIZEOF_ARG(t9)
|
||||
b arg1_next
|
||||
|
|
@ -121,10 +119,8 @@ arg1_next:
|
|||
|
||||
SRL t4, t6, 1*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg2_floatp
|
||||
REG_L a1, 1*FFI_SIZEOF_ARG(t9)
|
||||
b arg2_next
|
||||
arg2_floatp:
|
||||
beqz t4, arg2_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg2_doublep
|
||||
l.s $f13, 1*FFI_SIZEOF_ARG(t9)
|
||||
b arg2_next
|
||||
|
|
@ -134,10 +130,8 @@ arg2_next:
|
|||
|
||||
SRL t4, t6, 2*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg3_floatp
|
||||
REG_L a2, 2*FFI_SIZEOF_ARG(t9)
|
||||
b arg3_next
|
||||
arg3_floatp:
|
||||
beqz t4, arg3_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg3_doublep
|
||||
l.s $f14, 2*FFI_SIZEOF_ARG(t9)
|
||||
b arg3_next
|
||||
|
|
@ -147,10 +141,8 @@ arg3_next:
|
|||
|
||||
SRL t4, t6, 3*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg4_floatp
|
||||
REG_L a3, 3*FFI_SIZEOF_ARG(t9)
|
||||
b arg4_next
|
||||
arg4_floatp:
|
||||
beqz t4, arg4_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg4_doublep
|
||||
l.s $f15, 3*FFI_SIZEOF_ARG(t9)
|
||||
b arg4_next
|
||||
|
|
@ -160,10 +152,8 @@ arg4_next:
|
|||
|
||||
SRL t4, t6, 4*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg5_floatp
|
||||
REG_L a4, 4*FFI_SIZEOF_ARG(t9)
|
||||
b arg5_next
|
||||
arg5_floatp:
|
||||
beqz t4, arg5_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg5_doublep
|
||||
l.s $f16, 4*FFI_SIZEOF_ARG(t9)
|
||||
b arg5_next
|
||||
|
|
@ -173,10 +163,8 @@ arg5_next:
|
|||
|
||||
SRL t4, t6, 5*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg6_floatp
|
||||
REG_L a5, 5*FFI_SIZEOF_ARG(t9)
|
||||
b arg6_next
|
||||
arg6_floatp:
|
||||
beqz t4, arg6_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg6_doublep
|
||||
l.s $f17, 5*FFI_SIZEOF_ARG(t9)
|
||||
b arg6_next
|
||||
|
|
@ -186,10 +174,8 @@ arg6_next:
|
|||
|
||||
SRL t4, t6, 6*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg7_floatp
|
||||
REG_L a6, 6*FFI_SIZEOF_ARG(t9)
|
||||
b arg7_next
|
||||
arg7_floatp:
|
||||
beqz t4, arg7_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg7_doublep
|
||||
l.s $f18, 6*FFI_SIZEOF_ARG(t9)
|
||||
b arg7_next
|
||||
|
|
@ -199,10 +185,8 @@ arg7_next:
|
|||
|
||||
SRL t4, t6, 7*FFI_FLAG_BITS
|
||||
and t4, ((1<<FFI_FLAG_BITS)-1)
|
||||
bnez t4, arg8_floatp
|
||||
REG_L a7, 7*FFI_SIZEOF_ARG(t9)
|
||||
b arg8_next
|
||||
arg8_floatp:
|
||||
beqz t4, arg8_next
|
||||
bne t4, FFI_TYPE_FLOAT, arg8_doublep
|
||||
l.s $f19, 7*FFI_SIZEOF_ARG(t9)
|
||||
b arg8_next
|
||||
|
|
|
|||
304
Modules/_ctypes/libffi/src/nios2/ffi.c
Normal file
304
Modules/_ctypes/libffi/src/nios2/ffi.c
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
/* libffi support for Altera Nios II.
|
||||
|
||||
Copyright (c) 2013 Mentor Graphics.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
|
||||
#include <ffi.h>
|
||||
#include <ffi_common.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* The Nios II Processor Reference Handbook defines the procedure call
|
||||
ABI as follows.
|
||||
|
||||
Arguments are passed as if a structure containing the types of
|
||||
the arguments were constructed. The first 16 bytes are passed in r4
|
||||
through r7, the remainder on the stack. The first 16 bytes of a function
|
||||
taking variable arguments are passed in r4-r7 in the same way.
|
||||
|
||||
Return values of types up to 8 bytes are returned in r2 and r3. For
|
||||
return values greater than 8 bytes, the caller must allocate memory for
|
||||
the result and pass the address as if it were argument 0.
|
||||
|
||||
While this isn't specified explicitly in the ABI documentation, GCC
|
||||
promotes integral arguments smaller than int size to 32 bits.
|
||||
|
||||
Also of note, the ABI specifies that all structure objects are
|
||||
aligned to 32 bits even if all their fields have a smaller natural
|
||||
alignment. See FFI_AGGREGATE_ALIGNMENT. */
|
||||
|
||||
|
||||
/* Declare the assembly language hooks. */
|
||||
|
||||
extern UINT64 ffi_call_sysv (void (*) (char *, extended_cif *),
|
||||
extended_cif *,
|
||||
unsigned,
|
||||
void (*fn) (void));
|
||||
extern void ffi_closure_sysv (void);
|
||||
|
||||
/* Perform machine-dependent cif processing. */
|
||||
|
||||
ffi_status ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
{
|
||||
/* We always want at least 16 bytes in the parameter block since it
|
||||
simplifies the low-level call function. Also round the parameter
|
||||
block size up to a multiple of 4 bytes to preserve
|
||||
32-bit alignment of the stack pointer. */
|
||||
if (cif->bytes < 16)
|
||||
cif->bytes = 16;
|
||||
else
|
||||
cif->bytes = (cif->bytes + 3) & ~3;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
|
||||
/* ffi_prep_args is called by the assembly routine to transfer arguments
|
||||
to the stack using the pointers in the ecif array.
|
||||
Note that the stack buffer is big enough to fit all the arguments,
|
||||
but the first 16 bytes will be copied to registers for the actual
|
||||
call. */
|
||||
|
||||
void ffi_prep_args (char *stack, extended_cif *ecif)
|
||||
{
|
||||
char *argp = stack;
|
||||
unsigned int i;
|
||||
|
||||
/* The implicit return value pointer is passed as if it were a hidden
|
||||
first argument. */
|
||||
if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& ecif->cif->rtype->size > 8)
|
||||
{
|
||||
(*(void **) argp) = ecif->rvalue;
|
||||
argp += 4;
|
||||
}
|
||||
|
||||
for (i = 0; i < ecif->cif->nargs; i++)
|
||||
{
|
||||
void *avalue = ecif->avalue[i];
|
||||
ffi_type *atype = ecif->cif->arg_types[i];
|
||||
size_t size = atype->size;
|
||||
size_t alignment = atype->alignment;
|
||||
|
||||
/* Align argp as appropriate for the argument type. */
|
||||
if ((alignment - 1) & (unsigned) argp)
|
||||
argp = (char *) ALIGN (argp, alignment);
|
||||
|
||||
/* Copy the argument, promoting integral types smaller than a
|
||||
word to word size. */
|
||||
if (size < sizeof (int))
|
||||
{
|
||||
size = sizeof (int);
|
||||
switch (atype->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *) argp = (signed int) *(SINT8 *) avalue;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT8 *) avalue;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *) argp = (signed int) *(SINT16 *) avalue;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT16 *) avalue;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
memcpy (argp, avalue, atype->size);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT(0);
|
||||
}
|
||||
}
|
||||
else if (size == sizeof (int))
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT32 *) avalue;
|
||||
else
|
||||
memcpy (argp, avalue, size);
|
||||
argp += size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Call FN using the prepared CIF. RVALUE points to space allocated by
|
||||
the caller for the return value, and AVALUE is an array of argument
|
||||
pointers. */
|
||||
|
||||
void ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue)
|
||||
{
|
||||
|
||||
extended_cif ecif;
|
||||
UINT64 result;
|
||||
|
||||
/* If bigret is true, this is the case where a return value of larger
|
||||
than 8 bytes is handled by being passed by reference as an implicit
|
||||
argument. */
|
||||
int bigret = (cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& cif->rtype->size > 8);
|
||||
|
||||
ecif.cif = cif;
|
||||
ecif.avalue = avalue;
|
||||
|
||||
/* Allocate space for return value if this is the pass-by-reference case
|
||||
and the caller did not provide a buffer. */
|
||||
if (rvalue == NULL && bigret)
|
||||
ecif.rvalue = alloca (cif->rtype->size);
|
||||
else
|
||||
ecif.rvalue = rvalue;
|
||||
|
||||
result = ffi_call_sysv (ffi_prep_args, &ecif, cif->bytes, fn);
|
||||
|
||||
/* Now result contains the 64 bit contents returned from fn in
|
||||
r2 and r3. Copy the value of the appropriate size to the user-provided
|
||||
rvalue buffer. */
|
||||
if (rvalue && !bigret)
|
||||
switch (cif->rtype->size)
|
||||
{
|
||||
case 1:
|
||||
*(UINT8 *)rvalue = (UINT8) result;
|
||||
break;
|
||||
case 2:
|
||||
*(UINT16 *)rvalue = (UINT16) result;
|
||||
break;
|
||||
case 4:
|
||||
*(UINT32 *)rvalue = (UINT32) result;
|
||||
break;
|
||||
case 8:
|
||||
*(UINT64 *)rvalue = (UINT64) result;
|
||||
break;
|
||||
default:
|
||||
memcpy (rvalue, (void *)&result, cif->rtype->size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is invoked from the closure trampoline to invoke
|
||||
CLOSURE with argument block ARGS. Parse ARGS according to
|
||||
CLOSURE->cfi and invoke CLOSURE->fun. */
|
||||
|
||||
static UINT64
|
||||
ffi_closure_helper (unsigned char *args,
|
||||
ffi_closure *closure)
|
||||
{
|
||||
ffi_cif *cif = closure->cif;
|
||||
unsigned char *argp = args;
|
||||
void **parsed_args = alloca (cif->nargs * sizeof (void *));
|
||||
UINT64 result;
|
||||
void *retptr;
|
||||
unsigned int i;
|
||||
|
||||
/* First figure out what to do about the return type. If this is the
|
||||
big-structure-return case, the first arg is the hidden return buffer
|
||||
allocated by the caller. */
|
||||
if (cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& cif->rtype->size > 8)
|
||||
{
|
||||
retptr = *((void **) argp);
|
||||
argp += 4;
|
||||
}
|
||||
else
|
||||
retptr = (void *) &result;
|
||||
|
||||
/* Fill in the array of argument pointers. */
|
||||
for (i = 0; i < cif->nargs; i++)
|
||||
{
|
||||
size_t size = cif->arg_types[i]->size;
|
||||
size_t alignment = cif->arg_types[i]->alignment;
|
||||
|
||||
/* Align argp as appropriate for the argument type. */
|
||||
if ((alignment - 1) & (unsigned) argp)
|
||||
argp = (char *) ALIGN (argp, alignment);
|
||||
|
||||
/* Arguments smaller than an int are promoted to int. */
|
||||
if (size < sizeof (int))
|
||||
size = sizeof (int);
|
||||
|
||||
/* Store the pointer. */
|
||||
parsed_args[i] = argp;
|
||||
argp += size;
|
||||
}
|
||||
|
||||
/* Call the user-supplied function. */
|
||||
(closure->fun) (cif, retptr, parsed_args, closure->user_data);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize CLOSURE with a trampoline to call FUN with
|
||||
CIF and USER_DATA. */
|
||||
ffi_status
|
||||
ffi_prep_closure_loc (ffi_closure* closure,
|
||||
ffi_cif* cif,
|
||||
void (*fun) (ffi_cif*, void*, void**, void*),
|
||||
void *user_data,
|
||||
void *codeloc)
|
||||
{
|
||||
unsigned int *tramp = (unsigned int *) &closure->tramp[0];
|
||||
int i;
|
||||
|
||||
if (cif->abi != FFI_SYSV)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
/* The trampoline looks like:
|
||||
movhi r8, %hi(ffi_closure_sysv)
|
||||
ori r8, r8, %lo(ffi_closure_sysv)
|
||||
movhi r9, %hi(ffi_closure_helper)
|
||||
ori r0, r9, %lo(ffi_closure_helper)
|
||||
movhi r10, %hi(closure)
|
||||
ori r10, r10, %lo(closure)
|
||||
jmp r8
|
||||
and then ffi_closure_sysv retrieves the closure pointer out of r10
|
||||
in addition to the arguments passed in the normal way for the call,
|
||||
and invokes ffi_closure_helper. We encode the pointer to
|
||||
ffi_closure_helper in the trampoline because making a PIC call
|
||||
to it in ffi_closure_sysv would be messy (it would have to indirect
|
||||
through the GOT). */
|
||||
|
||||
#define HI(x) ((((unsigned int) (x)) >> 16) & 0xffff)
|
||||
#define LO(x) (((unsigned int) (x)) & 0xffff)
|
||||
tramp[0] = (0 << 27) | (8 << 22) | (HI (ffi_closure_sysv) << 6) | 0x34;
|
||||
tramp[1] = (8 << 27) | (8 << 22) | (LO (ffi_closure_sysv) << 6) | 0x14;
|
||||
tramp[2] = (0 << 27) | (9 << 22) | (HI (ffi_closure_helper) << 6) | 0x34;
|
||||
tramp[3] = (9 << 27) | (9 << 22) | (LO (ffi_closure_helper) << 6) | 0x14;
|
||||
tramp[4] = (0 << 27) | (10 << 22) | (HI (closure) << 6) | 0x34;
|
||||
tramp[5] = (10 << 27) | (10 << 22) | (LO (closure) << 6) | 0x14;
|
||||
tramp[6] = (8 << 27) | (0x0d << 11) | 0x3a;
|
||||
#undef HI
|
||||
#undef LO
|
||||
|
||||
/* Flush the caches.
|
||||
See Example 9-4 in the Nios II Software Developer's Handbook. */
|
||||
for (i = 0; i < 7; i++)
|
||||
asm volatile ("flushd 0(%0); flushi %0" :: "r"(tramp + i) : "memory");
|
||||
asm volatile ("flushp" ::: "memory");
|
||||
|
||||
closure->cif = cif;
|
||||
closure->fun = fun;
|
||||
closure->user_data = user_data;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
52
Modules/_ctypes/libffi/src/nios2/ffitarget.h
Normal file
52
Modules/_ctypes/libffi/src/nios2/ffitarget.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* libffi target includes for Altera Nios II.
|
||||
|
||||
Copyright (c) 2013 Mentor Graphics.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
|
||||
#ifndef LIBFFI_TARGET_H
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifndef LIBFFI_H
|
||||
#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
|
||||
#endif
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
typedef unsigned long ffi_arg;
|
||||
typedef signed long ffi_sarg;
|
||||
|
||||
typedef enum ffi_abi {
|
||||
FFI_FIRST_ABI = 0,
|
||||
FFI_SYSV,
|
||||
FFI_LAST_ABI,
|
||||
FFI_DEFAULT_ABI = FFI_SYSV
|
||||
} ffi_abi;
|
||||
#endif
|
||||
|
||||
/* Structures have a 4-byte alignment even if all the fields have lesser
|
||||
alignment requirements. */
|
||||
#define FFI_AGGREGATE_ALIGNMENT 4
|
||||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_TRAMPOLINE_SIZE 28 /* 7 instructions */
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
|
||||
#endif
|
||||
136
Modules/_ctypes/libffi/src/nios2/sysv.S
Normal file
136
Modules/_ctypes/libffi/src/nios2/sysv.S
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
/* Low-level libffi support for Altera Nios II.
|
||||
|
||||
Copyright (c) 2013 Mentor Graphics.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
/* This function is declared on the C side as
|
||||
|
||||
extern UINT64 ffi_call_sysv (void (*arghook) (char *, extended_cif *),
|
||||
extended_cif *ecif,
|
||||
unsigned nbytes,
|
||||
void (*fn) (void));
|
||||
|
||||
On input, the arguments appear as
|
||||
r4 = arghook
|
||||
r5 = ecif
|
||||
r6 = nbytes
|
||||
r7 = fn
|
||||
*/
|
||||
|
||||
.section .text
|
||||
.align 2
|
||||
.global ffi_call_sysv
|
||||
.type ffi_call_sysv, @function
|
||||
|
||||
ffi_call_sysv:
|
||||
.cfi_startproc
|
||||
|
||||
/* Create the stack frame, saving r16 so we can use it locally. */
|
||||
addi sp, sp, -12
|
||||
.cfi_def_cfa_offset 12
|
||||
stw ra, 8(sp)
|
||||
stw fp, 4(sp)
|
||||
stw r16, 0(sp)
|
||||
.cfi_offset 31, -4
|
||||
.cfi_offset 28, -8
|
||||
.cfi_offset 16, -12
|
||||
mov fp, sp
|
||||
.cfi_def_cfa_register 28
|
||||
mov r16, r7
|
||||
|
||||
/* Adjust the stack pointer to create the argument buffer
|
||||
nbytes long. */
|
||||
sub sp, sp, r6
|
||||
|
||||
/* Call the arghook function. */
|
||||
mov r2, r4 /* fn */
|
||||
mov r4, sp /* argbuffer */
|
||||
callr r2 /* r5 already contains ecif */
|
||||
|
||||
/* Pop off the first 16 bytes of the argument buffer on the stack,
|
||||
transferring the contents to the argument registers. */
|
||||
ldw r4, 0(sp)
|
||||
ldw r5, 4(sp)
|
||||
ldw r6, 8(sp)
|
||||
ldw r7, 12(sp)
|
||||
addi sp, sp, 16
|
||||
|
||||
/* Call the user function, which leaves its result in r2 and r3. */
|
||||
callr r16
|
||||
|
||||
/* Pop off the stack frame. */
|
||||
mov sp, fp
|
||||
ldw ra, 8(sp)
|
||||
ldw fp, 4(sp)
|
||||
ldw r16, 0(sp)
|
||||
addi sp, sp, 12
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size ffi_call_sysv, .-ffi_call_sysv
|
||||
|
||||
|
||||
/* Closure trampolines jump here after putting the C helper address
|
||||
in r9 and the closure pointer in r10. The user-supplied arguments
|
||||
to the closure are in the normal places, in r4-r7 and on the
|
||||
stack. Push the register arguments on the stack too and then call the
|
||||
C helper function to deal with them. */
|
||||
|
||||
.section .text
|
||||
.align 2
|
||||
.global ffi_closure_sysv
|
||||
.type ffi_closure_sysv, @function
|
||||
|
||||
ffi_closure_sysv:
|
||||
.cfi_startproc
|
||||
|
||||
/* Create the stack frame, pushing the register args on the stack
|
||||
just below the stack args. This is the same trick illustrated
|
||||
in Figure 7-3 in the Nios II Processor Reference Handbook, used
|
||||
for variable arguments and structures passed by value. */
|
||||
addi sp, sp, -20
|
||||
.cfi_def_cfa_offset 20
|
||||
stw ra, 0(sp)
|
||||
.cfi_offset 31, -20
|
||||
stw r4, 4(sp)
|
||||
.cfi_offset 4, -16
|
||||
stw r5, 8(sp)
|
||||
.cfi_offset 5, -12
|
||||
stw r6, 12(sp)
|
||||
.cfi_offset 6, -8
|
||||
stw r7, 16(sp)
|
||||
.cfi_offset 7, -4
|
||||
|
||||
/* Call the helper.
|
||||
r4 = pointer to arguments on stack
|
||||
r5 = closure pointer (loaded in r10 by the trampoline)
|
||||
r9 = address of helper function (loaded by trampoline) */
|
||||
addi r4, sp, 4
|
||||
mov r5, r10
|
||||
callr r9
|
||||
|
||||
/* Pop the stack and return. */
|
||||
ldw ra, 0(sp)
|
||||
addi sp, sp, 20
|
||||
.cfi_def_cfa_offset -20
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size ffi_closure_sysv, .-ffi_closure_sysv
|
||||
|
||||
|
|
@ -318,11 +318,6 @@ _ffi_call_AIX:
|
|||
|
||||
#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
|
||||
|
||||
.static_data
|
||||
.align LOG2_GPR_BYTES
|
||||
LLFB0$non_lazy_ptr:
|
||||
.g_long Lstartcode
|
||||
|
||||
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
|
||||
EH_frame1:
|
||||
.set L$set$0,LECIE1-LSCIE1
|
||||
|
|
@ -335,7 +330,7 @@ LSCIE1:
|
|||
.byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
|
||||
.byte 0x41 ; CIE RA Column
|
||||
.byte 0x1 ; uleb128 0x1; Augmentation size
|
||||
.byte 0x10 ; FDE Encoding (indirect pcrel)
|
||||
.byte 0x10 ; FDE Encoding (pcrel)
|
||||
.byte 0xc ; DW_CFA_def_cfa
|
||||
.byte 0x1 ; uleb128 0x1
|
||||
.byte 0x0 ; uleb128 0x0
|
||||
|
|
@ -349,7 +344,7 @@ LSFDE1:
|
|||
.long L$set$1 ; FDE Length
|
||||
LASFDE1:
|
||||
.long LASFDE1-EH_frame1 ; FDE CIE offset
|
||||
.g_long LLFB0$non_lazy_ptr-. ; FDE initial location
|
||||
.g_long Lstartcode-. ; FDE initial location
|
||||
.set L$set$3,LFE1-Lstartcode
|
||||
.g_long L$set$3 ; FDE address range
|
||||
.byte 0x0 ; uleb128 0x0; Augmentation size
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ LCFI1:
|
|||
lg r0,0(r3) ; size => r0
|
||||
lhz r3,FFI_TYPE_TYPE(r3) ; type => r3
|
||||
|
||||
/* The helper will have intercepted struture returns and inserted
|
||||
/* The helper will have intercepted structure returns and inserted
|
||||
the caller`s destination address for structs returned by ref. */
|
||||
|
||||
/* r3 contains the return type so use it to look up in a table
|
||||
|
|
@ -467,11 +467,6 @@ Lendcode:
|
|||
#define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90)
|
||||
#define EH_FRAME_OFFSETB MODE_CHOICE(1,3)
|
||||
|
||||
.static_data
|
||||
.align LOG2_GPR_BYTES
|
||||
LLFB1$non_lazy_ptr:
|
||||
.g_long Lstartcode
|
||||
|
||||
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
|
||||
EH_frame1:
|
||||
.set L$set$0,LECIE1-LSCIE1
|
||||
|
|
@ -484,7 +479,7 @@ LSCIE1:
|
|||
.byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
|
||||
.byte 0x41 ; CIE RA Column
|
||||
.byte 0x1 ; uleb128 0x1; Augmentation size
|
||||
.byte 0x10 ; FDE Encoding (indirect pcrel)
|
||||
.byte 0x10 ; FDE Encoding (pcrel)
|
||||
.byte 0xc ; DW_CFA_def_cfa
|
||||
.byte 0x1 ; uleb128 0x1
|
||||
.byte 0x0 ; uleb128 0x0
|
||||
|
|
@ -498,7 +493,7 @@ LSFDE1:
|
|||
|
||||
LASFDE1:
|
||||
.long LASFDE1-EH_frame1 ; FDE CIE offset
|
||||
.g_long LLFB1$non_lazy_ptr-. ; FDE initial location
|
||||
.g_long Lstartcode-. ; FDE initial location
|
||||
.set L$set$3,LFE1-Lstartcode
|
||||
.g_long L$set$3 ; FDE address range
|
||||
.byte 0x0 ; uleb128 0x0; Augmentation size
|
||||
|
|
@ -523,12 +518,12 @@ LEFDE1:
|
|||
L_ffi_closure_helper_DARWIN$stub:
|
||||
.indirect_symbol _ffi_closure_helper_DARWIN
|
||||
mflr r0
|
||||
bcl 20,31,"L00000000001$spb"
|
||||
"L00000000001$spb":
|
||||
bcl 20,31,"L1$spb"
|
||||
"L1$spb":
|
||||
mflr r11
|
||||
addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L00000000001$spb")
|
||||
addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")
|
||||
mtlr r0
|
||||
lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L00000000001$spb")(r11)
|
||||
lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")(r11)
|
||||
mtctr r12
|
||||
bctr
|
||||
.lazy_symbol_pointer
|
||||
|
|
@ -542,12 +537,12 @@ L_ffi_closure_helper_DARWIN$lazy_ptr:
|
|||
L_darwin64_struct_ret_by_value_p$stub:
|
||||
.indirect_symbol _darwin64_struct_ret_by_value_p
|
||||
mflr r0
|
||||
bcl 20,31,"L00000000002$spb"
|
||||
"L00000000002$spb":
|
||||
bcl 20,31,"L2$spb"
|
||||
"L2$spb":
|
||||
mflr r11
|
||||
addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L00000000002$spb")
|
||||
addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")
|
||||
mtlr r0
|
||||
lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L00000000002$spb")(r11)
|
||||
lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")(r11)
|
||||
mtctr r12
|
||||
bctr
|
||||
.lazy_symbol_pointer
|
||||
|
|
@ -560,12 +555,12 @@ L_darwin64_struct_ret_by_value_p$lazy_ptr:
|
|||
L_darwin64_pass_struct_floats$stub:
|
||||
.indirect_symbol _darwin64_pass_struct_floats
|
||||
mflr r0
|
||||
bcl 20,31,"L00000000003$spb"
|
||||
"L00000000003$spb":
|
||||
bcl 20,31,"L3$spb"
|
||||
"L3$spb":
|
||||
mflr r11
|
||||
addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L00000000003$spb")
|
||||
addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")
|
||||
mtlr r0
|
||||
lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L00000000003$spb")(r11)
|
||||
lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")(r11)
|
||||
mtctr r12
|
||||
bctr
|
||||
.lazy_symbol_pointer
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -593,7 +593,7 @@ darwin_adjust_aggregate_sizes (ffi_type *s)
|
|||
/* Natural alignment for all items. */
|
||||
align = p->alignment;
|
||||
#else
|
||||
/* Natrual alignment for the first item... */
|
||||
/* Natural alignment for the first item... */
|
||||
if (i == 0)
|
||||
align = p->alignment;
|
||||
else if (p->alignment == 16 || p->alignment < 4)
|
||||
|
|
|
|||
943
Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c
Normal file
943
Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c
Normal file
|
|
@ -0,0 +1,943 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffi_linux64.c - Copyright (C) 2013 IBM
|
||||
Copyright (C) 2011 Anthony Green
|
||||
Copyright (C) 2011 Kyle Moffett
|
||||
Copyright (C) 2008 Red Hat, Inc
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc
|
||||
Copyright (c) 1998 Geoffrey Keating
|
||||
|
||||
PowerPC Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#include "ffi.h"
|
||||
|
||||
#ifdef POWERPC64
|
||||
#include "ffi_common.h"
|
||||
#include "ffi_powerpc.h"
|
||||
|
||||
|
||||
/* About the LINUX64 ABI. */
|
||||
enum {
|
||||
NUM_GPR_ARG_REGISTERS64 = 8,
|
||||
NUM_FPR_ARG_REGISTERS64 = 13
|
||||
};
|
||||
enum { ASM_NEEDS_REGISTERS64 = 4 };
|
||||
|
||||
|
||||
#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
/* Adjust size of ffi_type_longdouble. */
|
||||
void FFI_HIDDEN
|
||||
ffi_prep_types_linux64 (ffi_abi abi)
|
||||
{
|
||||
if ((abi & (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128)) == FFI_LINUX)
|
||||
{
|
||||
ffi_type_longdouble.size = 8;
|
||||
ffi_type_longdouble.alignment = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
ffi_type_longdouble.size = 16;
|
||||
ffi_type_longdouble.alignment = 16;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if _CALL_ELF == 2
|
||||
static unsigned int
|
||||
discover_homogeneous_aggregate (const ffi_type *t, unsigned int *elnum)
|
||||
{
|
||||
switch (t->type)
|
||||
{
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_DOUBLE:
|
||||
*elnum = 1;
|
||||
return (int) t->type;
|
||||
|
||||
case FFI_TYPE_STRUCT:;
|
||||
{
|
||||
unsigned int base_elt = 0, total_elnum = 0;
|
||||
ffi_type **el = t->elements;
|
||||
while (*el)
|
||||
{
|
||||
unsigned int el_elt, el_elnum = 0;
|
||||
el_elt = discover_homogeneous_aggregate (*el, &el_elnum);
|
||||
if (el_elt == 0
|
||||
|| (base_elt && base_elt != el_elt))
|
||||
return 0;
|
||||
base_elt = el_elt;
|
||||
total_elnum += el_elnum;
|
||||
if (total_elnum > 8)
|
||||
return 0;
|
||||
el++;
|
||||
}
|
||||
*elnum = total_elnum;
|
||||
return base_elt;
|
||||
}
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Perform machine dependent cif processing */
|
||||
static ffi_status
|
||||
ffi_prep_cif_linux64_core (ffi_cif *cif)
|
||||
{
|
||||
ffi_type **ptr;
|
||||
unsigned bytes;
|
||||
unsigned i, fparg_count = 0, intarg_count = 0;
|
||||
unsigned flags = cif->flags;
|
||||
#if _CALL_ELF == 2
|
||||
unsigned int elt, elnum;
|
||||
#endif
|
||||
|
||||
#if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE
|
||||
/* If compiled without long double support.. */
|
||||
if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
|
||||
return FFI_BAD_ABI;
|
||||
#endif
|
||||
|
||||
/* The machine-independent calculation of cif->bytes doesn't work
|
||||
for us. Redo the calculation. */
|
||||
#if _CALL_ELF == 2
|
||||
/* Space for backchain, CR, LR, TOC and the asm's temp regs. */
|
||||
bytes = (4 + ASM_NEEDS_REGISTERS64) * sizeof (long);
|
||||
|
||||
/* Space for the general registers. */
|
||||
bytes += NUM_GPR_ARG_REGISTERS64 * sizeof (long);
|
||||
#else
|
||||
/* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp
|
||||
regs. */
|
||||
bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long);
|
||||
|
||||
/* Space for the mandatory parm save area and general registers. */
|
||||
bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long);
|
||||
#endif
|
||||
|
||||
/* Return value handling. */
|
||||
switch (cif->rtype->type)
|
||||
{
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
|
||||
flags |= FLAG_RETURNS_128BITS;
|
||||
/* Fall through. */
|
||||
#endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
flags |= FLAG_RETURNS_64BITS;
|
||||
/* Fall through. */
|
||||
case FFI_TYPE_FLOAT:
|
||||
flags |= FLAG_RETURNS_FP;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT128:
|
||||
flags |= FLAG_RETURNS_128BITS;
|
||||
/* Fall through. */
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
flags |= FLAG_RETURNS_64BITS;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
#if _CALL_ELF == 2
|
||||
elt = discover_homogeneous_aggregate (cif->rtype, &elnum);
|
||||
if (elt)
|
||||
{
|
||||
if (elt == FFI_TYPE_DOUBLE)
|
||||
flags |= FLAG_RETURNS_64BITS;
|
||||
flags |= FLAG_RETURNS_FP | FLAG_RETURNS_SMST;
|
||||
break;
|
||||
}
|
||||
if (cif->rtype->size <= 16)
|
||||
{
|
||||
flags |= FLAG_RETURNS_SMST;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
intarg_count++;
|
||||
flags |= FLAG_RETVAL_REFERENCE;
|
||||
/* Fall through. */
|
||||
case FFI_TYPE_VOID:
|
||||
flags |= FLAG_RETURNS_NOTHING;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Returns 32-bit integer, or similar. Nothing to do here. */
|
||||
break;
|
||||
}
|
||||
|
||||
for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
|
||||
{
|
||||
unsigned int align;
|
||||
|
||||
switch ((*ptr)->type)
|
||||
{
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
|
||||
{
|
||||
fparg_count++;
|
||||
intarg_count++;
|
||||
}
|
||||
/* Fall through. */
|
||||
#endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
case FFI_TYPE_FLOAT:
|
||||
fparg_count++;
|
||||
intarg_count++;
|
||||
if (fparg_count > NUM_FPR_ARG_REGISTERS64)
|
||||
flags |= FLAG_ARG_NEEDS_PSAVE;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
|
||||
{
|
||||
align = (*ptr)->alignment;
|
||||
if (align > 16)
|
||||
align = 16;
|
||||
align = align / 8;
|
||||
if (align > 1)
|
||||
intarg_count = ALIGN (intarg_count, align);
|
||||
}
|
||||
intarg_count += ((*ptr)->size + 7) / 8;
|
||||
#if _CALL_ELF == 2
|
||||
elt = discover_homogeneous_aggregate (*ptr, &elnum);
|
||||
if (elt)
|
||||
{
|
||||
fparg_count += elnum;
|
||||
if (fparg_count > NUM_FPR_ARG_REGISTERS64)
|
||||
flags |= FLAG_ARG_NEEDS_PSAVE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (intarg_count > NUM_GPR_ARG_REGISTERS64)
|
||||
flags |= FLAG_ARG_NEEDS_PSAVE;
|
||||
}
|
||||
break;
|
||||
|
||||
case FFI_TYPE_POINTER:
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_INT:
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_UINT16:
|
||||
case FFI_TYPE_SINT16:
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
/* Everything else is passed as a 8-byte word in a GPR, either
|
||||
the object itself or a pointer to it. */
|
||||
intarg_count++;
|
||||
if (intarg_count > NUM_GPR_ARG_REGISTERS64)
|
||||
flags |= FLAG_ARG_NEEDS_PSAVE;
|
||||
break;
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
}
|
||||
|
||||
if (fparg_count != 0)
|
||||
flags |= FLAG_FP_ARGUMENTS;
|
||||
if (intarg_count > 4)
|
||||
flags |= FLAG_4_GPR_ARGUMENTS;
|
||||
|
||||
/* Space for the FPR registers, if needed. */
|
||||
if (fparg_count != 0)
|
||||
bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double);
|
||||
|
||||
/* Stack space. */
|
||||
#if _CALL_ELF == 2
|
||||
if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0)
|
||||
bytes += intarg_count * sizeof (long);
|
||||
#else
|
||||
if (intarg_count > NUM_GPR_ARG_REGISTERS64)
|
||||
bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long);
|
||||
#endif
|
||||
|
||||
/* The stack space allocated needs to be a multiple of 16 bytes. */
|
||||
bytes = (bytes + 15) & ~0xF;
|
||||
|
||||
cif->flags = flags;
|
||||
cif->bytes = bytes;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
ffi_status FFI_HIDDEN
|
||||
ffi_prep_cif_linux64 (ffi_cif *cif)
|
||||
{
|
||||
if ((cif->abi & FFI_LINUX) != 0)
|
||||
cif->nfixedargs = cif->nargs;
|
||||
#if _CALL_ELF != 2
|
||||
else if (cif->abi == FFI_COMPAT_LINUX64)
|
||||
{
|
||||
/* This call is from old code. Don't touch cif->nfixedargs
|
||||
since old code will be using a smaller cif. */
|
||||
cif->flags |= FLAG_COMPAT;
|
||||
/* Translate to new abi value. */
|
||||
cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return FFI_BAD_ABI;
|
||||
return ffi_prep_cif_linux64_core (cif);
|
||||
}
|
||||
|
||||
ffi_status FFI_HIDDEN
|
||||
ffi_prep_cif_linux64_var (ffi_cif *cif,
|
||||
unsigned int nfixedargs,
|
||||
unsigned int ntotalargs MAYBE_UNUSED)
|
||||
{
|
||||
if ((cif->abi & FFI_LINUX) != 0)
|
||||
cif->nfixedargs = nfixedargs;
|
||||
#if _CALL_ELF != 2
|
||||
else if (cif->abi == FFI_COMPAT_LINUX64)
|
||||
{
|
||||
/* This call is from old code. Don't touch cif->nfixedargs
|
||||
since old code will be using a smaller cif. */
|
||||
cif->flags |= FLAG_COMPAT;
|
||||
/* Translate to new abi value. */
|
||||
cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return FFI_BAD_ABI;
|
||||
#if _CALL_ELF == 2
|
||||
cif->flags |= FLAG_ARG_NEEDS_PSAVE;
|
||||
#endif
|
||||
return ffi_prep_cif_linux64_core (cif);
|
||||
}
|
||||
|
||||
|
||||
/* ffi_prep_args64 is called by the assembly routine once stack space
|
||||
has been allocated for the function's arguments.
|
||||
|
||||
The stack layout we want looks like this:
|
||||
|
||||
| Ret addr from ffi_call_LINUX64 8bytes | higher addresses
|
||||
|--------------------------------------------|
|
||||
| CR save area 8bytes |
|
||||
|--------------------------------------------|
|
||||
| Previous backchain pointer 8 | stack pointer here
|
||||
|--------------------------------------------|<+ <<< on entry to
|
||||
| Saved r28-r31 4*8 | | ffi_call_LINUX64
|
||||
|--------------------------------------------| |
|
||||
| GPR registers r3-r10 8*8 | |
|
||||
|--------------------------------------------| |
|
||||
| FPR registers f1-f13 (optional) 13*8 | |
|
||||
|--------------------------------------------| |
|
||||
| Parameter save area | |
|
||||
|--------------------------------------------| |
|
||||
| TOC save area 8 | |
|
||||
|--------------------------------------------| | stack |
|
||||
| Linker doubleword 8 | | grows |
|
||||
|--------------------------------------------| | down V
|
||||
| Compiler doubleword 8 | |
|
||||
|--------------------------------------------| | lower addresses
|
||||
| Space for callee's LR 8 | |
|
||||
|--------------------------------------------| |
|
||||
| CR save area 8 | |
|
||||
|--------------------------------------------| | stack pointer here
|
||||
| Current backchain pointer 8 |-/ during
|
||||
|--------------------------------------------| <<< ffi_call_LINUX64
|
||||
|
||||
*/
|
||||
|
||||
void FFI_HIDDEN
|
||||
ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
|
||||
{
|
||||
const unsigned long bytes = ecif->cif->bytes;
|
||||
const unsigned long flags = ecif->cif->flags;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char *c;
|
||||
unsigned long *ul;
|
||||
float *f;
|
||||
double *d;
|
||||
size_t p;
|
||||
} valp;
|
||||
|
||||
/* 'stacktop' points at the previous backchain pointer. */
|
||||
valp stacktop;
|
||||
|
||||
/* 'next_arg' points at the space for gpr3, and grows upwards as
|
||||
we use GPR registers, then continues at rest. */
|
||||
valp gpr_base;
|
||||
valp gpr_end;
|
||||
valp rest;
|
||||
valp next_arg;
|
||||
|
||||
/* 'fpr_base' points at the space for fpr3, and grows upwards as
|
||||
we use FPR registers. */
|
||||
valp fpr_base;
|
||||
unsigned int fparg_count;
|
||||
|
||||
unsigned int i, words, nargs, nfixedargs;
|
||||
ffi_type **ptr;
|
||||
double double_tmp;
|
||||
union
|
||||
{
|
||||
void **v;
|
||||
char **c;
|
||||
signed char **sc;
|
||||
unsigned char **uc;
|
||||
signed short **ss;
|
||||
unsigned short **us;
|
||||
signed int **si;
|
||||
unsigned int **ui;
|
||||
unsigned long **ul;
|
||||
float **f;
|
||||
double **d;
|
||||
} p_argv;
|
||||
unsigned long gprvalue;
|
||||
unsigned long align;
|
||||
|
||||
stacktop.c = (char *) stack + bytes;
|
||||
gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64;
|
||||
gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64;
|
||||
#if _CALL_ELF == 2
|
||||
rest.ul = stack + 4 + NUM_GPR_ARG_REGISTERS64;
|
||||
#else
|
||||
rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64;
|
||||
#endif
|
||||
fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64;
|
||||
fparg_count = 0;
|
||||
next_arg.ul = gpr_base.ul;
|
||||
|
||||
/* Check that everything starts aligned properly. */
|
||||
FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
|
||||
FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
|
||||
FFI_ASSERT ((bytes & 0xF) == 0);
|
||||
|
||||
/* Deal with return values that are actually pass-by-reference. */
|
||||
if (flags & FLAG_RETVAL_REFERENCE)
|
||||
*next_arg.ul++ = (unsigned long) (char *) ecif->rvalue;
|
||||
|
||||
/* Now for the arguments. */
|
||||
p_argv.v = ecif->avalue;
|
||||
nargs = ecif->cif->nargs;
|
||||
#if _CALL_ELF != 2
|
||||
nfixedargs = (unsigned) -1;
|
||||
if ((flags & FLAG_COMPAT) == 0)
|
||||
#endif
|
||||
nfixedargs = ecif->cif->nfixedargs;
|
||||
for (ptr = ecif->cif->arg_types, i = 0;
|
||||
i < nargs;
|
||||
i++, ptr++, p_argv.v++)
|
||||
{
|
||||
#if _CALL_ELF == 2
|
||||
unsigned int elt, elnum;
|
||||
#endif
|
||||
|
||||
switch ((*ptr)->type)
|
||||
{
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
|
||||
{
|
||||
double_tmp = (*p_argv.d)[0];
|
||||
if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
|
||||
{
|
||||
*fpr_base.d++ = double_tmp;
|
||||
# if _CALL_ELF != 2
|
||||
if ((flags & FLAG_COMPAT) != 0)
|
||||
*next_arg.d = double_tmp;
|
||||
# endif
|
||||
}
|
||||
else
|
||||
*next_arg.d = double_tmp;
|
||||
if (++next_arg.ul == gpr_end.ul)
|
||||
next_arg.ul = rest.ul;
|
||||
fparg_count++;
|
||||
double_tmp = (*p_argv.d)[1];
|
||||
if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
|
||||
{
|
||||
*fpr_base.d++ = double_tmp;
|
||||
# if _CALL_ELF != 2
|
||||
if ((flags & FLAG_COMPAT) != 0)
|
||||
*next_arg.d = double_tmp;
|
||||
# endif
|
||||
}
|
||||
else
|
||||
*next_arg.d = double_tmp;
|
||||
if (++next_arg.ul == gpr_end.ul)
|
||||
next_arg.ul = rest.ul;
|
||||
fparg_count++;
|
||||
FFI_ASSERT (__LDBL_MANT_DIG__ == 106);
|
||||
FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
#endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
double_tmp = **p_argv.d;
|
||||
if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
|
||||
{
|
||||
*fpr_base.d++ = double_tmp;
|
||||
#if _CALL_ELF != 2
|
||||
if ((flags & FLAG_COMPAT) != 0)
|
||||
*next_arg.d = double_tmp;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
*next_arg.d = double_tmp;
|
||||
if (++next_arg.ul == gpr_end.ul)
|
||||
next_arg.ul = rest.ul;
|
||||
fparg_count++;
|
||||
FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_FLOAT:
|
||||
double_tmp = **p_argv.f;
|
||||
if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
|
||||
{
|
||||
*fpr_base.d++ = double_tmp;
|
||||
#if _CALL_ELF != 2
|
||||
if ((flags & FLAG_COMPAT) != 0)
|
||||
*next_arg.f = (float) double_tmp;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
*next_arg.f = (float) double_tmp;
|
||||
if (++next_arg.ul == gpr_end.ul)
|
||||
next_arg.ul = rest.ul;
|
||||
fparg_count++;
|
||||
FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
if ((ecif->cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
|
||||
{
|
||||
align = (*ptr)->alignment;
|
||||
if (align > 16)
|
||||
align = 16;
|
||||
if (align > 1)
|
||||
next_arg.p = ALIGN (next_arg.p, align);
|
||||
}
|
||||
#if _CALL_ELF == 2
|
||||
elt = discover_homogeneous_aggregate (*ptr, &elnum);
|
||||
if (elt)
|
||||
{
|
||||
union {
|
||||
void *v;
|
||||
float *f;
|
||||
double *d;
|
||||
} arg;
|
||||
|
||||
arg.v = *p_argv.v;
|
||||
if (elt == FFI_TYPE_FLOAT)
|
||||
{
|
||||
do
|
||||
{
|
||||
double_tmp = *arg.f++;
|
||||
if (fparg_count < NUM_FPR_ARG_REGISTERS64
|
||||
&& i < nfixedargs)
|
||||
*fpr_base.d++ = double_tmp;
|
||||
else
|
||||
*next_arg.f = (float) double_tmp;
|
||||
if (++next_arg.f == gpr_end.f)
|
||||
next_arg.f = rest.f;
|
||||
fparg_count++;
|
||||
}
|
||||
while (--elnum != 0);
|
||||
if ((next_arg.p & 3) != 0)
|
||||
{
|
||||
if (++next_arg.f == gpr_end.f)
|
||||
next_arg.f = rest.f;
|
||||
}
|
||||
}
|
||||
else
|
||||
do
|
||||
{
|
||||
double_tmp = *arg.d++;
|
||||
if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
|
||||
*fpr_base.d++ = double_tmp;
|
||||
else
|
||||
*next_arg.d = double_tmp;
|
||||
if (++next_arg.d == gpr_end.d)
|
||||
next_arg.d = rest.d;
|
||||
fparg_count++;
|
||||
}
|
||||
while (--elnum != 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
words = ((*ptr)->size + 7) / 8;
|
||||
if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul)
|
||||
{
|
||||
size_t first = gpr_end.c - next_arg.c;
|
||||
memcpy (next_arg.c, *p_argv.c, first);
|
||||
memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first);
|
||||
next_arg.c = rest.c + words * 8 - first;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *where = next_arg.c;
|
||||
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
/* Structures with size less than eight bytes are passed
|
||||
left-padded. */
|
||||
if ((*ptr)->size < 8)
|
||||
where += 8 - (*ptr)->size;
|
||||
#endif
|
||||
memcpy (where, *p_argv.c, (*ptr)->size);
|
||||
next_arg.ul += words;
|
||||
if (next_arg.ul == gpr_end.ul)
|
||||
next_arg.ul = rest.ul;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
gprvalue = **p_argv.uc;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_SINT8:
|
||||
gprvalue = **p_argv.sc;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_UINT16:
|
||||
gprvalue = **p_argv.us;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_SINT16:
|
||||
gprvalue = **p_argv.ss;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_UINT32:
|
||||
gprvalue = **p_argv.ui;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_INT:
|
||||
case FFI_TYPE_SINT32:
|
||||
gprvalue = **p_argv.si;
|
||||
goto putgpr;
|
||||
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_POINTER:
|
||||
gprvalue = **p_argv.ul;
|
||||
putgpr:
|
||||
*next_arg.ul++ = gprvalue;
|
||||
if (next_arg.ul == gpr_end.ul)
|
||||
next_arg.ul = rest.ul;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS
|
||||
|| (next_arg.ul >= gpr_base.ul
|
||||
&& next_arg.ul <= gpr_base.ul + 4));
|
||||
}
|
||||
|
||||
|
||||
#if _CALL_ELF == 2
|
||||
#define MIN_CACHE_LINE_SIZE 8
|
||||
|
||||
static void
|
||||
flush_icache (char *wraddr, char *xaddr, int size)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
|
||||
__asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
|
||||
: : "r" (xaddr + i), "r" (wraddr + i) : "memory");
|
||||
__asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
|
||||
: : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
|
||||
: "memory");
|
||||
}
|
||||
#endif
|
||||
|
||||
ffi_status
|
||||
ffi_prep_closure_loc_linux64 (ffi_closure *closure,
|
||||
ffi_cif *cif,
|
||||
void (*fun) (ffi_cif *, void *, void **, void *),
|
||||
void *user_data,
|
||||
void *codeloc)
|
||||
{
|
||||
#if _CALL_ELF == 2
|
||||
unsigned int *tramp = (unsigned int *) &closure->tramp[0];
|
||||
|
||||
if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
tramp[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */
|
||||
tramp[1] = 0xe98c0010; /* ld 12,1f-0b(12) */
|
||||
tramp[2] = 0x7d8903a6; /* mtctr 12 */
|
||||
tramp[3] = 0x4e800420; /* bctr */
|
||||
/* 1: .quad function_addr */
|
||||
/* 2: .quad context */
|
||||
*(void **) &tramp[4] = (void *) ffi_closure_LINUX64;
|
||||
*(void **) &tramp[6] = codeloc;
|
||||
flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
|
||||
#else
|
||||
void **tramp = (void **) &closure->tramp[0];
|
||||
|
||||
if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
/* Copy function address and TOC from ffi_closure_LINUX64. */
|
||||
memcpy (tramp, (char *) ffi_closure_LINUX64, 16);
|
||||
tramp[2] = tramp[1];
|
||||
tramp[1] = codeloc;
|
||||
#endif
|
||||
|
||||
closure->cif = cif;
|
||||
closure->fun = fun;
|
||||
closure->user_data = user_data;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
|
||||
int FFI_HIDDEN
|
||||
ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue,
|
||||
unsigned long *pst, ffi_dblfl *pfr)
|
||||
{
|
||||
/* rvalue is the pointer to space for return value in closure assembly */
|
||||
/* pst is the pointer to parameter save area
|
||||
(r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */
|
||||
/* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */
|
||||
|
||||
void **avalue;
|
||||
ffi_type **arg_types;
|
||||
unsigned long i, avn, nfixedargs;
|
||||
ffi_cif *cif;
|
||||
ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64;
|
||||
unsigned long align;
|
||||
|
||||
cif = closure->cif;
|
||||
avalue = alloca (cif->nargs * sizeof (void *));
|
||||
|
||||
/* Copy the caller's structure return value address so that the
|
||||
closure returns the data directly to the caller. */
|
||||
if (cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& (cif->flags & FLAG_RETURNS_SMST) == 0)
|
||||
{
|
||||
rvalue = (void *) *pst;
|
||||
pst++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
avn = cif->nargs;
|
||||
#if _CALL_ELF != 2
|
||||
nfixedargs = (unsigned) -1;
|
||||
if ((cif->flags & FLAG_COMPAT) == 0)
|
||||
#endif
|
||||
nfixedargs = cif->nfixedargs;
|
||||
arg_types = cif->arg_types;
|
||||
|
||||
/* Grab the addresses of the arguments from the stack frame. */
|
||||
while (i < avn)
|
||||
{
|
||||
unsigned int elt, elnum;
|
||||
|
||||
switch (arg_types[i]->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT8:
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
avalue[i] = (char *) pst + 7;
|
||||
pst++;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
case FFI_TYPE_UINT16:
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
avalue[i] = (char *) pst + 6;
|
||||
pst++;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_UINT32:
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
avalue[i] = (char *) pst + 4;
|
||||
pst++;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_POINTER:
|
||||
avalue[i] = pst;
|
||||
pst++;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
|
||||
{
|
||||
align = arg_types[i]->alignment;
|
||||
if (align > 16)
|
||||
align = 16;
|
||||
if (align > 1)
|
||||
pst = (unsigned long *) ALIGN ((size_t) pst, align);
|
||||
}
|
||||
elt = 0;
|
||||
#if _CALL_ELF == 2
|
||||
elt = discover_homogeneous_aggregate (arg_types[i], &elnum);
|
||||
#endif
|
||||
if (elt)
|
||||
{
|
||||
union {
|
||||
void *v;
|
||||
unsigned long *ul;
|
||||
float *f;
|
||||
double *d;
|
||||
size_t p;
|
||||
} to, from;
|
||||
|
||||
/* Repackage the aggregate from its parts. The
|
||||
aggregate size is not greater than the space taken by
|
||||
the registers so store back to the register/parameter
|
||||
save arrays. */
|
||||
if (pfr + elnum <= end_pfr)
|
||||
to.v = pfr;
|
||||
else
|
||||
to.v = pst;
|
||||
|
||||
avalue[i] = to.v;
|
||||
from.ul = pst;
|
||||
if (elt == FFI_TYPE_FLOAT)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (pfr < end_pfr && i < nfixedargs)
|
||||
{
|
||||
*to.f = (float) pfr->d;
|
||||
pfr++;
|
||||
}
|
||||
else
|
||||
*to.f = *from.f;
|
||||
to.f++;
|
||||
from.f++;
|
||||
}
|
||||
while (--elnum != 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
if (pfr < end_pfr && i < nfixedargs)
|
||||
{
|
||||
*to.d = pfr->d;
|
||||
pfr++;
|
||||
}
|
||||
else
|
||||
*to.d = *from.d;
|
||||
to.d++;
|
||||
from.d++;
|
||||
}
|
||||
while (--elnum != 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
/* Structures with size less than eight bytes are passed
|
||||
left-padded. */
|
||||
if (arg_types[i]->size < 8)
|
||||
avalue[i] = (char *) pst + 8 - arg_types[i]->size;
|
||||
else
|
||||
#endif
|
||||
avalue[i] = pst;
|
||||
}
|
||||
pst += (arg_types[i]->size + 7) / 8;
|
||||
break;
|
||||
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
|
||||
{
|
||||
if (pfr + 1 < end_pfr && i + 1 < nfixedargs)
|
||||
{
|
||||
avalue[i] = pfr;
|
||||
pfr += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pfr < end_pfr && i < nfixedargs)
|
||||
{
|
||||
/* Passed partly in f13 and partly on the stack.
|
||||
Move it all to the stack. */
|
||||
*pst = *(unsigned long *) pfr;
|
||||
pfr++;
|
||||
}
|
||||
avalue[i] = pst;
|
||||
}
|
||||
pst += 2;
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
#endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
/* On the outgoing stack all values are aligned to 8 */
|
||||
/* there are 13 64bit floating point registers */
|
||||
|
||||
if (pfr < end_pfr && i < nfixedargs)
|
||||
{
|
||||
avalue[i] = pfr;
|
||||
pfr++;
|
||||
}
|
||||
else
|
||||
avalue[i] = pst;
|
||||
pst++;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_FLOAT:
|
||||
if (pfr < end_pfr && i < nfixedargs)
|
||||
{
|
||||
/* Float values are stored as doubles in the
|
||||
ffi_closure_LINUX64 code. Fix them here. */
|
||||
pfr->f = (float) pfr->d;
|
||||
avalue[i] = pfr;
|
||||
pfr++;
|
||||
}
|
||||
else
|
||||
avalue[i] = pst;
|
||||
pst++;
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
(closure->fun) (cif, rvalue, avalue, closure->user_data);
|
||||
|
||||
/* Tell ffi_closure_LINUX64 how to perform return type promotions. */
|
||||
if ((cif->flags & FLAG_RETURNS_SMST) != 0)
|
||||
{
|
||||
if ((cif->flags & FLAG_RETURNS_FP) == 0)
|
||||
return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1;
|
||||
else if ((cif->flags & FLAG_RETURNS_64BITS) != 0)
|
||||
return FFI_V2_TYPE_DOUBLE_HOMOG;
|
||||
else
|
||||
return FFI_V2_TYPE_FLOAT_HOMOG;
|
||||
}
|
||||
return cif->rtype->type;
|
||||
}
|
||||
#endif
|
||||
77
Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h
Normal file
77
Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffi_powerpc.h - Copyright (C) 2013 IBM
|
||||
Copyright (C) 2011 Anthony Green
|
||||
Copyright (C) 2011 Kyle Moffett
|
||||
Copyright (C) 2008 Red Hat, Inc
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc
|
||||
Copyright (c) 1998 Geoffrey Keating
|
||||
|
||||
PowerPC Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
enum {
|
||||
/* The assembly depends on these exact flags. */
|
||||
/* These go in cr7 */
|
||||
FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */
|
||||
FLAG_RETURNS_NOTHING = 1 << (31-30),
|
||||
FLAG_RETURNS_FP = 1 << (31-29),
|
||||
FLAG_RETURNS_64BITS = 1 << (31-28),
|
||||
|
||||
/* This goes in cr6 */
|
||||
FLAG_RETURNS_128BITS = 1 << (31-27),
|
||||
|
||||
FLAG_COMPAT = 1 << (31- 8), /* Not used by assembly */
|
||||
|
||||
/* These go in cr1 */
|
||||
FLAG_ARG_NEEDS_COPY = 1 << (31- 7), /* Used by sysv code */
|
||||
FLAG_ARG_NEEDS_PSAVE = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */
|
||||
FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
|
||||
FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
|
||||
FLAG_RETVAL_REFERENCE = 1 << (31- 4)
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
float f;
|
||||
double d;
|
||||
} ffi_dblfl;
|
||||
|
||||
void FFI_HIDDEN ffi_closure_SYSV (void);
|
||||
void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *,
|
||||
void (*)(void));
|
||||
|
||||
void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi);
|
||||
ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *);
|
||||
int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *,
|
||||
ffi_dblfl *, unsigned long *);
|
||||
|
||||
void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long,
|
||||
unsigned long *, void (*)(void));
|
||||
void FFI_HIDDEN ffi_closure_LINUX64 (void);
|
||||
|
||||
void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi);
|
||||
ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *);
|
||||
ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int,
|
||||
unsigned int);
|
||||
void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const);
|
||||
int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *,
|
||||
unsigned long *, ffi_dblfl *);
|
||||
931
Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c
Normal file
931
Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c
Normal file
|
|
@ -0,0 +1,931 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
ffi_sysv.c - Copyright (C) 2013 IBM
|
||||
Copyright (C) 2011 Anthony Green
|
||||
Copyright (C) 2011 Kyle Moffett
|
||||
Copyright (C) 2008 Red Hat, Inc
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc
|
||||
Copyright (c) 1998 Geoffrey Keating
|
||||
|
||||
PowerPC Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#include "ffi.h"
|
||||
|
||||
#ifndef POWERPC64
|
||||
#include "ffi_common.h"
|
||||
#include "ffi_powerpc.h"
|
||||
|
||||
|
||||
/* About the SYSV ABI. */
|
||||
#define ASM_NEEDS_REGISTERS 4
|
||||
#define NUM_GPR_ARG_REGISTERS 8
|
||||
#define NUM_FPR_ARG_REGISTERS 8
|
||||
|
||||
|
||||
#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
/* Adjust size of ffi_type_longdouble. */
|
||||
void FFI_HIDDEN
|
||||
ffi_prep_types_sysv (ffi_abi abi)
|
||||
{
|
||||
if ((abi & (FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128)) == FFI_SYSV)
|
||||
{
|
||||
ffi_type_longdouble.size = 8;
|
||||
ffi_type_longdouble.alignment = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
ffi_type_longdouble.size = 16;
|
||||
ffi_type_longdouble.alignment = 16;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Transform long double, double and float to other types as per abi. */
|
||||
static int
|
||||
translate_float (int abi, int type)
|
||||
{
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
if (type == FFI_TYPE_LONGDOUBLE
|
||||
&& (abi & FFI_SYSV_LONG_DOUBLE_128) == 0)
|
||||
type = FFI_TYPE_DOUBLE;
|
||||
#endif
|
||||
if ((abi & FFI_SYSV_SOFT_FLOAT) != 0)
|
||||
{
|
||||
if (type == FFI_TYPE_FLOAT)
|
||||
type = FFI_TYPE_UINT32;
|
||||
else if (type == FFI_TYPE_DOUBLE)
|
||||
type = FFI_TYPE_UINT64;
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
else if (type == FFI_TYPE_LONGDOUBLE)
|
||||
type = FFI_TYPE_UINT128;
|
||||
}
|
||||
else if ((abi & FFI_SYSV_IBM_LONG_DOUBLE) == 0)
|
||||
{
|
||||
if (type == FFI_TYPE_LONGDOUBLE)
|
||||
type = FFI_TYPE_STRUCT;
|
||||
#endif
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/* Perform machine dependent cif processing */
|
||||
static ffi_status
|
||||
ffi_prep_cif_sysv_core (ffi_cif *cif)
|
||||
{
|
||||
ffi_type **ptr;
|
||||
unsigned bytes;
|
||||
unsigned i, fparg_count = 0, intarg_count = 0;
|
||||
unsigned flags = cif->flags;
|
||||
unsigned struct_copy_size = 0;
|
||||
unsigned type = cif->rtype->type;
|
||||
unsigned size = cif->rtype->size;
|
||||
|
||||
/* The machine-independent calculation of cif->bytes doesn't work
|
||||
for us. Redo the calculation. */
|
||||
|
||||
/* Space for the frame pointer, callee's LR, and the asm's temp regs. */
|
||||
bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int);
|
||||
|
||||
/* Space for the GPR registers. */
|
||||
bytes += NUM_GPR_ARG_REGISTERS * sizeof (int);
|
||||
|
||||
/* Return value handling. The rules for SYSV are as follows:
|
||||
- 32-bit (or less) integer values are returned in gpr3;
|
||||
- Structures of size <= 4 bytes also returned in gpr3;
|
||||
- 64-bit integer values and structures between 5 and 8 bytes are returned
|
||||
in gpr3 and gpr4;
|
||||
- Larger structures are allocated space and a pointer is passed as
|
||||
the first argument.
|
||||
- Single/double FP values are returned in fpr1;
|
||||
- long doubles (if not equivalent to double) are returned in
|
||||
fpr1,fpr2 for Linux and as for large structs for SysV. */
|
||||
|
||||
type = translate_float (cif->abi, type);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
flags |= FLAG_RETURNS_128BITS;
|
||||
/* Fall through. */
|
||||
#endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
flags |= FLAG_RETURNS_64BITS;
|
||||
/* Fall through. */
|
||||
case FFI_TYPE_FLOAT:
|
||||
flags |= FLAG_RETURNS_FP;
|
||||
#ifdef __NO_FPRS__
|
||||
return FFI_BAD_ABI;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT128:
|
||||
flags |= FLAG_RETURNS_128BITS;
|
||||
/* Fall through. */
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
flags |= FLAG_RETURNS_64BITS;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
/* The final SYSV ABI says that structures smaller or equal 8 bytes
|
||||
are returned in r3/r4. A draft ABI used by linux instead
|
||||
returns them in memory. */
|
||||
if ((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)
|
||||
{
|
||||
flags |= FLAG_RETURNS_SMST;
|
||||
break;
|
||||
}
|
||||
intarg_count++;
|
||||
flags |= FLAG_RETVAL_REFERENCE;
|
||||
/* Fall through. */
|
||||
case FFI_TYPE_VOID:
|
||||
flags |= FLAG_RETURNS_NOTHING;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Returns 32-bit integer, or similar. Nothing to do here. */
|
||||
break;
|
||||
}
|
||||
|
||||
/* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the
|
||||
first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest
|
||||
goes on the stack. Structures and long doubles (if not equivalent
|
||||
to double) are passed as a pointer to a copy of the structure.
|
||||
Stuff on the stack needs to keep proper alignment. */
|
||||
for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
|
||||
{
|
||||
unsigned short typenum = (*ptr)->type;
|
||||
|
||||
typenum = translate_float (cif->abi, typenum);
|
||||
|
||||
switch (typenum)
|
||||
{
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
fparg_count++;
|
||||
/* Fall thru */
|
||||
#endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
fparg_count++;
|
||||
/* If this FP arg is going on the stack, it must be
|
||||
8-byte-aligned. */
|
||||
if (fparg_count > NUM_FPR_ARG_REGISTERS
|
||||
&& intarg_count >= NUM_GPR_ARG_REGISTERS
|
||||
&& intarg_count % 2 != 0)
|
||||
intarg_count++;
|
||||
#ifdef __NO_FPRS__
|
||||
return FFI_BAD_ABI;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FFI_TYPE_FLOAT:
|
||||
fparg_count++;
|
||||
#ifdef __NO_FPRS__
|
||||
return FFI_BAD_ABI;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT128:
|
||||
/* A long double in FFI_LINUX_SOFT_FLOAT can use only a set
|
||||
of four consecutive gprs. If we do not have enough, we
|
||||
have to adjust the intarg_count value. */
|
||||
if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3
|
||||
&& intarg_count < NUM_GPR_ARG_REGISTERS)
|
||||
intarg_count = NUM_GPR_ARG_REGISTERS;
|
||||
intarg_count += 4;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
/* 'long long' arguments are passed as two words, but
|
||||
either both words must fit in registers or both go
|
||||
on the stack. If they go on the stack, they must
|
||||
be 8-byte-aligned.
|
||||
|
||||
Also, only certain register pairs can be used for
|
||||
passing long long int -- specifically (r3,r4), (r5,r6),
|
||||
(r7,r8), (r9,r10). */
|
||||
if (intarg_count == NUM_GPR_ARG_REGISTERS-1
|
||||
|| intarg_count % 2 != 0)
|
||||
intarg_count++;
|
||||
intarg_count += 2;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
/* We must allocate space for a copy of these to enforce
|
||||
pass-by-value. Pad the space up to a multiple of 16
|
||||
bytes (the maximum alignment required for anything under
|
||||
the SYSV ABI). */
|
||||
struct_copy_size += ((*ptr)->size + 15) & ~0xF;
|
||||
/* Fall through (allocate space for the pointer). */
|
||||
|
||||
case FFI_TYPE_POINTER:
|
||||
case FFI_TYPE_INT:
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_UINT16:
|
||||
case FFI_TYPE_SINT16:
|
||||
case FFI_TYPE_UINT8:
|
||||
case FFI_TYPE_SINT8:
|
||||
/* Everything else is passed as a 4-byte word in a GPR, either
|
||||
the object itself or a pointer to it. */
|
||||
intarg_count++;
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
}
|
||||
|
||||
if (fparg_count != 0)
|
||||
flags |= FLAG_FP_ARGUMENTS;
|
||||
if (intarg_count > 4)
|
||||
flags |= FLAG_4_GPR_ARGUMENTS;
|
||||
if (struct_copy_size != 0)
|
||||
flags |= FLAG_ARG_NEEDS_COPY;
|
||||
|
||||
/* Space for the FPR registers, if needed. */
|
||||
if (fparg_count != 0)
|
||||
bytes += NUM_FPR_ARG_REGISTERS * sizeof (double);
|
||||
|
||||
/* Stack space. */
|
||||
if (intarg_count > NUM_GPR_ARG_REGISTERS)
|
||||
bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof (int);
|
||||
if (fparg_count > NUM_FPR_ARG_REGISTERS)
|
||||
bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof (double);
|
||||
|
||||
/* The stack space allocated needs to be a multiple of 16 bytes. */
|
||||
bytes = (bytes + 15) & ~0xF;
|
||||
|
||||
/* Add in the space for the copied structures. */
|
||||
bytes += struct_copy_size;
|
||||
|
||||
cif->flags = flags;
|
||||
cif->bytes = bytes;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
ffi_status FFI_HIDDEN
|
||||
ffi_prep_cif_sysv (ffi_cif *cif)
|
||||
{
|
||||
if ((cif->abi & FFI_SYSV) == 0)
|
||||
{
|
||||
/* This call is from old code. Translate to new ABI values. */
|
||||
cif->flags |= FLAG_COMPAT;
|
||||
switch (cif->abi)
|
||||
{
|
||||
default:
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
case FFI_COMPAT_SYSV:
|
||||
cif->abi = FFI_SYSV | FFI_SYSV_STRUCT_RET | FFI_SYSV_LONG_DOUBLE_128;
|
||||
break;
|
||||
|
||||
case FFI_COMPAT_GCC_SYSV:
|
||||
cif->abi = FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128;
|
||||
break;
|
||||
|
||||
case FFI_COMPAT_LINUX:
|
||||
cif->abi = (FFI_SYSV | FFI_SYSV_IBM_LONG_DOUBLE
|
||||
| FFI_SYSV_LONG_DOUBLE_128);
|
||||
break;
|
||||
|
||||
case FFI_COMPAT_LINUX_SOFT_FLOAT:
|
||||
cif->abi = (FFI_SYSV | FFI_SYSV_SOFT_FLOAT | FFI_SYSV_IBM_LONG_DOUBLE
|
||||
| FFI_SYSV_LONG_DOUBLE_128);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ffi_prep_cif_sysv_core (cif);
|
||||
}
|
||||
|
||||
/* ffi_prep_args_SYSV is called by the assembly routine once stack space
|
||||
has been allocated for the function's arguments.
|
||||
|
||||
The stack layout we want looks like this:
|
||||
|
||||
| Return address from ffi_call_SYSV 4bytes | higher addresses
|
||||
|--------------------------------------------|
|
||||
| Previous backchain pointer 4 | stack pointer here
|
||||
|--------------------------------------------|<+ <<< on entry to
|
||||
| Saved r28-r31 4*4 | | ffi_call_SYSV
|
||||
|--------------------------------------------| |
|
||||
| GPR registers r3-r10 8*4 | | ffi_call_SYSV
|
||||
|--------------------------------------------| |
|
||||
| FPR registers f1-f8 (optional) 8*8 | |
|
||||
|--------------------------------------------| | stack |
|
||||
| Space for copied structures | | grows |
|
||||
|--------------------------------------------| | down V
|
||||
| Parameters that didn't fit in registers | |
|
||||
|--------------------------------------------| | lower addresses
|
||||
| Space for callee's LR 4 | |
|
||||
|--------------------------------------------| | stack pointer here
|
||||
| Current backchain pointer 4 |-/ during
|
||||
|--------------------------------------------| <<< ffi_call_SYSV
|
||||
|
||||
*/
|
||||
|
||||
void FFI_HIDDEN
|
||||
ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
|
||||
{
|
||||
const unsigned bytes = ecif->cif->bytes;
|
||||
const unsigned flags = ecif->cif->flags;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char *c;
|
||||
unsigned *u;
|
||||
long long *ll;
|
||||
float *f;
|
||||
double *d;
|
||||
} valp;
|
||||
|
||||
/* 'stacktop' points at the previous backchain pointer. */
|
||||
valp stacktop;
|
||||
|
||||
/* 'gpr_base' points at the space for gpr3, and grows upwards as
|
||||
we use GPR registers. */
|
||||
valp gpr_base;
|
||||
int intarg_count;
|
||||
|
||||
#ifndef __NO_FPRS__
|
||||
/* 'fpr_base' points at the space for fpr1, and grows upwards as
|
||||
we use FPR registers. */
|
||||
valp fpr_base;
|
||||
int fparg_count;
|
||||
#endif
|
||||
|
||||
/* 'copy_space' grows down as we put structures in it. It should
|
||||
stay 16-byte aligned. */
|
||||
valp copy_space;
|
||||
|
||||
/* 'next_arg' grows up as we put parameters in it. */
|
||||
valp next_arg;
|
||||
|
||||
int i;
|
||||
ffi_type **ptr;
|
||||
#ifndef __NO_FPRS__
|
||||
double double_tmp;
|
||||
#endif
|
||||
union
|
||||
{
|
||||
void **v;
|
||||
char **c;
|
||||
signed char **sc;
|
||||
unsigned char **uc;
|
||||
signed short **ss;
|
||||
unsigned short **us;
|
||||
unsigned int **ui;
|
||||
long long **ll;
|
||||
float **f;
|
||||
double **d;
|
||||
} p_argv;
|
||||
size_t struct_copy_size;
|
||||
unsigned gprvalue;
|
||||
|
||||
stacktop.c = (char *) stack + bytes;
|
||||
gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
|
||||
intarg_count = 0;
|
||||
#ifndef __NO_FPRS__
|
||||
fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
|
||||
fparg_count = 0;
|
||||
copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
|
||||
#else
|
||||
copy_space.c = gpr_base.c;
|
||||
#endif
|
||||
next_arg.u = stack + 2;
|
||||
|
||||
/* Check that everything starts aligned properly. */
|
||||
FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
|
||||
FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
|
||||
FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
|
||||
FFI_ASSERT ((bytes & 0xF) == 0);
|
||||
FFI_ASSERT (copy_space.c >= next_arg.c);
|
||||
|
||||
/* Deal with return values that are actually pass-by-reference. */
|
||||
if (flags & FLAG_RETVAL_REFERENCE)
|
||||
{
|
||||
*gpr_base.u++ = (unsigned long) (char *) ecif->rvalue;
|
||||
intarg_count++;
|
||||
}
|
||||
|
||||
/* Now for the arguments. */
|
||||
p_argv.v = ecif->avalue;
|
||||
for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
|
||||
i > 0;
|
||||
i--, ptr++, p_argv.v++)
|
||||
{
|
||||
unsigned int typenum = (*ptr)->type;
|
||||
|
||||
typenum = translate_float (ecif->cif->abi, typenum);
|
||||
|
||||
/* Now test the translated value */
|
||||
switch (typenum)
|
||||
{
|
||||
#ifndef __NO_FPRS__
|
||||
# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
double_tmp = (*p_argv.d)[0];
|
||||
|
||||
if (fparg_count >= NUM_FPR_ARG_REGISTERS - 1)
|
||||
{
|
||||
if (intarg_count >= NUM_GPR_ARG_REGISTERS
|
||||
&& intarg_count % 2 != 0)
|
||||
{
|
||||
intarg_count++;
|
||||
next_arg.u++;
|
||||
}
|
||||
*next_arg.d = double_tmp;
|
||||
next_arg.u += 2;
|
||||
double_tmp = (*p_argv.d)[1];
|
||||
*next_arg.d = double_tmp;
|
||||
next_arg.u += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
*fpr_base.d++ = double_tmp;
|
||||
double_tmp = (*p_argv.d)[1];
|
||||
*fpr_base.d++ = double_tmp;
|
||||
}
|
||||
|
||||
fparg_count += 2;
|
||||
FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
|
||||
break;
|
||||
# endif
|
||||
case FFI_TYPE_DOUBLE:
|
||||
double_tmp = **p_argv.d;
|
||||
|
||||
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
|
||||
{
|
||||
if (intarg_count >= NUM_GPR_ARG_REGISTERS
|
||||
&& intarg_count % 2 != 0)
|
||||
{
|
||||
intarg_count++;
|
||||
next_arg.u++;
|
||||
}
|
||||
*next_arg.d = double_tmp;
|
||||
next_arg.u += 2;
|
||||
}
|
||||
else
|
||||
*fpr_base.d++ = double_tmp;
|
||||
fparg_count++;
|
||||
FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
|
||||
break;
|
||||
|
||||
case FFI_TYPE_FLOAT:
|
||||
double_tmp = **p_argv.f;
|
||||
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
|
||||
{
|
||||
*next_arg.f = (float) double_tmp;
|
||||
next_arg.u += 1;
|
||||
intarg_count++;
|
||||
}
|
||||
else
|
||||
*fpr_base.d++ = double_tmp;
|
||||
fparg_count++;
|
||||
FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
|
||||
break;
|
||||
#endif /* have FPRs */
|
||||
|
||||
case FFI_TYPE_UINT128:
|
||||
/* The soft float ABI for long doubles works like this, a long double
|
||||
is passed in four consecutive GPRs if available. A maximum of 2
|
||||
long doubles can be passed in gprs. If we do not have 4 GPRs
|
||||
left, the long double is passed on the stack, 4-byte aligned. */
|
||||
{
|
||||
unsigned int int_tmp;
|
||||
unsigned int ii;
|
||||
if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3)
|
||||
{
|
||||
if (intarg_count < NUM_GPR_ARG_REGISTERS)
|
||||
intarg_count = NUM_GPR_ARG_REGISTERS;
|
||||
for (ii = 0; ii < 4; ii++)
|
||||
{
|
||||
int_tmp = (*p_argv.ui)[ii];
|
||||
*next_arg.u++ = int_tmp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ii = 0; ii < 4; ii++)
|
||||
{
|
||||
int_tmp = (*p_argv.ui)[ii];
|
||||
*gpr_base.u++ = int_tmp;
|
||||
}
|
||||
}
|
||||
intarg_count += 4;
|
||||
break;
|
||||
}
|
||||
|
||||
case FFI_TYPE_UINT64:
|
||||
case FFI_TYPE_SINT64:
|
||||
if (intarg_count == NUM_GPR_ARG_REGISTERS-1)
|
||||
intarg_count++;
|
||||
if (intarg_count >= NUM_GPR_ARG_REGISTERS)
|
||||
{
|
||||
if (intarg_count % 2 != 0)
|
||||
{
|
||||
intarg_count++;
|
||||
next_arg.u++;
|
||||
}
|
||||
*next_arg.ll = **p_argv.ll;
|
||||
next_arg.u += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The abi states only certain register pairs can be
|
||||
used for passing long long int specifically (r3,r4),
|
||||
(r5,r6), (r7,r8), (r9,r10). If next arg is long long
|
||||
but not correct starting register of pair then skip
|
||||
until the proper starting register. */
|
||||
if (intarg_count % 2 != 0)
|
||||
{
|
||||
intarg_count ++;
|
||||
gpr_base.u++;
|
||||
}
|
||||
*gpr_base.ll++ = **p_argv.ll;
|
||||
}
|
||||
intarg_count += 2;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
struct_copy_size = ((*ptr)->size + 15) & ~0xF;
|
||||
copy_space.c -= struct_copy_size;
|
||||
memcpy (copy_space.c, *p_argv.c, (*ptr)->size);
|
||||
|
||||
gprvalue = (unsigned long) copy_space.c;
|
||||
|
||||
FFI_ASSERT (copy_space.c > next_arg.c);
|
||||
FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY);
|
||||
goto putgpr;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
gprvalue = **p_argv.uc;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_SINT8:
|
||||
gprvalue = **p_argv.sc;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_UINT16:
|
||||
gprvalue = **p_argv.us;
|
||||
goto putgpr;
|
||||
case FFI_TYPE_SINT16:
|
||||
gprvalue = **p_argv.ss;
|
||||
goto putgpr;
|
||||
|
||||
case FFI_TYPE_INT:
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_POINTER:
|
||||
|
||||
gprvalue = **p_argv.ui;
|
||||
|
||||
putgpr:
|
||||
if (intarg_count >= NUM_GPR_ARG_REGISTERS)
|
||||
*next_arg.u++ = gprvalue;
|
||||
else
|
||||
*gpr_base.u++ = gprvalue;
|
||||
intarg_count++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that we didn't overrun the stack... */
|
||||
FFI_ASSERT (copy_space.c >= next_arg.c);
|
||||
FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
|
||||
/* The assert below is testing that the number of integer arguments agrees
|
||||
with the number found in ffi_prep_cif_machdep(). However, intarg_count
|
||||
is incremented whenever we place an FP arg on the stack, so account for
|
||||
that before our assert test. */
|
||||
#ifndef __NO_FPRS__
|
||||
if (fparg_count > NUM_FPR_ARG_REGISTERS)
|
||||
intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
|
||||
FFI_ASSERT (fpr_base.u
|
||||
<= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
|
||||
#endif
|
||||
FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4);
|
||||
}
|
||||
|
||||
#define MIN_CACHE_LINE_SIZE 8
|
||||
|
||||
static void
|
||||
flush_icache (char *wraddr, char *xaddr, int size)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
|
||||
__asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
|
||||
: : "r" (xaddr + i), "r" (wraddr + i) : "memory");
|
||||
__asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
|
||||
: : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
ffi_status FFI_HIDDEN
|
||||
ffi_prep_closure_loc_sysv (ffi_closure *closure,
|
||||
ffi_cif *cif,
|
||||
void (*fun) (ffi_cif *, void *, void **, void *),
|
||||
void *user_data,
|
||||
void *codeloc)
|
||||
{
|
||||
unsigned int *tramp;
|
||||
|
||||
if (cif->abi < FFI_SYSV || cif->abi >= FFI_LAST_ABI)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
tramp = (unsigned int *) &closure->tramp[0];
|
||||
tramp[0] = 0x7c0802a6; /* mflr r0 */
|
||||
tramp[1] = 0x4800000d; /* bl 10 <trampoline_initial+0x10> */
|
||||
tramp[4] = 0x7d6802a6; /* mflr r11 */
|
||||
tramp[5] = 0x7c0803a6; /* mtlr r0 */
|
||||
tramp[6] = 0x800b0000; /* lwz r0,0(r11) */
|
||||
tramp[7] = 0x816b0004; /* lwz r11,4(r11) */
|
||||
tramp[8] = 0x7c0903a6; /* mtctr r0 */
|
||||
tramp[9] = 0x4e800420; /* bctr */
|
||||
*(void **) &tramp[2] = (void *) ffi_closure_SYSV; /* function */
|
||||
*(void **) &tramp[3] = codeloc; /* context */
|
||||
|
||||
/* Flush the icache. */
|
||||
flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
|
||||
|
||||
closure->cif = cif;
|
||||
closure->fun = fun;
|
||||
closure->user_data = user_data;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
/* Basically the trampoline invokes ffi_closure_SYSV, and on
|
||||
entry, r11 holds the address of the closure.
|
||||
After storing the registers that could possibly contain
|
||||
parameters to be passed into the stack frame and setting
|
||||
up space for a return value, ffi_closure_SYSV invokes the
|
||||
following helper function to do most of the work. */
|
||||
|
||||
int
|
||||
ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
|
||||
unsigned long *pgr, ffi_dblfl *pfr,
|
||||
unsigned long *pst)
|
||||
{
|
||||
/* rvalue is the pointer to space for return value in closure assembly */
|
||||
/* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */
|
||||
/* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */
|
||||
/* pst is the pointer to outgoing parameter stack in original caller */
|
||||
|
||||
void ** avalue;
|
||||
ffi_type ** arg_types;
|
||||
long i, avn;
|
||||
#ifndef __NO_FPRS__
|
||||
long nf = 0; /* number of floating registers already used */
|
||||
#endif
|
||||
long ng = 0; /* number of general registers already used */
|
||||
|
||||
ffi_cif *cif = closure->cif;
|
||||
unsigned size = cif->rtype->size;
|
||||
unsigned short rtypenum = cif->rtype->type;
|
||||
|
||||
avalue = alloca (cif->nargs * sizeof (void *));
|
||||
|
||||
/* First translate for softfloat/nonlinux */
|
||||
rtypenum = translate_float (cif->abi, rtypenum);
|
||||
|
||||
/* Copy the caller's structure return value address so that the closure
|
||||
returns the data directly to the caller.
|
||||
For FFI_SYSV the result is passed in r3/r4 if the struct size is less
|
||||
or equal 8 bytes. */
|
||||
if (rtypenum == FFI_TYPE_STRUCT
|
||||
&& !((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8))
|
||||
{
|
||||
rvalue = (void *) *pgr;
|
||||
ng++;
|
||||
pgr++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
avn = cif->nargs;
|
||||
arg_types = cif->arg_types;
|
||||
|
||||
/* Grab the addresses of the arguments from the stack frame. */
|
||||
while (i < avn) {
|
||||
unsigned short typenum = arg_types[i]->type;
|
||||
|
||||
/* We may need to handle some values depending on ABI. */
|
||||
typenum = translate_float (cif->abi, typenum);
|
||||
|
||||
switch (typenum)
|
||||
{
|
||||
#ifndef __NO_FPRS__
|
||||
case FFI_TYPE_FLOAT:
|
||||
/* Unfortunately float values are stored as doubles
|
||||
in the ffi_closure_SYSV code (since we don't check
|
||||
the type in that routine). */
|
||||
if (nf < NUM_FPR_ARG_REGISTERS)
|
||||
{
|
||||
/* FIXME? here we are really changing the values
|
||||
stored in the original calling routines outgoing
|
||||
parameter stack. This is probably a really
|
||||
naughty thing to do but... */
|
||||
double temp = pfr->d;
|
||||
pfr->f = (float) temp;
|
||||
avalue[i] = pfr;
|
||||
nf++;
|
||||
pfr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
avalue[i] = pst;
|
||||
pst += 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case FFI_TYPE_DOUBLE:
|
||||
if (nf < NUM_FPR_ARG_REGISTERS)
|
||||
{
|
||||
avalue[i] = pfr;
|
||||
nf++;
|
||||
pfr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((long) pst) & 4)
|
||||
pst++;
|
||||
avalue[i] = pst;
|
||||
pst += 2;
|
||||
}
|
||||
break;
|
||||
|
||||
# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
if (nf < NUM_FPR_ARG_REGISTERS - 1)
|
||||
{
|
||||
avalue[i] = pfr;
|
||||
pfr += 2;
|
||||
nf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((long) pst) & 4)
|
||||
pst++;
|
||||
avalue[i] = pst;
|
||||
pst += 4;
|
||||
nf = 8;
|
||||
}
|
||||
break;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_UINT128:
|
||||
/* Test if for the whole long double, 4 gprs are available.
|
||||
otherwise the stuff ends up on the stack. */
|
||||
if (ng < NUM_GPR_ARG_REGISTERS - 3)
|
||||
{
|
||||
avalue[i] = pgr;
|
||||
pgr += 4;
|
||||
ng += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
avalue[i] = pst;
|
||||
pst += 4;
|
||||
ng = 8+4;
|
||||
}
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT8:
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
if (ng < NUM_GPR_ARG_REGISTERS)
|
||||
{
|
||||
avalue[i] = (char *) pgr + 3;
|
||||
ng++;
|
||||
pgr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
avalue[i] = (char *) pst + 3;
|
||||
pst++;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
case FFI_TYPE_UINT16:
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
if (ng < NUM_GPR_ARG_REGISTERS)
|
||||
{
|
||||
avalue[i] = (char *) pgr + 2;
|
||||
ng++;
|
||||
pgr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
avalue[i] = (char *) pst + 2;
|
||||
pst++;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_POINTER:
|
||||
if (ng < NUM_GPR_ARG_REGISTERS)
|
||||
{
|
||||
avalue[i] = pgr;
|
||||
ng++;
|
||||
pgr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
avalue[i] = pst;
|
||||
pst++;
|
||||
}
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
/* Structs are passed by reference. The address will appear in a
|
||||
gpr if it is one of the first 8 arguments. */
|
||||
if (ng < NUM_GPR_ARG_REGISTERS)
|
||||
{
|
||||
avalue[i] = (void *) *pgr;
|
||||
ng++;
|
||||
pgr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
avalue[i] = (void *) *pst;
|
||||
pst++;
|
||||
}
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_UINT64:
|
||||
/* Passing long long ints are complex, they must
|
||||
be passed in suitable register pairs such as
|
||||
(r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10)
|
||||
and if the entire pair aren't available then the outgoing
|
||||
parameter stack is used for both but an alignment of 8
|
||||
must will be kept. So we must either look in pgr
|
||||
or pst to find the correct address for this type
|
||||
of parameter. */
|
||||
if (ng < NUM_GPR_ARG_REGISTERS - 1)
|
||||
{
|
||||
if (ng & 1)
|
||||
{
|
||||
/* skip r4, r6, r8 as starting points */
|
||||
ng++;
|
||||
pgr++;
|
||||
}
|
||||
avalue[i] = pgr;
|
||||
ng += 2;
|
||||
pgr += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((long) pst) & 4)
|
||||
pst++;
|
||||
avalue[i] = pst;
|
||||
pst += 2;
|
||||
ng = NUM_GPR_ARG_REGISTERS;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
(closure->fun) (cif, rvalue, avalue, closure->user_data);
|
||||
|
||||
/* Tell ffi_closure_SYSV how to perform return type promotions.
|
||||
Because the FFI_SYSV ABI returns the structures <= 8 bytes in
|
||||
r3/r4 we have to tell ffi_closure_SYSV how to treat them. We
|
||||
combine the base type FFI_SYSV_TYPE_SMALL_STRUCT with the size of
|
||||
the struct less one. We never have a struct with size zero.
|
||||
See the comment in ffitarget.h about ordering. */
|
||||
if (rtypenum == FFI_TYPE_STRUCT
|
||||
&& (cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)
|
||||
return FFI_SYSV_TYPE_SMALL_STRUCT - 1 + size;
|
||||
return rtypenum;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -60,45 +60,76 @@ typedef signed long ffi_sarg;
|
|||
typedef enum ffi_abi {
|
||||
FFI_FIRST_ABI = 0,
|
||||
|
||||
#ifdef POWERPC
|
||||
FFI_SYSV,
|
||||
FFI_GCC_SYSV,
|
||||
FFI_LINUX64,
|
||||
FFI_LINUX,
|
||||
FFI_LINUX_SOFT_FLOAT,
|
||||
# if defined(POWERPC64)
|
||||
FFI_DEFAULT_ABI = FFI_LINUX64,
|
||||
# elif defined(__NO_FPRS__)
|
||||
FFI_DEFAULT_ABI = FFI_LINUX_SOFT_FLOAT,
|
||||
# elif (__LDBL_MANT_DIG__ == 106)
|
||||
FFI_DEFAULT_ABI = FFI_LINUX,
|
||||
# else
|
||||
FFI_DEFAULT_ABI = FFI_GCC_SYSV,
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef POWERPC_AIX
|
||||
#if defined (POWERPC_AIX)
|
||||
FFI_AIX,
|
||||
FFI_DARWIN,
|
||||
FFI_DEFAULT_ABI = FFI_AIX,
|
||||
#endif
|
||||
FFI_LAST_ABI
|
||||
|
||||
#ifdef POWERPC_DARWIN
|
||||
#elif defined (POWERPC_DARWIN)
|
||||
FFI_AIX,
|
||||
FFI_DARWIN,
|
||||
FFI_DEFAULT_ABI = FFI_DARWIN,
|
||||
#endif
|
||||
|
||||
#ifdef POWERPC_FREEBSD
|
||||
FFI_SYSV,
|
||||
FFI_GCC_SYSV,
|
||||
FFI_LINUX64,
|
||||
FFI_LINUX,
|
||||
FFI_LINUX_SOFT_FLOAT,
|
||||
FFI_DEFAULT_ABI = FFI_SYSV,
|
||||
#endif
|
||||
|
||||
FFI_LAST_ABI
|
||||
|
||||
#else
|
||||
/* The FFI_COMPAT values are used by old code. Since libffi may be
|
||||
a shared library we have to support old values for backwards
|
||||
compatibility. */
|
||||
FFI_COMPAT_SYSV,
|
||||
FFI_COMPAT_GCC_SYSV,
|
||||
FFI_COMPAT_LINUX64,
|
||||
FFI_COMPAT_LINUX,
|
||||
FFI_COMPAT_LINUX_SOFT_FLOAT,
|
||||
|
||||
# if defined (POWERPC64)
|
||||
/* This bit, always set in new code, must not be set in any of the
|
||||
old FFI_COMPAT values that might be used for 64-bit linux. We
|
||||
only need worry about FFI_COMPAT_LINUX64, but to be safe avoid
|
||||
all old values. */
|
||||
FFI_LINUX = 8,
|
||||
/* This and following bits can reuse FFI_COMPAT values. */
|
||||
FFI_LINUX_STRUCT_ALIGN = 1,
|
||||
FFI_LINUX_LONG_DOUBLE_128 = 2,
|
||||
FFI_DEFAULT_ABI = (FFI_LINUX
|
||||
# ifdef __STRUCT_PARM_ALIGN__
|
||||
| FFI_LINUX_STRUCT_ALIGN
|
||||
# endif
|
||||
# ifdef __LONG_DOUBLE_128__
|
||||
| FFI_LINUX_LONG_DOUBLE_128
|
||||
# endif
|
||||
),
|
||||
FFI_LAST_ABI = 12
|
||||
|
||||
# else
|
||||
/* This bit, always set in new code, must not be set in any of the
|
||||
old FFI_COMPAT values that might be used for 32-bit linux/sysv/bsd. */
|
||||
FFI_SYSV = 8,
|
||||
/* This and following bits can reuse FFI_COMPAT values. */
|
||||
FFI_SYSV_SOFT_FLOAT = 1,
|
||||
FFI_SYSV_STRUCT_RET = 2,
|
||||
FFI_SYSV_IBM_LONG_DOUBLE = 4,
|
||||
FFI_SYSV_LONG_DOUBLE_128 = 16,
|
||||
|
||||
FFI_DEFAULT_ABI = (FFI_SYSV
|
||||
# ifdef __NO_FPRS__
|
||||
| FFI_SYSV_SOFT_FLOAT
|
||||
# endif
|
||||
# if (defined (__SVR4_STRUCT_RETURN) \
|
||||
|| defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN))
|
||||
| FFI_SYSV_STRUCT_RET
|
||||
# endif
|
||||
# if __LDBL_MANT_DIG__ == 106
|
||||
| FFI_SYSV_IBM_LONG_DOUBLE
|
||||
# endif
|
||||
# ifdef __LONG_DOUBLE_128__
|
||||
| FFI_SYSV_LONG_DOUBLE_128
|
||||
# endif
|
||||
),
|
||||
FFI_LAST_ABI = 32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
} ffi_abi;
|
||||
#endif
|
||||
|
||||
|
|
@ -106,6 +137,10 @@ typedef enum ffi_abi {
|
|||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
#if defined (POWERPC) || defined (POWERPC_FREEBSD)
|
||||
# define FFI_TARGET_SPECIFIC_VARIADIC 1
|
||||
# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs
|
||||
#endif
|
||||
|
||||
/* For additional types like the below, take care about the order in
|
||||
ppc_closures.S. They must follow after the FFI_TYPE_LAST. */
|
||||
|
|
@ -113,19 +148,26 @@ typedef enum ffi_abi {
|
|||
/* Needed for soft-float long-double-128 support. */
|
||||
#define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1)
|
||||
|
||||
/* Needed for FFI_SYSV small structure returns.
|
||||
We use two flag bits, (FLAG_SYSV_SMST_R3, FLAG_SYSV_SMST_R4) which are
|
||||
defined in ffi.c, to determine the exact return type and its size. */
|
||||
/* Needed for FFI_SYSV small structure returns. */
|
||||
#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
|
||||
|
||||
#if defined(POWERPC64) || defined(POWERPC_AIX)
|
||||
/* Used by ELFv2 for homogenous structure returns. */
|
||||
#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_TYPE_LAST + 1)
|
||||
#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_TYPE_LAST + 2)
|
||||
#define FFI_V2_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 3)
|
||||
|
||||
#if _CALL_ELF == 2
|
||||
# define FFI_TRAMPOLINE_SIZE 32
|
||||
#else
|
||||
# if defined(POWERPC64) || defined(POWERPC_AIX)
|
||||
# if defined(POWERPC_DARWIN64)
|
||||
# define FFI_TRAMPOLINE_SIZE 48
|
||||
# else
|
||||
# define FFI_TRAMPOLINE_SIZE 24
|
||||
# endif
|
||||
#else /* POWERPC || POWERPC_AIX */
|
||||
# else /* POWERPC || POWERPC_AIX */
|
||||
# define FFI_TRAMPOLINE_SIZE 40
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
|
|
|
|||
|
|
@ -29,18 +29,25 @@
|
|||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
|
||||
#ifdef __powerpc64__
|
||||
#ifdef POWERPC64
|
||||
.hidden ffi_call_LINUX64
|
||||
.globl ffi_call_LINUX64
|
||||
# if _CALL_ELF == 2
|
||||
.text
|
||||
ffi_call_LINUX64:
|
||||
addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha
|
||||
addi %r2, %r2, .TOC.-ffi_call_LINUX64@l
|
||||
.localentry ffi_call_LINUX64, . - ffi_call_LINUX64
|
||||
# else
|
||||
.section ".opd","aw"
|
||||
.align 3
|
||||
ffi_call_LINUX64:
|
||||
#ifdef _CALL_LINUX
|
||||
# ifdef _CALL_LINUX
|
||||
.quad .L.ffi_call_LINUX64,.TOC.@tocbase,0
|
||||
.type ffi_call_LINUX64,@function
|
||||
.text
|
||||
.L.ffi_call_LINUX64:
|
||||
#else
|
||||
# else
|
||||
.hidden .ffi_call_LINUX64
|
||||
.globl .ffi_call_LINUX64
|
||||
.quad .ffi_call_LINUX64,.TOC.@tocbase,0
|
||||
|
|
@ -48,7 +55,8 @@ ffi_call_LINUX64:
|
|||
.type .ffi_call_LINUX64,@function
|
||||
.text
|
||||
.ffi_call_LINUX64:
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
.LFB1:
|
||||
mflr %r0
|
||||
std %r28, -32(%r1)
|
||||
|
|
@ -63,26 +71,35 @@ ffi_call_LINUX64:
|
|||
mr %r31, %r5 /* flags, */
|
||||
mr %r30, %r6 /* rvalue, */
|
||||
mr %r29, %r7 /* function address. */
|
||||
/* Save toc pointer, not for the ffi_prep_args64 call, but for the later
|
||||
bctrl function call. */
|
||||
# if _CALL_ELF == 2
|
||||
std %r2, 24(%r1)
|
||||
# else
|
||||
std %r2, 40(%r1)
|
||||
# endif
|
||||
|
||||
/* Call ffi_prep_args64. */
|
||||
mr %r4, %r1
|
||||
#ifdef _CALL_LINUX
|
||||
# if defined _CALL_LINUX || _CALL_ELF == 2
|
||||
bl ffi_prep_args64
|
||||
#else
|
||||
# else
|
||||
bl .ffi_prep_args64
|
||||
#endif
|
||||
# endif
|
||||
|
||||
ld %r0, 0(%r29)
|
||||
# if _CALL_ELF == 2
|
||||
mr %r12, %r29
|
||||
# else
|
||||
ld %r12, 0(%r29)
|
||||
ld %r2, 8(%r29)
|
||||
ld %r11, 16(%r29)
|
||||
|
||||
# endif
|
||||
/* Now do the call. */
|
||||
/* Set up cr1 with bits 4-7 of the flags. */
|
||||
mtcrf 0x40, %r31
|
||||
|
||||
/* Get the address to call into CTR. */
|
||||
mtctr %r0
|
||||
mtctr %r12
|
||||
/* Load all those argument registers. */
|
||||
ld %r3, -32-(8*8)(%r28)
|
||||
ld %r4, -32-(7*8)(%r28)
|
||||
|
|
@ -117,12 +134,17 @@ ffi_call_LINUX64:
|
|||
|
||||
/* This must follow the call immediately, the unwinder
|
||||
uses this to find out if r2 has been saved or not. */
|
||||
# if _CALL_ELF == 2
|
||||
ld %r2, 24(%r1)
|
||||
# else
|
||||
ld %r2, 40(%r1)
|
||||
# endif
|
||||
|
||||
/* Now, deal with the return value. */
|
||||
mtcrf 0x01, %r31
|
||||
bt- 30, .Ldone_return_value
|
||||
bt- 29, .Lfp_return_value
|
||||
bt 31, .Lstruct_return_value
|
||||
bt 30, .Ldone_return_value
|
||||
bt 29, .Lfp_return_value
|
||||
std %r3, 0(%r30)
|
||||
/* Fall through... */
|
||||
|
||||
|
|
@ -130,7 +152,7 @@ ffi_call_LINUX64:
|
|||
/* Restore the registers we used and return. */
|
||||
mr %r1, %r28
|
||||
ld %r0, 16(%r28)
|
||||
ld %r28, -32(%r1)
|
||||
ld %r28, -32(%r28)
|
||||
mtlr %r0
|
||||
ld %r29, -24(%r1)
|
||||
ld %r30, -16(%r1)
|
||||
|
|
@ -147,14 +169,48 @@ ffi_call_LINUX64:
|
|||
.Lfloat_return_value:
|
||||
stfs %f1, 0(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.Lstruct_return_value:
|
||||
bf 29, .Lsmall_struct
|
||||
bf 28, .Lfloat_homog_return_value
|
||||
stfd %f1, 0(%r30)
|
||||
stfd %f2, 8(%r30)
|
||||
stfd %f3, 16(%r30)
|
||||
stfd %f4, 24(%r30)
|
||||
stfd %f5, 32(%r30)
|
||||
stfd %f6, 40(%r30)
|
||||
stfd %f7, 48(%r30)
|
||||
stfd %f8, 56(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.Lfloat_homog_return_value:
|
||||
stfs %f1, 0(%r30)
|
||||
stfs %f2, 4(%r30)
|
||||
stfs %f3, 8(%r30)
|
||||
stfs %f4, 12(%r30)
|
||||
stfs %f5, 16(%r30)
|
||||
stfs %f6, 20(%r30)
|
||||
stfs %f7, 24(%r30)
|
||||
stfs %f8, 28(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.Lsmall_struct:
|
||||
std %r3, 0(%r30)
|
||||
std %r4, 8(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.LFE1:
|
||||
.long 0
|
||||
.byte 0,12,0,1,128,4,0,0
|
||||
#ifdef _CALL_LINUX
|
||||
# if _CALL_ELF == 2
|
||||
.size ffi_call_LINUX64,.-ffi_call_LINUX64
|
||||
# else
|
||||
# ifdef _CALL_LINUX
|
||||
.size ffi_call_LINUX64,.-.L.ffi_call_LINUX64
|
||||
#else
|
||||
# else
|
||||
.size .ffi_call_LINUX64,.-.ffi_call_LINUX64
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
||||
.Lframe1:
|
||||
|
|
@ -197,8 +253,8 @@ ffi_call_LINUX64:
|
|||
.uleb128 0x4
|
||||
.align 3
|
||||
.LEFDE1:
|
||||
#endif
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,18 +30,25 @@
|
|||
|
||||
.file "linux64_closure.S"
|
||||
|
||||
#ifdef __powerpc64__
|
||||
#ifdef POWERPC64
|
||||
FFI_HIDDEN (ffi_closure_LINUX64)
|
||||
.globl ffi_closure_LINUX64
|
||||
# if _CALL_ELF == 2
|
||||
.text
|
||||
ffi_closure_LINUX64:
|
||||
addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha
|
||||
addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l
|
||||
.localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64
|
||||
# else
|
||||
.section ".opd","aw"
|
||||
.align 3
|
||||
ffi_closure_LINUX64:
|
||||
#ifdef _CALL_LINUX
|
||||
# ifdef _CALL_LINUX
|
||||
.quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0
|
||||
.type ffi_closure_LINUX64,@function
|
||||
.text
|
||||
.L.ffi_closure_LINUX64:
|
||||
#else
|
||||
# else
|
||||
FFI_HIDDEN (.ffi_closure_LINUX64)
|
||||
.globl .ffi_closure_LINUX64
|
||||
.quad .ffi_closure_LINUX64,.TOC.@tocbase,0
|
||||
|
|
@ -49,61 +56,105 @@ ffi_closure_LINUX64:
|
|||
.type .ffi_closure_LINUX64,@function
|
||||
.text
|
||||
.ffi_closure_LINUX64:
|
||||
#endif
|
||||
.LFB1:
|
||||
# save general regs into parm save area
|
||||
std %r3, 48(%r1)
|
||||
std %r4, 56(%r1)
|
||||
std %r5, 64(%r1)
|
||||
std %r6, 72(%r1)
|
||||
mflr %r0
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if _CALL_ELF == 2
|
||||
# 32 byte special reg save area + 64 byte parm save area
|
||||
# + 64 byte retval area + 13*8 fpr save area + round to 16
|
||||
# define STACKFRAME 272
|
||||
# define PARMSAVE 32
|
||||
# define RETVAL PARMSAVE+64
|
||||
# else
|
||||
# 48 bytes special reg save area + 64 bytes parm save area
|
||||
# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
|
||||
# define STACKFRAME 240
|
||||
# define PARMSAVE 48
|
||||
# define RETVAL PARMSAVE+64
|
||||
# endif
|
||||
|
||||
.LFB1:
|
||||
# if _CALL_ELF == 2
|
||||
ld %r12, FFI_TRAMPOLINE_SIZE(%r11) # closure->cif
|
||||
mflr %r0
|
||||
lwz %r12, 28(%r12) # cif->flags
|
||||
mtcrf 0x40, %r12
|
||||
addi %r12, %r1, PARMSAVE
|
||||
bt 7, .Lparmsave
|
||||
# Our caller has not allocated a parameter save area.
|
||||
# We need to allocate one here and use it to pass gprs to
|
||||
# ffi_closure_helper_LINUX64.
|
||||
addi %r12, %r1, -STACKFRAME+PARMSAVE
|
||||
.Lparmsave:
|
||||
std %r0, 16(%r1)
|
||||
# Save general regs into parm save area
|
||||
std %r3, 0(%r12)
|
||||
std %r4, 8(%r12)
|
||||
std %r5, 16(%r12)
|
||||
std %r6, 24(%r12)
|
||||
std %r7, 32(%r12)
|
||||
std %r8, 40(%r12)
|
||||
std %r9, 48(%r12)
|
||||
std %r10, 56(%r12)
|
||||
|
||||
# load up the pointer to the parm save area
|
||||
mr %r5, %r12
|
||||
# else
|
||||
# copy r2 to r11 and load TOC into r2
|
||||
mr %r11, %r2
|
||||
ld %r2, 16(%r11)
|
||||
|
||||
mflr %r0
|
||||
# Save general regs into parm save area
|
||||
# This is the parameter save area set up by our caller.
|
||||
std %r3, PARMSAVE+0(%r1)
|
||||
std %r4, PARMSAVE+8(%r1)
|
||||
std %r5, PARMSAVE+16(%r1)
|
||||
std %r6, PARMSAVE+24(%r1)
|
||||
std %r7, PARMSAVE+32(%r1)
|
||||
std %r8, PARMSAVE+40(%r1)
|
||||
std %r9, PARMSAVE+48(%r1)
|
||||
std %r10, PARMSAVE+56(%r1)
|
||||
|
||||
std %r7, 80(%r1)
|
||||
std %r8, 88(%r1)
|
||||
std %r9, 96(%r1)
|
||||
std %r10, 104(%r1)
|
||||
std %r0, 16(%r1)
|
||||
|
||||
# mandatory 48 bytes special reg save area + 64 bytes parm save area
|
||||
# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
|
||||
stdu %r1, -240(%r1)
|
||||
.LCFI0:
|
||||
# load up the pointer to the parm save area
|
||||
addi %r5, %r1, PARMSAVE
|
||||
# endif
|
||||
|
||||
# next save fpr 1 to fpr 13
|
||||
stfd %f1, 128+(0*8)(%r1)
|
||||
stfd %f2, 128+(1*8)(%r1)
|
||||
stfd %f3, 128+(2*8)(%r1)
|
||||
stfd %f4, 128+(3*8)(%r1)
|
||||
stfd %f5, 128+(4*8)(%r1)
|
||||
stfd %f6, 128+(5*8)(%r1)
|
||||
stfd %f7, 128+(6*8)(%r1)
|
||||
stfd %f8, 128+(7*8)(%r1)
|
||||
stfd %f9, 128+(8*8)(%r1)
|
||||
stfd %f10, 128+(9*8)(%r1)
|
||||
stfd %f11, 128+(10*8)(%r1)
|
||||
stfd %f12, 128+(11*8)(%r1)
|
||||
stfd %f13, 128+(12*8)(%r1)
|
||||
stfd %f1, -104+(0*8)(%r1)
|
||||
stfd %f2, -104+(1*8)(%r1)
|
||||
stfd %f3, -104+(2*8)(%r1)
|
||||
stfd %f4, -104+(3*8)(%r1)
|
||||
stfd %f5, -104+(4*8)(%r1)
|
||||
stfd %f6, -104+(5*8)(%r1)
|
||||
stfd %f7, -104+(6*8)(%r1)
|
||||
stfd %f8, -104+(7*8)(%r1)
|
||||
stfd %f9, -104+(8*8)(%r1)
|
||||
stfd %f10, -104+(9*8)(%r1)
|
||||
stfd %f11, -104+(10*8)(%r1)
|
||||
stfd %f12, -104+(11*8)(%r1)
|
||||
stfd %f13, -104+(12*8)(%r1)
|
||||
|
||||
# load up the pointer to the saved fpr registers */
|
||||
addi %r6, %r1, -104
|
||||
|
||||
# load up the pointer to the result storage
|
||||
addi %r4, %r1, -STACKFRAME+RETVAL
|
||||
|
||||
stdu %r1, -STACKFRAME(%r1)
|
||||
.LCFI0:
|
||||
|
||||
# set up registers for the routine that actually does the work
|
||||
# get the context pointer from the trampoline
|
||||
mr %r3, %r11
|
||||
|
||||
# now load up the pointer to the result storage
|
||||
addi %r4, %r1, 112
|
||||
|
||||
# now load up the pointer to the parameter save area
|
||||
# in the previous frame
|
||||
addi %r5, %r1, 240 + 48
|
||||
|
||||
# now load up the pointer to the saved fpr registers */
|
||||
addi %r6, %r1, 128
|
||||
mr %r3, %r11
|
||||
|
||||
# make the call
|
||||
#ifdef _CALL_LINUX
|
||||
# if defined _CALL_LINUX || _CALL_ELF == 2
|
||||
bl ffi_closure_helper_LINUX64
|
||||
#else
|
||||
# else
|
||||
bl .ffi_closure_helper_LINUX64
|
||||
#endif
|
||||
# endif
|
||||
.Lret:
|
||||
|
||||
# now r3 contains the return type
|
||||
|
|
@ -112,10 +163,12 @@ ffi_closure_LINUX64:
|
|||
|
||||
# look up the proper starting point in table
|
||||
# by using return type as offset
|
||||
ld %r0, STACKFRAME+16(%r1)
|
||||
cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT
|
||||
bge .Lsmall
|
||||
mflr %r4 # move address of .Lret to r4
|
||||
sldi %r3, %r3, 4 # now multiply return type by 16
|
||||
addi %r4, %r4, .Lret_type0 - .Lret
|
||||
ld %r0, 240+16(%r1)
|
||||
add %r3, %r3, %r4 # add contents of table to table address
|
||||
mtctr %r3
|
||||
bctr # jump to it
|
||||
|
|
@ -128,89 +181,175 @@ ffi_closure_LINUX64:
|
|||
.Lret_type0:
|
||||
# case FFI_TYPE_VOID
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
nop
|
||||
# case FFI_TYPE_INT
|
||||
lwa %r3, 112+4(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lwa %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lwa %r3, RETVAL+4(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_FLOAT
|
||||
lfs %f1, 112+0(%r1)
|
||||
lfs %f1, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_DOUBLE
|
||||
lfd %f1, 112+0(%r1)
|
||||
lfd %f1, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_LONGDOUBLE
|
||||
lfd %f1, 112+0(%r1)
|
||||
lfd %f1, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
lfd %f2, 112+8(%r1)
|
||||
lfd %f2, RETVAL+8(%r1)
|
||||
b .Lfinish
|
||||
# case FFI_TYPE_UINT8
|
||||
lbz %r3, 112+7(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lbz %r3, RETVAL+7(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT8
|
||||
lbz %r3, 112+7(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lbz %r3, RETVAL+7(%r1)
|
||||
# endif
|
||||
extsb %r3,%r3
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
# case FFI_TYPE_UINT16
|
||||
lhz %r3, 112+6(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lhz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lhz %r3, RETVAL+6(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
.Lfinish:
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT16
|
||||
lha %r3, 112+6(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lha %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lha %r3, RETVAL+6(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_UINT32
|
||||
lwz %r3, 112+4(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lwz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lwz %r3, RETVAL+4(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT32
|
||||
lwa %r3, 112+4(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lwa %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lwa %r3, RETVAL+4(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_UINT64
|
||||
ld %r3, 112+0(%r1)
|
||||
ld %r3, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT64
|
||||
ld %r3, 112+0(%r1)
|
||||
ld %r3, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_STRUCT
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
nop
|
||||
# case FFI_TYPE_POINTER
|
||||
ld %r3, 112+0(%r1)
|
||||
ld %r3, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# esac
|
||||
# case FFI_V2_TYPE_FLOAT_HOMOG
|
||||
lfs %f1, RETVAL+0(%r1)
|
||||
lfs %f2, RETVAL+4(%r1)
|
||||
lfs %f3, RETVAL+8(%r1)
|
||||
b .Lmorefloat
|
||||
# case FFI_V2_TYPE_DOUBLE_HOMOG
|
||||
lfd %f1, RETVAL+0(%r1)
|
||||
lfd %f2, RETVAL+8(%r1)
|
||||
lfd %f3, RETVAL+16(%r1)
|
||||
lfd %f4, RETVAL+24(%r1)
|
||||
mtlr %r0
|
||||
lfd %f5, RETVAL+32(%r1)
|
||||
lfd %f6, RETVAL+40(%r1)
|
||||
lfd %f7, RETVAL+48(%r1)
|
||||
lfd %f8, RETVAL+56(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
.Lmorefloat:
|
||||
lfs %f4, RETVAL+12(%r1)
|
||||
mtlr %r0
|
||||
lfs %f5, RETVAL+16(%r1)
|
||||
lfs %f6, RETVAL+20(%r1)
|
||||
lfs %f7, RETVAL+24(%r1)
|
||||
lfs %f8, RETVAL+28(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
.Lsmall:
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
ld %r3,RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
ld %r4,RETVAL+8(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# else
|
||||
# A struct smaller than a dword is returned in the low bits of r3
|
||||
# ie. right justified. Larger structs are passed left justified
|
||||
# in r3 and r4. The return value area on the stack will have
|
||||
# the structs as they are usually stored in memory.
|
||||
cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes?
|
||||
neg %r5, %r3
|
||||
ld %r3,RETVAL+0(%r1)
|
||||
blt .Lsmalldown
|
||||
mtlr %r0
|
||||
ld %r4,RETVAL+8(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
.Lsmalldown:
|
||||
addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7
|
||||
mtlr %r0
|
||||
sldi %r5, %r5, 3
|
||||
addi %r1, %r1, STACKFRAME
|
||||
srd %r3, %r3, %r5
|
||||
blr
|
||||
# endif
|
||||
|
||||
.LFE1:
|
||||
.long 0
|
||||
.byte 0,12,0,1,128,0,0,0
|
||||
#ifdef _CALL_LINUX
|
||||
# if _CALL_ELF == 2
|
||||
.size ffi_closure_LINUX64,.-ffi_closure_LINUX64
|
||||
# else
|
||||
# ifdef _CALL_LINUX
|
||||
.size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64
|
||||
#else
|
||||
# else
|
||||
.size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
||||
.Lframe1:
|
||||
|
|
@ -239,14 +378,14 @@ ffi_closure_LINUX64:
|
|||
.byte 0x2 # DW_CFA_advance_loc1
|
||||
.byte .LCFI0-.LFB1
|
||||
.byte 0xe # DW_CFA_def_cfa_offset
|
||||
.uleb128 240
|
||||
.uleb128 STACKFRAME
|
||||
.byte 0x11 # DW_CFA_offset_extended_sf
|
||||
.uleb128 0x41
|
||||
.sleb128 -2
|
||||
.align 3
|
||||
.LEFDE1:
|
||||
#endif
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
# if defined __ELF__ && defined __linux__
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
.file "ppc_closure.S"
|
||||
|
||||
#ifndef __powerpc64__
|
||||
#ifndef POWERPC64
|
||||
|
||||
ENTRY(ffi_closure_SYSV)
|
||||
.LFB1:
|
||||
|
|
@ -159,25 +159,41 @@ ENTRY(ffi_closure_SYSV)
|
|||
#endif
|
||||
|
||||
# case FFI_TYPE_UINT8
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3,112+0(%r1)
|
||||
#else
|
||||
lbz %r3,112+3(%r1)
|
||||
#endif
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_SINT8
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3,112+0(%r1)
|
||||
#else
|
||||
lbz %r3,112+3(%r1)
|
||||
#endif
|
||||
extsb %r3,%r3
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
|
||||
# case FFI_TYPE_UINT16
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lhz %r3,112+0(%r1)
|
||||
#else
|
||||
lhz %r3,112+2(%r1)
|
||||
#endif
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_SINT16
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lha %r3,112+0(%r1)
|
||||
#else
|
||||
lha %r3,112+2(%r1)
|
||||
#endif
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
|
|
@ -222,7 +238,7 @@ ENTRY(ffi_closure_SYSV)
|
|||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
lwz %r5,112+8(%r1)
|
||||
bl .Luint128
|
||||
b .Luint128
|
||||
|
||||
# The return types below are only used when the ABI type is FFI_SYSV.
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct.
|
||||
|
|
@ -239,9 +255,15 @@ ENTRY(ffi_closure_SYSV)
|
|||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
#else
|
||||
srwi %r3,%r3,8
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
|
|
@ -252,20 +274,35 @@ ENTRY(ffi_closure_SYSV)
|
|||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
li %r5,24
|
||||
b .Lstruct567
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
li %r5,16
|
||||
b .Lstruct567
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
li %r5,8
|
||||
b .Lstruct567
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
|
|
@ -273,6 +310,7 @@ ENTRY(ffi_closure_SYSV)
|
|||
mtlr %r0
|
||||
b .Lfinish
|
||||
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
.Lstruct567:
|
||||
subfic %r6,%r5,32
|
||||
srw %r4,%r4,%r5
|
||||
|
|
@ -282,13 +320,14 @@ ENTRY(ffi_closure_SYSV)
|
|||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
#endif
|
||||
|
||||
.Luint128:
|
||||
lwz %r6,112+12(%r1)
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
|
||||
|
||||
END(ffi_closure_SYSV)
|
||||
|
||||
.section ".eh_frame",EH_FRAME_FLAGS,@progbits
|
||||
|
|
@ -339,8 +378,7 @@ END(ffi_closure_SYSV)
|
|||
.align 2
|
||||
.LEFDE1:
|
||||
|
||||
#endif
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include <ffi.h>
|
||||
#include <powerpc/asm.h>
|
||||
|
||||
#ifndef __powerpc64__
|
||||
#ifndef POWERPC64
|
||||
.globl ffi_prep_args_SYSV
|
||||
ENTRY(ffi_call_SYSV)
|
||||
.LFB1:
|
||||
|
|
@ -142,19 +142,14 @@ L(float_return_value):
|
|||
#endif
|
||||
|
||||
L(small_struct_return_value):
|
||||
extrwi %r6,%r31,2,19 /* number of bytes padding = shift/8 */
|
||||
mtcrf 0x02,%r31 /* copy flags to cr[24:27] (cr6) */
|
||||
extrwi %r5,%r31,5,19 /* r5 <- number of bits of padding */
|
||||
subfic %r6,%r6,4 /* r6 <- number of useful bytes in r3 */
|
||||
bf- 25,L(done_return_value) /* struct in r3 ? if not, done. */
|
||||
/* smst_one_register: */
|
||||
slw %r3,%r3,%r5 /* Left-justify value in r3 */
|
||||
mtxer %r6 /* move byte count to XER ... */
|
||||
stswx %r3,0,%r30 /* ... and store that many bytes */
|
||||
bf+ 26,L(done_return_value) /* struct in r3:r4 ? */
|
||||
add %r6,%r6,%r30 /* adjust pointer */
|
||||
stswi %r4,%r6,4 /* store last four bytes */
|
||||
b L(done_return_value)
|
||||
/*
|
||||
* The C code always allocates a properly-aligned 8-byte bounce
|
||||
* buffer to make this assembly code very simple. Just write out
|
||||
* r3 and r4 to the buffer to allow the C code to handle the rest.
|
||||
*/
|
||||
stw %r3, 0(%r30)
|
||||
stw %r4, 4(%r30)
|
||||
b L(done_return_value)
|
||||
|
||||
.LFE1:
|
||||
END(ffi_call_SYSV)
|
||||
|
|
@ -218,8 +213,8 @@ END(ffi_call_SYSV)
|
|||
.uleb128 0x1c
|
||||
.align 2
|
||||
.LEFDE1:
|
||||
#endif
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -76,6 +76,13 @@ static ffi_status initialize_aggregate(ffi_type *arg)
|
|||
total size of 3*sizeof(long). */
|
||||
arg->size = ALIGN (arg->size, arg->alignment);
|
||||
|
||||
/* On some targets, the ABI defines that structures have an additional
|
||||
alignment beyond the "natural" one based on their elements. */
|
||||
#ifdef FFI_AGGREGATE_ALIGNMENT
|
||||
if (FFI_AGGREGATE_ALIGNMENT > arg->alignment)
|
||||
arg->alignment = FFI_AGGREGATE_ALIGNMENT;
|
||||
#endif
|
||||
|
||||
if (arg->size == 0)
|
||||
return FFI_BAD_TYPEDEF;
|
||||
else
|
||||
|
|
@ -111,13 +118,8 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
|
|||
FFI_ASSERT((!isvariadic) || (nfixedargs >= 1));
|
||||
FFI_ASSERT(nfixedargs <= ntotalargs);
|
||||
|
||||
#ifndef X86_WIN32
|
||||
if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI))
|
||||
return FFI_BAD_ABI;
|
||||
#else
|
||||
if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI || abi == FFI_THISCALL))
|
||||
return FFI_BAD_ABI;
|
||||
#endif
|
||||
|
||||
cif->abi = abi;
|
||||
cif->arg_types = atypes;
|
||||
|
|
@ -126,6 +128,10 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
|
|||
|
||||
cif->flags = 0;
|
||||
|
||||
#if HAVE_LONG_DOUBLE_VARIANT
|
||||
ffi_prep_types (abi);
|
||||
#endif
|
||||
|
||||
/* Initialize the return type if necessary */
|
||||
if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK))
|
||||
return FFI_BAD_TYPEDEF;
|
||||
|
|
@ -146,7 +152,9 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
|
|||
#ifdef XTENSA
|
||||
&& (cif->rtype->size > 16)
|
||||
#endif
|
||||
|
||||
#ifdef NIOS2
|
||||
&& (cif->rtype->size > 8)
|
||||
#endif
|
||||
)
|
||||
bytes = STACK_ARG_SIZE(sizeof(void*));
|
||||
#endif
|
||||
|
|
@ -174,7 +182,7 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
|
|||
{
|
||||
/* Add any padding if necessary */
|
||||
if (((*ptr)->alignment - 1) & bytes)
|
||||
bytes = ALIGN(bytes, (*ptr)->alignment);
|
||||
bytes = (unsigned)ALIGN(bytes, (*ptr)->alignment);
|
||||
|
||||
#ifdef TILE
|
||||
if (bytes < 10 * FFI_SIZEOF_ARG &&
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
|
||||
#endif
|
||||
|
||||
/* If the structure has essentialy an unique element, return its type. */
|
||||
/* If the structure has essentially an unique element, return its type. */
|
||||
static int
|
||||
simple_type (ffi_type *arg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
void (*fnaddr)(void));
|
||||
|
||||
On entry, REG_ARGS contain the outgoing register values,
|
||||
and STACK_ARGS containts STACK_ARG_BYTES of additional values
|
||||
and STACK_ARGS contains STACK_ARG_BYTES of additional values
|
||||
to be passed on the stack. If STACK_ARG_BYTES is zero, then
|
||||
STACK_ARGS is ignored.
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,17 @@ const ffi_type ffi_type_##name = { \
|
|||
id, NULL \
|
||||
}
|
||||
|
||||
#define FFI_NONCONST_TYPEDEF(name, type, id) \
|
||||
struct struct_align_##name { \
|
||||
char c; \
|
||||
type x; \
|
||||
}; \
|
||||
ffi_type ffi_type_##name = { \
|
||||
sizeof(type), \
|
||||
offsetof(struct struct_align_##name, x), \
|
||||
id, NULL \
|
||||
}
|
||||
|
||||
/* Size and alignment are fake here. They must not be 0. */
|
||||
const ffi_type ffi_type_void = {
|
||||
1, 1, FFI_TYPE_VOID, NULL
|
||||
|
|
@ -73,5 +84,9 @@ FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE);
|
|||
# endif
|
||||
const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
|
||||
#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
# if HAVE_LONG_DOUBLE_VARIANT
|
||||
FFI_NONCONST_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
|
||||
# else
|
||||
FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
|||
195
Modules/_ctypes/libffi/src/vax/elfbsd.S
Normal file
195
Modules/_ctypes/libffi/src/vax/elfbsd.S
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* vax Foreign Function Interface
|
||||
*/
|
||||
|
||||
#define LIBFFI_ASM
|
||||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
|
||||
.text
|
||||
|
||||
/*
|
||||
* void * %r0
|
||||
* ffi_call_elfbsd(extended_cif *ecif, 4(%ap)
|
||||
* unsigned bytes, 8(%ap)
|
||||
* unsigned flags, 12(%ap)
|
||||
* void *rvalue, 16(%ap)
|
||||
* void (*fn)()); 20(%ap)
|
||||
*/
|
||||
.globl ffi_call_elfbsd
|
||||
.type ffi_call_elfbsd,@function
|
||||
.align 2
|
||||
ffi_call_elfbsd:
|
||||
.word 0x00c # save R2 and R3
|
||||
|
||||
# Allocate stack space for the args
|
||||
subl2 8(%ap), %sp
|
||||
|
||||
# Call ffi_prep_args
|
||||
pushl %sp
|
||||
pushl 4(%ap)
|
||||
calls $2, ffi_prep_args
|
||||
|
||||
# Get function pointer
|
||||
movl 20(%ap), %r1
|
||||
|
||||
# Build a CALLS frame
|
||||
ashl $-2, 8(%ap), %r0
|
||||
pushl %r0 # argument stack usage
|
||||
movl %sp, %r0 # future %ap
|
||||
# saved registers
|
||||
bbc $11, 0(%r1), 1f
|
||||
pushl %r11
|
||||
1: bbc $10, 0(%r1), 1f
|
||||
pushl %r10
|
||||
1: bbc $9, 0(%r1), 1f
|
||||
pushl %r9
|
||||
1: bbc $8, 0(%r1), 1f
|
||||
pushl %r8
|
||||
1: bbc $7, 0(%r1), 1f
|
||||
pushl %r7
|
||||
1: bbc $6, 0(%r1), 1f
|
||||
pushl %r6
|
||||
1: bbc $5, 0(%r1), 1f
|
||||
pushl %r5
|
||||
1: bbc $4, 0(%r1), 1f
|
||||
pushl %r4
|
||||
1: bbc $3, 0(%r1), 1f
|
||||
pushl %r3
|
||||
1: bbc $2, 0(%r1), 1f
|
||||
pushl %r2
|
||||
1:
|
||||
pushal 9f
|
||||
pushl %fp
|
||||
pushl %ap
|
||||
movl 16(%ap), %r3 # struct return address, if needed
|
||||
movl %r0, %ap
|
||||
movzwl 4(%fp), %r0 # previous PSW, without the saved registers mask
|
||||
bisl2 $0x20000000, %r0 # calls frame
|
||||
movzwl 0(%r1), %r2
|
||||
bicw2 $0xf003, %r2 # only keep R11-R2
|
||||
ashl $16, %r2, %r2
|
||||
bisl2 %r2, %r0 # saved register mask of the called function
|
||||
pushl %r0
|
||||
pushl $0
|
||||
movl %sp, %fp
|
||||
|
||||
# Invoke the function
|
||||
pushal 2(%r1) # skip procedure entry mask
|
||||
movl %r3, %r1
|
||||
bicpsw $0x000f
|
||||
rsb
|
||||
|
||||
9:
|
||||
# Copy return value if necessary
|
||||
tstl 16(%ap)
|
||||
jeql 9f
|
||||
movl 16(%ap), %r2
|
||||
|
||||
bbc $0, 12(%ap), 1f # CIF_FLAGS_CHAR
|
||||
movb %r0, 0(%r2)
|
||||
brb 9f
|
||||
1:
|
||||
bbc $1, 12(%ap), 1f # CIF_FLAGS_SHORT
|
||||
movw %r0, 0(%r2)
|
||||
brb 9f
|
||||
1:
|
||||
bbc $2, 12(%ap), 1f # CIF_FLAGS_INT
|
||||
movl %r0, 0(%r2)
|
||||
brb 9f
|
||||
1:
|
||||
bbc $3, 12(%ap), 1f # CIF_FLAGS_DINT
|
||||
movq %r0, 0(%r2)
|
||||
brb 9f
|
||||
1:
|
||||
movl %r1, %r0 # might have been a struct
|
||||
#brb 9f
|
||||
|
||||
9:
|
||||
ret
|
||||
|
||||
/*
|
||||
* ffi_closure_elfbsd(void);
|
||||
* invoked with %r0: ffi_closure *closure
|
||||
*/
|
||||
.globl ffi_closure_elfbsd
|
||||
.type ffi_closure_elfbsd, @function
|
||||
.align 2
|
||||
ffi_closure_elfbsd:
|
||||
.word 0
|
||||
|
||||
# Allocate room on stack for return value
|
||||
subl2 $8, %sp
|
||||
|
||||
# Invoke the closure function
|
||||
pushal 4(%ap) # calling stack
|
||||
pushal 4(%sp) # return value
|
||||
pushl %r0 # closure
|
||||
calls $3, ffi_closure_elfbsd_inner
|
||||
|
||||
# Copy return value if necessary
|
||||
bitb $1, %r0 # CIF_FLAGS_CHAR
|
||||
beql 1f
|
||||
movb 0(%sp), %r0
|
||||
brb 9f
|
||||
1:
|
||||
bitb $2, %r0 # CIF_FLAGS_SHORT
|
||||
beql 1f
|
||||
movw 0(%sp), %r0
|
||||
brb 9f
|
||||
1:
|
||||
bitb $4, %r0 # CIF_FLAGS_INT
|
||||
beql 1f
|
||||
movl 0(%sp), %r0
|
||||
brb 9f
|
||||
1:
|
||||
bitb $8, %r0 # CIF_FLAGS_DINT
|
||||
beql 1f
|
||||
movq 0(%sp), %r0
|
||||
#brb 9f
|
||||
1:
|
||||
|
||||
9:
|
||||
ret
|
||||
|
||||
/*
|
||||
* ffi_closure_struct_elfbsd(void);
|
||||
* invoked with %r0: ffi_closure *closure
|
||||
* %r1: struct return address
|
||||
*/
|
||||
.globl ffi_closure_struct_elfbsd
|
||||
.type ffi_closure_struct_elfbsd, @function
|
||||
.align 2
|
||||
ffi_closure_struct_elfbsd:
|
||||
.word 0
|
||||
|
||||
# Invoke the closure function
|
||||
pushal 4(%ap) # calling stack
|
||||
pushl %r1 # return value
|
||||
pushl %r0 # closure
|
||||
calls $3, ffi_closure_elfbsd_inner
|
||||
|
||||
ret
|
||||
276
Modules/_ctypes/libffi/src/vax/ffi.c
Normal file
276
Modules/_ctypes/libffi/src/vax/ffi.c
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* vax Foreign Function Interface
|
||||
*
|
||||
* This file attempts to provide all the FFI entry points which can reliably
|
||||
* be implemented in C.
|
||||
*/
|
||||
|
||||
#include <ffi.h>
|
||||
#include <ffi_common.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define CIF_FLAGS_CHAR 1 /* for struct only */
|
||||
#define CIF_FLAGS_SHORT 2 /* for struct only */
|
||||
#define CIF_FLAGS_INT 4
|
||||
#define CIF_FLAGS_DINT 8
|
||||
|
||||
/*
|
||||
* Foreign Function Interface API
|
||||
*/
|
||||
|
||||
void ffi_call_elfbsd (extended_cif *, unsigned, unsigned, void *,
|
||||
void (*) ());
|
||||
void *ffi_prep_args (extended_cif *ecif, void *stack);
|
||||
|
||||
void *
|
||||
ffi_prep_args (extended_cif *ecif, void *stack)
|
||||
{
|
||||
unsigned int i;
|
||||
void **p_argv;
|
||||
char *argp;
|
||||
ffi_type **p_arg;
|
||||
void *struct_value_ptr;
|
||||
|
||||
argp = stack;
|
||||
|
||||
if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& !ecif->cif->flags)
|
||||
struct_value_ptr = ecif->rvalue;
|
||||
else
|
||||
struct_value_ptr = NULL;
|
||||
|
||||
p_argv = ecif->avalue;
|
||||
|
||||
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
|
||||
i != 0;
|
||||
i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
|
||||
z = (*p_arg)->size;
|
||||
if (z < sizeof (int))
|
||||
{
|
||||
switch ((*p_arg)->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
memcpy (argp, *p_argv, z);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
}
|
||||
z = sizeof (int);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy (argp, *p_argv, z);
|
||||
|
||||
/* Align if necessary. */
|
||||
if ((sizeof(int) - 1) & z)
|
||||
z = ALIGN(z, sizeof(int));
|
||||
}
|
||||
|
||||
p_argv++;
|
||||
argp += z;
|
||||
}
|
||||
|
||||
return struct_value_ptr;
|
||||
}
|
||||
|
||||
ffi_status
|
||||
ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
{
|
||||
/* Set the return type flag */
|
||||
switch (cif->rtype->type)
|
||||
{
|
||||
case FFI_TYPE_VOID:
|
||||
cif->flags = 0;
|
||||
break;
|
||||
|
||||
case FFI_TYPE_STRUCT:
|
||||
if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT &&
|
||||
cif->rtype->elements[1])
|
||||
{
|
||||
cif->flags = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cif->rtype->size == sizeof (char))
|
||||
cif->flags = CIF_FLAGS_CHAR;
|
||||
else if (cif->rtype->size == sizeof (short))
|
||||
cif->flags = CIF_FLAGS_SHORT;
|
||||
else if (cif->rtype->size == sizeof (int))
|
||||
cif->flags = CIF_FLAGS_INT;
|
||||
else if (cif->rtype->size == 2 * sizeof (int))
|
||||
cif->flags = CIF_FLAGS_DINT;
|
||||
else
|
||||
cif->flags = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (cif->rtype->size <= sizeof (int))
|
||||
cif->flags = CIF_FLAGS_INT;
|
||||
else
|
||||
cif->flags = CIF_FLAGS_DINT;
|
||||
break;
|
||||
}
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
void
|
||||
ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
|
||||
{
|
||||
extended_cif ecif;
|
||||
|
||||
ecif.cif = cif;
|
||||
ecif.avalue = avalue;
|
||||
|
||||
/* If the return value is a struct and we don't have a return value
|
||||
address then we need to make one. */
|
||||
|
||||
if (rvalue == NULL
|
||||
&& cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& cif->flags == 0)
|
||||
ecif.rvalue = alloca (cif->rtype->size);
|
||||
else
|
||||
ecif.rvalue = rvalue;
|
||||
|
||||
switch (cif->abi)
|
||||
{
|
||||
case FFI_ELFBSD:
|
||||
ffi_call_elfbsd (&ecif, cif->bytes, cif->flags, ecif.rvalue, fn);
|
||||
break;
|
||||
|
||||
default:
|
||||
FFI_ASSERT (0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Closure API
|
||||
*/
|
||||
|
||||
void ffi_closure_elfbsd (void);
|
||||
void ffi_closure_struct_elfbsd (void);
|
||||
unsigned int ffi_closure_elfbsd_inner (ffi_closure *, void *, char *);
|
||||
|
||||
static void
|
||||
ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp)
|
||||
{
|
||||
unsigned int i;
|
||||
void **p_argv;
|
||||
ffi_type **p_arg;
|
||||
|
||||
p_argv = avalue;
|
||||
|
||||
for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
|
||||
{
|
||||
size_t z;
|
||||
|
||||
z = (*p_arg)->size;
|
||||
*p_argv = stackp;
|
||||
|
||||
/* Align if necessary */
|
||||
if ((sizeof (int) - 1) & z)
|
||||
z = ALIGN(z, sizeof (int));
|
||||
|
||||
p_argv++;
|
||||
stackp += z;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
ffi_closure_elfbsd_inner (ffi_closure *closure, void *resp, char *stack)
|
||||
{
|
||||
ffi_cif *cif;
|
||||
void **arg_area;
|
||||
|
||||
cif = closure->cif;
|
||||
arg_area = (void **) alloca (cif->nargs * sizeof (void *));
|
||||
|
||||
ffi_prep_closure_elfbsd (cif, arg_area, stack);
|
||||
|
||||
(closure->fun) (cif, resp, arg_area, closure->user_data);
|
||||
|
||||
return cif->flags;
|
||||
}
|
||||
|
||||
ffi_status
|
||||
ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif,
|
||||
void (*fun)(ffi_cif *, void *, void **, void *),
|
||||
void *user_data, void *codeloc)
|
||||
{
|
||||
char *tramp = (char *) codeloc;
|
||||
void *fn;
|
||||
|
||||
FFI_ASSERT (cif->abi == FFI_ELFBSD);
|
||||
|
||||
/* entry mask */
|
||||
*(unsigned short *)(tramp + 0) = 0x0000;
|
||||
/* movl #closure, r0 */
|
||||
tramp[2] = 0xd0;
|
||||
tramp[3] = 0x8f;
|
||||
*(unsigned int *)(tramp + 4) = (unsigned int) closure;
|
||||
tramp[8] = 0x50;
|
||||
|
||||
if (cif->rtype->type == FFI_TYPE_STRUCT
|
||||
&& !cif->flags)
|
||||
fn = &ffi_closure_struct_elfbsd;
|
||||
else
|
||||
fn = &ffi_closure_elfbsd;
|
||||
|
||||
/* jmpl #fn */
|
||||
tramp[9] = 0x17;
|
||||
tramp[10] = 0xef;
|
||||
*(unsigned int *)(tramp + 11) = (unsigned int)fn + 2 -
|
||||
(unsigned int)tramp - 9 - 6;
|
||||
|
||||
closure->cif = cif;
|
||||
closure->user_data = user_data;
|
||||
closure->fun = fun;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
49
Modules/_ctypes/libffi/src/vax/ffitarget.h
Normal file
49
Modules/_ctypes/libffi/src/vax/ffitarget.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* vax Foreign Function Interface
|
||||
*/
|
||||
|
||||
#ifndef LIBFFI_TARGET_H
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
typedef unsigned long ffi_arg;
|
||||
typedef signed long ffi_sarg;
|
||||
|
||||
typedef enum ffi_abi {
|
||||
FFI_FIRST_ABI = 0,
|
||||
FFI_ELFBSD,
|
||||
FFI_DEFAULT_ABI = FFI_ELFBSD,
|
||||
FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
|
||||
} ffi_abi;
|
||||
#endif
|
||||
|
||||
/* ---- Definitions for closures ----------------------------------------- */
|
||||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_TRAMPOLINE_SIZE 15
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
|
||||
#endif
|
||||
|
|
@ -39,16 +39,18 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/* ffi_prep_args is called by the assembly routine once stack space
|
||||
has been allocated for the function's arguments */
|
||||
|
||||
void ffi_prep_args(char *stack, extended_cif *ecif);
|
||||
void ffi_prep_args(char *stack, extended_cif *ecif)
|
||||
{
|
||||
register unsigned int i;
|
||||
register void **p_argv;
|
||||
register char *argp;
|
||||
register ffi_type **p_arg;
|
||||
#ifdef X86_WIN32
|
||||
#ifndef X86_WIN64
|
||||
size_t p_stack_args[2];
|
||||
void *p_stack_data[2];
|
||||
char *argp2 = stack;
|
||||
|
|
@ -67,7 +69,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
|
|||
)
|
||||
{
|
||||
*(void **) argp = ecif->rvalue;
|
||||
#ifdef X86_WIN32
|
||||
#ifndef X86_WIN64
|
||||
/* For fastcall/thiscall this is first register-passed
|
||||
argument. */
|
||||
if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
|
||||
|
|
@ -153,7 +155,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
|
|||
memcpy(argp, *p_argv, z);
|
||||
}
|
||||
|
||||
#ifdef X86_WIN32
|
||||
#ifndef X86_WIN64
|
||||
/* For thiscall/fastcall convention register-passed arguments
|
||||
are the first two none-floating-point arguments with a size
|
||||
smaller or equal to sizeof (void*). */
|
||||
|
|
@ -178,7 +180,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef X86_WIN32
|
||||
#ifndef X86_WIN64
|
||||
/* We need to move the register-passed arguments for thiscall/fastcall
|
||||
on top of stack, so that those can be moved to registers ecx/edx by
|
||||
call-handler. */
|
||||
|
|
@ -307,7 +309,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
|||
{
|
||||
if (((*ptr)->alignment - 1) & cif->bytes)
|
||||
cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
|
||||
cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
|
||||
cif->bytes += (unsigned)ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
|
||||
}
|
||||
|
||||
#ifdef X86_WIN64
|
||||
|
|
@ -315,7 +317,12 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
|||
cif->bytes += 4 * sizeof(ffi_arg);
|
||||
#endif
|
||||
|
||||
cif->bytes = (cif->bytes + 15) & ~0xF;
|
||||
#ifndef X86_WIN32
|
||||
#ifndef X86_WIN64
|
||||
if (cif->abi != FFI_STDCALL && cif->abi != FFI_THISCALL && cif->abi != FFI_FASTCALL)
|
||||
#endif
|
||||
cif->bytes = (cif->bytes + 15) & ~0xF;
|
||||
#endif
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
|
@ -324,11 +331,10 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
|||
extern int
|
||||
ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
|
||||
unsigned, unsigned, unsigned *, void (*fn)(void));
|
||||
#elif defined(X86_WIN32)
|
||||
#else
|
||||
extern void
|
||||
ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *,
|
||||
unsigned, unsigned, unsigned, unsigned *, void (*fn)(void));
|
||||
#else
|
||||
extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
|
||||
unsigned, unsigned, unsigned *, void (*fn)(void));
|
||||
#endif
|
||||
|
|
@ -370,10 +376,17 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
|
||||
cif->flags, ecif.rvalue, fn);
|
||||
break;
|
||||
#elif defined(X86_WIN32)
|
||||
#else
|
||||
#ifndef X86_WIN32
|
||||
case FFI_SYSV:
|
||||
ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
|
||||
fn);
|
||||
break;
|
||||
#else
|
||||
case FFI_SYSV:
|
||||
case FFI_STDCALL:
|
||||
case FFI_MS_CDECL:
|
||||
#endif
|
||||
case FFI_STDCALL:
|
||||
ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
|
||||
ecif.rvalue, fn);
|
||||
break;
|
||||
|
|
@ -406,11 +419,6 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
ecif.rvalue, fn);
|
||||
}
|
||||
break;
|
||||
#else
|
||||
case FFI_SYSV:
|
||||
ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
|
||||
fn);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
FFI_ASSERT(0);
|
||||
|
|
@ -434,12 +442,15 @@ void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *)
|
|||
#ifdef X86_WIN32
|
||||
void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *)
|
||||
__attribute__ ((regparm(1)));
|
||||
#endif
|
||||
#ifndef X86_WIN64
|
||||
void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *)
|
||||
__attribute__ ((regparm(1)));
|
||||
void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *)
|
||||
__attribute__ ((regparm(1)));
|
||||
#endif
|
||||
#ifdef X86_WIN64
|
||||
void FFI_HIDDEN ffi_closure_FASTCALL (ffi_closure *)
|
||||
__attribute__ ((regparm(1)));
|
||||
#else
|
||||
void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
|
||||
#endif
|
||||
|
||||
|
|
@ -598,7 +609,7 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
|
|||
*(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \
|
||||
}
|
||||
|
||||
#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \
|
||||
#define FFI_INIT_TRAMPOLINE_RAW_THISCALL(TRAMP,FUN,CTX,SIZE) \
|
||||
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
|
||||
unsigned int __fun = (unsigned int)(FUN); \
|
||||
unsigned int __ctx = (unsigned int)(CTX); \
|
||||
|
|
@ -625,18 +636,15 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
|
|||
*(unsigned short*) &__tramp[50] = (__size + 8); /* ret (__size + 8) */ \
|
||||
}
|
||||
|
||||
#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE) \
|
||||
#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX) \
|
||||
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
|
||||
unsigned int __fun = (unsigned int)(FUN); \
|
||||
unsigned int __ctx = (unsigned int)(CTX); \
|
||||
unsigned int __dis = __fun - (__ctx + 10); \
|
||||
unsigned short __size = (unsigned short)(SIZE); \
|
||||
*(unsigned char*) &__tramp[0] = 0xb8; \
|
||||
*(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
|
||||
*(unsigned char *) &__tramp[5] = 0xe8; \
|
||||
*(unsigned int*) &__tramp[6] = __dis; /* call __fun */ \
|
||||
*(unsigned char *) &__tramp[10] = 0xc2; \
|
||||
*(unsigned short*) &__tramp[11] = __size; /* ret __size */ \
|
||||
}
|
||||
|
||||
/* the cif must already be prep'ed */
|
||||
|
|
@ -666,20 +674,25 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
|||
&ffi_closure_SYSV,
|
||||
(void*)codeloc);
|
||||
}
|
||||
#ifdef X86_WIN32
|
||||
else if (cif->abi == FFI_FASTCALL)
|
||||
{
|
||||
FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
|
||||
&ffi_closure_FASTCALL,
|
||||
(void*)codeloc);
|
||||
}
|
||||
else if (cif->abi == FFI_THISCALL)
|
||||
{
|
||||
FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0],
|
||||
&ffi_closure_THISCALL,
|
||||
(void*)codeloc,
|
||||
cif->bytes);
|
||||
FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
|
||||
&ffi_closure_THISCALL,
|
||||
(void*)codeloc);
|
||||
}
|
||||
else if (cif->abi == FFI_STDCALL)
|
||||
{
|
||||
FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
|
||||
&ffi_closure_STDCALL,
|
||||
(void*)codeloc, cif->bytes);
|
||||
(void*)codeloc);
|
||||
}
|
||||
#ifdef X86_WIN32
|
||||
else if (cif->abi == FFI_MS_CDECL)
|
||||
{
|
||||
FFI_INIT_TRAMPOLINE (&closure->tramp[0],
|
||||
|
|
@ -713,12 +726,12 @@ ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
|
|||
{
|
||||
int i;
|
||||
|
||||
if (cif->abi != FFI_SYSV) {
|
||||
if (cif->abi != FFI_SYSV
|
||||
#ifdef X86_WIN32
|
||||
if (cif->abi != FFI_THISCALL)
|
||||
&& cif->abi != FFI_THISCALL
|
||||
#endif
|
||||
)
|
||||
return FFI_BAD_ABI;
|
||||
}
|
||||
|
||||
/* we currently don't support certain kinds of arguments for raw
|
||||
closures. This should be implemented by a separate assembly
|
||||
|
|
@ -741,8 +754,7 @@ ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
|
|||
}
|
||||
else if (cif->abi == FFI_THISCALL)
|
||||
{
|
||||
FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL,
|
||||
codeloc, cif->bytes);
|
||||
FFI_INIT_TRAMPOLINE_RAW_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL, codeloc, cif->bytes);
|
||||
}
|
||||
#endif
|
||||
closure->cif = cif;
|
||||
|
|
@ -787,10 +799,17 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
|
|||
|
||||
switch (cif->abi)
|
||||
{
|
||||
#ifdef X86_WIN32
|
||||
#ifndef X86_WIN32
|
||||
case FFI_SYSV:
|
||||
ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
|
||||
ecif.rvalue, fn);
|
||||
break;
|
||||
#else
|
||||
case FFI_SYSV:
|
||||
case FFI_STDCALL:
|
||||
case FFI_MS_CDECL:
|
||||
#endif
|
||||
#ifndef X86_WIN64
|
||||
case FFI_STDCALL:
|
||||
ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
|
||||
ecif.rvalue, fn);
|
||||
break;
|
||||
|
|
@ -823,11 +842,6 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
|
|||
ecif.rvalue, fn);
|
||||
}
|
||||
break;
|
||||
#else
|
||||
case FFI_SYSV:
|
||||
ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
|
||||
ecif.rvalue, fn);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
FFI_ASSERT(0);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 2008, 2010 Red Hat, Inc.
|
||||
Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
|
||||
|
||||
x86-64 Foreign Function Interface
|
||||
|
||||
x86-64 Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
|
@ -39,6 +39,7 @@
|
|||
#define MAX_SSE_REGS 8
|
||||
|
||||
#if defined(__INTEL_COMPILER)
|
||||
#include "xmmintrin.h"
|
||||
#define UINT128 __m128
|
||||
#else
|
||||
#if defined(__SUNPRO_C)
|
||||
|
|
@ -60,7 +61,7 @@ struct register_args
|
|||
{
|
||||
/* Registers for argument passing. */
|
||||
UINT64 gpr[MAX_GPR_REGS];
|
||||
union big_int_union sse[MAX_SSE_REGS];
|
||||
union big_int_union sse[MAX_SSE_REGS];
|
||||
};
|
||||
|
||||
extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
|
||||
|
|
@ -151,7 +152,7 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
|
|||
|
||||
See the x86-64 PS ABI for details.
|
||||
*/
|
||||
static int
|
||||
static size_t
|
||||
classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
||||
size_t byte_offset)
|
||||
{
|
||||
|
|
@ -167,7 +168,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
|||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_POINTER:
|
||||
{
|
||||
int size = byte_offset + type->size;
|
||||
size_t size = byte_offset + type->size;
|
||||
|
||||
if (size <= 4)
|
||||
{
|
||||
|
|
@ -202,15 +203,17 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
|||
case FFI_TYPE_DOUBLE:
|
||||
classes[0] = X86_64_SSEDF_CLASS;
|
||||
return 1;
|
||||
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
||||
case FFI_TYPE_LONGDOUBLE:
|
||||
classes[0] = X86_64_X87_CLASS;
|
||||
classes[1] = X86_64_X87UP_CLASS;
|
||||
return 2;
|
||||
#endif
|
||||
case FFI_TYPE_STRUCT:
|
||||
{
|
||||
const int UNITS_PER_WORD = 8;
|
||||
int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
|
||||
ffi_type **ptr;
|
||||
const size_t UNITS_PER_WORD = 8;
|
||||
size_t words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
|
||||
ffi_type **ptr;
|
||||
int i;
|
||||
enum x86_64_reg_class subclasses[MAX_CLASSES];
|
||||
|
||||
|
|
@ -232,7 +235,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
|||
/* Merge the fields of structure. */
|
||||
for (ptr = type->elements; *ptr != NULL; ptr++)
|
||||
{
|
||||
int num;
|
||||
size_t num;
|
||||
|
||||
byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
|
||||
|
||||
|
|
@ -241,7 +244,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
|||
return 0;
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
int pos = byte_offset / 8;
|
||||
size_t pos = byte_offset / 8;
|
||||
classes[i + pos] =
|
||||
merge_classes (subclasses[i], classes[i + pos]);
|
||||
}
|
||||
|
|
@ -305,11 +308,12 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
|||
class. Return zero iff parameter should be passed in memory, otherwise
|
||||
the number of registers. */
|
||||
|
||||
static int
|
||||
static size_t
|
||||
examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
|
||||
_Bool in_return, int *pngpr, int *pnsse)
|
||||
{
|
||||
int i, n, ngpr, nsse;
|
||||
size_t n;
|
||||
int i, ngpr, nsse;
|
||||
|
||||
n = classify_argument (type, classes, 0);
|
||||
if (n == 0)
|
||||
|
|
@ -350,9 +354,9 @@ examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
|
|||
ffi_status
|
||||
ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
{
|
||||
int gprcount, ssecount, i, avn, n, ngpr, nsse, flags;
|
||||
int gprcount, ssecount, i, avn, ngpr, nsse, flags;
|
||||
enum x86_64_reg_class classes[MAX_CLASSES];
|
||||
size_t bytes;
|
||||
size_t bytes, n;
|
||||
|
||||
gprcount = ssecount = 0;
|
||||
|
||||
|
|
@ -410,7 +414,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
|||
if (ssecount)
|
||||
flags |= 1 << 11;
|
||||
cif->flags = flags;
|
||||
cif->bytes = ALIGN (bytes, 8);
|
||||
cif->bytes = (unsigned)ALIGN (bytes, 8);
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
|
@ -453,8 +457,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
|||
|
||||
for (i = 0; i < avn; ++i)
|
||||
{
|
||||
size_t size = arg_types[i]->size;
|
||||
int n;
|
||||
size_t n, size = arg_types[i]->size;
|
||||
|
||||
n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
|
||||
if (n == 0
|
||||
|
|
@ -583,7 +586,7 @@ ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue,
|
|||
if (ret != FFI_TYPE_VOID)
|
||||
{
|
||||
enum x86_64_reg_class classes[MAX_CLASSES];
|
||||
int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
|
||||
size_t n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
|
||||
if (n == 0)
|
||||
{
|
||||
/* The return value goes in memory. Arrange for the closure
|
||||
|
|
@ -606,11 +609,11 @@ ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue,
|
|||
|
||||
avn = cif->nargs;
|
||||
arg_types = cif->arg_types;
|
||||
|
||||
|
||||
for (i = 0; i < avn; ++i)
|
||||
{
|
||||
enum x86_64_reg_class classes[MAX_CLASSES];
|
||||
int n;
|
||||
size_t n;
|
||||
|
||||
n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
|
||||
if (n == 0
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@ typedef enum ffi_abi {
|
|||
/* ---- Intel x86 and AMD x86-64 - */
|
||||
FFI_SYSV,
|
||||
FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
|
||||
FFI_THISCALL,
|
||||
FFI_FASTCALL,
|
||||
FFI_STDCALL,
|
||||
FFI_LAST_ABI,
|
||||
#if defined(__i386__) || defined(__i386)
|
||||
FFI_DEFAULT_ABI = FFI_SYSV
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ ffi_call_SYSV:
|
|||
movl 16(%ebp),%ecx
|
||||
subl %ecx,%esp
|
||||
|
||||
/* Align the stack pointer to 16-bytes */
|
||||
andl $0xfffffff0, %esp
|
||||
|
||||
movl %esp,%eax
|
||||
|
||||
/* Place all of the ffi_prep_args in position */
|
||||
|
|
@ -456,3 +459,5 @@ ffi_closure_raw_SYSV:
|
|||
#endif
|
||||
|
||||
#endif /* ifndef __x86_64__ */
|
||||
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
|
|
|||
|
|
@ -33,8 +33,13 @@
|
|||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
|
||||
#define CIF_ABI_OFFSET 0
|
||||
#define CIF_BYTES_OFFSET 16
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
|
||||
|
||||
.386
|
||||
.MODEL FLAT, C
|
||||
|
||||
|
|
@ -188,14 +193,23 @@ ca_epilogue:
|
|||
ret
|
||||
ffi_call_win32 ENDP
|
||||
|
||||
ffi_closure_THISCALL PROC NEAR FORCEFRAME
|
||||
sub esp, 40
|
||||
lea edx, [ebp -24]
|
||||
mov [ebp - 12], edx /* resp */
|
||||
lea edx, [ebp + 12] /* account for stub return address on stack */
|
||||
jmp stub
|
||||
ffi_closure_THISCALL PROC NEAR
|
||||
;; Insert the register argument on the stack as the first argument
|
||||
xchg DWORD PTR [esp+4], ecx
|
||||
xchg DWORD PTR [esp], ecx
|
||||
push ecx
|
||||
jmp ffi_closure_STDCALL
|
||||
ffi_closure_THISCALL ENDP
|
||||
|
||||
ffi_closure_FASTCALL PROC NEAR
|
||||
;; Insert the register argument on the stack as the first argument
|
||||
xchg DWORD PTR [esp+4], edx
|
||||
xchg DWORD PTR [esp], ecx
|
||||
push edx
|
||||
push ecx
|
||||
jmp ffi_closure_STDCALL
|
||||
ffi_closure_FASTCALL ENDP
|
||||
|
||||
ffi_closure_SYSV PROC NEAR FORCEFRAME
|
||||
;; the ffi_closure ctx is passed in eax by the trampoline.
|
||||
|
||||
|
|
@ -464,8 +478,23 @@ cd_retlongdouble:
|
|||
jmp cd_epilogue
|
||||
|
||||
cd_epilogue:
|
||||
;; Epilogue code is autogenerated.
|
||||
ret
|
||||
mov esp, ebp
|
||||
pop ebp
|
||||
pop ecx
|
||||
pop edx
|
||||
mov ecx, DWORD PTR [ecx + (CLOSURE_CIF_OFFSET-10)]
|
||||
add esp, DWORD PTR [ecx + CIF_BYTES_OFFSET]
|
||||
mov ecx, DWORD PTR [ecx + CIF_ABI_OFFSET]
|
||||
cmp ecx, 3
|
||||
je cd_thiscall
|
||||
cmp ecx, 4
|
||||
jne cd_not_fastcall
|
||||
|
||||
add esp, 4
|
||||
cd_thiscall:
|
||||
add esp, 4
|
||||
cd_not_fastcall:
|
||||
jmp edx
|
||||
ffi_closure_STDCALL ENDP
|
||||
|
||||
_TEXT ENDS
|
||||
|
|
@ -473,15 +502,23 @@ END
|
|||
|
||||
#else
|
||||
|
||||
#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
|
||||
|
||||
#if defined(SYMBOL_UNDERSCORE)
|
||||
#define USCORE_SYMBOL(x) _##x
|
||||
#else
|
||||
#define USCORE_SYMBOL(x) x
|
||||
#endif
|
||||
.text
|
||||
|
||||
# This assumes we are using gas.
|
||||
.balign 16
|
||||
.globl _ffi_call_win32
|
||||
#ifndef __OS2__
|
||||
FFI_HIDDEN(ffi_call_win32)
|
||||
.globl USCORE_SYMBOL(ffi_call_win32)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_call_win32; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
_ffi_call_win32:
|
||||
USCORE_SYMBOL(ffi_call_win32):
|
||||
.LFB1:
|
||||
pushl %ebp
|
||||
.LCFI0:
|
||||
|
|
@ -542,31 +579,32 @@ _ffi_call_win32:
|
|||
call 1f
|
||||
# Do not insert anything here between the call and the jump table.
|
||||
.Lstore_table:
|
||||
.long .Lnoretval /* FFI_TYPE_VOID */
|
||||
.long .Lretint /* FFI_TYPE_INT */
|
||||
.long .Lretfloat /* FFI_TYPE_FLOAT */
|
||||
.long .Lretdouble /* FFI_TYPE_DOUBLE */
|
||||
.long .Lretlongdouble /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lretuint8 /* FFI_TYPE_UINT8 */
|
||||
.long .Lretsint8 /* FFI_TYPE_SINT8 */
|
||||
.long .Lretuint16 /* FFI_TYPE_UINT16 */
|
||||
.long .Lretsint16 /* FFI_TYPE_SINT16 */
|
||||
.long .Lretint /* FFI_TYPE_UINT32 */
|
||||
.long .Lretint /* FFI_TYPE_SINT32 */
|
||||
.long .Lretint64 /* FFI_TYPE_UINT64 */
|
||||
.long .Lretint64 /* FFI_TYPE_SINT64 */
|
||||
.long .Lretstruct /* FFI_TYPE_STRUCT */
|
||||
.long .Lretint /* FFI_TYPE_POINTER */
|
||||
.long .Lretstruct1b /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lretstruct2b /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lretstruct4b /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lretstruct /* FFI_TYPE_MS_STRUCT */
|
||||
.long .Lnoretval-.Lstore_table /* FFI_TYPE_VOID */
|
||||
.long .Lretint-.Lstore_table /* FFI_TYPE_INT */
|
||||
.long .Lretfloat-.Lstore_table /* FFI_TYPE_FLOAT */
|
||||
.long .Lretdouble-.Lstore_table /* FFI_TYPE_DOUBLE */
|
||||
.long .Lretlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lretuint8-.Lstore_table /* FFI_TYPE_UINT8 */
|
||||
.long .Lretsint8-.Lstore_table /* FFI_TYPE_SINT8 */
|
||||
.long .Lretuint16-.Lstore_table /* FFI_TYPE_UINT16 */
|
||||
.long .Lretsint16-.Lstore_table /* FFI_TYPE_SINT16 */
|
||||
.long .Lretint-.Lstore_table /* FFI_TYPE_UINT32 */
|
||||
.long .Lretint-.Lstore_table /* FFI_TYPE_SINT32 */
|
||||
.long .Lretint64-.Lstore_table /* FFI_TYPE_UINT64 */
|
||||
.long .Lretint64-.Lstore_table /* FFI_TYPE_SINT64 */
|
||||
.long .Lretstruct-.Lstore_table /* FFI_TYPE_STRUCT */
|
||||
.long .Lretint-.Lstore_table /* FFI_TYPE_POINTER */
|
||||
.long .Lretstruct1b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lretstruct2b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lretstruct4b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lretstruct-.Lstore_table /* FFI_TYPE_MS_STRUCT */
|
||||
1:
|
||||
add %ecx, %ecx
|
||||
add %ecx, %ecx
|
||||
shl $2, %ecx
|
||||
add (%esp),%ecx
|
||||
mov (%ecx),%ecx
|
||||
add (%esp),%ecx
|
||||
add $4, %esp
|
||||
jmp *(%ecx)
|
||||
jmp *%ecx
|
||||
|
||||
/* Sign/zero extend as appropriate. */
|
||||
.Lretsint8:
|
||||
|
|
@ -644,27 +682,43 @@ _ffi_call_win32:
|
|||
ret
|
||||
.ffi_call_win32_end:
|
||||
.balign 16
|
||||
.globl _ffi_closure_THISCALL
|
||||
#ifndef __OS2__
|
||||
FFI_HIDDEN(ffi_closure_THISCALL)
|
||||
.globl USCORE_SYMBOL(ffi_closure_THISCALL)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_closure_THISCALL; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
_ffi_closure_THISCALL:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
subl $40, %esp
|
||||
leal -24(%ebp), %edx
|
||||
movl %edx, -12(%ebp) /* resp */
|
||||
leal 12(%ebp), %edx /* account for stub return address on stack */
|
||||
jmp .stub
|
||||
USCORE_SYMBOL(ffi_closure_THISCALL):
|
||||
/* Insert the register argument on the stack as the first argument */
|
||||
xchg %ecx, 4(%esp)
|
||||
xchg %ecx, (%esp)
|
||||
push %ecx
|
||||
jmp .ffi_closure_STDCALL_internal
|
||||
|
||||
.balign 16
|
||||
FFI_HIDDEN(ffi_closure_FASTCALL)
|
||||
.globl USCORE_SYMBOL(ffi_closure_FASTCALL)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_closure_FASTCALL; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
USCORE_SYMBOL(ffi_closure_FASTCALL):
|
||||
/* Insert the register arguments on the stack as the first two arguments */
|
||||
xchg %edx, 4(%esp)
|
||||
xchg %ecx, (%esp)
|
||||
push %edx
|
||||
push %ecx
|
||||
jmp .ffi_closure_STDCALL_internal
|
||||
.LFE1:
|
||||
|
||||
# This assumes we are using gas.
|
||||
.balign 16
|
||||
.globl _ffi_closure_SYSV
|
||||
#ifndef __OS2__
|
||||
FFI_HIDDEN(ffi_closure_SYSV)
|
||||
#if defined(X86_WIN32)
|
||||
.globl USCORE_SYMBOL(ffi_closure_SYSV)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_closure_SYSV; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
_ffi_closure_SYSV:
|
||||
USCORE_SYMBOL(ffi_closure_SYSV):
|
||||
#endif
|
||||
.LFB3:
|
||||
pushl %ebp
|
||||
.LCFI4:
|
||||
|
|
@ -674,43 +728,54 @@ _ffi_closure_SYSV:
|
|||
leal -24(%ebp), %edx
|
||||
movl %edx, -12(%ebp) /* resp */
|
||||
leal 8(%ebp), %edx
|
||||
.stub:
|
||||
movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
|
||||
leal -12(%ebp), %edx
|
||||
movl %edx, (%esp) /* &resp */
|
||||
call _ffi_closure_SYSV_inner
|
||||
#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
|
||||
call USCORE_SYMBOL(ffi_closure_SYSV_inner)
|
||||
#elif defined(X86_DARWIN)
|
||||
calll L_ffi_closure_SYSV_inner$stub
|
||||
#else
|
||||
movl %ebx, 8(%esp)
|
||||
call 1f
|
||||
1: popl %ebx
|
||||
addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
|
||||
call ffi_closure_SYSV_inner@PLT
|
||||
movl 8(%esp), %ebx
|
||||
#endif
|
||||
movl -12(%ebp), %ecx
|
||||
|
||||
0:
|
||||
call 1f
|
||||
# Do not insert anything here between the call and the jump table.
|
||||
.Lcls_store_table:
|
||||
.long .Lcls_noretval /* FFI_TYPE_VOID */
|
||||
.long .Lcls_retint /* FFI_TYPE_INT */
|
||||
.long .Lcls_retfloat /* FFI_TYPE_FLOAT */
|
||||
.long .Lcls_retdouble /* FFI_TYPE_DOUBLE */
|
||||
.long .Lcls_retldouble /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lcls_retuint8 /* FFI_TYPE_UINT8 */
|
||||
.long .Lcls_retsint8 /* FFI_TYPE_SINT8 */
|
||||
.long .Lcls_retuint16 /* FFI_TYPE_UINT16 */
|
||||
.long .Lcls_retsint16 /* FFI_TYPE_SINT16 */
|
||||
.long .Lcls_retint /* FFI_TYPE_UINT32 */
|
||||
.long .Lcls_retint /* FFI_TYPE_SINT32 */
|
||||
.long .Lcls_retllong /* FFI_TYPE_UINT64 */
|
||||
.long .Lcls_retllong /* FFI_TYPE_SINT64 */
|
||||
.long .Lcls_retstruct /* FFI_TYPE_STRUCT */
|
||||
.long .Lcls_retint /* FFI_TYPE_POINTER */
|
||||
.long .Lcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lcls_retmsstruct /* FFI_TYPE_MS_STRUCT */
|
||||
.long .Lcls_noretval-.Lcls_store_table /* FFI_TYPE_VOID */
|
||||
.long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_INT */
|
||||
.long .Lcls_retfloat-.Lcls_store_table /* FFI_TYPE_FLOAT */
|
||||
.long .Lcls_retdouble-.Lcls_store_table /* FFI_TYPE_DOUBLE */
|
||||
.long .Lcls_retldouble-.Lcls_store_table /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lcls_retuint8-.Lcls_store_table /* FFI_TYPE_UINT8 */
|
||||
.long .Lcls_retsint8-.Lcls_store_table /* FFI_TYPE_SINT8 */
|
||||
.long .Lcls_retuint16-.Lcls_store_table /* FFI_TYPE_UINT16 */
|
||||
.long .Lcls_retsint16-.Lcls_store_table /* FFI_TYPE_SINT16 */
|
||||
.long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_UINT32 */
|
||||
.long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_SINT32 */
|
||||
.long .Lcls_retllong-.Lcls_store_table /* FFI_TYPE_UINT64 */
|
||||
.long .Lcls_retllong-.Lcls_store_table /* FFI_TYPE_SINT64 */
|
||||
.long .Lcls_retstruct-.Lcls_store_table /* FFI_TYPE_STRUCT */
|
||||
.long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_POINTER */
|
||||
.long .Lcls_retstruct1-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lcls_retstruct2-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lcls_retstruct4-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lcls_retmsstruct-.Lcls_store_table /* FFI_TYPE_MS_STRUCT */
|
||||
|
||||
1:
|
||||
add %eax, %eax
|
||||
add %eax, %eax
|
||||
shl $2, %eax
|
||||
add (%esp),%eax
|
||||
mov (%eax),%eax
|
||||
add (%esp),%eax
|
||||
add $4, %esp
|
||||
jmp *(%eax)
|
||||
jmp *%eax
|
||||
|
||||
/* Sign/zero extend as appropriate. */
|
||||
.Lcls_retsint8:
|
||||
|
|
@ -788,12 +853,15 @@ _ffi_closure_SYSV:
|
|||
#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
|
||||
#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
|
||||
#define CIF_FLAGS_OFFSET 20
|
||||
|
||||
#ifdef X86_WIN32
|
||||
.balign 16
|
||||
.globl _ffi_closure_raw_THISCALL
|
||||
#ifndef __OS2__
|
||||
FFI_HIDDEN(ffi_closure_raw_THISCALL)
|
||||
.globl USCORE_SYMBOL(ffi_closure_raw_THISCALL)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
_ffi_closure_raw_THISCALL:
|
||||
USCORE_SYMBOL(ffi_closure_raw_THISCALL):
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
pushl %esi
|
||||
|
|
@ -803,13 +871,17 @@ _ffi_closure_raw_THISCALL:
|
|||
movl %edx, 12(%esp) /* user_data */
|
||||
leal 12(%ebp), %edx /* __builtin_dwarf_cfa () */
|
||||
jmp .stubraw
|
||||
#endif /* X86_WIN32 */
|
||||
|
||||
# This assumes we are using gas.
|
||||
.balign 16
|
||||
.globl _ffi_closure_raw_SYSV
|
||||
#ifndef __OS2__
|
||||
#if defined(X86_WIN32)
|
||||
.globl USCORE_SYMBOL(ffi_closure_raw_SYSV)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
_ffi_closure_raw_SYSV:
|
||||
USCORE_SYMBOL(ffi_closure_raw_SYSV):
|
||||
#endif /* defined(X86_WIN32) */
|
||||
.LFB4:
|
||||
pushl %ebp
|
||||
.LCFI6:
|
||||
|
|
@ -833,31 +905,32 @@ _ffi_closure_raw_SYSV:
|
|||
call 1f
|
||||
# Do not insert anything here between the call and the jump table.
|
||||
.Lrcls_store_table:
|
||||
.long .Lrcls_noretval /* FFI_TYPE_VOID */
|
||||
.long .Lrcls_retint /* FFI_TYPE_INT */
|
||||
.long .Lrcls_retfloat /* FFI_TYPE_FLOAT */
|
||||
.long .Lrcls_retdouble /* FFI_TYPE_DOUBLE */
|
||||
.long .Lrcls_retldouble /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lrcls_retuint8 /* FFI_TYPE_UINT8 */
|
||||
.long .Lrcls_retsint8 /* FFI_TYPE_SINT8 */
|
||||
.long .Lrcls_retuint16 /* FFI_TYPE_UINT16 */
|
||||
.long .Lrcls_retsint16 /* FFI_TYPE_SINT16 */
|
||||
.long .Lrcls_retint /* FFI_TYPE_UINT32 */
|
||||
.long .Lrcls_retint /* FFI_TYPE_SINT32 */
|
||||
.long .Lrcls_retllong /* FFI_TYPE_UINT64 */
|
||||
.long .Lrcls_retllong /* FFI_TYPE_SINT64 */
|
||||
.long .Lrcls_retstruct /* FFI_TYPE_STRUCT */
|
||||
.long .Lrcls_retint /* FFI_TYPE_POINTER */
|
||||
.long .Lrcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lrcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lrcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lrcls_retstruct /* FFI_TYPE_MS_STRUCT */
|
||||
.long .Lrcls_noretval-.Lrcls_store_table /* FFI_TYPE_VOID */
|
||||
.long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_INT */
|
||||
.long .Lrcls_retfloat-.Lrcls_store_table /* FFI_TYPE_FLOAT */
|
||||
.long .Lrcls_retdouble-.Lrcls_store_table /* FFI_TYPE_DOUBLE */
|
||||
.long .Lrcls_retldouble-.Lrcls_store_table /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lrcls_retuint8-.Lrcls_store_table /* FFI_TYPE_UINT8 */
|
||||
.long .Lrcls_retsint8-.Lrcls_store_table /* FFI_TYPE_SINT8 */
|
||||
.long .Lrcls_retuint16-.Lrcls_store_table /* FFI_TYPE_UINT16 */
|
||||
.long .Lrcls_retsint16-.Lrcls_store_table /* FFI_TYPE_SINT16 */
|
||||
.long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_UINT32 */
|
||||
.long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_SINT32 */
|
||||
.long .Lrcls_retllong-.Lrcls_store_table /* FFI_TYPE_UINT64 */
|
||||
.long .Lrcls_retllong-.Lrcls_store_table /* FFI_TYPE_SINT64 */
|
||||
.long .Lrcls_retstruct-.Lrcls_store_table /* FFI_TYPE_STRUCT */
|
||||
.long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_POINTER */
|
||||
.long .Lrcls_retstruct1-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lrcls_retstruct2-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lrcls_retstruct4-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lrcls_retstruct-.Lrcls_store_table /* FFI_TYPE_MS_STRUCT */
|
||||
1:
|
||||
add %eax, %eax
|
||||
add %eax, %eax
|
||||
shl $2, %eax
|
||||
add (%esp),%eax
|
||||
mov (%eax),%eax
|
||||
add (%esp),%eax
|
||||
add $4, %esp
|
||||
jmp *(%eax)
|
||||
jmp *%eax
|
||||
|
||||
/* Sign/zero extend as appropriate. */
|
||||
.Lrcls_retsint8:
|
||||
|
|
@ -925,11 +998,13 @@ _ffi_closure_raw_SYSV:
|
|||
|
||||
# This assumes we are using gas.
|
||||
.balign 16
|
||||
.globl _ffi_closure_STDCALL
|
||||
#ifndef __OS2__
|
||||
FFI_HIDDEN(ffi_closure_STDCALL)
|
||||
.globl USCORE_SYMBOL(ffi_closure_STDCALL)
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.def _ffi_closure_STDCALL; .scl 2; .type 32; .endef
|
||||
#endif
|
||||
_ffi_closure_STDCALL:
|
||||
USCORE_SYMBOL(ffi_closure_STDCALL):
|
||||
.ffi_closure_STDCALL_internal:
|
||||
.LFB5:
|
||||
pushl %ebp
|
||||
.LCFI9:
|
||||
|
|
@ -942,36 +1017,48 @@ _ffi_closure_STDCALL:
|
|||
movl %edx, 4(%esp) /* args */
|
||||
leal -12(%ebp), %edx
|
||||
movl %edx, (%esp) /* &resp */
|
||||
call _ffi_closure_SYSV_inner
|
||||
#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
|
||||
call USCORE_SYMBOL(ffi_closure_SYSV_inner)
|
||||
#elif defined(X86_DARWIN)
|
||||
calll L_ffi_closure_SYSV_inner$stub
|
||||
#else
|
||||
movl %ebx, 8(%esp)
|
||||
call 1f
|
||||
1: popl %ebx
|
||||
addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
|
||||
call ffi_closure_SYSV_inner@PLT
|
||||
movl 8(%esp), %ebx
|
||||
#endif
|
||||
movl -12(%ebp), %ecx
|
||||
0:
|
||||
call 1f
|
||||
# Do not insert anything here between the call and the jump table.
|
||||
.Lscls_store_table:
|
||||
.long .Lscls_noretval /* FFI_TYPE_VOID */
|
||||
.long .Lscls_retint /* FFI_TYPE_INT */
|
||||
.long .Lscls_retfloat /* FFI_TYPE_FLOAT */
|
||||
.long .Lscls_retdouble /* FFI_TYPE_DOUBLE */
|
||||
.long .Lscls_retldouble /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lscls_retuint8 /* FFI_TYPE_UINT8 */
|
||||
.long .Lscls_retsint8 /* FFI_TYPE_SINT8 */
|
||||
.long .Lscls_retuint16 /* FFI_TYPE_UINT16 */
|
||||
.long .Lscls_retsint16 /* FFI_TYPE_SINT16 */
|
||||
.long .Lscls_retint /* FFI_TYPE_UINT32 */
|
||||
.long .Lscls_retint /* FFI_TYPE_SINT32 */
|
||||
.long .Lscls_retllong /* FFI_TYPE_UINT64 */
|
||||
.long .Lscls_retllong /* FFI_TYPE_SINT64 */
|
||||
.long .Lscls_retstruct /* FFI_TYPE_STRUCT */
|
||||
.long .Lscls_retint /* FFI_TYPE_POINTER */
|
||||
.long .Lscls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lscls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lscls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
.long .Lscls_noretval-.Lscls_store_table /* FFI_TYPE_VOID */
|
||||
.long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_INT */
|
||||
.long .Lscls_retfloat-.Lscls_store_table /* FFI_TYPE_FLOAT */
|
||||
.long .Lscls_retdouble-.Lscls_store_table /* FFI_TYPE_DOUBLE */
|
||||
.long .Lscls_retldouble-.Lscls_store_table /* FFI_TYPE_LONGDOUBLE */
|
||||
.long .Lscls_retuint8-.Lscls_store_table /* FFI_TYPE_UINT8 */
|
||||
.long .Lscls_retsint8-.Lscls_store_table /* FFI_TYPE_SINT8 */
|
||||
.long .Lscls_retuint16-.Lscls_store_table /* FFI_TYPE_UINT16 */
|
||||
.long .Lscls_retsint16-.Lscls_store_table /* FFI_TYPE_SINT16 */
|
||||
.long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_UINT32 */
|
||||
.long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_SINT32 */
|
||||
.long .Lscls_retllong-.Lscls_store_table /* FFI_TYPE_UINT64 */
|
||||
.long .Lscls_retllong-.Lscls_store_table /* FFI_TYPE_SINT64 */
|
||||
.long .Lscls_retstruct-.Lscls_store_table /* FFI_TYPE_STRUCT */
|
||||
.long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_POINTER */
|
||||
.long .Lscls_retstruct1-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */
|
||||
.long .Lscls_retstruct2-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */
|
||||
.long .Lscls_retstruct4-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */
|
||||
1:
|
||||
add %eax, %eax
|
||||
add %eax, %eax
|
||||
shl $2, %eax
|
||||
add (%esp),%eax
|
||||
mov (%eax),%eax
|
||||
add (%esp),%eax
|
||||
add $4, %esp
|
||||
jmp *(%eax)
|
||||
jmp *%eax
|
||||
|
||||
/* Sign/zero extend as appropriate. */
|
||||
.Lscls_retsint8:
|
||||
|
|
@ -1030,11 +1117,30 @@ _ffi_closure_STDCALL:
|
|||
.Lscls_epilogue:
|
||||
movl %ebp, %esp
|
||||
popl %ebp
|
||||
ret
|
||||
popl %ecx
|
||||
popl %edx
|
||||
movl (CLOSURE_CIF_OFFSET-10)(%ecx), %ecx
|
||||
addl CIF_BYTES_OFFSET(%ecx), %esp
|
||||
movl CIF_ABI_OFFSET(%ecx), %ecx
|
||||
cmpl $3, %ecx /* FFI_THISCALL */
|
||||
je 1f
|
||||
cmpl $4, %ecx /* FFI_FASTCALL */
|
||||
jne 2f
|
||||
|
||||
addl $4, %esp
|
||||
1: addl $4, %esp
|
||||
2: jmp *%edx
|
||||
.ffi_closure_STDCALL_end:
|
||||
.LFE5:
|
||||
|
||||
#ifndef __OS2__
|
||||
#if defined(X86_DARWIN)
|
||||
.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
|
||||
L_ffi_closure_SYSV_inner$stub:
|
||||
.indirect_symbol _ffi_closure_SYSV_inner
|
||||
hlt ; hlt ; hlt ; hlt ; hlt
|
||||
#endif
|
||||
|
||||
#if defined(X86_WIN32) && !defined(__OS2__)
|
||||
.section .eh_frame,"w"
|
||||
#endif
|
||||
.Lframe1:
|
||||
|
|
@ -1094,7 +1200,6 @@ _ffi_closure_STDCALL:
|
|||
.align 4
|
||||
.LEFDE1:
|
||||
|
||||
|
||||
.LSFDE3:
|
||||
.long .LEFDE3-.LASFDE3 /* FDE Length */
|
||||
.LASFDE3:
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
timestamp
|
||||
|
|
@ -2,17 +2,6 @@
|
|||
|
||||
AUTOMAKE_OPTIONS = foreign dejagnu
|
||||
|
||||
# Setup the testing framework, if you have one
|
||||
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
|
||||
echo $(top_builddir)/../expect/expect ; \
|
||||
else echo expect ; fi`
|
||||
|
||||
RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest ; \
|
||||
else echo runtest; fi`
|
||||
|
||||
AM_RUNTESTFLAGS =
|
||||
|
||||
EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
|
||||
|
||||
CLEANFILES = *.exe core* *.log *.sum
|
||||
|
|
@ -20,7 +9,7 @@ CLEANFILES = *.exe core* *.log *.sum
|
|||
EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
|
||||
libffi.call/cls_align_longdouble_split.c \
|
||||
libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
|
||||
libffi.call/closure_fn1.c libffi.call/many2_win32.c \
|
||||
libffi.call/closure_fn1.c \
|
||||
libffi.call/return_ul.c libffi.call/cls_align_double.c \
|
||||
libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
|
||||
libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
|
||||
|
|
@ -30,7 +19,7 @@ libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
|
|||
libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
|
||||
libffi.call/struct8.c libffi.call/nested_struct8.c \
|
||||
libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
|
||||
libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \
|
||||
libffi.call/cls_pointer.c \
|
||||
libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
|
||||
libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
|
||||
libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
|
||||
|
|
@ -46,16 +35,16 @@ libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
|
|||
libffi.call/return_fl3.c libffi.call/stret_medium.c \
|
||||
libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
|
||||
libffi.call/float3.c libffi.call/many2.c \
|
||||
libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
|
||||
libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \
|
||||
libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
|
||||
libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
|
||||
libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
|
||||
libffi.call/cls_sshort.c libffi.call/many_win32.c \
|
||||
libffi.call/cls_sshort.c \
|
||||
libffi.call/nested_struct.c libffi.call/cls_20byte.c \
|
||||
libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
|
||||
libffi.call/return_uc.c libffi.call/closure_thiscall.c \
|
||||
libffi.call/return_uc.c \
|
||||
libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
|
||||
libffi.call/promotion.c libffi.call/struct1_win32.c \
|
||||
libffi.call/promotion.c \
|
||||
libffi.call/return_dbl.c libffi.call/cls_24byte.c \
|
||||
libffi.call/struct4.c libffi.call/cls_6byte.c \
|
||||
libffi.call/cls_align_uint32.c libffi.call/float.c \
|
||||
|
|
@ -63,7 +52,7 @@ libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
|
|||
libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
|
||||
libffi.call/cls_align_float.c libffi.call/return_fl1.c \
|
||||
libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
|
||||
libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
|
||||
libffi.call/cls_align_sint64.c \
|
||||
libffi.call/stret_large2.c libffi.call/return_sl.c \
|
||||
libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
|
||||
libffi.call/cls_2byte.c libffi.call/float2.c \
|
||||
|
|
@ -75,20 +64,22 @@ libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
|
|||
libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
|
||||
libffi.call/struct1.c libffi.call/nested_struct9.c \
|
||||
libffi.call/huge_struct.c libffi.call/problem1.c \
|
||||
libffi.call/float4.c libffi.call/fastthis3_win32.c \
|
||||
libffi.call/return_ldl.c libffi.call/strlen2_win32.c \
|
||||
libffi.call/closure_fn5.c libffi.call/struct2_win32.c \
|
||||
libffi.call/float4.c \
|
||||
libffi.call/return_ldl.c \
|
||||
libffi.call/closure_fn5.c \
|
||||
libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
|
||||
libffi.call/return_sc.c libffi.call/struct7.c \
|
||||
libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
|
||||
libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \
|
||||
libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \
|
||||
libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \
|
||||
libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \
|
||||
libffi.call/cls_6_1_byte.c \
|
||||
libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \
|
||||
libffi.call/unwindtest_ffi_call.cc \
|
||||
lib/wrapper.exp lib/target-libpath.exp \
|
||||
lib/libffi.exp libffi.call/cls_struct_va1.c \
|
||||
libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
|
||||
libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
|
||||
libffi.call/nested_struct11.c libffi.call/uninitialized.c \
|
||||
libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
|
||||
libffi.call/va_struct3.c
|
||||
|
||||
libffi.call/va_struct3.c \
|
||||
libffi.call/strlen2.c \
|
||||
libffi.call/strlen3.c \
|
||||
libffi.call/strlen4.c
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.12.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.4 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
@ -14,23 +14,51 @@
|
|||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
|
@ -51,7 +79,7 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = testsuite
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
|
||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
|
|
@ -73,6 +101,18 @@ mkinstalldirs = $(install_sh) -d
|
|||
CONFIG_HEADER = $(top_builddir)/fficonfig.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
|
@ -80,14 +120,18 @@ am__can_run_installinfo = \
|
|||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
DEJATOOL = $(PACKAGE)
|
||||
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
|
||||
EXPECT = expect
|
||||
RUNTEST = runtest
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS =
|
||||
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
|
@ -101,6 +145,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
|
@ -116,6 +164,7 @@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
|
|||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
|
||||
HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
|
@ -162,6 +211,7 @@ abs_top_builddir = @abs_top_builddir@
|
|||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
|
|
@ -217,22 +267,12 @@ top_build_prefix = @top_build_prefix@
|
|||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign dejagnu
|
||||
|
||||
# Setup the testing framework, if you have one
|
||||
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
|
||||
echo $(top_builddir)/../expect/expect ; \
|
||||
else echo expect ; fi`
|
||||
|
||||
RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest ; \
|
||||
else echo runtest; fi`
|
||||
|
||||
EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
|
||||
CLEANFILES = *.exe core* *.log *.sum
|
||||
EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
|
||||
libffi.call/cls_align_longdouble_split.c \
|
||||
libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
|
||||
libffi.call/closure_fn1.c libffi.call/many2_win32.c \
|
||||
libffi.call/closure_fn1.c \
|
||||
libffi.call/return_ul.c libffi.call/cls_align_double.c \
|
||||
libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
|
||||
libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
|
||||
|
|
@ -242,7 +282,7 @@ libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
|
|||
libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
|
||||
libffi.call/struct8.c libffi.call/nested_struct8.c \
|
||||
libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
|
||||
libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \
|
||||
libffi.call/cls_pointer.c \
|
||||
libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
|
||||
libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
|
||||
libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
|
||||
|
|
@ -258,16 +298,16 @@ libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
|
|||
libffi.call/return_fl3.c libffi.call/stret_medium.c \
|
||||
libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
|
||||
libffi.call/float3.c libffi.call/many2.c \
|
||||
libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \
|
||||
libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \
|
||||
libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
|
||||
libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
|
||||
libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
|
||||
libffi.call/cls_sshort.c libffi.call/many_win32.c \
|
||||
libffi.call/cls_sshort.c \
|
||||
libffi.call/nested_struct.c libffi.call/cls_20byte.c \
|
||||
libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
|
||||
libffi.call/return_uc.c libffi.call/closure_thiscall.c \
|
||||
libffi.call/return_uc.c \
|
||||
libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
|
||||
libffi.call/promotion.c libffi.call/struct1_win32.c \
|
||||
libffi.call/promotion.c \
|
||||
libffi.call/return_dbl.c libffi.call/cls_24byte.c \
|
||||
libffi.call/struct4.c libffi.call/cls_6byte.c \
|
||||
libffi.call/cls_align_uint32.c libffi.call/float.c \
|
||||
|
|
@ -275,7 +315,7 @@ libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
|
|||
libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
|
||||
libffi.call/cls_align_float.c libffi.call/return_fl1.c \
|
||||
libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
|
||||
libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \
|
||||
libffi.call/cls_align_sint64.c \
|
||||
libffi.call/stret_large2.c libffi.call/return_sl.c \
|
||||
libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
|
||||
libffi.call/cls_2byte.c libffi.call/float2.c \
|
||||
|
|
@ -287,22 +327,25 @@ libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
|
|||
libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
|
||||
libffi.call/struct1.c libffi.call/nested_struct9.c \
|
||||
libffi.call/huge_struct.c libffi.call/problem1.c \
|
||||
libffi.call/float4.c libffi.call/fastthis3_win32.c \
|
||||
libffi.call/return_ldl.c libffi.call/strlen2_win32.c \
|
||||
libffi.call/closure_fn5.c libffi.call/struct2_win32.c \
|
||||
libffi.call/float4.c \
|
||||
libffi.call/return_ldl.c \
|
||||
libffi.call/closure_fn5.c \
|
||||
libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
|
||||
libffi.call/return_sc.c libffi.call/struct7.c \
|
||||
libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
|
||||
libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \
|
||||
libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \
|
||||
libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \
|
||||
libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \
|
||||
libffi.call/cls_6_1_byte.c \
|
||||
libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \
|
||||
libffi.call/unwindtest_ffi_call.cc \
|
||||
lib/wrapper.exp lib/target-libpath.exp \
|
||||
lib/libffi.exp libffi.call/cls_struct_va1.c \
|
||||
libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
|
||||
libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
|
||||
libffi.call/nested_struct11.c libffi.call/uninitialized.c \
|
||||
libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
|
||||
libffi.call/va_struct3.c
|
||||
libffi.call/va_struct3.c \
|
||||
libffi.call/strlen2.c \
|
||||
libffi.call/strlen3.c \
|
||||
libffi.call/strlen4.c
|
||||
|
||||
all: all-am
|
||||
|
||||
|
|
@ -343,11 +386,9 @@ mostlyclean-libtool:
|
|||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
tags TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
|
@ -355,13 +396,12 @@ cscope cscopelist:
|
|||
check-DEJAGNU: site.exp
|
||||
srcdir='$(srcdir)'; export srcdir; \
|
||||
EXPECT=$(EXPECT); export EXPECT; \
|
||||
runtest=$(RUNTEST); \
|
||||
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
|
||||
if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
|
||||
exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
|
||||
if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
|
||||
if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
|
||||
then :; else exit_status=1; fi; \
|
||||
done; \
|
||||
else echo "WARNING: could not find 'runtest'" 1>&2; :;\
|
||||
else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
|
||||
fi; \
|
||||
exit $$exit_status
|
||||
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
|
||||
|
|
@ -532,16 +572,17 @@ uninstall-am:
|
|||
.MAKE: check-am install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
|
||||
clean-libtool distclean distclean-DEJAGNU distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
uninstall uninstall-am
|
||||
clean-libtool cscopelist-am ctags-am distclean \
|
||||
distclean-DEJAGNU distclean-generic distclean-libtool distdir \
|
||||
dvi dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
|
|
|||
|
|
@ -222,6 +222,10 @@ proc libffi_target_compile { source dest type options } {
|
|||
lappend options "libs= -lpthread"
|
||||
}
|
||||
|
||||
if { [string match "*.cc" $source] } {
|
||||
lappend options "c++"
|
||||
}
|
||||
|
||||
verbose "options: $options"
|
||||
return [target_compile $source $dest $type $options]
|
||||
}
|
||||
|
|
@ -273,6 +277,46 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
|
|||
}
|
||||
}
|
||||
|
||||
proc run-many-tests { testcases extra_flags } {
|
||||
global using_gcc
|
||||
if { [string match $using_gcc "yes"] } {
|
||||
set common "-W -Wall"
|
||||
set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
|
||||
} else {
|
||||
# Assume we are using the vendor compiler.
|
||||
set common ""
|
||||
set optimizations { "" }
|
||||
}
|
||||
|
||||
set targetabis { "" }
|
||||
if [string match $using_gcc "yes"] {
|
||||
if [istarget "i?86-*-*"] {
|
||||
set targetabis {
|
||||
""
|
||||
"-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
|
||||
"-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
|
||||
"-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set common [ concat $common $extra_flags ]
|
||||
foreach test $testcases {
|
||||
set testname [file tail $test]
|
||||
if [search_for $test "ABI_NUM"] {
|
||||
set abis $targetabis
|
||||
} else {
|
||||
set abis { "" }
|
||||
}
|
||||
foreach opt $optimizations {
|
||||
foreach abi $abis {
|
||||
set options [concat $common $opt $abi]
|
||||
verbose "Testing $testname, $options" 1
|
||||
dg-test $test $options ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Like check_conditional_xfail, but callable from a dg test.
|
||||
|
||||
|
|
|
|||
|
|
@ -19,20 +19,7 @@ libffi-init
|
|||
|
||||
global srcdir subdir
|
||||
|
||||
if { [string match $using_gcc "yes"] } {
|
||||
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" ""
|
||||
|
||||
} else {
|
||||
|
||||
# Assume we are using the vendor compiler.
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" ""
|
||||
|
||||
}
|
||||
run-many-tests [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] ""
|
||||
|
||||
dg-finish
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue