]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libffi: Sync with libffi 3.4.2
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 31 Aug 2021 14:14:47 +0000 (07:14 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Oct 2021 12:35:52 +0000 (05:35 -0700)
Merged commit: f9ea41683444ebe11cfa45b05223899764df28fb

236 files changed:
libffi/.gitattributes [new file with mode: 0644]
libffi/LICENSE
libffi/LICENSE-BUILDTOOLS [new file with mode: 0644]
libffi/MERGE [new file with mode: 0644]
libffi/Makefile.am
libffi/Makefile.in [deleted file]
libffi/README [deleted file]
libffi/README.md [new file with mode: 0644]
libffi/acinclude.m4
libffi/aclocal.m4 [deleted file]
libffi/configure [deleted file]
libffi/configure.ac
libffi/configure.host
libffi/doc/Makefile.am [new file with mode: 0644]
libffi/doc/libffi.texi
libffi/doc/version.texi
libffi/fficonfig.h.in [deleted file]
libffi/generate-darwin-source-and-headers.py [changed mode: 0644->0755]
libffi/include/Makefile.am
libffi/include/Makefile.in [deleted file]
libffi/include/ffi.h.in
libffi/include/ffi_cfi.h
libffi/include/ffi_common.h
libffi/include/tramp.h [new file with mode: 0644]
libffi/libffi.map.in
libffi/libffi.pc.in
libffi/libffi.xcodeproj/project.pbxproj
libffi/libtool-version
libffi/man/Makefile.in [deleted file]
libffi/mdate-sh [deleted file]
libffi/msvcc.sh
libffi/src/aarch64/ffi.c
libffi/src/aarch64/ffitarget.h
libffi/src/aarch64/internal.h
libffi/src/aarch64/sysv.S
libffi/src/aarch64/win64_armasm.S [new file with mode: 0644]
libffi/src/alpha/ffi.c
libffi/src/arc/ffi.c
libffi/src/arm/ffi.c
libffi/src/arm/ffitarget.h
libffi/src/arm/internal.h
libffi/src/arm/sysv.S
libffi/src/arm/sysv_msvc_arm32.S [new file with mode: 0644]
libffi/src/closures.c
libffi/src/cris/ffi.c
libffi/src/csky/ffi.c [new file with mode: 0644]
libffi/src/csky/ffitarget.h [new file with mode: 0644]
libffi/src/csky/sysv.S [new file with mode: 0644]
libffi/src/dlmalloc.c
libffi/src/frv/ffi.c
libffi/src/ia64/ffi.c
libffi/src/ia64/ffitarget.h
libffi/src/ia64/unix.S
libffi/src/java_raw_api.c
libffi/src/kvx/asm.h [new file with mode: 0644]
libffi/src/kvx/ffi.c [new file with mode: 0644]
libffi/src/kvx/ffitarget.h [new file with mode: 0644]
libffi/src/kvx/sysv.S [new file with mode: 0644]
libffi/src/m32r/ffi.c
libffi/src/m68k/ffi.c
libffi/src/m68k/sysv.S
libffi/src/m88k/ffi.c
libffi/src/metag/ffi.c
libffi/src/microblaze/ffi.c
libffi/src/mips/ffi.c
libffi/src/mips/ffitarget.h
libffi/src/mips/n32.S
libffi/src/mips/o32.S
libffi/src/moxie/eabi.S
libffi/src/moxie/ffi.c
libffi/src/nios2/ffi.c
libffi/src/pa/ffi.c
libffi/src/pa/ffitarget.h
libffi/src/pa/hpux32.S
libffi/src/pa/linux.S
libffi/src/powerpc/asm.h
libffi/src/powerpc/darwin_closure.S
libffi/src/powerpc/ffi.c
libffi/src/powerpc/ffi_darwin.c
libffi/src/powerpc/ffi_linux64.c
libffi/src/powerpc/ffi_powerpc.h
libffi/src/powerpc/ffitarget.h
libffi/src/powerpc/linux64.S
libffi/src/powerpc/linux64_closure.S
libffi/src/powerpc/sysv.S
libffi/src/prep_cif.c
libffi/src/raw_api.c
libffi/src/riscv/ffi.c
libffi/src/sparc/ffi.c
libffi/src/sparc/ffi64.c
libffi/src/tramp.c [new file with mode: 0644]
libffi/src/types.c
libffi/src/vax/ffi.c
libffi/src/x86/asmnames.h [new file with mode: 0644]
libffi/src/x86/darwin.S [deleted file]
libffi/src/x86/darwin64.S [deleted file]
libffi/src/x86/darwin64_c.c [deleted file]
libffi/src/x86/darwin_c.c [deleted file]
libffi/src/x86/ffi.c
libffi/src/x86/ffi64.c
libffi/src/x86/ffitarget.h
libffi/src/x86/ffiw64.c
libffi/src/x86/internal.h
libffi/src/x86/internal64.h
libffi/src/x86/sysv.S
libffi/src/x86/sysv_intel.S [new file with mode: 0644]
libffi/src/x86/unix64.S
libffi/src/x86/win64.S
libffi/src/x86/win64_intel.S [new file with mode: 0644]
libffi/src/xtensa/ffi.c
libffi/src/xtensa/sysv.S
libffi/testsuite/Makefile.am
libffi/testsuite/Makefile.in [deleted file]
libffi/testsuite/lib/libffi.exp
libffi/testsuite/libffi.bhaible/Makefile [new file with mode: 0644]
libffi/testsuite/libffi.bhaible/README [new file with mode: 0644]
libffi/testsuite/libffi.bhaible/alignof.h [new file with mode: 0644]
libffi/testsuite/libffi.bhaible/bhaible.exp [new file with mode: 0644]
libffi/testsuite/libffi.bhaible/test-call.c [new file with mode: 0644]
libffi/testsuite/libffi.bhaible/test-callback.c [new file with mode: 0644]
libffi/testsuite/libffi.bhaible/testcases.c [new file with mode: 0644]
libffi/testsuite/libffi.call/align_mixed.c [new file with mode: 0644]
libffi/testsuite/libffi.call/align_stdcall.c [new file with mode: 0644]
libffi/testsuite/libffi.call/call.exp
libffi/testsuite/libffi.call/cls_uchar_va.c [deleted file]
libffi/testsuite/libffi.call/cls_ushort_va.c [deleted file]
libffi/testsuite/libffi.call/ffitest.h
libffi/testsuite/libffi.call/float2.c
libffi/testsuite/libffi.call/offsets.c [new file with mode: 0644]
libffi/testsuite/libffi.call/struct10.c [new file with mode: 0644]
libffi/testsuite/libffi.call/va_1.c
libffi/testsuite/libffi.call/va_2.c [new file with mode: 0644]
libffi/testsuite/libffi.closures/closure.exp [new file with mode: 0644]
libffi/testsuite/libffi.closures/closure_fn0.c [moved from libffi/testsuite/libffi.call/closure_fn0.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_fn1.c [moved from libffi/testsuite/libffi.call/closure_fn1.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_fn2.c [moved from libffi/testsuite/libffi.call/closure_fn2.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_fn3.c [moved from libffi/testsuite/libffi.call/closure_fn3.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_fn4.c [moved from libffi/testsuite/libffi.call/closure_fn4.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_fn5.c [moved from libffi/testsuite/libffi.call/closure_fn5.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_fn6.c [moved from libffi/testsuite/libffi.call/closure_fn6.c with 100% similarity]
libffi/testsuite/libffi.closures/closure_loc_fn0.c [moved from libffi/testsuite/libffi.call/closure_loc_fn0.c with 96% similarity]
libffi/testsuite/libffi.closures/closure_simple.c [moved from libffi/testsuite/libffi.call/closure_simple.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_12byte.c [moved from libffi/testsuite/libffi.call/cls_12byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_16byte.c [moved from libffi/testsuite/libffi.call/cls_16byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_18byte.c [moved from libffi/testsuite/libffi.call/cls_18byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_19byte.c [moved from libffi/testsuite/libffi.call/cls_19byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_1_1byte.c [moved from libffi/testsuite/libffi.call/cls_1_1byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_20byte.c [moved from libffi/testsuite/libffi.call/cls_20byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_20byte1.c [moved from libffi/testsuite/libffi.call/cls_20byte1.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_24byte.c [moved from libffi/testsuite/libffi.call/cls_24byte.c with 95% similarity]
libffi/testsuite/libffi.closures/cls_2byte.c [moved from libffi/testsuite/libffi.call/cls_2byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_3_1byte.c [moved from libffi/testsuite/libffi.call/cls_3_1byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_3byte1.c [moved from libffi/testsuite/libffi.call/cls_3byte1.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_3byte2.c [moved from libffi/testsuite/libffi.call/cls_3byte2.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_3float.c [new file with mode: 0644]
libffi/testsuite/libffi.closures/cls_4_1byte.c [moved from libffi/testsuite/libffi.call/cls_4_1byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_4byte.c [moved from libffi/testsuite/libffi.call/cls_4byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_5_1_byte.c [moved from libffi/testsuite/libffi.call/cls_5_1_byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_5byte.c [moved from libffi/testsuite/libffi.call/cls_5byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_64byte.c [moved from libffi/testsuite/libffi.call/cls_64byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_6_1_byte.c [moved from libffi/testsuite/libffi.call/cls_6_1_byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_6byte.c [moved from libffi/testsuite/libffi.call/cls_6byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_7_1_byte.c [moved from libffi/testsuite/libffi.call/cls_7_1_byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_7byte.c [moved from libffi/testsuite/libffi.call/cls_7byte.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_8byte.c [moved from libffi/testsuite/libffi.call/cls_8byte.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_9byte1.c [moved from libffi/testsuite/libffi.call/cls_9byte1.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_9byte2.c [moved from libffi/testsuite/libffi.call/cls_9byte2.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_double.c [moved from libffi/testsuite/libffi.call/cls_align_double.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_float.c [moved from libffi/testsuite/libffi.call/cls_align_float.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_longdouble.c [moved from libffi/testsuite/libffi.call/cls_align_longdouble.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_longdouble_split.c [moved from libffi/testsuite/libffi.call/cls_align_longdouble_split.c with 98% similarity]
libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c [moved from libffi/testsuite/libffi.call/cls_align_longdouble_split2.c with 98% similarity]
libffi/testsuite/libffi.closures/cls_align_pointer.c [moved from libffi/testsuite/libffi.call/cls_align_pointer.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_sint16.c [moved from libffi/testsuite/libffi.call/cls_align_sint16.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_sint32.c [moved from libffi/testsuite/libffi.call/cls_align_sint32.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_sint64.c [moved from libffi/testsuite/libffi.call/cls_align_sint64.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_uint16.c [moved from libffi/testsuite/libffi.call/cls_align_uint16.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_uint32.c [moved from libffi/testsuite/libffi.call/cls_align_uint32.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_align_uint64.c [moved from libffi/testsuite/libffi.call/cls_align_uint64.c with 97% similarity]
libffi/testsuite/libffi.closures/cls_dbls_struct.c [moved from libffi/testsuite/libffi.call/cls_dbls_struct.c with 92% similarity]
libffi/testsuite/libffi.closures/cls_double.c [moved from libffi/testsuite/libffi.call/cls_double.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_double_va.c [moved from libffi/testsuite/libffi.call/cls_double_va.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_float.c [moved from libffi/testsuite/libffi.call/cls_float.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_longdouble.c [moved from libffi/testsuite/libffi.call/cls_longdouble.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_longdouble_va.c [moved from libffi/testsuite/libffi.call/cls_longdouble_va.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_many_mixed_args.c [moved from libffi/testsuite/libffi.call/cls_many_mixed_args.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c [moved from libffi/testsuite/libffi.call/cls_many_mixed_float_double.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_multi_schar.c [moved from libffi/testsuite/libffi.call/cls_multi_schar.c with 96% similarity]
libffi/testsuite/libffi.closures/cls_multi_sshort.c [moved from libffi/testsuite/libffi.call/cls_multi_sshort.c with 96% similarity]
libffi/testsuite/libffi.closures/cls_multi_sshortchar.c [moved from libffi/testsuite/libffi.call/cls_multi_sshortchar.c with 96% similarity]
libffi/testsuite/libffi.closures/cls_multi_uchar.c [moved from libffi/testsuite/libffi.call/cls_multi_uchar.c with 96% similarity]
libffi/testsuite/libffi.closures/cls_multi_ushort.c [moved from libffi/testsuite/libffi.call/cls_multi_ushort.c with 95% similarity]
libffi/testsuite/libffi.closures/cls_multi_ushortchar.c [moved from libffi/testsuite/libffi.call/cls_multi_ushortchar.c with 96% similarity]
libffi/testsuite/libffi.closures/cls_pointer.c [moved from libffi/testsuite/libffi.call/cls_pointer.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_pointer_stack.c [moved from libffi/testsuite/libffi.call/cls_pointer_stack.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_schar.c [moved from libffi/testsuite/libffi.call/cls_schar.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_sint.c [moved from libffi/testsuite/libffi.call/cls_sint.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_sshort.c [moved from libffi/testsuite/libffi.call/cls_sshort.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_struct_va1.c [moved from libffi/testsuite/libffi.call/cls_struct_va1.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_uchar.c [moved from libffi/testsuite/libffi.call/cls_uchar.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_uint.c [moved from libffi/testsuite/libffi.call/cls_uint.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_uint_va.c [moved from libffi/testsuite/libffi.call/cls_uint_va.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_ulong_va.c [moved from libffi/testsuite/libffi.call/cls_ulong_va.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_ulonglong.c [moved from libffi/testsuite/libffi.call/cls_ulonglong.c with 100% similarity]
libffi/testsuite/libffi.closures/cls_ushort.c [moved from libffi/testsuite/libffi.call/cls_ushort.c with 100% similarity]
libffi/testsuite/libffi.closures/err_bad_abi.c [moved from libffi/testsuite/libffi.call/err_bad_abi.c with 100% similarity]
libffi/testsuite/libffi.closures/ffitest.h [new file with mode: 0644]
libffi/testsuite/libffi.closures/huge_struct.c [moved from libffi/testsuite/libffi.call/huge_struct.c with 99% similarity]
libffi/testsuite/libffi.closures/nested_struct.c [moved from libffi/testsuite/libffi.call/nested_struct.c with 98% similarity]
libffi/testsuite/libffi.closures/nested_struct1.c [moved from libffi/testsuite/libffi.call/nested_struct1.c with 98% similarity]
libffi/testsuite/libffi.closures/nested_struct10.c [moved from libffi/testsuite/libffi.call/nested_struct10.c with 99% similarity]
libffi/testsuite/libffi.closures/nested_struct11.c [moved from libffi/testsuite/libffi.call/nested_struct11.c with 100% similarity]
libffi/testsuite/libffi.closures/nested_struct12.c [new file with mode: 0644]
libffi/testsuite/libffi.closures/nested_struct13.c [moved from libffi/testsuite/libffi.call/nested_struct12.c with 88% similarity]
libffi/testsuite/libffi.closures/nested_struct2.c [moved from libffi/testsuite/libffi.call/nested_struct2.c with 98% similarity]
libffi/testsuite/libffi.closures/nested_struct3.c [moved from libffi/testsuite/libffi.call/nested_struct3.c with 98% similarity]
libffi/testsuite/libffi.closures/nested_struct4.c [moved from libffi/testsuite/libffi.call/nested_struct4.c with 100% similarity]
libffi/testsuite/libffi.closures/nested_struct5.c [moved from libffi/testsuite/libffi.call/nested_struct5.c with 100% similarity]
libffi/testsuite/libffi.closures/nested_struct6.c [moved from libffi/testsuite/libffi.call/nested_struct6.c with 100% similarity]
libffi/testsuite/libffi.closures/nested_struct7.c [moved from libffi/testsuite/libffi.call/nested_struct7.c with 100% similarity]
libffi/testsuite/libffi.closures/nested_struct8.c [moved from libffi/testsuite/libffi.call/nested_struct8.c with 100% similarity]
libffi/testsuite/libffi.closures/nested_struct9.c [moved from libffi/testsuite/libffi.call/nested_struct9.c with 100% similarity]
libffi/testsuite/libffi.closures/problem1.c [moved from libffi/testsuite/libffi.call/problem1.c with 100% similarity]
libffi/testsuite/libffi.closures/single_entry_structs1.c [new file with mode: 0644]
libffi/testsuite/libffi.closures/single_entry_structs2.c [new file with mode: 0644]
libffi/testsuite/libffi.closures/single_entry_structs3.c [new file with mode: 0644]
libffi/testsuite/libffi.closures/stret_large.c [moved from libffi/testsuite/libffi.call/stret_large.c with 100% similarity]
libffi/testsuite/libffi.closures/stret_large2.c [moved from libffi/testsuite/libffi.call/stret_large2.c with 100% similarity]
libffi/testsuite/libffi.closures/stret_medium.c [moved from libffi/testsuite/libffi.call/stret_medium.c with 98% similarity]
libffi/testsuite/libffi.closures/stret_medium2.c [moved from libffi/testsuite/libffi.call/stret_medium2.c with 98% similarity]
libffi/testsuite/libffi.closures/testclosure.c [moved from libffi/testsuite/libffi.call/testclosure.c with 95% similarity]
libffi/testsuite/libffi.closures/unwindtest.cc [moved from libffi/testsuite/libffi.special/unwindtest.cc with 95% similarity]
libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc [moved from libffi/testsuite/libffi.special/unwindtest_ffi_call.cc with 94% similarity]
libffi/testsuite/libffi.go/static-chain.h
libffi/testsuite/libffi.special/ffitestcxx.h [deleted file]
libffi/testsuite/libffi.special/special.exp [deleted file]

diff --git a/libffi/.gitattributes b/libffi/.gitattributes
new file mode 100644 (file)
index 0000000..f7d3833
--- /dev/null
@@ -0,0 +1,4 @@
+*      text=auto
+
+*.sln  text eol=crlf
+*.vcxproj*     text eol=crlf
index a66fab4f25a05b6b7d2ac8b438e86214c02135b8..e4034b09af090e5d0fc55cc6500567672ceadb6c 100644 (file)
@@ -1,4 +1,4 @@
-libffi - Copyright (c) 1996-2014  Anthony Green, Red Hat, Inc and others.
+libffi - Copyright (c) 1996-2021  Anthony Green, Red Hat, Inc and others.
 See source files for details.
 
 Permission is hereby granted, free of charge, to any person obtaining
diff --git a/libffi/LICENSE-BUILDTOOLS b/libffi/LICENSE-BUILDTOOLS
new file mode 100644 (file)
index 0000000..d1d626e
--- /dev/null
@@ -0,0 +1,353 @@
+The libffi source distribution contains certain code that is not part
+of libffi, and is only used as tooling to assist with the building and
+testing of libffi.  This includes the msvcc.sh script used to wrap the
+Microsoft compiler with GNU compatible command-line options,
+make_sunver.pl, and the libffi test code distributed in the
+testsuite/libffi.bhaible directory.  This code is distributed with
+libffi for the purpose of convenience only, and libffi is in no way
+derived from this code.
+
+msvcc.sh an testsuite/libffi.bhaible are both distributed under the
+terms of the GNU GPL version 2, as below.
+
+
+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    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.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/libffi/MERGE b/libffi/MERGE
new file mode 100644 (file)
index 0000000..fd0076e
--- /dev/null
@@ -0,0 +1,4 @@
+f9ea41683444ebe11cfa45b05223899764df28fb
+
+The first line of this file holds the git revision number of the
+last merge done from the master library sources.
index 203b7d10a4224de044f69e3d4530a4888a51248c..1b18198ad18c789ae4b3e0d801ec0c43fc57e0a7 100644 (file)
 ## Process this with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = foreign subdir-objects info-in-builddir
+AUTOMAKE_OPTIONS = foreign subdir-objects
 
-ACLOCAL_AMFLAGS = -I .. -I ../config
+ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = include testsuite man
+if BUILD_DOCS
+## This hack is needed because it doesn't seem possible to make a
+## conditional info_TEXINFOS in Automake.  At least Automake 1.14
+## either gives errors -- if this attempted in the most
+## straightforward way -- or simply unconditionally tries to build the
+## info file.
+SUBDIRS += doc
+endif
 
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj                     \
-       ChangeLog.libffi ChangeLog.libffi-3.1                           \
+EXTRA_DIST = LICENSE ChangeLog.old                                     \
        m4/libtool.m4 m4/lt~obsolete.m4                                 \
         m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
         m4/ltversion.m4 src/debug.c msvcc.sh                           \
        generate-darwin-source-and-headers.py                           \
        libffi.xcodeproj/project.pbxproj                                \
-       libtool-ldflags
+       libtool-ldflags libtool-version configure.host README.md        \
+       libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl      
 
 # local.exp is generated by configure
 DISTCLEANFILES = local.exp
 
-# Automake Documentation:
-# If your package has Texinfo files in many directories, you can use the
-# variable TEXINFO_TEX to tell Automake where to find the canonical
-# `texinfo.tex' for your package. The value of this variable should be
-# the relative path from the current `Makefile.am' to `texinfo.tex'.
-TEXINFO_TEX   = ../gcc/doc/include/texinfo.tex
-
-# Defines info, dvi, pdf and html targets
-MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
-info_TEXINFOS = doc/libffi.texi
-
-# AM_CONDITIONAL on configure option --generated-files-in-srcdir
-if GENINSRC
-STAMP_GENINSRC = stamp-geninsrc
-else
-STAMP_GENINSRC =
-endif
-
-# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
-if BUILD_INFO
-STAMP_BUILD_INFO = stamp-build-info
-else
-STAMP_BUILD_INFO =
-endif
-
-all-local: $(STAMP_GENINSRC)
-
-stamp-geninsrc: doc/libffi.info
-       cp -p $(top_builddir)/doc/libffi.info $(srcdir)/doc/libffi.info
-       @touch $@
-
-doc/libffi.info: $(STAMP_BUILD_INFO)
-
-stamp-build-info: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)/doc -o doc/libffi.info $(srcdir)/doc/libffi.texi
-       @touch $@
-
-CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO)
-MAINTAINERCLEANFILES = $(srcdir)/doc/libffi.info
-
-## ################################################################
-
-##
-## This section is for make and multilib madness.
-##
-
-# Work around what appears to be a GNU make bug handling MAKEFLAGS
-# 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)"
-
 # Subdir rules rely on $(FLAGS_TO_PASS)
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 
@@ -114,82 +38,62 @@ toolexeclib_LTLIBRARIES = libffi.la
 noinst_LTLIBRARIES = libffi_convenience.la
 
 libffi_la_SOURCES = src/prep_cif.c src/types.c \
-               src/raw_api.c src/java_raw_api.c src/closures.c
+               src/raw_api.c src/java_raw_api.c src/closures.c \
+               src/tramp.c
 
 if FFI_DEBUG
 libffi_la_SOURCES += src/debug.c
 endif
 
-noinst_HEADERS = \
-       src/aarch64/ffitarget.h src/aarch64/internal.h                  \
+noinst_HEADERS = src/aarch64/ffitarget.h src/aarch64/internal.h                \
        src/alpha/ffitarget.h src/alpha/internal.h                      \
-       src/arc/ffitarget.h                                             \
-       src/arm/ffitarget.h src/arm/internal.h                          \
-       src/avr32/ffitarget.h                                           \
-       src/bfin/ffitarget.h                                            \
-       src/cris/ffitarget.h                                            \
-       src/frv/ffitarget.h                                             \
+       src/arc/ffitarget.h src/arm/ffitarget.h src/arm/internal.h      \
+       src/avr32/ffitarget.h src/bfin/ffitarget.h                      \
+       src/cris/ffitarget.h src/csky/ffitarget.h src/frv/ffitarget.h   \
        src/ia64/ffitarget.h src/ia64/ia64_flags.h                      \
-       src/m32r/ffitarget.h                                            \
-       src/m68k/ffitarget.h                                            \
-       src/m88k/ffitarget.h                                            \
-       src/metag/ffitarget.h                                           \
-       src/microblaze/ffitarget.h                                      \
-       src/mips/ffitarget.h                                            \
-       src/moxie/ffitarget.h                                           \
-       src/nios2/ffitarget.h                                           \
-       src/or1k/ffitarget.h                                            \
-       src/pa/ffitarget.h                                              \
-       src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
-       src/riscv/ffitarget.h                                           \
-       src/s390/ffitarget.h                                            \
-       src/sh/ffitarget.h                                              \
-       src/sh64/ffitarget.h                                            \
-       src/sparc/ffitarget.h src/sparc/internal.h                      \
-       src/tile/ffitarget.h                                            \
-       src/vax/ffitarget.h                                             \
+       src/m32r/ffitarget.h src/m68k/ffitarget.h                       \
+       src/m88k/ffitarget.h src/metag/ffitarget.h                      \
+       src/microblaze/ffitarget.h src/mips/ffitarget.h                 \
+       src/moxie/ffitarget.h src/nios2/ffitarget.h                     \
+       src/or1k/ffitarget.h src/pa/ffitarget.h                         \
+       src/powerpc/ffitarget.h src/powerpc/asm.h                       \
+       src/powerpc/ffi_powerpc.h src/riscv/ffitarget.h                 \
+       src/s390/ffitarget.h src/s390/internal.h src/sh/ffitarget.h     \
+       src/sh64/ffitarget.h src/sparc/ffitarget.h                      \
+       src/sparc/internal.h src/tile/ffitarget.h src/vax/ffitarget.h   \
        src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h     \
-       src/xtensa/ffitarget.h                                          \
-       src/dlmalloc.c
-
-EXTRA_libffi_la_SOURCES = \
-       src/aarch64/ffi.c src/aarch64/sysv.S                            \
-       src/alpha/ffi.c src/alpha/osf.S                                 \
-       src/arc/ffi.c src/arc/arcompact.S                               \
-       src/arm/ffi.c src/arm/sysv.S                                    \
-       src/avr32/ffi.c src/avr32/sysv.S                                \
-       src/bfin/ffi.c src/bfin/sysv.S                                  \
-       src/cris/ffi.c src/cris/sysv.S                                  \
-       src/frv/ffi.c src/frv/eabi.S                                    \
-       src/ia64/ffi.c src/ia64/unix.S                                  \
-       src/m32r/ffi.c src/m32r/sysv.S                                  \
-       src/m68k/ffi.c src/m68k/sysv.S                                  \
-       src/m88k/ffi.c src/m88k/obsd.S                                  \
-       src/metag/ffi.c src/metag/sysv.S                                \
-       src/microblaze/ffi.c src/microblaze/sysv.S                      \
-       src/mips/ffi.c src/mips/o32.S src/mips/n32.S                    \
-       src/moxie/ffi.c src/moxie/eabi.S                                \
-       src/nios2/ffi.c src/nios2/sysv.S                                \
-       src/or1k/ffi.c src/or1k/sysv.S                                  \
-       src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S                     \
-       src/powerpc/ffi.c 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/aix.S src/powerpc/darwin.S src/powerpc/aix_closure.S \
-        src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c          \
-       src/riscv/ffi.c src/riscv/sysv.S                                \
-       src/s390/ffi.c src/s390/sysv.S                                  \
-       src/sh/ffi.c src/sh/sysv.S                                      \
-       src/sh64/ffi.c src/sh64/sysv.S                                  \
-       src/sparc/ffi.c src/sparc/ffi64.c src/sparc/v8.S src/sparc/v9.S \
-       src/tile/ffi.c src/tile/tile.S                                  \
-       src/vax/ffi.c src/vax/elfbsd.S                                  \
-       src/x86/ffi.c src/x86/sysv.S                                    \
-        src/x86/ffiw64.c src/x86/win64.S                               \
-        src/x86/ffi64.c src/x86/unix64.S                               \
-        src/x86/darwin64.S src/x86/darwin.S                            \
-        src/x86/darwin64_c.c src/x86/darwin_c.c                        \
-       src/xtensa/ffi.c src/xtensa/sysv.S
+       src/x86/asmnames.h src/xtensa/ffitarget.h src/dlmalloc.c        \
+       src/kvx/ffitarget.h
+
+EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S         \
+       src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S      \
+       src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c                 \
+       src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S          \
+       src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c                 \
+       src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c    \
+       src/csky/ffi.c src/csky/sysv.S src/frv/eabi.S src/ia64/ffi.c    \
+       src/ia64/unix.S src/m32r/ffi.c src/m32r/sysv.S src/m68k/ffi.c   \
+       src/m68k/sysv.S src/m88k/ffi.c src/m88k/obsd.S                  \
+       src/metag/ffi.c src/metag/sysv.S src/microblaze/ffi.c           \
+       src/microblaze/sysv.S src/mips/ffi.c src/mips/o32.S             \
+       src/mips/n32.S src/moxie/ffi.c src/moxie/eabi.S                 \
+       src/nios2/ffi.c src/nios2/sysv.S src/or1k/ffi.c                 \
+       src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S     \
+       src/powerpc/ffi.c 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/aix.S                     \
+       src/powerpc/darwin.S src/powerpc/aix_closure.S                  \
+       src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c           \
+       src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c                 \
+       src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c       \
+       src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c               \
+       src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S    \
+       src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S     \
+       src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c                \
+       src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S     \
+       src/xtensa/ffi.c src/xtensa/sysv.S src/kvx/ffi.c                \
+       src/kvx/sysv.S
 
 TARGET_OBJ = @TARGET_OBJ@
 libffi_la_LIBADD = $(TARGET_OBJ)
@@ -200,26 +104,26 @@ libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
 libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
 
-AM_CFLAGS = -Wall -g -fexceptions
+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
 
-if LIBAT_BUILD_VERSIONED_SHLIB
-if LIBAT_BUILD_VERSIONED_SHLIB_GNU
+if LIBFFI_BUILD_VERSIONED_SHLIB
+if LIBFFI_BUILD_VERSIONED_SHLIB_GNU
 libffi_version_script = -Wl,--version-script,libffi.map
 libffi_version_dep = libffi.map
 endif
-if LIBAT_BUILD_VERSIONED_SHLIB_SUN
+if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
 libffi_version_script = -Wl,-M,libffi.map-sun
 libffi_version_dep = libffi.map-sun
-libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
-                $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
-       perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
+libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \
+                $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
+       perl $(top_srcdir)/make_sunver.pl libffi.map \
         `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
            sed 's,\([^/        ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
         > $@ || (rm -f $@ ; exit 1)
@@ -231,7 +135,8 @@ endif
 libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
 
 libffi.map: $(top_srcdir)/libffi.map.in
-       $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
+       $(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \
+        -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in
 
 libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
 libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
@@ -239,12 +144,8 @@ libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
-# Multilib support.  Automake should provide these on its own.
-all-recursive: all-multi
-install-recursive: install-multi
-mostlyclean-recursive: mostlyclean-multi
-clean-recursive: clean-multi
-distclean-recursive: distclean-multi
-maintainer-clean-recursive: maintainer-clean-multi
+dist-hook:
+       d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc)
+       if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
+       s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md
 
-include $(top_srcdir)/../multilib.am
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
deleted file mode 100644 (file)
index 745bdd8..0000000
+++ /dev/null
@@ -1,1944 +0,0 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-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 \
-      *\\[\ \  ]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
-    esac; \
-  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@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-@FFI_DEBUG_TRUE@am__append_1 = src/debug.c
-# Build debug. Define FFI_DEBUG on the commandline so that, when building with
-# MSVC, it can link against the debug CRT.
-@FFI_DEBUG_TRUE@am__append_2 = -DFFI_DEBUG
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
-       $(top_srcdir)/../config/asmcfi.m4 \
-       $(top_srcdir)/../config/depstand.m4 \
-       $(top_srcdir)/../config/lead-dot.m4 \
-       $(top_srcdir)/../config/multi.m4 \
-       $(top_srcdir)/../config/override.m4 \
-       $(top_srcdir)/../config/toolexeclibdir.m4 \
-       $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
-       $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
-       $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
-       $(am__configure_deps) $(srcdir)/doc/version.texi \
-       $(srcdir)/doc/stamp-vti $(noinst_HEADERS)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = fficonfig.h
-CONFIG_CLEAN_FILES = libffi.pc
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
-       "$(DESTDIR)$(pkgconfigdir)"
-LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-am__dirstamp = $(am__leading_dot)dirstamp
-@FFI_DEBUG_TRUE@am__objects_1 = src/debug.lo
-am_libffi_la_OBJECTS = src/prep_cif.lo src/types.lo src/raw_api.lo \
-       src/java_raw_api.lo src/closures.lo $(am__objects_1)
-libffi_la_OBJECTS = $(am_libffi_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
-am__objects_2 = src/prep_cif.lo src/types.lo src/raw_api.lo \
-       src/java_raw_api.lo src/closures.lo $(am__objects_1)
-am_libffi_convenience_la_OBJECTS = $(am__objects_2)
-nodist_libffi_convenience_la_OBJECTS =
-libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
-       $(nodist_libffi_convenience_la_OBJECTS)
-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 = 
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/../depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CCASFLAGS) $(CCASFLAGS)
-AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
-am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
-am__v_CPPAS_0 = @echo "  CPPAS   " $@;
-am__v_CPPAS_1 = 
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libffi_la_SOURCES) $(EXTRA_libffi_la_SOURCES) \
-       $(libffi_convenience_la_SOURCES) \
-       $(EXTRA_libffi_convenience_la_SOURCES) \
-       $(nodist_libffi_convenience_la_SOURCES)
-AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
-am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
-am__v_DVIPS_0 = @echo "  DVIPS   " $@;
-am__v_DVIPS_1 = 
-AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
-am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
-am__v_MAKEINFO_0 = @echo "  MAKEINFO" $@;
-am__v_MAKEINFO_1 = 
-AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
-am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
-am__v_INFOHTML_0 = @echo "  INFOHTML" $@;
-am__v_INFOHTML_1 = 
-AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
-am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
-am__v_TEXI2DVI_0 = @echo "  TEXI2DVI" $@;
-am__v_TEXI2DVI_1 = 
-AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
-am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
-am__v_TEXI2PDF_0 = @echo "  TEXI2PDF" $@;
-am__v_TEXI2PDF_1 = 
-AM_V_texinfo = $(am__v_texinfo_@AM_V@)
-am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
-am__v_texinfo_0 = -q
-am__v_texinfo_1 = 
-AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
-am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
-am__v_texidevnull_0 = > /dev/null
-am__v_texidevnull_1 = 
-INFO_DEPS = doc/libffi.info
-am__TEXINFO_TEX_DIR = $(srcdir)/../gcc/doc/include
-DVIS = doc/libffi.dvi
-PDFS = doc/libffi.pdf
-PSS = doc/libffi.ps
-HTMLS = doc/libffi.html
-TEXINFOS = doc/libffi.texi
-TEXI2DVI = texi2dvi
-TEXI2PDF = $(TEXI2DVI) --pdf --batch
-MAKEINFOHTML = $(MAKEINFO) --html
-AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
-DVIPS = dvips
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-       ctags-recursive dvi-recursive html-recursive info-recursive \
-       install-data-recursive install-dvi-recursive \
-       install-exec-recursive install-html-recursive \
-       install-info-recursive install-pdf-recursive \
-       install-ps-recursive install-recursive installcheck-recursive \
-       installdirs-recursive pdf-recursive ps-recursive \
-       tags-recursive uninstall-recursive
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-DATA = $(pkgconfig_DATA)
-HEADERS = $(noinst_HEADERS)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       cscope
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
-       $(LISP)fficonfig.h.in
-# 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
-CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-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@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OPT_LDFLAGS = @OPT_LDFLAGS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-TARGET_OBJ = @TARGET_OBJ@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-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@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-get_gcc_base_ver = @get_gcc_base_ver@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-multi_basedir = @multi_basedir@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign subdir-objects info-in-builddir
-ACLOCAL_AMFLAGS = -I .. -I ../config
-SUBDIRS = include testsuite man
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj                     \
-       ChangeLog.libffi ChangeLog.libffi-3.1                           \
-       m4/libtool.m4 m4/lt~obsolete.m4                                 \
-        m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
-        m4/ltversion.m4 src/debug.c msvcc.sh                           \
-       generate-darwin-source-and-headers.py                           \
-       libffi.xcodeproj/project.pbxproj                                \
-       libtool-ldflags
-
-
-# local.exp is generated by configure
-DISTCLEANFILES = local.exp
-
-# Automake Documentation:
-# If your package has Texinfo files in many directories, you can use the
-# variable TEXINFO_TEX to tell Automake where to find the canonical
-# `texinfo.tex' for your package. The value of this variable should be
-# the relative path from the current `Makefile.am' to `texinfo.tex'.
-TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
-
-# Defines info, dvi, pdf and html targets
-MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
-info_TEXINFOS = doc/libffi.texi
-@GENINSRC_FALSE@STAMP_GENINSRC = 
-
-# AM_CONDITIONAL on configure option --generated-files-in-srcdir
-@GENINSRC_TRUE@STAMP_GENINSRC = stamp-geninsrc
-@BUILD_INFO_FALSE@STAMP_BUILD_INFO = 
-
-# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
-@BUILD_INFO_TRUE@STAMP_BUILD_INFO = stamp-build-info
-CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO)
-MAINTAINERCLEANFILES = $(srcdir)/doc/libffi.info
-
-# Work around what appears to be a GNU make bug handling MAKEFLAGS
-# 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)"
-
-
-# Subdir rules rely on $(FLAGS_TO_PASS)
-FLAGS_TO_PASS = $(AM_MAKEFLAGS)
-MAKEOVERRIDES = 
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libffi.pc
-toolexeclib_LTLIBRARIES = libffi.la
-noinst_LTLIBRARIES = libffi_convenience.la
-libffi_la_SOURCES = src/prep_cif.c src/types.c src/raw_api.c \
-       src/java_raw_api.c src/closures.c $(am__append_1)
-noinst_HEADERS = \
-       src/aarch64/ffitarget.h src/aarch64/internal.h                  \
-       src/alpha/ffitarget.h src/alpha/internal.h                      \
-       src/arc/ffitarget.h                                             \
-       src/arm/ffitarget.h src/arm/internal.h                          \
-       src/avr32/ffitarget.h                                           \
-       src/bfin/ffitarget.h                                            \
-       src/cris/ffitarget.h                                            \
-       src/frv/ffitarget.h                                             \
-       src/ia64/ffitarget.h src/ia64/ia64_flags.h                      \
-       src/m32r/ffitarget.h                                            \
-       src/m68k/ffitarget.h                                            \
-       src/m88k/ffitarget.h                                            \
-       src/metag/ffitarget.h                                           \
-       src/microblaze/ffitarget.h                                      \
-       src/mips/ffitarget.h                                            \
-       src/moxie/ffitarget.h                                           \
-       src/nios2/ffitarget.h                                           \
-       src/or1k/ffitarget.h                                            \
-       src/pa/ffitarget.h                                              \
-       src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
-       src/riscv/ffitarget.h                                           \
-       src/s390/ffitarget.h                                            \
-       src/sh/ffitarget.h                                              \
-       src/sh64/ffitarget.h                                            \
-       src/sparc/ffitarget.h src/sparc/internal.h                      \
-       src/tile/ffitarget.h                                            \
-       src/vax/ffitarget.h                                             \
-       src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h     \
-       src/xtensa/ffitarget.h                                          \
-       src/dlmalloc.c
-
-EXTRA_libffi_la_SOURCES = \
-       src/aarch64/ffi.c src/aarch64/sysv.S                            \
-       src/alpha/ffi.c src/alpha/osf.S                                 \
-       src/arc/ffi.c src/arc/arcompact.S                               \
-       src/arm/ffi.c src/arm/sysv.S                                    \
-       src/avr32/ffi.c src/avr32/sysv.S                                \
-       src/bfin/ffi.c src/bfin/sysv.S                                  \
-       src/cris/ffi.c src/cris/sysv.S                                  \
-       src/frv/ffi.c src/frv/eabi.S                                    \
-       src/ia64/ffi.c src/ia64/unix.S                                  \
-       src/m32r/ffi.c src/m32r/sysv.S                                  \
-       src/m68k/ffi.c src/m68k/sysv.S                                  \
-       src/m88k/ffi.c src/m88k/obsd.S                                  \
-       src/metag/ffi.c src/metag/sysv.S                                \
-       src/microblaze/ffi.c src/microblaze/sysv.S                      \
-       src/mips/ffi.c src/mips/o32.S src/mips/n32.S                    \
-       src/moxie/ffi.c src/moxie/eabi.S                                \
-       src/nios2/ffi.c src/nios2/sysv.S                                \
-       src/or1k/ffi.c src/or1k/sysv.S                                  \
-       src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S                     \
-       src/powerpc/ffi.c 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/aix.S src/powerpc/darwin.S src/powerpc/aix_closure.S \
-        src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c          \
-       src/riscv/ffi.c src/riscv/sysv.S                                \
-       src/s390/ffi.c src/s390/sysv.S                                  \
-       src/sh/ffi.c src/sh/sysv.S                                      \
-       src/sh64/ffi.c src/sh64/sysv.S                                  \
-       src/sparc/ffi.c src/sparc/ffi64.c src/sparc/v8.S src/sparc/v9.S \
-       src/tile/ffi.c src/tile/tile.S                                  \
-       src/vax/ffi.c src/vax/elfbsd.S                                  \
-       src/x86/ffi.c src/x86/sysv.S                                    \
-        src/x86/ffiw64.c src/x86/win64.S                               \
-        src/x86/ffi64.c src/x86/unix64.S                               \
-        src/x86/darwin64.S src/x86/darwin.S                            \
-        src/x86/darwin64_c.c src/x86/darwin_c.c                        \
-       src/xtensa/ffi.c src/xtensa/sysv.S
-
-libffi_la_LIBADD = $(TARGET_OBJ)
-libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
-EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES)
-libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
-libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
-nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
-AM_CFLAGS = -Wall -g -fexceptions $(am__append_2)
-@LIBAT_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_script = 
-@LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_script = -Wl,--version-script,libffi.map
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_script = -Wl,-M,libffi.map-sun
-@LIBAT_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = 
-@LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun
-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
-libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
-libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
-AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
-AM_CCASFLAGS = $(AM_CPPFLAGS)
-MULTISRCTOP = 
-MULTIBUILDTOP = 
-MULTIDIRS = 
-MULTISUBDIR = 
-MULTIDO = true
-MULTICLEAN = true
-all: fficonfig.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .S .c .dvi .lo .o .obj .ps
-am--refresh: Makefile
-       @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../multilib.am $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
-             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
-               && exit 0; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
-       $(am__cd) $(top_srcdir) && \
-         $(AUTOMAKE) --foreign Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           echo ' $(SHELL) ./config.status'; \
-           $(SHELL) ./config.status;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
-       esac;
-$(top_srcdir)/../multilib.am $(am__empty):
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-       $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-fficonfig.h: stamp-h1
-       @test -f $@ || rm -f stamp-h1
-       @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
-
-stamp-h1: $(srcdir)/fficonfig.h.in $(top_builddir)/config.status
-       @rm -f stamp-h1
-       cd $(top_builddir) && $(SHELL) ./config.status fficonfig.h
-$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
-       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
-       rm -f stamp-h1
-       touch $@
-
-distclean-hdr:
-       -rm -f fficonfig.h stamp-h1
-libffi.pc: $(top_builddir)/config.status $(srcdir)/libffi.pc.in
-       cd $(top_builddir) && $(SHELL) ./config.status $@
-
-clean-noinstLTLIBRARIES:
-       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-       @list='$(noinst_LTLIBRARIES)'; \
-       locs=`for p in $$list; do echo $$p; done | \
-             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-             sort -u`; \
-       test -z "$$locs" || { \
-         echo rm -f $${locs}; \
-         rm -f $${locs}; \
-       }
-
-install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
-       @$(NORMAL_INSTALL)
-       @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
-       list2=; for p in $$list; do \
-         if test -f $$p; then \
-           list2="$$list2 $$p"; \
-         else :; fi; \
-       done; \
-       test -z "$$list2" || { \
-         echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \
-       }
-
-uninstall-toolexeclibLTLIBRARIES:
-       @$(NORMAL_UNINSTALL)
-       @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$f"; \
-       done
-
-clean-toolexeclibLTLIBRARIES:
-       -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
-       @list='$(toolexeclib_LTLIBRARIES)'; \
-       locs=`for p in $$list; do echo $$p; done | \
-             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-             sort -u`; \
-       test -z "$$locs" || { \
-         echo rm -f $${locs}; \
-         rm -f $${locs}; \
-       }
-src/$(am__dirstamp):
-       @$(MKDIR_P) src
-       @: > src/$(am__dirstamp)
-src/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/$(DEPDIR)
-       @: > src/$(DEPDIR)/$(am__dirstamp)
-src/prep_cif.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/types.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/java_raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/closures.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/debug.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/aarch64/$(am__dirstamp):
-       @$(MKDIR_P) src/aarch64
-       @: > src/aarch64/$(am__dirstamp)
-src/aarch64/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/aarch64/$(DEPDIR)
-       @: > src/aarch64/$(DEPDIR)/$(am__dirstamp)
-src/aarch64/ffi.lo: src/aarch64/$(am__dirstamp) \
-       src/aarch64/$(DEPDIR)/$(am__dirstamp)
-src/aarch64/sysv.lo: src/aarch64/$(am__dirstamp) \
-       src/aarch64/$(DEPDIR)/$(am__dirstamp)
-src/alpha/$(am__dirstamp):
-       @$(MKDIR_P) src/alpha
-       @: > src/alpha/$(am__dirstamp)
-src/alpha/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/alpha/$(DEPDIR)
-       @: > src/alpha/$(DEPDIR)/$(am__dirstamp)
-src/alpha/ffi.lo: src/alpha/$(am__dirstamp) \
-       src/alpha/$(DEPDIR)/$(am__dirstamp)
-src/alpha/osf.lo: src/alpha/$(am__dirstamp) \
-       src/alpha/$(DEPDIR)/$(am__dirstamp)
-src/arc/$(am__dirstamp):
-       @$(MKDIR_P) src/arc
-       @: > src/arc/$(am__dirstamp)
-src/arc/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/arc/$(DEPDIR)
-       @: > src/arc/$(DEPDIR)/$(am__dirstamp)
-src/arc/ffi.lo: src/arc/$(am__dirstamp) \
-       src/arc/$(DEPDIR)/$(am__dirstamp)
-src/arc/arcompact.lo: src/arc/$(am__dirstamp) \
-       src/arc/$(DEPDIR)/$(am__dirstamp)
-src/arm/$(am__dirstamp):
-       @$(MKDIR_P) src/arm
-       @: > src/arm/$(am__dirstamp)
-src/arm/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/arm/$(DEPDIR)
-       @: > src/arm/$(DEPDIR)/$(am__dirstamp)
-src/arm/ffi.lo: src/arm/$(am__dirstamp) \
-       src/arm/$(DEPDIR)/$(am__dirstamp)
-src/arm/sysv.lo: src/arm/$(am__dirstamp) \
-       src/arm/$(DEPDIR)/$(am__dirstamp)
-src/avr32/$(am__dirstamp):
-       @$(MKDIR_P) src/avr32
-       @: > src/avr32/$(am__dirstamp)
-src/avr32/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/avr32/$(DEPDIR)
-       @: > src/avr32/$(DEPDIR)/$(am__dirstamp)
-src/avr32/ffi.lo: src/avr32/$(am__dirstamp) \
-       src/avr32/$(DEPDIR)/$(am__dirstamp)
-src/avr32/sysv.lo: src/avr32/$(am__dirstamp) \
-       src/avr32/$(DEPDIR)/$(am__dirstamp)
-src/bfin/$(am__dirstamp):
-       @$(MKDIR_P) src/bfin
-       @: > src/bfin/$(am__dirstamp)
-src/bfin/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/bfin/$(DEPDIR)
-       @: > src/bfin/$(DEPDIR)/$(am__dirstamp)
-src/bfin/ffi.lo: src/bfin/$(am__dirstamp) \
-       src/bfin/$(DEPDIR)/$(am__dirstamp)
-src/bfin/sysv.lo: src/bfin/$(am__dirstamp) \
-       src/bfin/$(DEPDIR)/$(am__dirstamp)
-src/cris/$(am__dirstamp):
-       @$(MKDIR_P) src/cris
-       @: > src/cris/$(am__dirstamp)
-src/cris/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/cris/$(DEPDIR)
-       @: > src/cris/$(DEPDIR)/$(am__dirstamp)
-src/cris/ffi.lo: src/cris/$(am__dirstamp) \
-       src/cris/$(DEPDIR)/$(am__dirstamp)
-src/cris/sysv.lo: src/cris/$(am__dirstamp) \
-       src/cris/$(DEPDIR)/$(am__dirstamp)
-src/frv/$(am__dirstamp):
-       @$(MKDIR_P) src/frv
-       @: > src/frv/$(am__dirstamp)
-src/frv/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/frv/$(DEPDIR)
-       @: > src/frv/$(DEPDIR)/$(am__dirstamp)
-src/frv/ffi.lo: src/frv/$(am__dirstamp) \
-       src/frv/$(DEPDIR)/$(am__dirstamp)
-src/frv/eabi.lo: src/frv/$(am__dirstamp) \
-       src/frv/$(DEPDIR)/$(am__dirstamp)
-src/ia64/$(am__dirstamp):
-       @$(MKDIR_P) src/ia64
-       @: > src/ia64/$(am__dirstamp)
-src/ia64/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/ia64/$(DEPDIR)
-       @: > src/ia64/$(DEPDIR)/$(am__dirstamp)
-src/ia64/ffi.lo: src/ia64/$(am__dirstamp) \
-       src/ia64/$(DEPDIR)/$(am__dirstamp)
-src/ia64/unix.lo: src/ia64/$(am__dirstamp) \
-       src/ia64/$(DEPDIR)/$(am__dirstamp)
-src/m32r/$(am__dirstamp):
-       @$(MKDIR_P) src/m32r
-       @: > src/m32r/$(am__dirstamp)
-src/m32r/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/m32r/$(DEPDIR)
-       @: > src/m32r/$(DEPDIR)/$(am__dirstamp)
-src/m32r/ffi.lo: src/m32r/$(am__dirstamp) \
-       src/m32r/$(DEPDIR)/$(am__dirstamp)
-src/m32r/sysv.lo: src/m32r/$(am__dirstamp) \
-       src/m32r/$(DEPDIR)/$(am__dirstamp)
-src/m68k/$(am__dirstamp):
-       @$(MKDIR_P) src/m68k
-       @: > src/m68k/$(am__dirstamp)
-src/m68k/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/m68k/$(DEPDIR)
-       @: > src/m68k/$(DEPDIR)/$(am__dirstamp)
-src/m68k/ffi.lo: src/m68k/$(am__dirstamp) \
-       src/m68k/$(DEPDIR)/$(am__dirstamp)
-src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \
-       src/m68k/$(DEPDIR)/$(am__dirstamp)
-src/m88k/$(am__dirstamp):
-       @$(MKDIR_P) src/m88k
-       @: > src/m88k/$(am__dirstamp)
-src/m88k/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/m88k/$(DEPDIR)
-       @: > src/m88k/$(DEPDIR)/$(am__dirstamp)
-src/m88k/ffi.lo: src/m88k/$(am__dirstamp) \
-       src/m88k/$(DEPDIR)/$(am__dirstamp)
-src/m88k/obsd.lo: src/m88k/$(am__dirstamp) \
-       src/m88k/$(DEPDIR)/$(am__dirstamp)
-src/metag/$(am__dirstamp):
-       @$(MKDIR_P) src/metag
-       @: > src/metag/$(am__dirstamp)
-src/metag/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/metag/$(DEPDIR)
-       @: > src/metag/$(DEPDIR)/$(am__dirstamp)
-src/metag/ffi.lo: src/metag/$(am__dirstamp) \
-       src/metag/$(DEPDIR)/$(am__dirstamp)
-src/metag/sysv.lo: src/metag/$(am__dirstamp) \
-       src/metag/$(DEPDIR)/$(am__dirstamp)
-src/microblaze/$(am__dirstamp):
-       @$(MKDIR_P) src/microblaze
-       @: > src/microblaze/$(am__dirstamp)
-src/microblaze/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/microblaze/$(DEPDIR)
-       @: > src/microblaze/$(DEPDIR)/$(am__dirstamp)
-src/microblaze/ffi.lo: src/microblaze/$(am__dirstamp) \
-       src/microblaze/$(DEPDIR)/$(am__dirstamp)
-src/microblaze/sysv.lo: src/microblaze/$(am__dirstamp) \
-       src/microblaze/$(DEPDIR)/$(am__dirstamp)
-src/mips/$(am__dirstamp):
-       @$(MKDIR_P) src/mips
-       @: > src/mips/$(am__dirstamp)
-src/mips/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/mips/$(DEPDIR)
-       @: > src/mips/$(DEPDIR)/$(am__dirstamp)
-src/mips/ffi.lo: src/mips/$(am__dirstamp) \
-       src/mips/$(DEPDIR)/$(am__dirstamp)
-src/mips/o32.lo: src/mips/$(am__dirstamp) \
-       src/mips/$(DEPDIR)/$(am__dirstamp)
-src/mips/n32.lo: src/mips/$(am__dirstamp) \
-       src/mips/$(DEPDIR)/$(am__dirstamp)
-src/moxie/$(am__dirstamp):
-       @$(MKDIR_P) src/moxie
-       @: > src/moxie/$(am__dirstamp)
-src/moxie/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/moxie/$(DEPDIR)
-       @: > src/moxie/$(DEPDIR)/$(am__dirstamp)
-src/moxie/ffi.lo: src/moxie/$(am__dirstamp) \
-       src/moxie/$(DEPDIR)/$(am__dirstamp)
-src/moxie/eabi.lo: src/moxie/$(am__dirstamp) \
-       src/moxie/$(DEPDIR)/$(am__dirstamp)
-src/nios2/$(am__dirstamp):
-       @$(MKDIR_P) src/nios2
-       @: > src/nios2/$(am__dirstamp)
-src/nios2/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/nios2/$(DEPDIR)
-       @: > src/nios2/$(DEPDIR)/$(am__dirstamp)
-src/nios2/ffi.lo: src/nios2/$(am__dirstamp) \
-       src/nios2/$(DEPDIR)/$(am__dirstamp)
-src/nios2/sysv.lo: src/nios2/$(am__dirstamp) \
-       src/nios2/$(DEPDIR)/$(am__dirstamp)
-src/or1k/$(am__dirstamp):
-       @$(MKDIR_P) src/or1k
-       @: > src/or1k/$(am__dirstamp)
-src/or1k/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/or1k/$(DEPDIR)
-       @: > src/or1k/$(DEPDIR)/$(am__dirstamp)
-src/or1k/ffi.lo: src/or1k/$(am__dirstamp) \
-       src/or1k/$(DEPDIR)/$(am__dirstamp)
-src/or1k/sysv.lo: src/or1k/$(am__dirstamp) \
-       src/or1k/$(DEPDIR)/$(am__dirstamp)
-src/pa/$(am__dirstamp):
-       @$(MKDIR_P) src/pa
-       @: > src/pa/$(am__dirstamp)
-src/pa/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/pa/$(DEPDIR)
-       @: > src/pa/$(DEPDIR)/$(am__dirstamp)
-src/pa/ffi.lo: src/pa/$(am__dirstamp) src/pa/$(DEPDIR)/$(am__dirstamp)
-src/pa/linux.lo: src/pa/$(am__dirstamp) \
-       src/pa/$(DEPDIR)/$(am__dirstamp)
-src/pa/hpux32.lo: src/pa/$(am__dirstamp) \
-       src/pa/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/$(am__dirstamp):
-       @$(MKDIR_P) src/powerpc
-       @: > src/powerpc/$(am__dirstamp)
-src/powerpc/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/powerpc/$(DEPDIR)
-       @: > src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi_sysv.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi_linux64.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/sysv.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/linux64.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/linux64_closure.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ppc_closure.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/aix.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/darwin.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/aix_closure.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/darwin_closure.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi_darwin.lo: src/powerpc/$(am__dirstamp) \
-       src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/riscv/$(am__dirstamp):
-       @$(MKDIR_P) src/riscv
-       @: > src/riscv/$(am__dirstamp)
-src/riscv/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/riscv/$(DEPDIR)
-       @: > src/riscv/$(DEPDIR)/$(am__dirstamp)
-src/riscv/ffi.lo: src/riscv/$(am__dirstamp) \
-       src/riscv/$(DEPDIR)/$(am__dirstamp)
-src/riscv/sysv.lo: src/riscv/$(am__dirstamp) \
-       src/riscv/$(DEPDIR)/$(am__dirstamp)
-src/s390/$(am__dirstamp):
-       @$(MKDIR_P) src/s390
-       @: > src/s390/$(am__dirstamp)
-src/s390/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/s390/$(DEPDIR)
-       @: > src/s390/$(DEPDIR)/$(am__dirstamp)
-src/s390/ffi.lo: src/s390/$(am__dirstamp) \
-       src/s390/$(DEPDIR)/$(am__dirstamp)
-src/s390/sysv.lo: src/s390/$(am__dirstamp) \
-       src/s390/$(DEPDIR)/$(am__dirstamp)
-src/sh/$(am__dirstamp):
-       @$(MKDIR_P) src/sh
-       @: > src/sh/$(am__dirstamp)
-src/sh/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/sh/$(DEPDIR)
-       @: > src/sh/$(DEPDIR)/$(am__dirstamp)
-src/sh/ffi.lo: src/sh/$(am__dirstamp) src/sh/$(DEPDIR)/$(am__dirstamp)
-src/sh/sysv.lo: src/sh/$(am__dirstamp) \
-       src/sh/$(DEPDIR)/$(am__dirstamp)
-src/sh64/$(am__dirstamp):
-       @$(MKDIR_P) src/sh64
-       @: > src/sh64/$(am__dirstamp)
-src/sh64/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/sh64/$(DEPDIR)
-       @: > src/sh64/$(DEPDIR)/$(am__dirstamp)
-src/sh64/ffi.lo: src/sh64/$(am__dirstamp) \
-       src/sh64/$(DEPDIR)/$(am__dirstamp)
-src/sh64/sysv.lo: src/sh64/$(am__dirstamp) \
-       src/sh64/$(DEPDIR)/$(am__dirstamp)
-src/sparc/$(am__dirstamp):
-       @$(MKDIR_P) src/sparc
-       @: > src/sparc/$(am__dirstamp)
-src/sparc/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/sparc/$(DEPDIR)
-       @: > src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/ffi.lo: src/sparc/$(am__dirstamp) \
-       src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/ffi64.lo: src/sparc/$(am__dirstamp) \
-       src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/v8.lo: src/sparc/$(am__dirstamp) \
-       src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/v9.lo: src/sparc/$(am__dirstamp) \
-       src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/tile/$(am__dirstamp):
-       @$(MKDIR_P) src/tile
-       @: > src/tile/$(am__dirstamp)
-src/tile/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/tile/$(DEPDIR)
-       @: > src/tile/$(DEPDIR)/$(am__dirstamp)
-src/tile/ffi.lo: src/tile/$(am__dirstamp) \
-       src/tile/$(DEPDIR)/$(am__dirstamp)
-src/tile/tile.lo: src/tile/$(am__dirstamp) \
-       src/tile/$(DEPDIR)/$(am__dirstamp)
-src/vax/$(am__dirstamp):
-       @$(MKDIR_P) src/vax
-       @: > src/vax/$(am__dirstamp)
-src/vax/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/vax/$(DEPDIR)
-       @: > src/vax/$(DEPDIR)/$(am__dirstamp)
-src/vax/ffi.lo: src/vax/$(am__dirstamp) \
-       src/vax/$(DEPDIR)/$(am__dirstamp)
-src/vax/elfbsd.lo: src/vax/$(am__dirstamp) \
-       src/vax/$(DEPDIR)/$(am__dirstamp)
-src/x86/$(am__dirstamp):
-       @$(MKDIR_P) src/x86
-       @: > src/x86/$(am__dirstamp)
-src/x86/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/x86/$(DEPDIR)
-       @: > src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/ffi.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/sysv.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/ffiw64.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/win64.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/ffi64.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/unix64.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/darwin64.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/darwin.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/darwin64_c.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/darwin_c.lo: src/x86/$(am__dirstamp) \
-       src/x86/$(DEPDIR)/$(am__dirstamp)
-src/xtensa/$(am__dirstamp):
-       @$(MKDIR_P) src/xtensa
-       @: > src/xtensa/$(am__dirstamp)
-src/xtensa/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/xtensa/$(DEPDIR)
-       @: > src/xtensa/$(DEPDIR)/$(am__dirstamp)
-src/xtensa/ffi.lo: src/xtensa/$(am__dirstamp) \
-       src/xtensa/$(DEPDIR)/$(am__dirstamp)
-src/xtensa/sysv.lo: src/xtensa/$(am__dirstamp) \
-       src/xtensa/$(DEPDIR)/$(am__dirstamp)
-
-libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(EXTRA_libffi_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS)
-
-libffi_convenience.la: $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_DEPENDENCIES) $(EXTRA_libffi_convenience_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(LINK)  $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-       -rm -f *.$(OBJEXT)
-       -rm -f src/*.$(OBJEXT)
-       -rm -f src/*.lo
-       -rm -f src/aarch64/*.$(OBJEXT)
-       -rm -f src/aarch64/*.lo
-       -rm -f src/alpha/*.$(OBJEXT)
-       -rm -f src/alpha/*.lo
-       -rm -f src/arc/*.$(OBJEXT)
-       -rm -f src/arc/*.lo
-       -rm -f src/arm/*.$(OBJEXT)
-       -rm -f src/arm/*.lo
-       -rm -f src/avr32/*.$(OBJEXT)
-       -rm -f src/avr32/*.lo
-       -rm -f src/bfin/*.$(OBJEXT)
-       -rm -f src/bfin/*.lo
-       -rm -f src/cris/*.$(OBJEXT)
-       -rm -f src/cris/*.lo
-       -rm -f src/frv/*.$(OBJEXT)
-       -rm -f src/frv/*.lo
-       -rm -f src/ia64/*.$(OBJEXT)
-       -rm -f src/ia64/*.lo
-       -rm -f src/m32r/*.$(OBJEXT)
-       -rm -f src/m32r/*.lo
-       -rm -f src/m68k/*.$(OBJEXT)
-       -rm -f src/m68k/*.lo
-       -rm -f src/m88k/*.$(OBJEXT)
-       -rm -f src/m88k/*.lo
-       -rm -f src/metag/*.$(OBJEXT)
-       -rm -f src/metag/*.lo
-       -rm -f src/microblaze/*.$(OBJEXT)
-       -rm -f src/microblaze/*.lo
-       -rm -f src/mips/*.$(OBJEXT)
-       -rm -f src/mips/*.lo
-       -rm -f src/moxie/*.$(OBJEXT)
-       -rm -f src/moxie/*.lo
-       -rm -f src/nios2/*.$(OBJEXT)
-       -rm -f src/nios2/*.lo
-       -rm -f src/or1k/*.$(OBJEXT)
-       -rm -f src/or1k/*.lo
-       -rm -f src/pa/*.$(OBJEXT)
-       -rm -f src/pa/*.lo
-       -rm -f src/powerpc/*.$(OBJEXT)
-       -rm -f src/powerpc/*.lo
-       -rm -f src/riscv/*.$(OBJEXT)
-       -rm -f src/riscv/*.lo
-       -rm -f src/s390/*.$(OBJEXT)
-       -rm -f src/s390/*.lo
-       -rm -f src/sh/*.$(OBJEXT)
-       -rm -f src/sh/*.lo
-       -rm -f src/sh64/*.$(OBJEXT)
-       -rm -f src/sh64/*.lo
-       -rm -f src/sparc/*.$(OBJEXT)
-       -rm -f src/sparc/*.lo
-       -rm -f src/tile/*.$(OBJEXT)
-       -rm -f src/tile/*.lo
-       -rm -f src/vax/*.$(OBJEXT)
-       -rm -f src/vax/*.lo
-       -rm -f src/x86/*.$(OBJEXT)
-       -rm -f src/x86/*.lo
-       -rm -f src/xtensa/*.$(OBJEXT)
-       -rm -f src/xtensa/*.lo
-
-distclean-compile:
-       -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/closures.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/debug.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/java_raw_api.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/prep_cif.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_api.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/types.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/arcompact.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/avr32/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/avr32/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/bfin/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/bfin/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/eabi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/obsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/microblaze/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/microblaze/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/n32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/o32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/eabi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/or1k/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/or1k/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/hpux32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/linux.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/aix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/aix_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/darwin_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_linux64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ppc_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/riscv/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/riscv/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/s390/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/s390/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh64/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh64/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/ffi64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/v8.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/v9.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/tile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/elfbsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin64_c.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin_c.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffiw64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/unix64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/sysv.Plo@am__quote@
-
-.S.o:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
-
-.S.obj:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.S.lo:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@    DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@        $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
-
-.c.o:
-@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-       -rm -rf src/.libs src/_libs
-       -rm -rf src/aarch64/.libs src/aarch64/_libs
-       -rm -rf src/alpha/.libs src/alpha/_libs
-       -rm -rf src/arc/.libs src/arc/_libs
-       -rm -rf src/arm/.libs src/arm/_libs
-       -rm -rf src/avr32/.libs src/avr32/_libs
-       -rm -rf src/bfin/.libs src/bfin/_libs
-       -rm -rf src/cris/.libs src/cris/_libs
-       -rm -rf src/frv/.libs src/frv/_libs
-       -rm -rf src/ia64/.libs src/ia64/_libs
-       -rm -rf src/m32r/.libs src/m32r/_libs
-       -rm -rf src/m68k/.libs src/m68k/_libs
-       -rm -rf src/m88k/.libs src/m88k/_libs
-       -rm -rf src/metag/.libs src/metag/_libs
-       -rm -rf src/microblaze/.libs src/microblaze/_libs
-       -rm -rf src/mips/.libs src/mips/_libs
-       -rm -rf src/moxie/.libs src/moxie/_libs
-       -rm -rf src/nios2/.libs src/nios2/_libs
-       -rm -rf src/or1k/.libs src/or1k/_libs
-       -rm -rf src/pa/.libs src/pa/_libs
-       -rm -rf src/powerpc/.libs src/powerpc/_libs
-       -rm -rf src/riscv/.libs src/riscv/_libs
-       -rm -rf src/s390/.libs src/s390/_libs
-       -rm -rf src/sh/.libs src/sh/_libs
-       -rm -rf src/sh64/.libs src/sh64/_libs
-       -rm -rf src/sparc/.libs src/sparc/_libs
-       -rm -rf src/tile/.libs src/tile/_libs
-       -rm -rf src/vax/.libs src/vax/_libs
-       -rm -rf src/x86/.libs src/x86/_libs
-       -rm -rf src/xtensa/.libs src/xtensa/_libs
-
-distclean-libtool:
-       -rm -f libtool config.lt
-doc/$(am__dirstamp):
-       @$(MKDIR_P) doc
-       @: > doc/$(am__dirstamp)
-
-doc/libffi.dvi: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-       $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
-       $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
-       `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi
-
-doc/libffi.pdf: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-       $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
-       $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
-       `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi
-
-doc/libffi.html: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-       $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
-       $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
-        -o $(@:.html=.htp) `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi; \
-       then \
-         rm -rf $@ && mv $(@:.html=.htp) $@; \
-       else \
-         rm -rf $(@:.html=.htp); exit 1; \
-       fi
-$(srcdir)/doc/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/doc/stamp-vti
-$(srcdir)/doc/stamp-vti: doc/libffi.texi $(top_srcdir)/configure
-       @test -f doc/$(am__dirstamp) || $(MAKE) $(AM_MAKEFLAGS) doc/$(am__dirstamp)
-       @(dir=.; test -f ./doc/libffi.texi || dir=$(srcdir); \
-       set `$(SHELL) $(srcdir)/mdate-sh $$dir/doc/libffi.texi`; \
-       echo "@set UPDATED $$1 $$2 $$3"; \
-       echo "@set UPDATED-MONTH $$2 $$3"; \
-       echo "@set EDITION $(VERSION)"; \
-       echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
-       (cmp -s vti.tmp$$$$ $(srcdir)/doc/version.texi \
-         || (echo "Updating $(srcdir)/doc/version.texi" && \
-             cp vti.tmp$$$$ $(srcdir)/doc/version.texi.tmp$$$$ && \
-             mv $(srcdir)/doc/version.texi.tmp$$$$ $(srcdir)/doc/version.texi)) && \
-       rm -f vti.tmp$$$$ $(srcdir)/doc/version.texi.$$$$
-       @cp $(srcdir)/doc/version.texi $@
-
-mostlyclean-vti:
-       -rm -f vti.tmp* $(srcdir)/doc/version.texi.tmp*
-
-maintainer-clean-vti:
-@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi
-.dvi.ps:
-       $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       $(DVIPS) $(AM_V_texinfo) -o $@ $<
-
-uninstall-dvi-am:
-       @$(NORMAL_UNINSTALL)
-       @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
-         rm -f "$(DESTDIR)$(dvidir)/$$f"; \
-       done
-
-uninstall-html-am:
-       @$(NORMAL_UNINSTALL)
-       @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
-         rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
-       done
-
-uninstall-info-am:
-       @$(PRE_UNINSTALL)
-       @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
-         list='$(INFO_DEPS)'; \
-         for file in $$list; do \
-           relfile=`echo "$$file" | sed 's|^.*/||'`; \
-           echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
-           if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
-           then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
-         done; \
-       else :; fi
-       @$(NORMAL_UNINSTALL)
-       @list='$(INFO_DEPS)'; \
-       for file in $$list; do \
-         relfile=`echo "$$file" | sed 's|^.*/||'`; \
-         relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
-         (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
-            echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
-            rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
-          else :; fi); \
-       done
-
-uninstall-pdf-am:
-       @$(NORMAL_UNINSTALL)
-       @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
-       done
-
-uninstall-ps-am:
-       @$(NORMAL_UNINSTALL)
-       @list='$(PSS)'; test -n "$(psdir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(psdir)/$$f"; \
-       done
-
-dist-info: $(INFO_DEPS)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       list='$(INFO_DEPS)'; \
-       for base in $$list; do \
-         case $$base in \
-           $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
-         esac; \
-         if test -f $$base; then d=.; else d=$(srcdir); fi; \
-         base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
-         for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
-           if test -f $$file; then \
-             relfile=`expr "$$file" : "$$d/\(.*\)"`; \
-             test -f "$(distdir)/$$relfile" || \
-               cp -p $$file "$(distdir)/$$relfile"; \
-           else :; fi; \
-         done; \
-       done
-
-mostlyclean-aminfo:
-       -rm -rf doc/libffi.t2d doc/libffi.t2p
-
-clean-aminfo:
-       -test -z "doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html" \
-       || rm -rf doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html
-
-maintainer-clean-aminfo:
-       @list='$(INFO_DEPS)'; for i in $$list; do \
-         i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
-         echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
-         rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
-       done
-install-pkgconfigDATA: $(pkgconfig_DATA)
-       @$(NORMAL_INSTALL)
-       @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
-       done
-
-uninstall-pkgconfigDATA:
-       @$(NORMAL_UNINSTALL)
-       @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
-       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-       @fail=; \
-       if $(am__make_keepgoing); then \
-         failcom='fail=yes'; \
-       else \
-         failcom='exit 1'; \
-       fi; \
-       dot_seen=no; \
-       target=`echo $@ | sed s/-recursive//`; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       for subdir in $$list; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           dot_seen=yes; \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done; \
-       if test "$$dot_seen" = "no"; then \
-         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-       fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
-       $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-       set x; \
-       here=`pwd`; \
-       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-         include_option=--etags-include; \
-         empty_fix=.; \
-       else \
-         include_option=--include; \
-         empty_fix=; \
-       fi; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test ! -f $$subdir/TAGS || \
-             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-         fi; \
-       done; \
-       $(am__define_uniq_tagged_files); \
-       shift; \
-       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-         test -n "$$unique" || unique=$$empty_fix; \
-         if test $$# -gt 0; then \
-           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-             "$$@" $$unique; \
-         else \
-           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-             $$unique; \
-         fi; \
-       fi
-ctags: ctags-recursive
-
-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
-
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && $(am__cd) $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) "$$here"
-cscope: cscope.files
-       test ! -s cscope.files \
-         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-clean-cscope:
-       -rm -f cscope.files
-cscope.files: clean-cscope cscopelist
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
-       list='$(am__tagged_files)'; \
-       case "$(srcdir)" in \
-         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-         *) sdir=$(subdir)/$(srcdir) ;; \
-       esac; \
-       for i in $$list; do \
-         if test -f "$$i"; then \
-           echo "$(subdir)/$$i"; \
-         else \
-           echo "$$sdir/$$i"; \
-         fi; \
-       done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) $(DATA) $(HEADERS) \
-               fficonfig.h all-local
-installdirs: installdirs-recursive
-installdirs-am:
-       for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(pkgconfigdir)"; do \
-         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-       done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-       if test -z '$(STRIP)'; then \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-             install; \
-       else \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
-mostlyclean-generic:
-
-clean-generic:
-       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-       -rm -f doc/$(am__dirstamp)
-       -rm -f src/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/$(am__dirstamp)
-       -rm -f src/aarch64/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/aarch64/$(am__dirstamp)
-       -rm -f src/alpha/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/alpha/$(am__dirstamp)
-       -rm -f src/arc/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/arc/$(am__dirstamp)
-       -rm -f src/arm/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/arm/$(am__dirstamp)
-       -rm -f src/avr32/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/avr32/$(am__dirstamp)
-       -rm -f src/bfin/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/bfin/$(am__dirstamp)
-       -rm -f src/cris/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/cris/$(am__dirstamp)
-       -rm -f src/frv/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/frv/$(am__dirstamp)
-       -rm -f src/ia64/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/ia64/$(am__dirstamp)
-       -rm -f src/m32r/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/m32r/$(am__dirstamp)
-       -rm -f src/m68k/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/m68k/$(am__dirstamp)
-       -rm -f src/m88k/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/m88k/$(am__dirstamp)
-       -rm -f src/metag/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/metag/$(am__dirstamp)
-       -rm -f src/microblaze/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/microblaze/$(am__dirstamp)
-       -rm -f src/mips/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/mips/$(am__dirstamp)
-       -rm -f src/moxie/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/moxie/$(am__dirstamp)
-       -rm -f src/nios2/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/nios2/$(am__dirstamp)
-       -rm -f src/or1k/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/or1k/$(am__dirstamp)
-       -rm -f src/pa/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/pa/$(am__dirstamp)
-       -rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/powerpc/$(am__dirstamp)
-       -rm -f src/riscv/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/riscv/$(am__dirstamp)
-       -rm -f src/s390/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/s390/$(am__dirstamp)
-       -rm -f src/sh/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/sh/$(am__dirstamp)
-       -rm -f src/sh64/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/sh64/$(am__dirstamp)
-       -rm -f src/sparc/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/sparc/$(am__dirstamp)
-       -rm -f src/tile/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/tile/$(am__dirstamp)
-       -rm -f src/vax/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/vax/$(am__dirstamp)
-       -rm -f src/x86/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/x86/$(am__dirstamp)
-       -rm -f src/xtensa/$(DEPDIR)/$(am__dirstamp)
-       -rm -f src/xtensa/$(am__dirstamp)
-       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-aminfo clean-generic clean-libtool clean-local \
-       clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES \
-       mostlyclean-am
-
-distclean: distclean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/or1k/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/riscv/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
-       -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-hdr distclean-libtool distclean-local distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am: $(DVIS)
-
-html: html-recursive
-
-html-am: $(HTMLS)
-
-info: info-recursive
-
-info-am: $(INFO_DEPS)
-
-install-data-am: install-info-am install-pkgconfigDATA
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am: $(DVIS)
-       @$(NORMAL_INSTALL)
-       @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
-       done
-install-exec-am: install-exec-local install-toolexeclibLTLIBRARIES
-
-install-html: install-html-recursive
-
-install-html-am: $(HTMLS)
-       @$(NORMAL_INSTALL)
-       @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         $(am__strip_dir) \
-         d2=$$d$$p; \
-         if test -d "$$d2"; then \
-           echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
-           $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
-           echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
-           $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
-         else \
-           list2="$$list2 $$d2"; \
-         fi; \
-       done; \
-       test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
-       done; }
-install-info: install-info-recursive
-
-install-info-am: $(INFO_DEPS)
-       @$(NORMAL_INSTALL)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
-       fi; \
-       for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-         esac; \
-         if test -f $$file; then d=.; else d=$(srcdir); fi; \
-         file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
-         for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
-                      $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
-           if test -f $$ifile; then \
-             echo "$$ifile"; \
-           else : ; fi; \
-         done; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
-       @$(POST_INSTALL)
-       @if $(am__can_run_installinfo); then \
-         list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
-         for file in $$list; do \
-           relfile=`echo "$$file" | sed 's|^.*/||'`; \
-           echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
-           install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
-         done; \
-       else : ; fi
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am: $(PDFS)
-       @$(NORMAL_INSTALL)
-       @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
-install-ps: install-ps-recursive
-
-install-ps-am: $(PSS)
-       @$(NORMAL_INSTALL)
-       @list='$(PSS)'; test -n "$(psdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf $(top_srcdir)/autom4te.cache
-       -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/or1k/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/riscv/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-aminfo \
-       maintainer-clean-generic maintainer-clean-local \
-       maintainer-clean-vti
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool mostlyclean-local \
-       mostlyclean-vti
-
-pdf: pdf-recursive
-
-pdf-am: $(PDFS)
-
-ps: ps-recursive
-
-ps-am: $(PSS)
-
-uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
-       uninstall-pdf-am uninstall-pkgconfigDATA uninstall-ps-am \
-       uninstall-toolexeclibLTLIBRARIES
-
-.MAKE: $(am__recursive_targets) all install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
-       am--refresh check check-am clean clean-aminfo clean-cscope \
-       clean-generic clean-libtool clean-local \
-       clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES cscope \
-       cscopelist-am ctags ctags-am dist-info distclean \
-       distclean-compile distclean-generic distclean-hdr \
-       distclean-libtool distclean-local distclean-tags 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-exec-local install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-pkgconfigDATA install-ps \
-       install-ps-am install-strip install-toolexeclibLTLIBRARIES \
-       installcheck installcheck-am installdirs installdirs-am \
-       maintainer-clean maintainer-clean-aminfo \
-       maintainer-clean-generic maintainer-clean-local \
-       maintainer-clean-vti mostlyclean mostlyclean-aminfo \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       mostlyclean-local mostlyclean-vti pdf pdf-am ps ps-am tags \
-       tags-am uninstall uninstall-am uninstall-dvi-am \
-       uninstall-html-am uninstall-info-am uninstall-pdf-am \
-       uninstall-pkgconfigDATA uninstall-ps-am \
-       uninstall-toolexeclibLTLIBRARIES
-
-.PRECIOUS: Makefile
-
-
-all-local: $(STAMP_GENINSRC)
-
-stamp-geninsrc: doc/libffi.info
-       cp -p $(top_builddir)/doc/libffi.info $(srcdir)/doc/libffi.info
-       @touch $@
-
-doc/libffi.info: $(STAMP_BUILD_INFO)
-
-stamp-build-info: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)/doc -o doc/libffi.info $(srcdir)/doc/libffi.texi
-       @touch $@
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@                $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@       perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@        `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@           sed 's,\([^/        ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
-@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@        > $@ || (rm -f $@ ; exit 1)
-
-libffi.map: $(top_srcdir)/libffi.map.in
-       $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
-
-# Multilib support.  Automake should provide these on its own.
-all-recursive: all-multi
-install-recursive: install-multi
-mostlyclean-recursive: mostlyclean-multi
-clean-recursive: clean-multi
-distclean-recursive: distclean-multi
-maintainer-clean-recursive: maintainer-clean-multi
-
-# GNU Make needs to see an explicit $(MAKE) variable in the command it
-# runs to enable its job server during parallel builds.  Hence the
-# comments below.
-all-multi:
-       $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
-install-multi:
-       $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
-mostlyclean-multi:
-       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
-clean-multi:
-       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
-distclean-multi:
-       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
-maintainer-clean-multi:
-       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
-
-.MAKE .PHONY: all-multi clean-multi distclean-multi install-am \
-             install-multi maintainer-clean-multi mostlyclean-multi
-
-install-exec-local: install-multi
-
-all-local: all-multi
-mostlyclean-local: mostlyclean-multi
-clean-local: clean-multi
-distclean-local: distclean-multi
-maintainer-clean-local: maintainer-clean-multi
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libffi/README b/libffi/README
deleted file mode 100644 (file)
index c072101..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-Status
-======
-
-libffi-4?? was released on TBD.  Check the libffi web
-page for updates: <URL:http://sourceware.org/libffi/>.
-
-
-What is libffi?
-===============
-
-Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the "calling
-convention". The "calling convention" is essentially 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.
-
-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
-bridge from the interpreter program to compiled code.
-
-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.
-
-
-Supported Platforms
-===================
-
-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.2
-
-At the time of release, the following basic configurations have been
-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                     |
-| Blackfin        | uClinux          | GCC                     |
-| HPPA            | HPUX             | GCC                     |
-| IA-64           | Linux            | GCC                     |
-| M68K            | FreeMiNT         | 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                     |
-| Nios II         | Linux            | GCC                     |
-| OpenRISC        | Linux            | GCC                     |
-| PowerPC 32-bit  | AIX              | IBM XL C                |
-| PowerPC 64-bit  | AIX              | IBM XL C                |
-| PowerPC         | AMIGA            | GCC                     |
-| PowerPC         | Linux            | GCC                     |
-| PowerPC         | Mac OSX          | GCC                     |
-| PowerPC         | FreeBSD          | GCC                     |
-| PowerPC 64-bit  | FreeBSD          | GCC                     |
-| PowerPC 64-bit  | Linux ELFv1      | GCC                     |
-| PowerPC 64-bit  | Linux ELFv2      | GCC                     |
-| S390            | Linux            | GCC                     |
-| S390X           | Linux            | GCC                     |
-| SPARC           | Linux            | GCC                     |
-| SPARC           | Solaris          | GCC                     |
-| SPARC           | Solaris          | Oracle Solaris Studio C |
-| SPARC64         | Linux            | GCC                     |
-| 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                     |
-| X86             | kFreeBSD         | GCC                     |
-| X86             | Linux            | GCC                     |
-| X86             | Mac OSX          | GCC                     |
-| X86             | OpenBSD          | GCC                     |
-| X86             | OS/2             | GCC                     |
-| X86             | Solaris          | GCC                     |
-| X86             | Solaris          | Oracle Solaris Studio C |
-| X86             | Windows/Cygwin   | GCC                     |
-| X86             | Windows/MingW    | GCC                     |
-| X86-64          | FreeBSD          | GCC                     |
-| X86-64          | Linux            | GCC                     |
-| X86-64          | Linux/x32        | GCC                     |
-| X86-64          | OpenBSD          | GCC                     |
-| X86-64          | Solaris          | Oracle Solaris Studio C |
-| X86-64          | Windows/Cygwin   | GCC                     |
-| X86-64          | Windows/MingW    | GCC                     |
-| Xtensa          | Linux            | GCC                     |
-|-----------------+------------------+-------------------------|
-
-Please send additional platform test results to
-libffi-discuss@sourceware.org and feel free to update the wiki page
-above.
-
-Installing libffi
-=================
-
-First you must configure the distribution for your particular
-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. 
-
-If you want to enable extra run-time debugging checks use the the
---enable-debug configure switch. This is useful when your program dies
-mysteriously while using libffi. 
-
-Another useful configure switch is --enable-purify-safety. Using this
-will add some extra code which will suppress certain warnings when you
-are using Purify with libffi. Only use this switch when using 
-Purify, as it will slow down the library.
-
-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 CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"
-
-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.
-
-It is also possible to build libffi on Windows platforms with the LLVM
-project's clang-cl compiler, like below:
-
-path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
-
-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.
-
-Configure has many other options. Use "configure --help" to see them all.
-
-Once configure has finished, type "make". Note that you must be using
-GNU make.  You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .
-
-To ensure that libffi is working as advertised, type "make check".
-This will require that you have DejaGNU installed.
-
-To install the library and header files, type "make install".
-
-
-History
-=======
-
-See the git log for details at http://github.com/atgreen/libffi.
-
-4.0 TBD
-        New API in support of GO closures.
-
-3.2.1 Nov-12-14
-        Build fix for non-iOS AArch64 targets.
-
-3.2 Nov-11-14
-        Add C99 Complex Type support (currently only supported on
-          s390).
-       Add support for PASCAL and REGISTER calling conventions on x86
-         Windows/Linux.
-       Add OpenRISC and Cygwin-64 support.
-        Bug fixes.
-
-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.
-       Add missing Moxie bits.
-       Fix stack alignment bug on 32-bit x86.
-       Build fix for m68000 targets.
-       Build fix for soft-float Power targets.
-       Fix the install dir location for some platforms when building
-         with GCC (OS X, Solaris).
-       Fix Cygwin regression.
-
-3.0.12 Feb-11-13
-        Add Moxie support.
-       Add AArch64 support.
-       Add Blackfin support.
-       Add TILE-Gx/TILEPro support.
-       Add MicroBlaze support.
-       Add Xtensa support.
-       Add support for PaX enabled kernels with MPROTECT.
-       Add support for native vendor compilers on
-         Solaris and AIX.
-       Work around LLVM/GCC interoperability issue on x86_64.
-
-3.0.11 Apr-11-12
-        Lots of build fixes.
-       Add support for variadic functions (ffi_prep_cif_var).
-       Add Linux/x32 support.
-       Add thiscall, fastcall and MSVC cdecl support on Windows.
-       Add Amiga and newer MacOS support.
-       Add m68k FreeMiNT support.
-       Integration with iOS' xcode build tools.
-       Fix Octeon and MC68881 support.
-       Fix code pessimizations.
-
-3.0.10 Aug-23-11
-        Add support for Apple's iOS.
-       Add support for ARM VFP ABI.
-        Add RTEMS support for MIPS and M68K.
-       Fix instruction cache clearing problems on
-         ARM and SPARC.
-       Fix the N64 build on mips-sgi-irix6.5.
-       Enable builds with Microsoft's compiler.
-       Enable x86 builds with Oracle's Solaris compiler.
-       Fix support for calling code compiled with Oracle's Sparc
-         Solaris compiler.
-       Testsuite fixes for Tru64 Unix.
-       Additional platform support.
-
-3.0.9 Dec-31-09
-        Add AVR32 and win64 ports.  Add ARM softfp support.
-       Many fixes for AIX, Solaris, HP-UX, *BSD.
-       Several PowerPC and x86-64 bug fixes.
-       Build DLL for windows.
-
-3.0.8 Dec-19-08
-        Add *BSD, BeOS, and PA-Linux support.
-
-3.0.7 Nov-11-08
-        Fix for ppc FreeBSD.
-       (thanks to Andreas Tobler)
-
-3.0.6 Jul-17-08
-        Fix for closures on sh.
-       Mark the sh/sh64 stack as non-executable.
-       (both thanks to Kaz Kojima)
-
-3.0.5 Apr-3-08
-        Fix libffi.pc file.
-       Fix #define ARM for IcedTea users.
-       Fix x86 closure bug.
-
-3.0.4 Feb-24-08
-        Fix x86 OpenBSD configury.
-
-3.0.3 Feb-22-08
-        Enable x86 OpenBSD thanks to Thomas Heller, and
-       x86-64 FreeBSD thanks to Björn König and Andreas Tobler.
-       Clean up test instruction in README.
-
-3.0.2 Feb-21-08
-        Improved x86 FreeBSD support.
-       Thanks to Björn König.
-
-3.0.1 Feb-15-08
-        Fix instruction cache flushing bug on MIPS.
-       Thanks to David Daney.
-
-3.0.0 Feb-15-08
-        Many changes, mostly thanks to the GCC project.
-       Cygnus Solutions is now Red Hat.
-
-  [10 years go by...]
-
-1.20 Oct-5-98
-       Raffaele Sena produces ARM port.
-
-1.19 Oct-5-98
-       Fixed x86 long double and long long return support.
-       m68k bug fixes from Andreas Schwab.
-       Patch for DU assembler compatibility for the Alpha from Richard
-       Henderson.
-
-1.18 Apr-17-98
-       Bug fixes and MIPS configuration changes.
-
-1.17 Feb-24-98
-       Bug fixes and m68k port from Andreas Schwab. PowerPC port from
-       Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.
-
-1.16 Feb-11-98
-       Richard Henderson produces Alpha port.
-
-1.15 Dec-4-97
-       Fixed an n32 ABI bug. New libtool, auto* support.
-
-1.14 May-13-97
-       libtool is now used to generate shared and static libraries.
-       Fixed a minor portability problem reported by Russ McManus
-       <mcmanr@eq.gs.com>.
-
-1.13 Dec-2-96
-       Added --enable-purify-safety to keep Purify from complaining
-       about certain low level code.
-       Sparc fix for calling functions with < 6 args.
-       Linux x86 a.out fix.
-
-1.12 Nov-22-96
-       Added missing ffi_type_void, needed for supporting void return 
-       types. Fixed test case for non MIPS machines. Cygnus Support 
-       is now Cygnus Solutions. 
-
-1.11 Oct-30-96
-       Added notes about GNU make.
-
-1.10 Oct-29-96
-       Added configuration fix for non GNU compilers.
-
-1.09 Oct-29-96
-       Added --enable-debug configure switch. Clean-ups based on LCLint 
-       feedback. ffi_mips.h is always installed. Many configuration 
-       fixes. Fixed ffitest.c for sparc builds.
-
-1.08 Oct-15-96
-       Fixed n32 problem. Many clean-ups.
-
-1.07 Oct-14-96
-       Gordon Irlam rewrites v8.S again. Bug fixes.
-
-1.06 Oct-14-96
-       Gordon Irlam improved the sparc port. 
-
-1.05 Oct-14-96
-       Interface changes based on feedback.
-
-1.04 Oct-11-96
-       Sparc port complete (modulo struct passing bug).
-
-1.03 Oct-10-96
-       Passing struct args, and returning struct values works for
-       all architectures/calling conventions. Expanded tests.
-
-1.02 Oct-9-96
-       Added SGI n32 support. Fixed bugs in both o32 and Linux support.
-       Added "make test".
-
-1.01 Oct-8-96
-       Fixed float passing bug in mips version. Restructured some
-       of the code. Builds cleanly with SGI tools.
-
-1.00 Oct-7-96
-       First release. No public announcement.
-
-
-Authors & Credits
-=================
-
-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
-details.
-
-Some of the ideas behind libffi were inspired by Gianni Mariani's free
-gencall library for Silicon Graphics machines.
-
-The closure mechanism was designed and implemented by Kresten Krab
-Thorup.
-
-Major processor architecture ports were contributed by the following
-developers:
-
-aarch64                Marcus Shawcroft, James Greenhalgh
-alpha          Richard Henderson
-arm            Raffaele Sena
-blackfin        Alexandre Keunecke I. de Mendonca
-cris           Simon Posnjak, Hans-Peter Nilsson
-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
-openrisc        Sebastian Macke
-pa             Randolph Chung, Dave Anglin, Andreas Tobler
-powerpc                Geoffrey Keating, Andreas Tobler, 
-                        David Edelsohn, John Hornkvist
-powerpc64      Jakub Jelinek
-s390           Gerhard Tonn, Ulrich Weigand
-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
-
-Jesper Skov and Andrew Haley both did more than their fair share of
-stepping through the code and tracking down bugs.
-
-Thanks also to Tom Tromey for bug fixes, documentation and
-configuration help.
-
-Thanks to Jim Blandy, who provided some useful feedback on the libffi
-interface.
-
-Andreas Tobler has done a tremendous amount of work on the testsuite.
-
-Alex Oliva solved the executable page problem for SElinux.
-
-The list above is almost certainly incomplete and inaccurate.  I'm
-happy to make corrections or additions upon request.
-
-If you have a problem, or have found a bug, please send a note to the
-author at green@moxielogic.com, or the project mailing list at
-libffi-discuss@sourceware.org.
diff --git a/libffi/README.md b/libffi/README.md
new file mode 100644 (file)
index 0000000..b95bd74
--- /dev/null
@@ -0,0 +1,495 @@
+Status
+======
+
+libffi-3.4.1 was released on June 28, 2021.  Check the libffi web page
+for updates: <URL:http://sourceware.org/libffi/>.
+
+
+What is libffi?
+===============
+
+Compilers for high level languages generate code that follow certain
+conventions. These conventions are necessary, in part, for separate
+compilation to work. One such convention is the "calling
+convention". The "calling convention" is essentially 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.
+
+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
+bridge from the interpreter program to compiled code.
+
+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.
+
+
+Supported Platforms
+===================
+
+Libffi has been ported to many different platforms.
+
+At the time of release, the following basic configurations have been
+tested:
+
+| Architecture    | Operating System | Compiler                |
+| --------------- | ---------------- | ----------------------- |
+| AArch64 (ARM64) | iOS              | Clang                   |
+| AArch64         | Linux            | GCC                     |
+| AArch64         | Windows          | MSVC                    |
+| Alpha           | Linux            | GCC                     |
+| Alpha           | Tru64            | GCC                     |
+| ARC             | Linux            | GCC                     |
+| ARM             | Linux            | GCC                     |
+| ARM             | iOS              | GCC                     |
+| ARM             | Windows          | MSVC                    |
+| AVR32           | Linux            | GCC                     |
+| Blackfin        | uClinux          | GCC                     |
+| CSKY            | Linux            | GCC                     |
+| HPPA            | HPUX             | GCC                     |
+| KVX             | Linux            | GCC                     |
+| IA-64           | Linux            | GCC                     |
+| M68K            | FreeMiNT         | 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                     |
+| Nios II         | Linux            | GCC                     |
+| OpenRISC        | Linux            | GCC                     |
+| PowerPC 32-bit  | AIX              | IBM XL C                |
+| PowerPC 64-bit  | AIX              | IBM XL C                |
+| PowerPC         | AMIGA            | GCC                     |
+| PowerPC         | Linux            | GCC                     |
+| PowerPC         | Mac OSX          | GCC                     |
+| PowerPC         | FreeBSD          | GCC                     |
+| PowerPC 64-bit  | FreeBSD          | GCC                     |
+| PowerPC 64-bit  | Linux ELFv1      | GCC                     |
+| PowerPC 64-bit  | Linux ELFv2      | GCC                     |
+| RISC-V 32-bit   | Linux            | GCC                     |
+| RISC-V 64-bit   | Linux            | GCC                     |
+| S390            | Linux            | GCC                     |
+| S390X           | Linux            | GCC                     |
+| SPARC           | Linux            | GCC                     |
+| SPARC           | Solaris          | GCC                     |
+| SPARC           | Solaris          | Oracle Solaris Studio C |
+| SPARC64         | Linux            | GCC                     |
+| 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                     |
+| X86             | kFreeBSD         | GCC                     |
+| X86             | Linux            | GCC                     |
+| X86             | OpenBSD          | GCC                     |
+| X86             | OS/2             | GCC                     |
+| X86             | Solaris          | GCC                     |
+| X86             | Solaris          | Oracle Solaris Studio C |
+| X86             | Windows/Cygwin   | GCC                     |
+| X86             | Windows/MingW    | GCC                     |
+| X86-64          | FreeBSD          | GCC                     |
+| X86-64          | Linux            | GCC                     |
+| X86-64          | Linux/x32        | GCC                     |
+| X86-64          | OpenBSD          | GCC                     |
+| X86-64          | Solaris          | Oracle Solaris Studio C |
+| X86-64          | Windows/Cygwin   | GCC                     |
+| X86-64          | Windows/MingW    | GCC                     |
+| X86-64          | Mac OSX          | GCC                     |
+| Xtensa          | Linux            | GCC                     |
+
+Please send additional platform test results to
+libffi-discuss@sourceware.org.
+
+Installing libffi
+=================
+
+First you must configure the distribution for your particular
+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.  Note that building libffi requires a C99 compatible
+compiler.
+
+If you're building libffi directly from git hosted sources, configure
+won't exist yet; run ./autogen.sh first.  This will require that you
+install autoconf, automake and libtool.
+
+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.
+
+If you want to enable extra run-time debugging checks use the the
+``--enable-debug`` configure switch. This is useful when your program dies
+mysteriously while using libffi.
+
+Another useful configure switch is ``--enable-purify-safety``. Using this
+will add some extra code which will suppress certain warnings when you
+are using Purify with libffi. Only use this switch when using
+Purify, as it will slow down the library.
+
+If you don't want to build documentation, use the ``--disable-docs``
+configure switch.
+
+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 CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP" CPPFLAGS="-DFFI_BUILDING_DLL"
+
+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.
+
+It is also possible to build libffi on Windows platforms with the LLVM
+project's clang-cl compiler, like below:
+
+    path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
+
+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.)
+
+To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder have
+   aarch64/Ffi_staticLib.sln
+   required header files in aarch64/aarch64_include/
+
+
+SPARC Solaris builds require the use of the GNU assembler and linker.
+Point ``AS`` and ``LD`` environment variables at those tool prior to
+configuration.
+
+For iOS builds, the ``libffi.xcodeproj`` Xcode project is available.
+
+Configure has many other options. Use ``configure --help`` to see them all.
+
+Once configure has finished, type "make". Note that you must be using
+GNU make.  You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .
+
+To ensure that libffi is working as advertised, type "make check".
+This will require that you have DejaGNU installed.
+
+To install the library and header files, type ``make install``.
+
+
+History
+=======
+
+See the git log for details at http://github.com/libffi/libffi.
+
+    3.4.2 Jun-28-21
+        Add static trampoline support for Linux on x86_64 and ARM64.
+        Add support for Alibaba's CSKY architecture.
+        Add support for Kalray's KVX architecture.
+        Add support for Intel Control-flow Enforcement Technology (CET).
+        Add support for ARM Pointer Authentication (PA).
+        Fix 32-bit PPC regression.
+        Fix MIPS soft-float problem.
+        Enable tmpdir override with the $LIBFFI_TMPDIR environment variable.
+        Enable compatibility with MSVC runtime stack checking.
+        Reject float and small integer argument in ffi_prep_cif_var().
+          Callers must promote these types themselves.
+
+    3.3 Nov-23-19
+        Add RISC-V support.
+        New API in support of GO closures.
+        Add IEEE754 binary128 long double support for 64-bit Power
+        Default to Microsoft's 64 bit long double ABI with Visual C++.
+        GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
+        Add Windows on ARM64 (WOA) support.
+        Add Windows 32-bit ARM support.
+        Raw java (gcj) API deprecated.
+        Add pre-built PDF documentation to source distribution.
+        Many new test cases and bug fixes.
+
+    3.2.1 Nov-12-14
+        Build fix for non-iOS AArch64 targets.
+
+    3.2 Nov-11-14
+        Add C99 Complex Type support (currently only supported on
+          s390).
+        Add support for PASCAL and REGISTER calling conventions on x86
+          Windows/Linux.
+        Add OpenRISC and Cygwin-64 support.
+        Bug fixes.
+
+    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.
+        Add missing Moxie bits.
+        Fix stack alignment bug on 32-bit x86.
+        Build fix for m68000 targets.
+        Build fix for soft-float Power targets.
+        Fix the install dir location for some platforms when building
+          with GCC (OS X, Solaris).
+        Fix Cygwin regression.
+
+    3.0.12 Feb-11-13
+        Add Moxie support.
+        Add AArch64 support.
+        Add Blackfin support.
+        Add TILE-Gx/TILEPro support.
+        Add MicroBlaze support.
+        Add Xtensa support.
+        Add support for PaX enabled kernels with MPROTECT.
+        Add support for native vendor compilers on
+          Solaris and AIX.
+        Work around LLVM/GCC interoperability issue on x86_64.
+
+    3.0.11 Apr-11-12
+        Lots of build fixes.
+        Add support for variadic functions (ffi_prep_cif_var).
+        Add Linux/x32 support.
+        Add thiscall, fastcall and MSVC cdecl support on Windows.
+        Add Amiga and newer MacOS support.
+        Add m68k FreeMiNT support.
+        Integration with iOS' xcode build tools.
+        Fix Octeon and MC68881 support.
+        Fix code pessimizations.
+
+    3.0.10 Aug-23-11
+        Add support for Apple's iOS.
+        Add support for ARM VFP ABI.
+        Add RTEMS support for MIPS and M68K.
+        Fix instruction cache clearing problems on
+          ARM and SPARC.
+        Fix the N64 build on mips-sgi-irix6.5.
+        Enable builds with Microsoft's compiler.
+        Enable x86 builds with Oracle's Solaris compiler.
+        Fix support for calling code compiled with Oracle's Sparc
+          Solaris compiler.
+        Testsuite fixes for Tru64 Unix.
+        Additional platform support.
+
+    3.0.9 Dec-31-09
+        Add AVR32 and win64 ports.  Add ARM softfp support.
+        Many fixes for AIX, Solaris, HP-UX, *BSD.
+        Several PowerPC and x86-64 bug fixes.
+        Build DLL for windows.
+
+    3.0.8 Dec-19-08
+        Add *BSD, BeOS, and PA-Linux support.
+
+    3.0.7 Nov-11-08
+        Fix for ppc FreeBSD.
+        (thanks to Andreas Tobler)
+
+    3.0.6 Jul-17-08
+        Fix for closures on sh.
+        Mark the sh/sh64 stack as non-executable.
+        (both thanks to Kaz Kojima)
+
+    3.0.5 Apr-3-08
+        Fix libffi.pc file.
+        Fix #define ARM for IcedTea users.
+        Fix x86 closure bug.
+
+    3.0.4 Feb-24-08
+        Fix x86 OpenBSD configury.
+
+    3.0.3 Feb-22-08
+        Enable x86 OpenBSD thanks to Thomas Heller, and
+          x86-64 FreeBSD thanks to Björn König and Andreas Tobler.
+        Clean up test instruction in README.
+
+    3.0.2 Feb-21-08
+        Improved x86 FreeBSD support.
+        Thanks to Björn König.
+
+    3.0.1 Feb-15-08
+        Fix instruction cache flushing bug on MIPS.
+        Thanks to David Daney.
+
+    3.0.0 Feb-15-08
+        Many changes, mostly thanks to the GCC project.
+        Cygnus Solutions is now Red Hat.
+
+      [10 years go by...]
+
+    1.20 Oct-5-98
+        Raffaele Sena produces ARM port.
+
+    1.19 Oct-5-98
+        Fixed x86 long double and long long return support.
+        m68k bug fixes from Andreas Schwab.
+        Patch for DU assembler compatibility for the Alpha from Richard
+          Henderson.
+
+    1.18 Apr-17-98
+        Bug fixes and MIPS configuration changes.
+
+    1.17 Feb-24-98
+        Bug fixes and m68k port from Andreas Schwab. PowerPC port from
+        Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.
+
+    1.16 Feb-11-98
+        Richard Henderson produces Alpha port.
+
+    1.15 Dec-4-97
+        Fixed an n32 ABI bug. New libtool, auto* support.
+
+    1.14 May-13-97
+        libtool is now used to generate shared and static libraries.
+        Fixed a minor portability problem reported by Russ McManus
+        <mcmanr@eq.gs.com>.
+
+    1.13 Dec-2-96
+        Added --enable-purify-safety to keep Purify from complaining
+          about certain low level code.
+        Sparc fix for calling functions with < 6 args.
+        Linux x86 a.out fix.
+
+    1.12 Nov-22-96
+        Added missing ffi_type_void, needed for supporting void return
+          types. Fixed test case for non MIPS machines. Cygnus Support
+          is now Cygnus Solutions.
+
+    1.11 Oct-30-96
+        Added notes about GNU make.
+
+    1.10 Oct-29-96
+        Added configuration fix for non GNU compilers.
+
+    1.09 Oct-29-96
+        Added --enable-debug configure switch. Clean-ups based on LCLint
+        feedback. ffi_mips.h is always installed. Many configuration
+        fixes. Fixed ffitest.c for sparc builds.
+
+    1.08 Oct-15-96
+        Fixed n32 problem. Many clean-ups.
+
+    1.07 Oct-14-96
+        Gordon Irlam rewrites v8.S again. Bug fixes.
+
+    1.06 Oct-14-96
+        Gordon Irlam improved the sparc port.
+
+    1.05 Oct-14-96
+        Interface changes based on feedback.
+
+    1.04 Oct-11-96
+        Sparc port complete (modulo struct passing bug).
+
+    1.03 Oct-10-96
+        Passing struct args, and returning struct values works for
+        all architectures/calling conventions. Expanded tests.
+
+    1.02 Oct-9-96
+        Added SGI n32 support. Fixed bugs in both o32 and Linux support.
+        Added "make test".
+
+    1.01 Oct-8-96
+        Fixed float passing bug in mips version. Restructured some
+        of the code. Builds cleanly with SGI tools.
+
+    1.00 Oct-7-96
+        First release. No public announcement.
+
+Authors & Credits
+=================
+
+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
+details.
+
+Some of the ideas behind libffi were inspired by Gianni Mariani's free
+gencall library for Silicon Graphics machines.
+
+The closure mechanism was designed and implemented by Kresten Krab
+Thorup.
+
+Major processor architecture ports were contributed by the following
+developers:
+
+    aarch64             Marcus Shawcroft, James Greenhalgh
+    alpha               Richard Henderson
+    arc                 Hackers at Synopsis
+    arm                 Raffaele Sena
+    avr32               Bradley Smith
+    blackfin            Alexandre Keunecke I. de Mendonca
+    cris                Simon Posnjak, Hans-Peter Nilsson
+    csky                Ma Jun, Zhang Wenmeng
+    frv                 Anthony Green
+    ia64                Hans Boehm
+    kvx                 Yann Sionneau
+    m32r                Kazuhiro Inaoka
+    m68k                Andreas Schwab
+    m88k                Miod Vallat
+    metag               Hackers at Imagination Technologies
+    microblaze          Nathan Rossi
+    mips                Anthony Green, Casey Marshall
+    mips64              David Daney
+    moxie               Anthony Green
+    nios ii             Sandra Loosemore
+    openrisc            Sebastian Macke
+    pa                  Randolph Chung, Dave Anglin, Andreas Tobler
+    powerpc             Geoffrey Keating, Andreas Tobler,
+                        David Edelsohn, John Hornkvist
+    powerpc64           Jakub Jelinek
+    riscv               Michael Knyszek, Andrew Waterman, Stef O'Rear
+    s390                Gerhard Tonn, Ulrich Weigand
+    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
+
+Jesper Skov and Andrew Haley both did more than their fair share of
+stepping through the code and tracking down bugs.
+
+Thanks also to Tom Tromey for bug fixes, documentation and
+configuration help.
+
+Thanks to Jim Blandy, who provided some useful feedback on the libffi
+interface.
+
+Andreas Tobler has done a tremendous amount of work on the testsuite.
+
+Alex Oliva solved the executable page problem for SElinux.
+
+The list above is almost certainly incomplete and inaccurate.  I'm
+happy to make corrections or additions upon request.
+
+If you have a problem, or have found a bug, please file an issue on
+our issue tracker at https://github.com/libffi/libffi/issues.
+
+The author can be reached at green@moxielogic.com.
+
+To subscribe/unsubscribe to our mailing lists, visit:
+https://sourceware.org/mailman/listinfo/libffi-announce
+https://sourceware.org/mailman/listinfo/libffi-discuss
index b09be64f9287b476f0ec9786ae0bc3b3727c1713..1a70efb010dc045bb4287ca1afcff76bfa0d74a1 100644 (file)
@@ -95,14 +95,14 @@ dnl ----------------------------------------------------------------------
 dnl This whole bit snagged from libstdc++-v3, via libatomic.
 
 dnl
-dnl LIBAT_ENABLE
+dnl LIBFFI_ENABLE
 dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
 dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
 dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
 dnl
 dnl See docs/html/17_intro/configury.html#enable for documentation.
 dnl
-m4_define([LIBAT_ENABLE],[dnl
+m4_define([LIBFFI_ENABLE],[dnl
 m4_define([_g_switch],[--enable-$1])dnl
 m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
  AC_ARG_ENABLE($1,_g_help,
@@ -146,7 +146,7 @@ dnl
 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
 dnl set libat_gnu_ld_version to 12345.  Zeros cause problems.
 dnl
-AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
+AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [
   # If we're not using GNU ld, then there's no point in even trying these
   # tests.  Check for that first.  We should have already tested for gld
   # by now (in libtool), but require it now just to be safe...
@@ -178,7 +178,7 @@ AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
   fi
   changequote(,)
   ldver=`$LD --version 2>/dev/null |
-         sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
+         sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
   changequote([,])
   libat_gnu_ld_version=`echo $ldver | \
          $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
@@ -248,7 +248,7 @@ dnl
 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
 dnl set libat_gnu_ld_version to 12345.  Zeros cause problems.
 dnl
-AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
+AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [
   # If we're not using GNU ld, then there's no point in even trying these
   # tests.  Check for that first.  We should have already tested for gld
   # by now (in libtool), but require it now just to be safe...
@@ -278,9 +278,13 @@ AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
   if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
     libat_ld_is_gold=yes
   fi
+  libat_ld_is_lld=no
+  if $LD --version 2>/dev/null | grep 'LLD '> /dev/null 2>&1; then
+    libat_ld_is_lld=yes
+  fi
   changequote(,)
   ldver=`$LD --version 2>/dev/null |
-         sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
+         sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
   changequote([,])
   libat_gnu_ld_version=`echo $ldver | \
          $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
@@ -341,20 +345,20 @@ dnl --enable-symvers=style adds a version script to the linker call when
 dnl       creating the shared library.  The choice of version script is
 dnl       controlled by 'style'.
 dnl --disable-symvers does not.
-dnl  +  Usage:  LIBAT_ENABLE_SYMVERS[(DEFAULT)]
+dnl  +  Usage:  LIBFFI_ENABLE_SYMVERS[(DEFAULT)]
 dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
 dnl       choose a default style based on linker characteristics.  Passing
 dnl       'no' disables versioning.
 dnl
-AC_DEFUN([LIBAT_ENABLE_SYMVERS], [
+AC_DEFUN([LIBFFI_ENABLE_SYMVERS], [
 
-LIBAT_ENABLE(symvers,yes,[=STYLE],
+LIBFFI_ENABLE(symvers,yes,[=STYLE],
   [enables symbol versioning of the shared library],
   [permit yes|no|gnu*|sun])
 
-# If we never went through the LIBAT_CHECK_LINKER_FEATURES macro, then we
+# If we never went through the LIBFFI_CHECK_LINKER_FEATURES macro, then we
 # don't know enough about $LD to do tricks...
-AC_REQUIRE([LIBAT_CHECK_LINKER_FEATURES])
+AC_REQUIRE([LIBFFI_CHECK_LINKER_FEATURES])
 
 # Turn a 'yes' into a suitable default.
 if test x$enable_symvers = xyes ; then
@@ -420,7 +424,7 @@ changequote([,])dnl
 fi
 
 # For GNU ld, we need at least this version.  The format is described in
-# LIBAT_CHECK_LINKER_FEATURES above.
+# LIBFFI_CHECK_LINKER_FEATURES above.
 libat_min_gnu_ld_version=21400
 # XXXXXXXXXXX libat_gnu_ld_version=21390
 
@@ -432,6 +436,8 @@ if test $enable_symvers != no && test $libat_shared_libgcc = yes; then
       enable_symvers=gnu
     elif test $libat_ld_is_gold = yes ; then
       enable_symvers=gnu
+    elif test $libat_ld_is_lld = yes ; then
+      enable_symvers=gnu
     else
       # The right tools, the right setup, but too old.  Fallbacks?
       AC_MSG_WARN(=== Linker version $libat_gnu_ld_version is too old for)
@@ -462,12 +468,12 @@ if test $enable_symvers != no && test $libat_shared_libgcc = yes; then
   fi
 fi
 if test $enable_symvers = gnu; then
-  AC_DEFINE(LIBAT_GNU_SYMBOL_VERSIONING, 1,
+  AC_DEFINE(LIBFFI_GNU_SYMBOL_VERSIONING, 1,
            [Define to 1 if GNU symbol versioning is used for libatomic.])
 fi
 
-AM_CONDITIONAL(LIBAT_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
-AM_CONDITIONAL(LIBAT_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu)
-AM_CONDITIONAL(LIBAT_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun)
+AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
+AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu)
+AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun)
 AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
 ])
diff --git a/libffi/aclocal.m4 b/libffi/aclocal.m4
deleted file mode 100644 (file)
index 9c8c88f..0000000
+++ /dev/null
@@ -1,1202 +0,0 @@
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-
-# Copyright (C) 1996-2017 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# 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],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf.  It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-
-# Copyright (C) 2002-2017 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_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.15'
-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.15.1], [],
-      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too.  Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_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.15.1])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-2017 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_AS
-# ----------
-AC_DEFUN([AM_PROG_AS],
-[# By default we simply use the C compiler to build assembly code.
-AC_REQUIRE([AC_PROG_CC])
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
-AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
-_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
-])
-
-# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
-
-# Copyright (C) 2001-2017 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.
-
-# 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/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is '.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-])
-
-# AM_CONDITIONAL                                            -*- Autoconf -*-
-
-# Copyright (C) 1997-2017 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_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ([2.52])dnl
- m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999-2017 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.
-
-
-# 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,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
-      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
-      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
-      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
-      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                    [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
-  fi
-  am__universal=false
-  m4_case([$1], [CC],
-    [case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac],
-    [CXX],
-    [case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac])
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_$1_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE([dependency-tracking], [dnl
-AS_HELP_STRING(
-  [--enable-dependency-tracking],
-  [do not reject slow dependency extractors])
-AS_HELP_STRING(
-  [--disable-dependency-tracking],
-  [speeds up one-time build])])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-  am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking.              -*- Autoconf -*-
-
-# Copyright (C) 1999-2017 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_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
-  # 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
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    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
-    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
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
-  done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake.                             -*- Autoconf -*-
-
-# Copyright (C) 1996-2017 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.
-
-# 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.
-
-dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
-m4_define([AC_PROG_CC],
-m4_defn([AC_PROG_CC])
-[_AM_PROG_CC_C_O
-])
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# 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.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
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[AC_DIAGNOSE([obsolete],
-             [$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])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(
-  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
-  [ok:ok],,
-  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
- AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
-AM_MISSING_PROG([AUTOCONF], [autoconf])
-AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
-AM_MISSING_PROG([AUTOHEADER], [autoheader])
-AM_MISSING_PROG([MAKEINFO], [makeinfo])
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-# For better backward compatibility.  To be removed once Automake 1.9.x
-# dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target (and possibly the TAP driver).  The
-# system "awk" is bad on some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-                            [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                 [_AM_DEPENDENCIES([CC])],
-                 [m4_define([AC_PROG_CC],
-                            m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                 [_AM_DEPENDENCIES([CXX])],
-                 [m4_define([AC_PROG_CXX],
-                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                 [_AM_DEPENDENCIES([OBJC])],
-                 [m4_define([AC_PROG_OBJC],
-                            m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
-                 [_AM_DEPENDENCIES([OBJCXX])],
-                 [m4_define([AC_PROG_OBJCXX],
-                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
-])
-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
-
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes.  So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
-  cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present.  This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message.  This
-can help us improve future automake versions.
-
-END
-  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
-    echo 'Configuration will proceed anyway, since you have set the' >&2
-    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
-    echo >&2
-  else
-    cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
-    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
-  fi
-fi
-dnl The trailing newline in this macro's definition is deliberate, for
-dnl backward compatibility and to allow trailing 'dnl'-style comments
-dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
-])
-
-dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $_am_arg | $_am_arg:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001-2017 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_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
-  *)
-    install_sh="\${SHELL} $am_aux_dir/install-sh"
-  esac
-fi
-AC_SUBST([install_sh])])
-
-# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996-2017 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_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless 'enable' is passed literally.
-# For symmetry, 'disable' may be passed as well.  Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
-       [enable], [m4_define([am_maintainer_other], [disable])],
-       [disable], [m4_define([am_maintainer_other], [enable])],
-       [m4_define([am_maintainer_other], [enable])
-        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
-  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
-  AC_ARG_ENABLE([maintainer-mode],
-    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
-      am_maintainer_other[ make rules and dependencies not useful
-      (and sometimes confusing) to the casual installer])],
-    [USE_MAINTAINER_MODE=$enableval],
-    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
-  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
-  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
-  MAINT=$MAINTAINER_MODE_TRUE
-  AC_SUBST([MAINT])dnl
-]
-)
-
-# Check to see how 'make' treats includes.                 -*- Autoconf -*-
-
-# Copyright (C) 2001-2017 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_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-       @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
-
-# Copyright (C) 1997-2017 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_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# 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
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
-  am_missing_run="$MISSING "
-else
-  am_missing_run=
-  AC_MSG_WARN(['missing' script is too old or missing])
-fi
-])
-
-# Helper functions for option handling.                     -*- Autoconf -*-
-
-# Copyright (C) 2001-2017 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_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Copyright (C) 1999-2017 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_CC_C_O
-# ---------------
-# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
-# to automatically call this.
-AC_DEFUN([_AM_PROG_CC_C_O],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-AC_LANG_PUSH([C])dnl
-AC_CACHE_CHECK(
-  [whether $CC understands -c and -o together],
-  [am_cv_prog_cc_c_o],
-  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-  # Make sure it works both with $CC and with simple cc.
-  # Following AC_PROG_CC_C_O, we do the test twice because some
-  # compilers refuse to overwrite an existing .o file with -o,
-  # though they will create one.
-  am_cv_prog_cc_c_o=yes
-  for am_i in 1 2; do
-    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
-         && test -f conftest2.$ac_objext; then
-      : OK
-    else
-      am_cv_prog_cc_c_o=no
-      break
-    fi
-  done
-  rm -f core conftest*
-  unset am_i])
-if test "$am_cv_prog_cc_c_o" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-AC_LANG_POP([C])])
-
-# For backward compatibility.
-AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-
-# Copyright (C) 2001-2017 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_RUN_LOG(COMMAND)
-# -------------------
-# Run COMMAND, save the exit status in ac_status, and log it.
-# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
-AC_DEFUN([AM_RUN_LOG],
-[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
-   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   (exit $ac_status); }])
-
-# Check to make sure that the build environment is sane.    -*- Autoconf -*-
-
-# Copyright (C) 1996-2017 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_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name.  Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
-  *[[\\\"\#\$\&\'\`$am_lf]]*)
-    AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
-  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
-    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   am_has_slept=no
-   for am_try in 1 2; do
-     echo "timestamp, slept: $am_has_slept" > conftest.file
-     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-     if test "$[*]" = "X"; then
-       # -L didn't work.
-       set X `ls -t "$srcdir/configure" conftest.file`
-     fi
-     if test "$[*]" != "X $srcdir/configure conftest.file" \
-       && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-       # If neither matched, then we have a broken ls.  This can happen
-       # if, for instance, CONFIG_SHELL is bash and it inherits a
-       # broken ls alias from the environment.  This has actually
-       # happened.  Such a system could not be considered "sane".
-       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-  alias in your environment])
-     fi
-     if test "$[2]" = conftest.file || test $am_try -eq 2; then
-       break
-     fi
-     # Just in case.
-     sleep 1
-     am_has_slept=yes
-   done
-   test "$[2]" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT([yes])
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
-  ( sleep 1 ) &
-  am_sleep_pid=$!
-fi
-AC_CONFIG_COMMANDS_PRE(
-  [AC_MSG_CHECKING([that generated files are newer than configure])
-   if test -n "$am_sleep_pid"; then
-     # Hide warnings about reused PIDs.
-     wait $am_sleep_pid 2>/dev/null
-   fi
-   AC_MSG_RESULT([done])])
-rm -f conftest.file
-])
-
-# Copyright (C) 2009-2017 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_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-2017 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
-# ---------------------
-# One issue with vendor 'install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in "make install-strip", and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip".  However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006-2017 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_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball.                            -*- Autoconf -*-
-
-# Copyright (C) 2004-2017 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_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of 'v7', 'ustar', or 'pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-#     tardir=directory && $(am__tar) > result.tar
-#
-# 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}'])
-
-# 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'
-
-m4_if([$1], [v7],
-  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-
-  [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
-
-  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
-
-m4_include([../config/acx.m4])
-m4_include([../config/asmcfi.m4])
-m4_include([../config/depstand.m4])
-m4_include([../config/lead-dot.m4])
-m4_include([../config/multi.m4])
-m4_include([../config/override.m4])
-m4_include([../config/toolexeclibdir.m4])
-m4_include([../libtool.m4])
-m4_include([../ltoptions.m4])
-m4_include([../ltsugar.m4])
-m4_include([../ltversion.m4])
-m4_include([../lt~obsolete.m4])
-m4_include([acinclude.m4])
diff --git a/libffi/configure b/libffi/configure
deleted file mode 100755 (executable)
index 8d52ec4..0000000
+++ /dev/null
@@ -1,19411 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libffi 3.99999.
-#
-# Report bugs to <http://github.com/atgreen/libffi/issues>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-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
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-       expr "X$arg" : "X\\(.*\\)$as_nl";
-       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""       $as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="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
-else
-  case \`(set -o) 2>/dev/null\` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-"
-  as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
-  exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-
-  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
-    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
-      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  as_found=:
-  case $as_dir in #(
-        /*)
-          for as_base in sh bash ksh sh5; do
-            # Try only shells that exist, to save several forks.
-            as_shell=$as_dir/$as_base
-            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  CONFIG_SHELL=$as_shell as_have_required=yes
-                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  break 2
-fi
-fi
-          done;;
-       esac
-  as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
-      if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
-  else
-    $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: http://github.com/atgreen/libffi/issues about your
-$0: system, including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
-  fi
-  exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-           s//\1/
-           q
-         }
-         /^X\/\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\/\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
-  as_lineno_1=$LINENO as_lineno_1a=$LINENO
-  as_lineno_2=$LINENO as_lineno_2a=$LINENO
-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='        ';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='libffi'
-PACKAGE_TARNAME='libffi'
-PACKAGE_VERSION='3.99999'
-PACKAGE_STRING='libffi 3.99999'
-PACKAGE_BUGREPORT='http://github.com/atgreen/libffi/issues'
-PACKAGE_URL=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-get_gcc_base_ver
-LIBAT_BUILD_VERSIONED_SHLIB_SUN_FALSE
-LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE
-LIBAT_BUILD_VERSIONED_SHLIB_GNU_FALSE
-LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE
-LIBAT_BUILD_VERSIONED_SHLIB_FALSE
-LIBAT_BUILD_VERSIONED_SHLIB_TRUE
-OPT_LDFLAGS
-SECTION_LDFLAGS
-toolexeclibdir
-toolexecdir
-FFI_DEBUG_FALSE
-FFI_DEBUG_TRUE
-TARGET_OBJ
-TARGETDIR
-TARGET
-FFI_EXEC_TRAMPOLINE_TABLE
-FFI_EXEC_TRAMPOLINE_TABLE_FALSE
-FFI_EXEC_TRAMPOLINE_TABLE_TRUE
-HAVE_LONG_DOUBLE_VARIANT
-HAVE_LONG_DOUBLE
-ALLOCA
-AM_LTLDFLAGS
-AM_RUNTESTFLAGS
-TESTSUBDIR_FALSE
-TESTSUBDIR_TRUE
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-CXXCPP
-CPP
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-RANLIB
-AR
-OBJDUMP
-LN_S
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-EGREP
-GREP
-SED
-LIBTOOL
-am__fastdepCCAS_FALSE
-am__fastdepCCAS_TRUE
-CCASDEPMODE
-CCASFLAGS
-CCAS
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-GENINSRC_FALSE
-GENINSRC_TRUE
-BUILD_INFO_FALSE
-BUILD_INFO_TRUE
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-multi_basedir
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_multilib
-enable_silent_rules
-enable_generated_files_in_srcdir
-enable_dependency_tracking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-enable_libtool_lock
-enable_maintainer_mode
-enable_pax_emutramp
-enable_debug
-enable_structs
-enable_raw_api
-enable_purify_safety
-with_toolexeclibdir
-enable_symvers
-with_gcc_major_version_only
-'
-      ac_precious_vars='build_alias
-host_alias
-target_alias
-CCAS
-CCASFLAGS
-CPP
-CPPFLAGS
-CXXCPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
-    ac_prev=
-    continue
-  fi
-
-  case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
-    datadir=$ac_optarg ;;
-
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-        ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
-
-  -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-        ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-        ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=\$ac_optarg ;;
-
-  -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-        ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    case $ac_envvar in #(
-      '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
-    esac
-    eval $ac_envvar=\$ac_optarg
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
-               datadir sysconfdir sharedstatedir localstatedir includedir \
-               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
-do
-  eval ac_val=\$$ac_var
-  # Remove trailing slashes.
-  case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
-  esac
-  # Be sure to have absolute directory names.
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-  esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_myself" : 'X\(//\)[^/]' \| \
-        X"$as_myself" : 'X\(//\)$' \| \
-        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
-       pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures libffi 3.99999 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/libffi]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
-_ACEOF
-
-  cat <<\_ACEOF
-
-Program names:
-  --program-prefix=PREFIX            prepend PREFIX to installed program names
-  --program-suffix=SUFFIX            append SUFFIX to installed program names
-  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
-
-System types:
-  --build=BUILD     configure for building on BUILD [guessed]
-  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
-  --target=TARGET   configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-  case $ac_init_help in
-     short | recursive ) echo "Configuration of libffi 3.99999:";;
-   esac
-  cat <<\_ACEOF
-
-Optional Features:
-  --disable-option-checking  ignore unrecognized --enable/--with options
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-multilib       build many library versions (default)
-  --enable-silent-rules   less verbose build output (undo: "make V=1")
-  --disable-silent-rules  verbose build output (undo: "make V=0")
-  --enable-generated-files-in-srcdir
-                          put copies of generated files in source dir intended
-                          for creating source tarballs for users without
-                          texinfo bison or flex
-  --enable-dependency-tracking
-                          do not reject slow dependency extractors
-  --disable-dependency-tracking
-                          speeds up one-time build
-  --enable-shared[=PKGS]  build shared libraries [default=yes]
-  --enable-static[=PKGS]  build static libraries [default=yes]
-  --enable-fast-install[=PKGS]
-                          optimize for fast installation [default=yes]
-  --disable-libtool-lock  avoid locking (might break parallel builds)
-  --enable-maintainer-mode
-                          enable make rules and dependencies not useful (and
-                          sometimes confusing) to the casual installer
-  --enable-pax_emutramp       enable pax emulated trampolines, for we can't use PROT_EXEC
-  --enable-debug          debugging mode
-  --disable-structs       omit code for struct support
-  --disable-raw-api       make the raw api unavailable
-  --enable-purify-safety  purify-safe mode
-  --enable-symvers=STYLE  enables symbol versioning of the shared library
-                          [default=yes]
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic              try to use only PIC/non-PIC objects [default=use
-                          both]
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-toolexeclibdir=DIR
-                          install libraries built with a cross compiler within
-                          DIR
-  --with-gcc-major-version-only
-                          use only GCC major number in filesystem paths
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
-  CCAS        assembler compiler command (defaults to CC)
-  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
-  CPP         C preprocessor
-  CXXCPP      C++ preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <http://github.com/atgreen/libffi/issues>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-libffi configure 3.99999
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-        test -z "$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-        test -z "$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if test "$cross_compiling" = yes; then
-    # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid; break
-else
-  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
-                       if test $ac_lo -le $ac_mid; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=$ac_mid; break
-else
-  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid
-else
-  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (($2) < 0)
-    {
-      long int i = longval ();
-      if (i != ($2))
-       return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ($2))
-       return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
-  ac_retval=1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
-  fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_compute_int
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ------------------------------------------------------ ##
-## Report this to http://github.com/atgreen/libffi/issues ##
-## ------------------------------------------------------ ##"
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-        return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-           return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by libffi $as_me 3.99999, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
-  done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
-    2)
-      as_fn_append ac_configure_args1 " '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-       ac_must_keep_next=false # Got value, back to normal.
-      else
-       case $ac_arg in
-         *=* | --config-cache | -C | -disable-* | --disable-* \
-         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-         | -with-* | --with-* | -without-* | --without-* | --x)
-           case "$ac_configure_args0 " in
-             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-           esac
-           ;;
-         -* ) ac_must_keep_next=true ;;
-       esac
-      fi
-      as_fn_append ac_configure_args " '$ac_arg'"
-      ;;
-    esac
-  done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-  (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      sed -n \
-       "s/'\''/'\''\\\\'\'''\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
-    *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-)
-    echo
-
-    $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      $as_echo "$ac_var='\''$ac_val'\''"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
-      echo
-      for ac_var in $ac_subst_files
-      do
-       eval ac_val=\$$ac_var
-       case $ac_val in
-       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-       esac
-       $as_echo "$ac_var='\''$ac_val'\''"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
-      echo
-      cat confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
-elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
-else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
-  test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special files
-  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
-  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . "$cache_file";;
-      *)                      . "./$cache_file";;
-    esac
-  fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-       # differences in whitespace do not lead to failure.
-       ac_old_val_w=`echo x $ac_old_val`
-       ac_new_val_w=`echo x $ac_new_val`
-       if test "$ac_old_val_w" != "$ac_new_val_w"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-         ac_cache_corrupted=:
-       else
-         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-         eval $ac_var=\$ac_old_val
-       fi
-       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-ac_config_headers="$ac_config_headers fficonfig.h"
-
-
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
-  enableval=$enable_multilib; case "$enableval" in
-  yes) multilib=yes ;;
-  no)  multilib=no ;;
-  *)   as_fn_error $? "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
-  multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
-  if test "$with_target_subdir" != "."; then
-    multi_basedir="$srcdir/$with_multisrctop../.."
-  else
-    multi_basedir="$srcdir/$with_multisrctop.."
-  fi
-else
-  multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
-   && test "x${with_multisubdir}" != x ; then
-   cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$target_alias" = x; then
-  ac_cv_target=$ac_cv_host
-else
-  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
-  test "$program_prefix$program_suffix$program_transform_name" = \
-    NONENONEs,x,x, &&
-  program_prefix=${target_alias}-
-
-target_alias=${target_alias-$host_alias}
-
-am__api_version='1.15'
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-         if test $ac_prog = install &&
-           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         elif test $ac_prog = install &&
-           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
-           rm -rf conftest.one conftest.two conftest.dir
-           echo one > conftest.one
-           echo two > conftest.two
-           mkdir conftest.dir
-           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-             test -s conftest.one && test -s conftest.two &&
-             test -s conftest.dir/conftest.one &&
-             test -s conftest.dir/conftest.two
-           then
-             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-             break 3
-           fi
-         fi
-       fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name.  Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
-  *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
-  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   am_has_slept=no
-   for am_try in 1 2; do
-     echo "timestamp, slept: $am_has_slept" > conftest.file
-     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-     if test "$*" = "X"; then
-       # -L didn't work.
-       set X `ls -t "$srcdir/configure" conftest.file`
-     fi
-     if test "$*" != "X $srcdir/configure conftest.file" \
-       && test "$*" != "X conftest.file $srcdir/configure"; then
-
-       # If neither matched, then we have a broken ls.  This can happen
-       # if, for instance, CONFIG_SHELL is bash and it inherits a
-       # broken ls alias from the environment.  This has actually
-       # happened.  Such a system could not be considered "sane".
-       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-  alias in your environment" "$LINENO" 5
-     fi
-     if test "$2" = conftest.file || test $am_try -eq 2; then
-       break
-     fi
-     # Just in case.
-     sleep 1
-     am_has_slept=yes
-   done
-   test "$2" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
-  ( sleep 1 ) &
-  am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
-  program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
-  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
-  am_missing_run="$MISSING "
-else
-  am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
-  *)
-    install_sh="\${SHELL} $am_aux_dir/install-sh"
-  esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip".  However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if ${ac_cv_path_mkdir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in mkdir gmkdir; do
-        for ac_exec_ext in '' $ac_executable_extensions; do
-          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
-          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
-            'mkdir (GNU coreutils) '* | \
-            'mkdir (coreutils) '* | \
-            'mkdir (fileutils) '4.1*)
-              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
-              break 3;;
-          esac
-        done
-       done
-  done
-IFS=$as_save_IFS
-
-fi
-
-  test -d ./--version && rmdir ./--version
-  if test "${ac_cv_path_mkdir+set}" = set; then
-    MKDIR_P="$ac_cv_path_mkdir -p"
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for MKDIR_P within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    MKDIR_P="$ac_install_sh -d"
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-       @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
-  enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in # (((
-  yes) AM_DEFAULT_VERBOSITY=0;;
-   no) AM_DEFAULT_VERBOSITY=1;;
-    *) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  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
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
-    AM_V='$(V)'
-  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
-  AM_V=$AM_DEFAULT_VERBOSITY
-  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  am__isrc=' -I$(srcdir)'
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='libffi'
- VERSION='3.99999'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# For better backward compatibility.  To be removed once Automake 1.9.x
-# dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
-
-# We need awk for the "check" target (and possibly the TAP driver).  The
-# system "awk" is bad on some platforms.
-# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar  pax cpio none'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes.  So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
-  cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present.  This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message.  This
-can help us improve future automake versions.
-
-END
-  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
-    echo 'Configuration will proceed anyway, since you have set the' >&2
-    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
-    echo >&2
-  else
-    cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
-    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
-  fi
-fi
-
-
-# See if makeinfo has been installed and is modern enough
-# that we can use it.
-
-  # Extract the first word of "makeinfo", so it can be a program name with args.
-set dummy makeinfo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKEINFO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKEINFO"; then
-  ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKEINFO="makeinfo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKEINFO=$ac_cv_prog_MAKEINFO
-if test -n "$MAKEINFO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5
-$as_echo "$MAKEINFO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  if test -n "$MAKEINFO"; then
-    # Found it, now check the version.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modern makeinfo" >&5
-$as_echo_n "checking for modern makeinfo... " >&6; }
-if ${gcc_cv_prog_makeinfo_modern+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_prog_version=`eval $MAKEINFO --version 2>&1 |
-                                     sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
-
-                    case $ac_prog_version in
-                      '')  gcc_cv_prog_makeinfo_modern=no;;
-                      4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*)  gcc_cv_prog_makeinfo_modern=yes;;
-                      *)   gcc_cv_prog_makeinfo_modern=no;;
-                    esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_makeinfo_modern" >&5
-$as_echo "$gcc_cv_prog_makeinfo_modern" >&6; }
-  else
-    gcc_cv_prog_makeinfo_modern=no
-  fi
-  if test $gcc_cv_prog_makeinfo_modern = no; then
-    MAKEINFO="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing makeinfo"
-  fi
-
- if test $gcc_cv_prog_makeinfo_modern = "yes"; then
-  BUILD_INFO_TRUE=
-  BUILD_INFO_FALSE='#'
-else
-  BUILD_INFO_TRUE='#'
-  BUILD_INFO_FALSE=
-fi
-
-
-# We would like our source tree to be readonly. However when releases or
-# pre-releases are generated, the flex/bison generated files as well as the
-# various formats of manuals need to be included along with the rest of the
-# sources.  Therefore we have --enable-generated-files-in-srcdir to do
-# just that.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking generated-files-in-srcdir" >&5
-$as_echo_n "checking generated-files-in-srcdir... " >&6; }
-# Check whether --enable-generated-files-in-srcdir was given.
-if test "${enable_generated_files_in_srcdir+set}" = set; then :
-  enableval=$enable_generated_files_in_srcdir; case "$enableval" in
- yes) enable_generated_files_in_srcdir=yes ;;
- no)  enable_generated_files_in_srcdir=no ;;
- *)   as_fn_error $? "Unknown argument to enable/disable version-specific libs" "$LINENO" 5;;
- esac
-else
-  enable_generated_files_in_srcdir=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_generated_files_in_srcdir" >&5
-$as_echo "$enable_generated_files_in_srcdir" >&6; }
- if test "$enable_generated_files_in_srcdir" = yes; then
-  GENINSRC_TRUE=
-  GENINSRC_FALSE='#'
-else
-  GENINSRC_TRUE='#'
-  GENINSRC_FALSE=
-fi
-
-
-# The same as in boehm-gc and libstdc++. Have to borrow it from there.
-# We must force CC to /not/ be precious variables; otherwise
-# the wrong, non-multilib-adjusted value will be used in multilibs.
-# As a side effect, we have to subst CFLAGS ourselves.
-# Also save and restore CFLAGS, since AC_PROG_CC will come up with
-# defaults of its own if none are provided.
-
-
-
-save_CFLAGS=$CFLAGS
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-       ;;
-    [ab].out )
-       # We found the default executable, but exeext='' is most
-       # certainly right.
-       break;;
-    *.* )
-       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-       then :; else
-          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-       fi
-       # We set ac_cv_exeext here because the later test for it is not
-       # safe: cross compilers may not add the suffix if given an `-o'
-       # argument, so we may need to know it at that point already.
-       # Even if this section looks crufty: it has the advantage of
-       # actually working.
-       break;;
-    * )
-       break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-         break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-       cross_compiling=yes
-    else
-       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-        CFLAGS="-g"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-  # Make sure it works both with $CC and with simple cc.
-  # Following AC_PROG_CC_C_O, we do the test twice because some
-  # compilers refuse to overwrite an existing .o file with -o,
-  # though they will create one.
-  am_cv_prog_cc_c_o=yes
-  for am_i in 1 2; do
-    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
-   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } \
-         && test -f conftest2.$ac_objext; then
-      : OK
-    else
-      am_cv_prog_cc_c_o=no
-      break
-    fi
-  done
-  rm -f core conftest*
-  unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-       @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
-  enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-  am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
-else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
-
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
-else
-  GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-        CXXFLAGS="-g"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX"  am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
-
-
-CFLAGS=$save_CFLAGS
-
-
-
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-depcc="$CCAS"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CCAS_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CCAS_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CCAS_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
-CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
-  am__fastdepCCAS_TRUE=
-  am__fastdepCCAS_FALSE='#'
-else
-  am__fastdepCCAS_TRUE='#'
-  am__fastdepCCAS_FALSE=
-fi
-
-
-
-case `pwd` in
-  *\ * | *\    *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.2.7a'
-macro_revision='1.3134'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO ""
-}
-
-case "$ECHO" in
-  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
-  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
-  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_SED_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
-  fi
-else
-  ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-   then ac_cv_path_FGREP="$GREP -F"
-   else
-     if test -z "$FGREP"; then
-  ac_path_FGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in fgrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
-  # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'FGREP' >> "conftest.nl"
-    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_FGREP="$ac_path_FGREP"
-      ac_path_FGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_FGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_FGREP=$FGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       # Tru64's nm complains that /dev/null is an invalid object file
-       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-       */dev/null* | *'Invalid file or object type'*)
-         lt_cv_path_NM="$tmp_nm -B"
-         break
-         ;;
-       *)
-         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-         */dev/null*)
-           lt_cv_path_NM="$tmp_nm -p"
-           break
-           ;;
-         *)
-           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-           continue # so that we can try to find one that supports BSD flags
-           ;;
-         esac
-         ;;
-       esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in dumpbin "link -dump"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DUMPBIN"; then
-  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$DUMPBIN" && break
-  done
-fi
-if test -z "$DUMPBIN"; then
-  ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in dumpbin "link -dump"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DUMPBIN"; then
-  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_DUMPBIN" && break
-done
-
-  if test "x$ac_ct_DUMPBIN" = x; then
-    DUMPBIN=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DUMPBIN=$ac_ct_DUMPBIN
-  fi
-fi
-
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
-  cat conftest.out >&5
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-    i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
-                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-             test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[45]*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[3-9]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK '"\
-"     {last_section=section; section=\$ 3};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
-  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<_LT_EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-         cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-const struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-         cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_save_LIBS="$LIBS"
-         lt_save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
-           pipe_works=yes
-         fi
-         LIBS="$lt_save_LIBS"
-         CFLAGS="$lt_save_CFLAGS"
-       else
-         echo "cannot find nm_test_func in $nlist" >&5
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
-  else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
-  enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-       HPUX_IA64_MODE="32"
-       ;;
-      *ELF-64*)
-       HPUX_IA64_MODE="64"
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -melf32bsmip"
-         ;;
-       *N32*)
-         LD="${LD-ld} -melf32bmipn32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -melf64bmip"
-       ;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -32"
-         ;;
-       *N32*)
-         LD="${LD-ld} -n32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -64"
-         ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_i386_fbsd"
-           ;;
-         x86_64-*linux*)
-           case `/usr/bin/file conftest.o` in
-             *x86-64*)
-               LD="${LD-ld} -m elf32_x86_64"
-               ;;
-             *)
-               LD="${LD-ld} -m elf_i386"
-               ;;
-           esac
-           ;;
-         powerpc64le-*linux*)
-           LD="${LD-ld} -m elf32lppclinux"
-           ;;
-         powerpc64-*linux*)
-           LD="${LD-ld} -m elf32ppclinux"
-           ;;
-         s390x-*linux*)
-           LD="${LD-ld} -m elf_s390"
-           ;;
-         sparc64-*linux*)
-           LD="${LD-ld} -m elf32_sparc"
-           ;;
-       esac
-       ;;
-      *64-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_x86_64_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_x86_64"
-           ;;
-         powerpcle-*linux*)
-           LD="${LD-ld} -m elf64lppc"
-           ;;
-         powerpc-*linux*)
-           LD="${LD-ld} -m elf64ppc"
-           ;;
-         s390*-*linux*|s390*-*tpf*)
-           LD="${LD-ld} -m elf64_s390"
-           ;;
-         sparc*-*linux*)
-           LD="${LD-ld} -m elf64_sparc"
-           ;;
-       esac
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_cc_needs_belf=yes
-else
-  lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-         LD="${LD-ld} -64"
-       fi
-       ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
-  fi
-else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    NMEDIT=$ac_ct_NMEDIT
-  fi
-else
-  NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LIPO"; then
-  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
-  ac_ct_LIPO=$LIPO
-  # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_LIPO"; then
-  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_LIPO="lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_LIPO" = x; then
-    LIPO=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    LIPO=$ac_ct_LIPO
-  fi
-else
-  LIPO="$ac_cv_prog_LIPO"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL"; then
-  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
-  ac_ct_OTOOL=$OTOOL
-  # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL"; then
-  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OTOOL="otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL" = x; then
-    OTOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL=$ac_ct_OTOOL
-  fi
-else
-  OTOOL="$ac_cv_prog_OTOOL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL64"; then
-  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
-  ac_ct_OTOOL64=$OTOOL64
-  # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL64"; then
-  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OTOOL64="otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL64" = x; then
-    OTOOL64=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL64=$ac_ct_OTOOL64
-  fi
-else
-  OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-       # By default we will add the -single_module flag. You can override
-       # by either setting the environment variable LT_MULTI_MODULE
-       # non-empty at configure time, or by adding -multi_module to the
-       # link flags.
-       rm -rf libconftest.dylib*
-       echo "int foo(void){return 1;}" > conftest.c
-       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
-       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
-         lt_cv_apple_cc_single_mod=yes
-       else
-         cat conftest.err >&5
-       fi
-       rm -rf libconftest.dylib*
-       rm -f conftest.*
-      fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_ld_exported_symbols_list=yes
-else
-  lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-       LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-      echo "$AR cru libconftest.a conftest.o" >&5
-      $AR cru libconftest.a conftest.o 2>&5
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
-       lt_cv_ld_force_load=yes
-      else
-       cat conftest.err >&5
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
-    # Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not expect to
-    # build without first building modern cctools / linker.
-    case $host_cpu-$host_os in
-    *-rhapsody* | *-darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    *-darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    *-darwin*)
-      # darwin 5.x (macOS 10.1) onwards we only need to adjust when the
-      # deployment target is forced to an earlier version.
-      case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in
-       UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*)
-         ;;
-       10.[012][,.]*)
-         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         ;;
-       *)
-         ;;
-     esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-# Set options
-
-
-
-        enable_dlopen=no
-
-
-  enable_win32_dll=no
-
-
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_shared=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_static=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
-  withval=$with_pic; pic_mode="$withval"
-else
-  pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      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,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_fast_install=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  else
-    MAGIC_CMD=:
-  fi
-fi
-
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
-  *)
-    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
-  esac
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
-    :
-fi
-
-fi
-
-
-
-
-
-
-  lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static='-Bstatic'
-      fi
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      lt_prog_compiler_static=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       # +Z the default
-       ;;
-      *)
-       lt_prog_compiler_pic='-fPIC'
-       ;;
-      esac
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       lt_prog_compiler_pic=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      lt_prog_compiler_wl='-Xlinker '
-      lt_prog_compiler_pic='-Xcompiler -fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static='-Bstatic'
-      else
-       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-       # +Z the default
-       ;;
-      *)
-       lt_prog_compiler_pic='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-fPIC'
-       lt_prog_compiler_static='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='--shared'
-       lt_prog_compiler_static='--static'
-       ;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-fpic'
-       lt_prog_compiler_static='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-qpic'
-       lt_prog_compiler_static='-qstaticlink'
-       ;;
-      *)
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ F* | *Sun*Fortran*)
-         # Sun Fortran 8.3 passes all unrecognized flags to the linker
-         lt_prog_compiler_pic='-KPIC'
-         lt_prog_compiler_static='-Bstatic'
-         lt_prog_compiler_wl=''
-         ;;
-       *Sun\ C*)
-         # Sun C 5.9
-         lt_prog_compiler_pic='-KPIC'
-         lt_prog_compiler_static='-Bstatic'
-         lt_prog_compiler_wl='-Wl,'
-         ;;
-       esac
-       ;;
-      esac
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-       lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_prog_compiler_pic='-Kconform_pic'
-       lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared=no
-      ;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
-
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
-else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  runpath_var=
-  allow_undefined_flag=
-  always_export_symbols=no
-  archive_cmds=
-  archive_expsym_cmds=
-  compiler_needs_object=no
-  enable_shared_with_static_runtimes=no
-  export_dynamic_flag_spec=
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  hardcode_automatic=no
-  hardcode_direct=no
-  hardcode_direct_absolute=no
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
-  hardcode_libdir_separator=
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  inherit_rpath=no
-  link_all_deplibs=unknown
-  module_cmds=
-  module_expsym_cmds=
-  old_archive_from_new_cmds=
-  old_archive_from_expsyms_cmds=
-  thread_safe_flag_spec=
-  whole_archive_flag_spec=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-       # The AIX port of GNU ld has always aspired to compatibility
-       # with the native linker.  However, as the warning in the GNU ld
-       # block says, versions before 2.19.5* couldn't really create working
-       # shared libraries, regardless of the interface used.
-       case `$LD -v 2>&1` in
-         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
-         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
-         *)
-           lt_use_gnu_ld_interface=yes
-           ;;
-       esac
-       ;;
-      *)
-       lt_use_gnu_ld_interface=yes
-       ;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       ld_shlibs=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       allow_undefined_flag=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
-      allow_undefined_flag=unsupported
-      always_export_symbols=no
-      enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname.def;
-       else
-         echo EXPORTS > $output_objdir/$soname.def;
-         cat $export_symbols >> $output_objdir/$soname.def;
-       fi~
-       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      link_all_deplibs=yes
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-       case $cc_basename in
-         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
-       esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-        && test "$tmp_diet" = no
-      then
-       tmp_addflag=' $pic_flag'
-       tmp_sharedflag='-shared'
-       case $cc_basename,$host_cpu in
-        pgcc*)                         # Portland Group C compiler
-         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95* | pgfortran*)
-                                       # Portland Group f77 and f90 compilers
-         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag -Mnomain' ;;
-       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
-         tmp_addflag=' -i_dynamic' ;;
-       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
-         tmp_addflag=' -i_dynamic -nofor_main' ;;
-       ifc* | ifort*)                  # Intel Fortran compiler
-         tmp_addflag=' -nofor_main' ;;
-       lf95*)                          # Lahey Fortran 8.1
-         whole_archive_flag_spec=
-         tmp_sharedflag='--shared' ;;
-       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-         tmp_sharedflag='-qmkshrobj'
-         tmp_addflag= ;;
-       nvcc*)  # Cuda Compiler Driver 2.2
-         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         compiler_needs_object=yes
-         ;;
-       esac
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ C*)                       # Sun C 5.9
-         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         compiler_needs_object=yes
-         tmp_sharedflag='-G' ;;
-       *Sun\ F*)                       # Sun Fortran 8.3
-         tmp_sharedflag='-G' ;;
-       esac
-       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-           echo "local: *; };" >> $output_objdir/$libname.ver~
-           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-       case $cc_basename in
-       xlf* | bgf* | bgxlf* | mpixlf*)
-         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-         hardcode_libdir_flag_spec=
-         hardcode_libdir_flag_spec_ld='-rpath $libdir'
-         archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-         if test "x$supports_anon_versioning" = xyes; then
-           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-             echo "local: *; };" >> $output_objdir/$libname.ver~
-             $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-         fi
-         ;;
-       esac
-      else
-        ld_shlibs=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-       ld_shlibs=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-       ld_shlibs=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-       ;;
-       *)
-         # For security reasons, it is highly recommended that you always
-         # use absolute paths for naming shared libraries, and exclude the
-         # DT_RUNPATH tag from executables and libraries.  But doing so
-         # requires that you compile everything twice, which is a pain.
-         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         else
-           ld_shlibs=no
-         fi
-       ;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag=unsupported
-      always_export_symbols=yes
-      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       hardcode_direct=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-       # On IA64, the linker does run time linking by default, so we don't
-       # have to do anything special.
-       aix_use_runtimelinking=no
-       exp_sym_flag='-Bexport'
-       no_entry_flag=""
-      else
-       # If we're using GNU nm, then we don't want the "-C" option.
-       # -C means demangle to AIX nm, but means don't demangle with GNU nm
-       # Also, AIX nm treats weak defined symbols like other global
-       # defined symbols, whereas GNU nm marks them as "W".
-       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       else
-         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       fi
-       aix_use_runtimelinking=no
-
-       # Test if we are trying to use run time linking or normal
-       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-       # need to do runtime linking.
-       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-         for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-         done
-         ;;
-       esac
-
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_direct_absolute=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
-
-      if test "$GCC" = yes; then
-       case $host_os in aix4.[012]|aix4.[012].*)
-       # We only want to do this on AIX 4.2 and lower, the check
-       # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-         # We have reworked collect2
-         :
-         else
-         # We have old collect2
-         hardcode_direct=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         hardcode_minus_L=yes
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_libdir_separator=
-         fi
-         ;;
-       esac
-       shared_flag='-shared'
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag="$shared_flag "'${wl}-G'
-       fi
-      else
-       # not using gcc
-       if test "$host_cpu" = ia64; then
-       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-       # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-       else
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag='${wl}-G'
-         else
-           shared_flag='${wl}-bM:SRE'
-         fi
-       fi
-      fi
-
-      export_dynamic_flag_spec='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
-       # Warning - without using the other runtime loading flags (-brtl),
-       # -berok will link without error, but may produce a broken library.
-       allow_undefined_flag='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-       /^0/ {
-           s/^0  *\(.*\)$/\1/
-           p
-       }
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-       if test "$host_cpu" = ia64; then
-         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-         allow_undefined_flag="-z nodefs"
-         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-       /^0/ {
-           s/^0  *\(.*\)$/\1/
-           p
-       }
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         # Warning - without using the other run time loading flags,
-         # -berok will link without error, but may produce a broken library.
-         no_undefined_flag=' ${wl}-bernotok'
-         allow_undefined_flag=' ${wl}-berok'
-         if test "$with_gnu_ld" = yes; then
-           # We only use this code for GNU lds that support --whole-archive.
-           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-         else
-           # Exported symbols can be pulled into shared objects from archives
-           whole_archive_flag_spec='$convenience'
-         fi
-         archive_cmds_need_lc=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      allow_undefined_flag=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_from_new_cmds='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes=yes
-      ;;
-
-    darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc=no
-  hardcode_direct=no
-  hardcode_automatic=yes
-  hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-  else
-    whole_archive_flag_spec=''
-  fi
-  link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
-  else
-  ld_shlibs=no
-  fi
-
-      ;;
-
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-       archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-       hardcode_libdir_flag_spec_ld='+b $libdir'
-       hardcode_libdir_separator=:
-       hardcode_direct=yes
-       hardcode_direct_absolute=yes
-       export_dynamic_flag_spec='${wl}-E'
-       # hardcode_minus_L: Not really in the search PATH,
-       # but as the default location of the library.
-       hardcode_minus_L=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*)
-         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-
-         # Older versions of the 11.00 compiler do not understand -b yet
-         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS -b"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler__b=yes
-       fi
-     else
-       lt_cv_prog_compiler__b=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
-    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-       hardcode_libdir_separator=:
-
-       case $host_cpu in
-       hppa*64*|ia64*)
-         hardcode_direct=no
-         hardcode_shlibpath_var=no
-         ;;
-       *)
-         hardcode_direct=yes
-         hardcode_direct_absolute=yes
-         export_dynamic_flag_spec='${wl}-E'
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L=yes
-         ;;
-       esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       # Try to use the -exported_symbol ld option, if it does not
-       # work, assume that -exports_file does not work either and
-       # implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int foo(void) {}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-        LDFLAGS="$save_LDFLAGS"
-      else
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      inherit_rpath=yes
-      link_all_deplibs=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    newsos6)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_shlibpath_var=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-       hardcode_direct_absolute=yes
-       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-         export_dynamic_flag_spec='${wl}-E'
-       else
-         case $host_os in
-          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-            hardcode_libdir_flag_spec='-R$libdir'
-            ;;
-          *)
-            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-            ;;
-         esac
-       fi
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       allow_undefined_flag=' -expect_unresolved \*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-       allow_undefined_flag=' -expect_unresolved \*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-       # Both c and cxx compiler support -rpath directly
-       hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_separator=:
-      ;;
-
-    solaris*)
-      no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-       case `$CC -V 2>&1` in
-       *"Compilers 5.0"*)
-         wlarc=''
-         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-         ;;
-       *)
-         wlarc='${wl}'
-         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-         ;;
-       esac
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_shlibpath_var=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-       # The compiler driver will combine and reorder linker options,
-       # but understands `-z linker_flag'.  GCC discards it without `$wl',
-       # but is careful enough not to reorder.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       if test "$GCC" = yes; then
-         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-       else
-         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
-       fi
-       ;;
-      esac
-      link_all_deplibs=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-       # Use $CC to link under sequent, because it throws in some extra .o
-       # files that make .init and .fini sections work.
-       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-       sni)
-         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         reload_cmds='$CC -r -o $output$reload_objs'
-         hardcode_direct=no
-        ;;
-       motorola)
-         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_shlibpath_var=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       ld_shlibs=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-       export_dynamic_flag_spec='${wl}-Blargedynsym'
-       ;;
-      esac
-    fi
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  $RM conftest*
-       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-         soname=conftest
-         lib=conftest
-         libobjs=conftest.$ac_objext
-         deplibs=
-         wl=$lt_prog_compiler_wl
-         pic_flag=$lt_prog_compiler_pic
-         compiler_flags=-v
-         linker_flags=-v
-         verstring=
-         output_objdir=.
-         libname=conftest
-         lt_save_allow_undefined_flag=$allow_undefined_flag
-         allow_undefined_flag=
-         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-         then
-           lt_cv_archive_cmds_need_lc=no
-         else
-           lt_cv_archive_cmds_need_lc=yes
-         fi
-         allow_undefined_flag=$lt_save_allow_undefined_flag
-       else
-         cat conftest.err 1>&5
-       fi
-       $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
-      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[lt_foo]++; }
-  if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-          echo ' yes '
-          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-       :
-      else
-       can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[23].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-haiku*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       else
-               version_type=irix
-       fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-
-# uclinux* changes (here and below) have been submitted to the libtool
-# project, but have not yet been accepted: they are GCC-local changes
-# for the time being.  (See
-# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-
-fi
-
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-       ;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-  if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-    ;;
-
-  *)
-    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_shl_load=yes
-else
-  ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
-  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_svld_dlopen=yes
-else
-  ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_dld_link=yes
-else
-  ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line 11566 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
-#endif
-
-void fnord () { int i=42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line 11672 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
-#endif
-
-void fnord () { int i=42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-  # Report which library types will actually be built
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
-  if ${ac_cv_prog_CXXCPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
-else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-else
-  _lt_caught_CXX_error=yes
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-reload_flag_CXX=$reload_flag
-reload_cmds_CXX=$reload_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-  # save warnings/boilerplate of simple test code
-  ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-  ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  compiler=$CC
-  compiler_CXX=$CC
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-    else
-      lt_prog_compiler_no_builtin_flag_CXX=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-         $GREP 'no-whole-archive' > /dev/null; then
-          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          whole_archive_flag_spec_CXX=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-    ld_shlibs_CXX=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-      aix[4-9]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-           for ld_flag in $LDFLAGS; do
-             case $ld_flag in
-             *-brtl*)
-               aix_use_runtimelinking=yes
-               break
-               ;;
-             esac
-           done
-           ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        archive_cmds_CXX=''
-        hardcode_direct_CXX=yes
-        hardcode_direct_absolute_CXX=yes
-        hardcode_libdir_separator_CXX=':'
-        link_all_deplibs_CXX=yes
-        file_list_spec_CXX='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[012]|aix4.[012].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-           # We have reworked collect2
-           :
-         else
-           # We have old collect2
-           hardcode_direct_CXX=unsupported
-           # It fails to find uninstalled libraries when the uninstalled
-           # path is not listed in the libpath.  Setting hardcode_minus_L
-           # to unsupported forces relinking
-           hardcode_minus_L_CXX=yes
-           hardcode_libdir_flag_spec_CXX='-L$libdir'
-           hardcode_libdir_separator_CXX=
-         fi
-          esac
-          shared_flag='-shared'
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag="$shared_flag "'${wl}-G'
-         fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-         # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-          else
-           if test "$aix_use_runtimelinking" = yes; then
-             shared_flag='${wl}-G'
-           else
-             shared_flag='${wl}-bM:SRE'
-           fi
-          fi
-        fi
-
-        export_dynamic_flag_spec_CXX='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-       # export.
-        always_export_symbols_CXX=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          allow_undefined_flag_CXX='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-       /^0/ {
-           s/^0  *\(.*\)$/\1/
-           p
-       }
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-           hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-           allow_undefined_flag_CXX="-z nodefs"
-           archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-           # Determine the default libpath from the value encoded in an
-           # empty executable.
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-       /^0/ {
-           s/^0  *\(.*\)$/\1/
-           p
-       }
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-           # Warning - without using the other run time loading flags,
-           # -berok will link without error, but may produce a broken library.
-           no_undefined_flag_CXX=' ${wl}-bernotok'
-           allow_undefined_flag_CXX=' ${wl}-berok'
-           if test "$with_gnu_ld" = yes; then
-             # We only use this code for GNU lds that support --whole-archive.
-             whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           else
-             # Exported symbols can be pulled into shared objects from archives
-             whole_archive_flag_spec_CXX='$convenience'
-           fi
-           archive_cmds_need_lc_CXX=yes
-           # This is similar to how AIX traditionally builds its shared
-           # libraries.
-           archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-         allow_undefined_flag_CXX=unsupported
-         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-         # support --undefined.  This deserves some investigation.  FIXME
-         archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       else
-         ld_shlibs_CXX=no
-       fi
-       ;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-         # FIXME: insert proper C++ library support
-         ld_shlibs_CXX=no
-         ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-        # as there is no search path for DLLs.
-        hardcode_libdir_flag_spec_CXX='-L$libdir'
-        export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
-        allow_undefined_flag_CXX=unsupported
-        always_export_symbols_CXX=no
-        enable_shared_with_static_runtimes_CXX=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-           cp $export_symbols $output_objdir/$soname.def;
-          else
-           echo EXPORTS > $output_objdir/$soname.def;
-           cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          ld_shlibs_CXX=no
-        fi
-        ;;
-      darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc_CXX=no
-  hardcode_direct_CXX=no
-  hardcode_automatic_CXX=yes
-  hardcode_shlibpath_var_CXX=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-  else
-    whole_archive_flag_spec_CXX=''
-  fi
-  link_all_deplibs_CXX=yes
-  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-
-  else
-  ld_shlibs_CXX=no
-  fi
-
-       ;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          ghcx*)
-           # Green Hills C++ Compiler
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-        esac
-        ;;
-
-      freebsd2.*)
-        # C++ shared libraries reported to be fairly broken before
-       # switch to ELF
-        ld_shlibs_CXX=no
-        ;;
-
-      freebsd-elf*)
-        archive_cmds_need_lc_CXX=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        ld_shlibs_CXX=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      haiku*)
-        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        link_all_deplibs_CXX=yes
-        ;;
-
-      hpux9*)
-        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-        hardcode_libdir_separator_CXX=:
-        export_dynamic_flag_spec_CXX='${wl}-E'
-        hardcode_direct_CXX=yes
-        hardcode_minus_L_CXX=yes # Not in the search PATH,
-                                            # but as the default
-                                            # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            ld_shlibs_CXX=no
-            ;;
-          aCC*)
-            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              ld_shlibs_CXX=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-         hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-         hardcode_libdir_separator_CXX=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-             export_dynamic_flag_spec_CXX='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            hardcode_direct_CXX=no
-            hardcode_shlibpath_var_CXX=no
-            ;;
-          *)
-            hardcode_direct_CXX=yes
-            hardcode_direct_absolute_CXX=yes
-            hardcode_minus_L_CXX=yes # Not in the search PATH,
-                                                # but as the default
-                                                # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          aCC*)
-           case $host_cpu in
-             hppa*64*)
-               archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-             ia64*)
-               archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-             *)
-               archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-           esac
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-           ;;
-          *)
-           if test "$GXX" = yes; then
-             if test $with_gnu_ld = no; then
-               case $host_cpu in
-                 hppa*64*)
-                   archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-                 ia64*)
-                   archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-                 *)
-                   archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-               esac
-             fi
-           else
-             # FIXME: insert proper C++ library support
-             ld_shlibs_CXX=no
-           fi
-           ;;
-        esac
-        ;;
-
-      interix[3-9]*)
-       hardcode_direct_CXX=no
-       hardcode_shlibpath_var_CXX=no
-       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-       export_dynamic_flag_spec_CXX='${wl}-E'
-       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-       # Instead, shared libraries are loaded at an image base (0x10000000 by
-       # default) and relocated if they conflict, which is a slow very memory
-       # consuming and fragmenting process.  To avoid this, we pick a random,
-       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-       archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-       archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-       ;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-           # SGI C++
-           archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
-           # Archives containing C++ object files must be created using
-           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-           # necessary to make sure instantiated templates are included
-           # in the archive.
-           old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
-           ;;
-          *)
-           if test "$GXX" = yes; then
-             if test "$with_gnu_ld" = no; then
-               archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-             else
-               archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-             fi
-           fi
-           link_all_deplibs_CXX=yes
-           ;;
-        esac
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        hardcode_libdir_separator_CXX=:
-        inherit_rpath_CXX=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-           # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-           # KCC will only create a shared library if the output file
-           # ends with ".so" (or ".sl" for HP-UX), so rename the library
-           # to its proper name (with version) after linking.
-           archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-           archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
-           hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-           # Archives containing C++ object files must be created using
-           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-           old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-           ;;
-         icpc* | ecpc* )
-           # Intel C++
-           with_gnu_ld=yes
-           # version 8.0 and above of icpc choke on multiply defined symbols
-           # if we add $predep_objects and $postdep_objects, however 7.1 and
-           # earlier do not add the objects themselves.
-           case `$CC -V 2>&1` in
-             *"Version 7."*)
-               archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-               archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-               ;;
-             *)  # Version 8.0 or newer
-               tmp_idyn=
-               case $host_cpu in
-                 ia64*) tmp_idyn=' -i_dynamic';;
-               esac
-               archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-               archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-               ;;
-           esac
-           archive_cmds_need_lc_CXX=no
-           hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-           whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-           case `$CC -V` in
-           *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
-             prelink_cmds_CXX='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
-             old_archive_cmds_CXX='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-               $RANLIB $oldlib'
-             archive_cmds_CXX='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-             archive_expsym_cmds_CXX='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-             ;;
-           *) # Version 6 and above use weak symbols
-             archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-             archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-             ;;
-           esac
-
-           hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-           whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-         cxx*)
-           # Compaq C++
-           archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-           runpath_var=LD_RUN_PATH
-           hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-           hardcode_libdir_separator_CXX=:
-
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
-           ;;
-         xl* | mpixl* | bgxl*)
-           # IBM XL 8.0 on PPC, with GNU ld
-           hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-           archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           if test "x$supports_anon_versioning" = xyes; then
-             archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
-               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-               echo "local: *; };" >> $output_objdir/$libname.ver~
-               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-           fi
-           ;;
-         *)
-           case `$CC -V 2>&1 | sed 5q` in
-           *Sun\ C*)
-             # Sun C++ 5.9
-             no_undefined_flag_CXX=' -zdefs'
-             archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-             archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-             hardcode_libdir_flag_spec_CXX='-R$libdir'
-             whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-             compiler_needs_object_CXX=yes
-
-             # Not sure whether something based on
-             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-             # would be better.
-             output_verbose_link_cmd='func_echo_all'
-
-             # Archives containing C++ object files must be created using
-             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-             # necessary to make sure instantiated templates are included
-             # in the archive.
-             old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-             ;;
-           esac
-           ;;
-       esac
-       ;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-       ;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-         *)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-       esac
-       ;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-         archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-         wlarc=
-         hardcode_libdir_flag_spec_CXX='-R$libdir'
-         hardcode_direct_CXX=yes
-         hardcode_shlibpath_var_CXX=no
-       fi
-       # Workaround some broken pre-1.5 toolchains
-       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-       ;;
-
-      *nto* | *qnx*)
-        ld_shlibs_CXX=yes
-       ;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-       ld_shlibs_CXX=no
-       ;;
-
-      openbsd*)
-       if test -f /usr/libexec/ld.so; then
-         hardcode_direct_CXX=yes
-         hardcode_shlibpath_var_CXX=no
-         hardcode_direct_absolute_CXX=yes
-         archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-         hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-           archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-           export_dynamic_flag_spec_CXX='${wl}-E'
-           whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-         fi
-         output_verbose_link_cmd=func_echo_all
-       else
-         ld_shlibs_CXX=no
-       fi
-       ;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-           # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-           # KCC will only create a shared library if the output file
-           # ends with ".so" (or ".sl" for HP-UX), so rename the library
-           # to its proper name (with version) after linking.
-           archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-           hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-           hardcode_libdir_separator_CXX=:
-
-           # Archives containing C++ object files must be created using
-           # the KAI C++ compiler.
-           case $host in
-             osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
-             *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
-           esac
-           ;;
-          RCC*)
-           # Rational C++ 2.4.1
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          cxx*)
-           case $host in
-             osf3*)
-               allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-               archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-               hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-               ;;
-             *)
-               allow_undefined_flag_CXX=' -expect_unresolved \*'
-               archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-               archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-                 echo "-hidden">> $lib.exp~
-                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-                 $RM $lib.exp'
-               hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-               ;;
-           esac
-
-           hardcode_libdir_separator_CXX=:
-
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-           ;;
-         *)
-           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-             allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-             case $host in
-               osf3*)
-                 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-                 ;;
-               *)
-                 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-                 ;;
-             esac
-
-             hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-             hardcode_libdir_separator_CXX=:
-
-             # Commands to make compiler produce verbose output that lists
-             # what "hidden" libraries, object files and flags are used when
-             # linking a shared library.
-             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-           else
-             # FIXME: insert proper C++ library support
-             ld_shlibs_CXX=no
-           fi
-           ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-           # Sun C++ 4.x
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          lcc*)
-           # Lucid
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-            archive_cmds_need_lc_CXX=yes
-           no_undefined_flag_CXX=' -zdefs'
-           archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-           archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-           hardcode_libdir_flag_spec_CXX='-R$libdir'
-           hardcode_shlibpath_var_CXX=no
-           case $host_os in
-             solaris2.[0-5] | solaris2.[0-5].*) ;;
-             *)
-               # The compiler driver will combine and reorder linker options,
-               # but understands `-z linker_flag'.
-               # Supported since Solaris 2.6 (maybe 2.5.1?)
-               whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
-               ;;
-           esac
-           link_all_deplibs_CXX=yes
-
-           output_verbose_link_cmd='func_echo_all'
-
-           # Archives containing C++ object files must be created using
-           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-           # necessary to make sure instantiated templates are included
-           # in the archive.
-           old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-           ;;
-          gcx*)
-           # Green Hills C++ Compiler
-           archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-           # The C++ compiler must be used to create the archive.
-           old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-           ;;
-          *)
-           # GNU C++ compiler with Solaris linker
-           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-             no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-               archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-               archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-               # Commands to make compiler produce verbose output that lists
-               # what "hidden" libraries, object files and flags are used when
-               # linking a shared library.
-               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-             else
-               # g++ 2.7 appears to require `-G' NOT `-shared' on this
-               # platform.
-               archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-               archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-               # Commands to make compiler produce verbose output that lists
-               # what "hidden" libraries, object files and flags are used when
-               # linking a shared library.
-               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-             fi
-
-             hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-             case $host_os in
-               solaris2.[0-5] | solaris2.[0-5].*) ;;
-               *)
-                 whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-                 ;;
-             esac
-           fi
-           ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_CXX='${wl}-z,text'
-      archive_cmds_need_lc_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-         archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-       # Note: We can NOT use -z defs as we might desire, because we do not
-       # link with -lc, and that would cause any symbols used from libc to
-       # always be unresolved, which means just about no library would
-       # ever link correctly.  If we're not using GNU ld we use -z text
-       # though, which does catch some bad symbols but isn't as heavy-handed
-       # as -z defs.
-       no_undefined_flag_CXX='${wl}-z,text'
-       allow_undefined_flag_CXX='${wl}-z,nodefs'
-       archive_cmds_need_lc_CXX=no
-       hardcode_shlibpath_var_CXX=no
-       hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
-       hardcode_libdir_separator_CXX=':'
-       link_all_deplibs_CXX=yes
-       export_dynamic_flag_spec_CXX='${wl}-Bexport'
-       runpath_var='LD_RUN_PATH'
-
-       case $cc_basename in
-          CC*)
-           archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
-             '"$old_archive_cmds_CXX"
-           reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
-             '"$reload_cmds_CXX"
-           ;;
-         *)
-           archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           ;;
-       esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-           # NonStop-UX NCC 3.20
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           ld_shlibs_CXX=no
-           ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-    esac
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-    test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-    GCC_CXX="$GXX"
-    LD_CXX="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    # Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-        prev=$p
-        continue
-       else
-        prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-        case $p in
-        -L* | -R*)
-          # Internal compiler library paths should come after those
-          # provided the user.  The postdeps already come after the
-          # user supplied libs so there is no need to process them.
-          if test -z "$compiler_lib_search_path_CXX"; then
-            compiler_lib_search_path_CXX="${prev}${p}"
-          else
-            compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
-          fi
-          ;;
-        # The "-l" case would never come before the object being
-        # linked, so don't bother handling this case.
-        esac
-       else
-        if test -z "$postdeps_CXX"; then
-          postdeps_CXX="${prev}${p}"
-        else
-          postdeps_CXX="${postdeps_CXX} ${prev}${p}"
-        fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-        pre_test_object_deps_done=yes
-        continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-        if test -z "$predep_objects_CXX"; then
-          predep_objects_CXX="$p"
-        else
-          predep_objects_CXX="$predep_objects_CXX $p"
-        fi
-       else
-        if test -z "$postdep_objects_CXX"; then
-          postdep_objects_CXX="$p"
-        else
-          postdep_objects_CXX="$postdep_objects_CXX $p"
-        fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$RM -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  predep_objects_CXX=
-  postdep_objects_CXX=
-  postdeps_CXX=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
- compiler_lib_search_dirs_CXX=
-if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    lt_prog_compiler_wl_CXX='-Wl,'
-    lt_prog_compiler_static_CXX='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static_CXX='-Bstatic'
-      fi
-      lt_prog_compiler_pic_CXX='-fPIC'
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic_CXX='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      lt_prog_compiler_pic_CXX=
-      ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      lt_prog_compiler_static_CXX=
-      ;;
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       lt_prog_compiler_pic_CXX=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       ;;
-      *)
-       lt_prog_compiler_pic_CXX='-fPIC'
-       ;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic_CXX='-fPIC -shared'
-      ;;
-    *)
-      lt_prog_compiler_pic_CXX='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[4-9]*)
-       # All AIX code is PIC.
-       if test "$host_cpu" = ia64; then
-         # AIX 5 now supports IA64 processor
-         lt_prog_compiler_static_CXX='-Bstatic'
-       else
-         lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
-       fi
-       ;;
-      chorus*)
-       case $cc_basename in
-       cxch68*)
-         # Green Hills C++ Compiler
-         # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-         ;;
-       esac
-       ;;
-      dgux*)
-       case $cc_basename in
-         ec++*)
-           lt_prog_compiler_pic_CXX='-KPIC'
-           ;;
-         ghcx*)
-           # Green Hills C++ Compiler
-           lt_prog_compiler_pic_CXX='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      freebsd* | dragonfly*)
-       # FreeBSD uses GNU C++
-       ;;
-      hpux9* | hpux10* | hpux11*)
-       case $cc_basename in
-         CC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-           if test "$host_cpu" != ia64; then
-             lt_prog_compiler_pic_CXX='+Z'
-           fi
-           ;;
-         aCC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-           case $host_cpu in
-           hppa*64*|ia64*)
-             # +Z the default
-             ;;
-           *)
-             lt_prog_compiler_pic_CXX='+Z'
-             ;;
-           esac
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      interix*)
-       # This is c89, which is MS Visual C++ (no shared libs)
-       # Anyone wants to do a port?
-       ;;
-      irix5* | irix6* | nonstopux*)
-       case $cc_basename in
-         CC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_static_CXX='-non_shared'
-           # CC pic flag -KPIC is the default.
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-       case $cc_basename in
-         KCC*)
-           # KAI C++ Compiler
-           lt_prog_compiler_wl_CXX='--backend -Wl,'
-           lt_prog_compiler_pic_CXX='-fPIC'
-           ;;
-         ecpc* )
-           # old Intel C++ for x86_64 which still supported -KPIC.
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-KPIC'
-           lt_prog_compiler_static_CXX='-static'
-           ;;
-         icpc* )
-           # Intel C++, used to be incompatible with GCC.
-           # ICC 10 doesn't accept -KPIC any more.
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-fPIC'
-           lt_prog_compiler_static_CXX='-static'
-           ;;
-         pgCC* | pgcpp*)
-           # Portland Group C++ compiler
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-fpic'
-           lt_prog_compiler_static_CXX='-Bstatic'
-           ;;
-         cxx*)
-           # Compaq C++
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           lt_prog_compiler_pic_CXX=
-           lt_prog_compiler_static_CXX='-non_shared'
-           ;;
-         xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
-           # IBM XL 8.0, 9.0 on PPC and BlueGene
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-qpic'
-           lt_prog_compiler_static_CXX='-qstaticlink'
-           ;;
-         *)
-           case `$CC -V 2>&1 | sed 5q` in
-           *Sun\ C*)
-             # Sun C++ 5.9
-             lt_prog_compiler_pic_CXX='-KPIC'
-             lt_prog_compiler_static_CXX='-Bstatic'
-             lt_prog_compiler_wl_CXX='-Qoption ld '
-             ;;
-           esac
-           ;;
-       esac
-       ;;
-      lynxos*)
-       ;;
-      m88k*)
-       ;;
-      mvs*)
-       case $cc_basename in
-         cxx*)
-           lt_prog_compiler_pic_CXX='-W c,exportall'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      netbsd*)
-       ;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        lt_prog_compiler_pic_CXX='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-       case $cc_basename in
-         KCC*)
-           lt_prog_compiler_wl_CXX='--backend -Wl,'
-           ;;
-         RCC*)
-           # Rational C++ 2.4.1
-           lt_prog_compiler_pic_CXX='-pic'
-           ;;
-         cxx*)
-           # Digital/Compaq C++
-           lt_prog_compiler_wl_CXX='-Wl,'
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           lt_prog_compiler_pic_CXX=
-           lt_prog_compiler_static_CXX='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      psos*)
-       ;;
-      solaris*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-           lt_prog_compiler_pic_CXX='-KPIC'
-           lt_prog_compiler_static_CXX='-Bstatic'
-           lt_prog_compiler_wl_CXX='-Qoption ld '
-           ;;
-         gcx*)
-           # Green Hills C++ Compiler
-           lt_prog_compiler_pic_CXX='-PIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sunos4*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.x
-           lt_prog_compiler_pic_CXX='-pic'
-           lt_prog_compiler_static_CXX='-Bstatic'
-           ;;
-         lcc*)
-           # Lucid
-           lt_prog_compiler_pic_CXX='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-       case $cc_basename in
-         CC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-KPIC'
-           lt_prog_compiler_static_CXX='-Bstatic'
-           ;;
-       esac
-       ;;
-      tandem*)
-       case $cc_basename in
-         NCC*)
-           # NonStop-UX NCC 3.20
-           lt_prog_compiler_pic_CXX='-KPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      vxworks*)
-       ;;
-      *)
-       lt_prog_compiler_can_build_shared_CXX=no
-       ;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
-
-
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works_CXX=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_CXX=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
-    case $lt_prog_compiler_pic_CXX in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
-     esac
-else
-    lt_prog_compiler_pic_CXX=
-     lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_CXX=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_CXX=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
-    :
-else
-    lt_prog_compiler_static_CXX=
-fi
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix[4-9]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
-  cygwin* | mingw* | cegcc*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-with_gnu_ld_CXX=$with_gnu_ld
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_CXX=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_CXX in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  $RM conftest*
-       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-         soname=conftest
-         lib=conftest
-         libobjs=conftest.$ac_objext
-         deplibs=
-         wl=$lt_prog_compiler_wl_CXX
-         pic_flag=$lt_prog_compiler_pic_CXX
-         compiler_flags=-v
-         linker_flags=-v
-         verstring=
-         output_objdir=.
-         libname=conftest
-         lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-         allow_undefined_flag_CXX=
-         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-         then
-           lt_cv_archive_cmds_need_lc_CXX=no
-         else
-           lt_cv_archive_cmds_need_lc_CXX=yes
-         fi
-         allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-       else
-         cat conftest.err 1>&5
-       fi
-       $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
-      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-          echo ' yes '
-          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-       :
-      else
-       can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[23].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-haiku*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       else
-               version_type=irix
-       fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-
-# uclinux* changes (here and below) have been submitted to the libtool
-# project, but have not yet been accepted: they are GCC-local changes
-# for the time being.  (See
-# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
-linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
-        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-
-fi
-
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-       ;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
-   test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-        ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-# Test for 64-bit build.
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
-$as_echo_n "checking size of size_t... " >&6; }
-if ${ac_cv_sizeof_size_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_size_t" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (size_t)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_size_t=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
-$as_echo "$ac_cv_sizeof_size_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
-_ACEOF
-
-
-
-cat > local.exp <<EOF
-set CC_FOR_TARGET "$CC"
-set CXX_FOR_TARGET "$CXX"
-EOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
-    # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
-  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
-  USE_MAINTAINER_MODE=no
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
-   if test $USE_MAINTAINER_MODE = yes; then
-  MAINTAINER_MODE_TRUE=
-  MAINTAINER_MODE_FALSE='#'
-else
-  MAINTAINER_MODE_TRUE='#'
-  MAINTAINER_MODE_FALSE=
-fi
-
-  MAINT=$MAINTAINER_MODE_TRUE
-
-
-
-for ac_header in sys/mman.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mman_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_MMAN_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_func in mmap mkostemp
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mman_h" = xyes; then :
-  libffi_header_sys_mman_h=yes
-else
-  libffi_header_sys_mman_h=no
-fi
-
-
-ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  libffi_func_mmap=yes
-else
-  libffi_func_mmap=no
-fi
-
-if test "$libffi_header_sys_mman_h" != yes \
- || test "$libffi_func_mmap" != yes; then
-   ac_cv_func_mmap_file=no
-   ac_cv_func_mmap_dev_zero=no
-   ac_cv_func_mmap_anon=no
-else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether read-only mmap of a plain file works" >&5
-$as_echo_n "checking whether read-only mmap of a plain file works... " >&6; }
-if ${ac_cv_func_mmap_file+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Add a system to this blacklist if
-   # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
-   # memory area containing the same data that you'd get if you applied
-   # read() to the same fd.  The only system known to have a problem here
-   # is VMS, where text files have record structure.
-   case "$host_os" in
-     vms* | ultrix*)
-       ac_cv_func_mmap_file=no ;;
-     *)
-       ac_cv_func_mmap_file=yes;;
-   esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_file" >&5
-$as_echo "$ac_cv_func_mmap_file" >&6; }
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap from /dev/zero works" >&5
-$as_echo_n "checking whether mmap from /dev/zero works... " >&6; }
-if ${ac_cv_func_mmap_dev_zero+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Add a system to this blacklist if it has mmap() but /dev/zero
-   # does not exist, or if mmapping /dev/zero does not give anonymous
-   # zeroed pages with both the following properties:
-   # 1. If you map N consecutive pages in with one call, and then
-   #    unmap any subset of those pages, the pages that were not
-   #    explicitly unmapped remain accessible.
-   # 2. If you map two adjacent blocks of memory and then unmap them
-   #    both at once, they must both go away.
-   # Systems known to be in this category are Windows (all variants),
-   # VMS, and Darwin.
-   case "$host_os" in
-     vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
-       ac_cv_func_mmap_dev_zero=no ;;
-     *)
-       ac_cv_func_mmap_dev_zero=yes;;
-   esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_dev_zero" >&5
-$as_echo "$ac_cv_func_mmap_dev_zero" >&6; }
-
-   # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5
-$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; }
-if ${ac_cv_decl_map_anon+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-#ifndef MAP_ANONYMOUS
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
-int
-main ()
-{
-int n = MAP_ANONYMOUS;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_decl_map_anon=yes
-else
-  ac_cv_decl_map_anon=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_decl_map_anon" >&5
-$as_echo "$ac_cv_decl_map_anon" >&6; }
-
-   if test $ac_cv_decl_map_anon = no; then
-     ac_cv_func_mmap_anon=no
-   else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap with MAP_ANON(YMOUS) works" >&5
-$as_echo_n "checking whether mmap with MAP_ANON(YMOUS) works... " >&6; }
-if ${ac_cv_func_mmap_anon+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Add a system to this blacklist if it has mmap() and MAP_ANON or
-   # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
-   # doesn't give anonymous zeroed pages with the same properties listed
-   # above for use of /dev/zero.
-   # Systems known to be in this category are Windows, VMS, and SCO Unix.
-   case "$host_os" in
-     vms* | cygwin* | pe | mingw* | sco* | udk* )
-       ac_cv_func_mmap_anon=no ;;
-     *)
-       ac_cv_func_mmap_anon=yes;;
-   esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_anon" >&5
-$as_echo "$ac_cv_func_mmap_anon" >&6; }
-   fi
-fi
-
-if test $ac_cv_func_mmap_file = yes; then
-
-$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h
-
-fi
-if test $ac_cv_func_mmap_dev_zero = yes; then
-
-$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h
-
-fi
-if test $ac_cv_func_mmap_anon = yes; then
-
-$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h
-
-fi
-
-
- if test -d $srcdir/testsuite; then
-  TESTSUBDIR_TRUE=
-  TESTSUBDIR_FALSE='#'
-else
-  TESTSUBDIR_TRUE='#'
-  TESTSUBDIR_FALSE=
-fi
-
-
-TARGETDIR="unknown"
-HAVE_LONG_DOUBLE_VARIANT=0
-
-. ${srcdir}/configure.host
-
-if test -n "${UNSUPPORTED}"; then
-  as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
-fi
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-for ac_func in memcpy
-do :
-  ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy"
-if test "x$ac_cv_func_memcpy" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMCPY 1
-_ACEOF
-
-fi
-done
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
-                         if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_working_alloca_h=yes
-else
-  ac_cv_working_alloca_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
-
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  ifdef HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
-int
-main ()
-{
-char *p = (char *) alloca (1);
-                                   if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_alloca_works=yes
-else
-  ac_cv_func_alloca_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-
-else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
-else
-  ac_cv_os_cray=no
-fi
-rm -f conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
-    break
-fi
-
-  done
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_c_stack_direction=0
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-find_stack_direction (int *addr, int depth)
-{
-  int dir, dummy = 0;
-  if (! addr)
-    addr = &dummy;
-  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
-  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
-  return dir + dummy;
-}
-
-int
-main (int argc, char **argv)
-{
-  return find_stack_direction (0, argc + !argv + 20) < 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_stack_direction=1
-else
-  ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
-$as_echo_n "checking size of double... " >&6; }
-if ${ac_cv_sizeof_double+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_double" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (double)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_double=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5
-$as_echo "$ac_cv_sizeof_double" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_DOUBLE $ac_cv_sizeof_double
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
-$as_echo_n "checking size of long double... " >&6; }
-if ${ac_cv_sizeof_long_double+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_long_double" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long double)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_long_double=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
-$as_echo "$ac_cv_sizeof_long_double" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
-_ACEOF
-
-
-
-# Also AC_SUBST this variable for ffi.h.
-if test -z "$HAVE_LONG_DOUBLE"; then
-  HAVE_LONG_DOUBLE=0
-  if test $ac_cv_sizeof_long_double != 0; then
-    if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
-
-$as_echo "#define HAVE_LONG_DOUBLE_VARIANT 1" >>confdefs.h
-
-      HAVE_LONG_DOUBLE=1
-    else
-      if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
-        HAVE_LONG_DOUBLE=1
-
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
-
-      fi
-    fi
-  fi
-fi
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-              not a universal capable compiler
-            #endif
-            typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-       # Check for potential -arch flags.  It is not universal unless
-       # there are at least two -arch flags with different values.
-       ac_arch=
-       ac_prev=
-       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-        if test -n "$ac_prev"; then
-          case $ac_word in
-            i?86 | x86_64 | ppc | ppc64)
-              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-                ac_arch=$ac_word
-              else
-                ac_cv_c_bigendian=universal
-                break
-              fi
-              ;;
-          esac
-          ac_prev=
-        elif test "x$ac_word" = "x-arch"; then
-          ac_prev=arch
-        fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-            #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-                    && LITTLE_ENDIAN)
-             bogus endian macros
-            #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-               #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-                not big endian
-               #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-             bogus endian macros
-            #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
-                not big endian
-               #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-short int ascii_mm[] =
-                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-               short int ascii_ii[] =
-                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-               int use_ascii (int i) {
-                 return ascii_mm[i] + ascii_ii[i];
-               }
-               short int ebcdic_ii[] =
-                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
-                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-               int use_ebcdic (int i) {
-                 return ebcdic_mm[i] + ebcdic_ii[i];
-               }
-               extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-             ac_cv_c_bigendian=yes
-           fi
-           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-             if test "$ac_cv_c_bigendian" = unknown; then
-               ac_cv_c_bigendian=no
-             else
-               # finding both strings is unlikely to happen, but who knows?
-               ac_cv_c_bigendian=unknown
-             fi
-           fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-            /* Are we little or big endian?  From Harbison&Steele.  */
-            union
-            {
-              long int l;
-              char c[sizeof (long int)];
-            } u;
-            u.l = 1;
-            return u.c[sizeof (long int) - 1] == 1;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
-   no)
-      ;; #(
-   universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
-     ;; #(
-   *)
-     as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .cfi pseudo-op support" >&5
-$as_echo_n "checking assembler .cfi pseudo-op support... " >&6; }
-if ${gcc_cv_as_cfi_pseudo_op+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    gcc_cv_as_cfi_pseudo_op=unknown
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-asm (".cfi_startproc\n\t.cfi_endproc");
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gcc_cv_as_cfi_pseudo_op=yes
-else
-  gcc_cv_as_cfi_pseudo_op=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_pseudo_op" >&5
-$as_echo "$gcc_cv_as_cfi_pseudo_op" >&6; }
- if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
-
-$as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.h
-
- fi
-
-
-case "$TARGET" in
-  SPARC)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5
-$as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; }
-if ${libffi_cv_as_sparc_ua_pcrel+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-       save_CFLAGS="$CFLAGS"
-       save_LDFLAGS="$LDFLAGS"
-       CFLAGS="$CFLAGS -fpic"
-       LDFLAGS="$LDFLAGS -shared"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  libffi_cv_as_sparc_ua_pcrel=yes
-else
-  libffi_cv_as_sparc_ua_pcrel=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-       CFLAGS="$save_CFLAGS"
-       LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_sparc_ua_pcrel" >&5
-$as_echo "$libffi_cv_as_sparc_ua_pcrel" >&6; }
-    if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
-
-$as_echo "#define HAVE_AS_SPARC_UA_PCREL 1" >>confdefs.h
-
-    fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .register pseudo-op support" >&5
-$as_echo_n "checking assembler .register pseudo-op support... " >&6; }
-if ${libffi_cv_as_register_pseudo_op+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-       libffi_cv_as_register_pseudo_op=unknown
-       # Check if we have .register
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-asm (".register %g2, #scratch");
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libffi_cv_as_register_pseudo_op=yes
-else
-  libffi_cv_as_register_pseudo_op=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_register_pseudo_op" >&5
-$as_echo "$libffi_cv_as_register_pseudo_op" >&6; }
-    if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
-
-$as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h
-
-    fi
-    ;;
-
-  X86*)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5
-$as_echo_n "checking assembler supports pc related relocs... " >&6; }
-if ${libffi_cv_as_x86_pcrel+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-       libffi_cv_as_x86_pcrel=no
-       echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
-       if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
-           libffi_cv_as_x86_pcrel=yes
-       fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_pcrel" >&5
-$as_echo "$libffi_cv_as_x86_pcrel" >&6; }
-    if test "x$libffi_cv_as_x86_pcrel" = xyes; then
-
-$as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h
-
-    fi
-    ;;
-
-  S390)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler uses zarch features" >&5
-$as_echo_n "checking compiler uses zarch features... " >&6; }
-if ${libffi_cv_as_s390_zarch+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-       libffi_cv_as_s390_zarch=no
-       echo 'void foo(void) { bar(); bar(); }' > conftest.c
-       if $CC $CFLAGS -S conftest.c > /dev/null 2>&1; then
-           if grep -q brasl conftest.s; then
-               libffi_cv_as_s390_zarch=yes
-           fi
-       fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_s390_zarch" >&5
-$as_echo "$libffi_cv_as_s390_zarch" >&6; }
-    if test "x$libffi_cv_as_s390_zarch" = xyes; then
-
-$as_echo "#define HAVE_AS_S390_ZARCH 1" >>confdefs.h
-
-    fi
-    ;;
-esac
-
-# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
-# Check whether --enable-pax_emutramp was given.
-if test "${enable_pax_emutramp+set}" = set; then :
-  enableval=$enable_pax_emutramp; if test "$enable_pax_emutramp" = "yes"; then
-
-$as_echo "#define FFI_MMAP_EXEC_EMUTRAMP_PAX 1" >>confdefs.h
-
-  fi
-fi
-
-
-FFI_EXEC_TRAMPOLINE_TABLE=0
-case "$target" in
-     *arm*-apple-darwin* | aarch64-apple-darwin*)
-       FFI_EXEC_TRAMPOLINE_TABLE=1
-
-$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
-
-     ;;
-     *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
-
-$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
-
-     ;;
-esac
- if test x$FFI_EXEC_TRAMPOLINE_TABLE = x1; then
-  FFI_EXEC_TRAMPOLINE_TABLE_TRUE=
-  FFI_EXEC_TRAMPOLINE_TABLE_FALSE='#'
-else
-  FFI_EXEC_TRAMPOLINE_TABLE_TRUE='#'
-  FFI_EXEC_TRAMPOLINE_TABLE_FALSE=
-fi
-
-
-
-if test x$TARGET = xX86_64; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain supports unwind section type" >&5
-$as_echo_n "checking toolchain supports unwind section type... " >&6; }
-if ${libffi_cv_as_x86_64_unwind_section_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-        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
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_64_unwind_section_type" >&5
-$as_echo "$libffi_cv_as_x86_64_unwind_section_type" >&6; }
-    if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
-
-$as_echo "#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1" >>confdefs.h
-
-    fi
-fi
-
-if test "x$GCC" = "xyes"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5
-$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
-if ${libffi_cv_ro_eh_frame+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-       libffi_cv_ro_eh_frame=no
-       echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
-       if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then
-           objdump -h conftest.o > conftest.dump 2>&1
-           libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1`
-           if test "x$libffi_eh_frame_line" != "x"; then
-               libffi_test_line=`expr $libffi_eh_frame_line + 1`p
-               sed -n $libffi_test_line conftest.dump > conftest.line
-               if grep READONLY conftest.line > /dev/null; then
-                   libffi_cv_ro_eh_frame=yes
-               fi
-           fi
-       fi
-       rm -f conftest.*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_ro_eh_frame" >&5
-$as_echo "$libffi_cv_ro_eh_frame" >&6; }
-  if test "x$libffi_cv_ro_eh_frame" = xyes; then
-
-$as_echo "#define HAVE_RO_EH_FRAME 1" >>confdefs.h
-
-
-$as_echo "#define EH_FRAME_FLAGS \"a\"" >>confdefs.h
-
-  else
-
-$as_echo "#define EH_FRAME_FLAGS \"aw\"" >>confdefs.h
-
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"hidden\")))" >&5
-$as_echo_n "checking for __attribute__((visibility(\"hidden\")))... " >&6; }
-if ${libffi_cv_hidden_visibility_attribute+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-       echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1  ; }' > conftest.c
-       libffi_cv_hidden_visibility_attribute=no
-       if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-           if grep '\.hidden.*foo' conftest.s >/dev/null; then
-               libffi_cv_hidden_visibility_attribute=yes
-           fi
-       fi
-       rm -f conftest.*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_hidden_visibility_attribute" >&5
-$as_echo "$libffi_cv_hidden_visibility_attribute" >&6; }
-  if test $libffi_cv_hidden_visibility_attribute = yes; then
-
-$as_echo "#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1" >>confdefs.h
-
-  fi
-fi
-
-
-
-
-
-
-
-TARGET_OBJ=
-for i in $SOURCES; do
-  TARGET_OBJ="${TARGET_OBJ} src/${TARGETDIR}/"`echo $i | sed 's/[cS]$/lo/'`
-done
-
-
-
-
-
-# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
-  enableval=$enable_debug; if test "$enable_debug" = "yes"; then
-
-$as_echo "#define FFI_DEBUG 1" >>confdefs.h
-
-  fi
-fi
-
- if test "$enable_debug" = "yes"; then
-  FFI_DEBUG_TRUE=
-  FFI_DEBUG_FALSE='#'
-else
-  FFI_DEBUG_TRUE='#'
-  FFI_DEBUG_FALSE=
-fi
-
-
-# Check whether --enable-structs was given.
-if test "${enable_structs+set}" = set; then :
-  enableval=$enable_structs; if test "$enable_structs" = "no"; then
-
-$as_echo "#define FFI_NO_STRUCTS 1" >>confdefs.h
-
-  fi
-fi
-
- if test "$enable_debug" = "yes"; then
-  FFI_DEBUG_TRUE=
-  FFI_DEBUG_FALSE='#'
-else
-  FFI_DEBUG_TRUE='#'
-  FFI_DEBUG_FALSE=
-fi
-
-
-# Check whether --enable-raw-api was given.
-if test "${enable_raw_api+set}" = set; then :
-  enableval=$enable_raw_api; if test "$enable_raw_api" = "no"; then
-
-$as_echo "#define FFI_NO_RAW_API 1" >>confdefs.h
-
-  fi
-fi
-
-
-# Check whether --enable-purify-safety was given.
-if test "${enable_purify_safety+set}" = set; then :
-  enableval=$enable_purify_safety; if test "$enable_purify_safety" = "yes"; then
-
-$as_echo "#define USING_PURIFY 1" >>confdefs.h
-
-  fi
-fi
-
-
-
-# Check whether --with-toolexeclibdir was given.
-if test "${with_toolexeclibdir+set}" = set; then :
-  withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
-  /)
-    ;;
-  */)
-    with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
-    ;;
-esac
-else
-  with_toolexeclibdir=no
-fi
-
-
-
-if test -n "$with_cross_host" &&
-   test x"$with_cross_host" != x"no"; then
-  toolexecdir='$(exec_prefix)/$(target_alias)'
-  case ${with_toolexeclibdir} in
-    no)
-      toolexeclibdir='$(toolexecdir)/lib'
-      ;;
-    *)
-      toolexeclibdir=${with_toolexeclibdir}
-      ;;
-  esac
-else
-  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
-  toolexeclibdir='$(libdir)'
-fi
-multi_os_directory=`$CC -print-multi-os-directory`
-case $multi_os_directory in
-  .) ;; # Avoid trailing /.
-  *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
-esac
-
-
-
-if test "${multilib}" = "yes"; then
-  multilib_arg="--enable-multilib"
-else
-  multilib_arg=
-fi
-
-# Check linker support.
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-  # If we're not using GNU ld, then there's no point in even trying these
-  # tests.  Check for that first.  We should have already tested for gld
-  # by now (in libtool), but require it now just to be safe...
-  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
-  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
-
-
-  # The name set by libtool depends on the version of libtool.  Shame on us
-  # for depending on an impl detail, but c'est la vie.  Older versions used
-  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
-  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
-  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
-  # set (hence we're using an older libtool), then set it.
-  if test x${with_gnu_ld+set} != xset; then
-    if test x${ac_cv_prog_gnu_ld+set} != xset; then
-      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
-      with_gnu_ld=no
-    else
-      with_gnu_ld=$ac_cv_prog_gnu_ld
-    fi
-  fi
-
-  # Start by getting the version number.  I think the libtool test already
-  # does some of this, but throws away the result.
-  libat_ld_is_gold=no
-  if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
-    libat_ld_is_gold=yes
-  fi
-
-  ldver=`$LD --version 2>/dev/null |
-         sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
-
-  libat_gnu_ld_version=`echo $ldver | \
-         $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-
-  # Set --gc-sections.
-  if test "$with_gnu_ld" = "notbroken"; then
-    # GNU ld it is!  Joy and bunny rabbits!
-
-    # All these tests are for C++; save the language and the compiler flags.
-    # Need to do this so that g++ won't try to link in libstdc++
-    ac_test_CFLAGS="${CFLAGS+set}"
-    ac_save_CFLAGS="$CFLAGS"
-    CFLAGS='-x c++  -Wl,--gc-sections'
-
-    # Check for -Wl,--gc-sections
-    # XXX This test is broken at the moment, as symbols required for linking
-    # are now in libsupc++ (not built yet).  In addition, this test has
-    # cored on solaris in the past.  In addition, --gc-sections doesn't
-    # really work at the moment (keeps on discarding used sections, first
-    # .eh_frame and now some of the glibc sections for iconv).
-    # Bzzzzt.  Thanks for playing, maybe next time.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,--gc-sections" >&5
-$as_echo_n "checking for ld that supports -Wl,--gc-sections... " >&6; }
-    if test "$cross_compiling" = yes; then :
-  ac_sectionLDflags=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-     int main(void)
-     {
-       try { throw 1; }
-       catch (...) { };
-       return 0;
-     }
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_sectionLDflags=yes
-else
-  ac_sectionLDflags=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-    if test "$ac_test_CFLAGS" = set; then
-      CFLAGS="$ac_save_CFLAGS"
-    else
-      # this is the suspicious part
-      CFLAGS=''
-    fi
-    if test "$ac_sectionLDflags" = "yes"; then
-      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_sectionLDflags" >&5
-$as_echo "$ac_sectionLDflags" >&6; }
-  fi
-
-  # Set linker optimization flags.
-  if test x"$with_gnu_ld" = x"yes"; then
-    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
-  fi
-
-
-
-
-
-
- # Check whether --enable-symvers was given.
-if test "${enable_symvers+set}" = set; then :
-  enableval=$enable_symvers;
-      case "$enableval" in
-       yes|no|gnu*|sun) ;;
-       *) as_fn_error $? "Unknown argument to enable/disable symvers" "$LINENO" 5 ;;
-                          esac
-
-else
-  enable_symvers=yes
-fi
-
-
-
-# If we never went through the LIBAT_CHECK_LINKER_FEATURES macro, then we
-# don't know enough about $LD to do tricks...
-
-
-# Turn a 'yes' into a suitable default.
-if test x$enable_symvers = xyes ; then
-  # FIXME  The following test is too strict, in theory.
-  if test $enable_shared = no || test "x$LD" = x; then
-    enable_symvers=no
-  else
-    if test $with_gnu_ld = yes ; then
-      enable_symvers=gnu
-    else
-      case ${target_os} in
-        # Sun symbol versioning exists since Solaris 2.5.
-        solaris2.[5-9]* | solaris2.1[0-9]*)
-          enable_symvers=sun ;;
-        *)
-          enable_symvers=no ;;
-      esac
-    fi
-  fi
-fi
-
-# Check if 'sun' was requested on non-Solaris 2 platforms.
-if test x$enable_symvers = xsun ; then
-  case ${target_os} in
-    solaris2*)
-      # All fine.
-      ;;
-    *)
-      # Unlikely to work.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5
-$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5
-$as_echo "$as_me: WARNING: === you are not targetting Solaris 2." >&2;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
-$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
-      enable_symvers=no
-      ;;
-  esac
-fi
-
-# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
-if test $enable_symvers != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared libgcc" >&5
-$as_echo_n "checking for shared libgcc... " >&6; }
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=' -lgcc_s'
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  libat_shared_libgcc=yes
-else
-  libat_shared_libgcc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  CFLAGS="$ac_save_CFLAGS"
-  if test $libat_shared_libgcc = no; then
-    cat > conftest.c <<EOF
-int main (void) { return 0; }
-EOF
-    libat_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
-                            -shared -shared-libgcc -o conftest.so \
-                            conftest.c -v 2>&1 >/dev/null \
-                            | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
-    rm -f conftest.c conftest.so
-    if test x${libat_libgcc_s_suffix+set} = xset; then
-      CFLAGS=" -lgcc_s$libat_libgcc_s_suffix"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  libat_shared_libgcc=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-      CFLAGS="$ac_save_CFLAGS"
-    fi
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libat_shared_libgcc" >&5
-$as_echo "$libat_shared_libgcc" >&6; }
-fi
-
-# For GNU ld, we need at least this version.  The format is described in
-# LIBAT_CHECK_LINKER_FEATURES above.
-libat_min_gnu_ld_version=21400
-# XXXXXXXXXXX libat_gnu_ld_version=21390
-
-# Check to see if unspecified "yes" value can win, given results above.
-# Change "yes" into either "no" or a style name.
-if test $enable_symvers != no && test $libat_shared_libgcc = yes; then
-  if test $with_gnu_ld = yes; then
-    if test $libat_gnu_ld_version -ge $libat_min_gnu_ld_version ; then
-      enable_symvers=gnu
-    elif test $libat_ld_is_gold = yes ; then
-      enable_symvers=gnu
-    else
-      # The right tools, the right setup, but too old.  Fallbacks?
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $libat_gnu_ld_version is too old for" >&5
-$as_echo "$as_me: WARNING: === Linker version $libat_gnu_ld_version is too old for" >&2;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === full symbol versioning support in this release of GCC." >&5
-$as_echo "$as_me: WARNING: === full symbol versioning support in this release of GCC." >&2;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You would need to upgrade your binutils to version" >&5
-$as_echo "$as_me: WARNING: === You would need to upgrade your binutils to version" >&2;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === $libat_min_gnu_ld_version or later and rebuild GCC." >&5
-$as_echo "$as_me: WARNING: === $libat_min_gnu_ld_version or later and rebuild GCC." >&2;}
-      if test $libat_gnu_ld_version -ge 21200 ; then
-        # Globbing fix is present, proper block support is not.
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
-$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
-        enable_symvers=no
-      else
-        # 2.11 or older.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
-$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
-        enable_symvers=no
-      fi
-    fi
-  elif test $enable_symvers = sun; then
-    : All interesting versions of Sun ld support sun style symbol versioning.
-  else
-    # just fail for now
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested some kind of symbol versioning, but" >&5
-$as_echo "$as_me: WARNING: === You have requested some kind of symbol versioning, but" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === either you are not using a supported linker, or you are" >&5
-$as_echo "$as_me: WARNING: === either you are not using a supported linker, or you are" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === not building a shared libgcc_s (which is required)." >&5
-$as_echo "$as_me: WARNING: === not building a shared libgcc_s (which is required)." >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
-$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
-    enable_symvers=no
-  fi
-fi
-if test $enable_symvers = gnu; then
-
-$as_echo "#define LIBAT_GNU_SYMBOL_VERSIONING 1" >>confdefs.h
-
-fi
-
- if test $enable_symvers != no; then
-  LIBAT_BUILD_VERSIONED_SHLIB_TRUE=
-  LIBAT_BUILD_VERSIONED_SHLIB_FALSE='#'
-else
-  LIBAT_BUILD_VERSIONED_SHLIB_TRUE='#'
-  LIBAT_BUILD_VERSIONED_SHLIB_FALSE=
-fi
-
- if test $enable_symvers = gnu; then
-  LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE=
-  LIBAT_BUILD_VERSIONED_SHLIB_GNU_FALSE='#'
-else
-  LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE='#'
-  LIBAT_BUILD_VERSIONED_SHLIB_GNU_FALSE=
-fi
-
- if test $enable_symvers = sun; then
-  LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE=
-  LIBAT_BUILD_VERSIONED_SHLIB_SUN_FALSE='#'
-else
-  LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE='#'
-  LIBAT_BUILD_VERSIONED_SHLIB_SUN_FALSE=
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5
-$as_echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
-
-
-# Determine what GCC version number to use in filesystem paths.
-
-  get_gcc_base_ver="cat"
-
-# Check whether --with-gcc-major-version-only was given.
-if test "${with_gcc_major_version_only+set}" = set; then :
-  withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
-        get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
-      fi
-
-fi
-
-
-
-
-ac_config_commands="$ac_config_commands include"
-
-ac_config_commands="$ac_config_commands src"
-
-
-ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h"
-
-
-ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
-
-
-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
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-
-  (set) 2>&1 |
-    case $as_nl`(ac_space=' '; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes: double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \.
-      sed -n \
-       "s/'/'\\\\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;; #(
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-) |
-  sed '
-     /^ac_cv_env_/b end
-     t clear
-     :clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-  if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-       cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-         mv -f confcache "$cache_file"$$ &&
-         mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-         mv -f confcache "$cache_file" ;;
-       esac
-      fi
-    fi
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
-   if test -n "$am_sleep_pid"; then
-     # Hide warnings about reused PIDs.
-     wait $am_sleep_pid 2>/dev/null
-   fi
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
-  am__EXEEXT_TRUE=
-  am__EXEEXT_FALSE='#'
-else
-  am__EXEEXT_TRUE='#'
-  am__EXEEXT_FALSE=
-fi
-
-if test -z "${BUILD_INFO_TRUE}" && test -z "${BUILD_INFO_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_INFO\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${GENINSRC_TRUE}" && test -z "${GENINSRC_FALSE}"; then
-  as_fn_error $? "conditional \"GENINSRC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${TESTSUBDIR_TRUE}" && test -z "${TESTSUBDIR_FALSE}"; then
-  as_fn_error $? "conditional \"TESTSUBDIR\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${FFI_EXEC_TRAMPOLINE_TABLE_TRUE}" && test -z "${FFI_EXEC_TRAMPOLINE_TABLE_FALSE}"; then
-  as_fn_error $? "conditional \"FFI_EXEC_TRAMPOLINE_TABLE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${FFI_DEBUG_TRUE}" && test -z "${FFI_DEBUG_FALSE}"; then
-  as_fn_error $? "conditional \"FFI_DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${FFI_DEBUG_TRUE}" && test -z "${FFI_DEBUG_FALSE}"; then
-  as_fn_error $? "conditional \"FFI_DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LIBAT_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${LIBAT_BUILD_VERSIONED_SHLIB_FALSE}"; then
-  as_fn_error $? "conditional \"LIBAT_BUILD_VERSIONED_SHLIB\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE}" && test -z "${LIBAT_BUILD_VERSIONED_SHLIB_GNU_FALSE}"; then
-  as_fn_error $? "conditional \"LIBAT_BUILD_VERSIONED_SHLIB_GNU\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE}" && test -z "${LIBAT_BUILD_VERSIONED_SHLIB_SUN_FALSE}"; then
-  as_fn_error $? "conditional \"LIBAT_BUILD_VERSIONED_SHLIB_SUN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-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
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-       expr "X$arg" : "X\\(.*\\)$as_nl";
-       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""       $as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-           s//\1/
-           q
-         }
-         /^X\/\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\/\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='        ';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by libffi $as_me 3.99999, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_links="$ac_config_links"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration.  Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-      --config     print configuration, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-      --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration links:
-$config_links
-
-Configuration commands:
-$config_commands
-
-Report bugs to <http://github.com/atgreen/libffi/issues>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-libffi config.status 3.99999
-configured by $0, generated by GNU Autoconf 2.69,
-  with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=?*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
-  *)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
-    esac
-    as_fn_append CONFIG_FILES " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --he | --h)
-    # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
-  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
-  *) as_fn_append ac_config_targets " $1"
-     ac_need_defaults=false ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-  shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-  CONFIG_SHELL='$SHELL'
-  export CONFIG_SHELL
-  exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-
-srcdir="$srcdir"
-host="$host"
-target="$target"
-with_multisubdir="$with_multisubdir"
-with_multisrctop="$with_multisrctop"
-with_target_subdir="$with_target_subdir"
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-multi_basedir="$multi_basedir"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="$CC"
-CXX="$CXX"
-GFORTRAN="$GFORTRAN"
-GDC="$GDC"
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
-predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
-postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
-reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
-reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
-fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in SHELL \
-ECHO \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-OBJDUMP \
-deplibs_check_method \
-file_magic_cmd \
-AR \
-AR_FLAGS \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
-lt_prog_compiler_pic \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
-hardcode_libdir_separator \
-fix_srcfile_path \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib \
-compiler_lib_search_dirs \
-predep_objects \
-postdep_objects \
-predeps \
-postdeps \
-compiler_lib_search_path \
-LD_CXX \
-reload_flag_CXX \
-compiler_CXX \
-lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_wl_CXX \
-lt_prog_compiler_pic_CXX \
-lt_prog_compiler_static_CXX \
-lt_cv_prog_compiler_c_o_CXX \
-export_dynamic_flag_spec_CXX \
-whole_archive_flag_spec_CXX \
-compiler_needs_object_CXX \
-with_gnu_ld_CXX \
-allow_undefined_flag_CXX \
-no_undefined_flag_CXX \
-hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_flag_spec_ld_CXX \
-hardcode_libdir_separator_CXX \
-fix_srcfile_path_CXX \
-exclude_expsyms_CXX \
-include_expsyms_CXX \
-file_list_spec_CXX \
-compiler_lib_search_dirs_CXX \
-predep_objects_CXX \
-postdep_objects_CXX \
-predeps_CXX \
-postdeps_CXX \
-compiler_lib_search_path_CXX; do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
-reload_cmds_CXX \
-old_archive_cmds_CXX \
-old_archive_from_new_cmds_CXX \
-old_archive_from_expsyms_cmds_CXX \
-archive_cmds_CXX \
-archive_expsym_cmds_CXX \
-module_cmds_CXX \
-module_expsym_cmds_CXX \
-export_symbols_cmds_CXX \
-prelink_cmds_CXX; do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'
-
-
-
-
-
-TARGETDIR="$TARGETDIR"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
-  case $ac_config_target in
-    "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;;
-    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
-    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;;
-    "src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;;
-    "include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;;
-    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
-    "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
-    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
-    "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
-
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
-  esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
-  tmp= ac_tmp=
-  trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
-  trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
-}  ||
-{
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
-  eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
-  echo "cat >conf$$subs.awk <<_ACEOF" &&
-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-  echo "_ACEOF"
-} >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-  if test $ac_delim_n = $ac_delim_num; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
-  N
-  s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = "\a"
-
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
-h
-s///
-s/^/:/
-s/[     ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[  ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[      ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any.  Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[    ]*#[    ]*define[       ][      ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  for (key in D) D_is_set[key] = 1
-  FS = "\a"
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
-  line = \$ 0
-  split(line, arg, " ")
-  if (arg[1] == "#") {
-    defundef = arg[2]
-    mac1 = arg[3]
-  } else {
-    defundef = substr(arg[1], 2)
-    mac1 = arg[2]
-  }
-  split(mac1, mac2, "(") #)
-  macro = mac2[1]
-  prefix = substr(line, 1, index(line, defundef) - 1)
-  if (D_is_set[macro]) {
-    # Preserve the white space surrounding the "#".
-    print prefix "define", macro P[macro] D[macro]
-    next
-  } else {
-    # Replace #undef with comments.  This is necessary, for example,
-    # in the case of _POSIX_SOURCE, which is predefined and required
-    # on some systems where configure will not decide to define it.
-    if (defundef == "undef") {
-      print "/*", prefix defundef, macro, "*/"
-      next
-    }
-  }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
-
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-        # (if the path is not absolute).  The absolute path cannot be DOS-style,
-        # because $ac_f cannot contain `:'.
-        test -f "$ac_f" ||
-          case $ac_f in
-          [\\/$]*) false;;
-          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-          esac ||
-          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      as_fn_append ac_file_inputs " '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-       `' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
-    fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
-
-    case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-    esac
-    ;;
-  esac
-
-  ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_file" : 'X\(//\)[^/]' \| \
-        X"$ac_file" : 'X\(//\)$' \| \
-        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-  as_dir="$ac_dir"; as_fn_mkdir_p
-  ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
-  esac
-  ac_MKDIR_P=$MKDIR_P
-  case $MKDIR_P in
-  [\\/$]* | ?:[\\/]* ) ;;
-  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
-  esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  ac_datarootdir_hack='
-  s&@datadir@&$datadir&g
-  s&@docdir@&$docdir&g
-  s&@infodir@&$infodir&g
-  s&@localedir@&$localedir&g
-  s&@mandir@&$mandir&g
-  s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
-
-  rm -f "$ac_tmp/stdin"
-  case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
-  esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-  :H)
-  #
-  # CONFIG_HEADER
-  #
-  if test x"$ac_file" != x-; then
-    {
-      $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
-       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    fi
-  else
-    $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
-  fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $_am_arg | $_am_arg:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$_am_arg" : 'X\(//\)[^/]' \| \
-        X"$_am_arg" : 'X\(//\)$' \| \
-        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-  :L)
-  #
-  # CONFIG_LINK
-  #
-
-  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
-    :
-  else
-    # Prefer the file from the source tree if names are identical.
-    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
-      ac_source=$srcdir/$ac_source
-    fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
-$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
-
-    if test ! -r "$ac_source"; then
-      as_fn_error $? "$ac_source: file not found" "$LINENO" 5
-    fi
-    rm -f "$ac_file"
-
-    # Try a relative symlink, then a hard link, then a copy.
-    case $ac_source in
-    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
-       *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
-    esac
-    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
-      ln "$ac_source" "$ac_file" 2>/dev/null ||
-      cp -p "$ac_source" "$ac_file" ||
-      as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
-  fi
- ;;
-  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
-  esac
-
-
-  case $ac_file$ac_mode in
-    "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
-   ac_file=Makefile . ${multi_basedir}/config-ml.in
-   ;;
-esac ;;
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # 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
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    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
-    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
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\).*/{
-           s//\1/
-           q
-         }
-         s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
-  done
-}
- ;;
-    "libtool":C)
-
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags="CXX "
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects
-postdep_objects=$lt_postdep_objects
-predeps=$lt_predeps
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
-
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-  esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1+=\$2"
-}
-_LT_EOF
-    ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1=\$$1\$2"
-}
-
-_LT_EOF
-    ;;
-  esac
-
-
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-
-
-    cat <<_LT_EOF >> "$ofile"
-
-# ### BEGIN LIBTOOL TAG CONFIG: CXX
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag_CXX
-reload_cmds=$lt_reload_cmds_CXX
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds_CXX
-
-# A language specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object_CXX
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld_CXX
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute_CXX
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath_CXX
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path_CXX
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds_CXX
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec_CXX
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects_CXX
-postdep_objects=$lt_postdep_objects_CXX
-predeps=$lt_predeps_CXX
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# ### END LIBTOOL TAG CONFIG: CXX
-_LT_EOF
-
- ;;
-    "include":C) test -d include || mkdir include ;;
-    "src":C)
-test -d src || mkdir src
-test -d src/$TARGETDIR || mkdir src/$TARGETDIR
- ;;
-
-  esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
index 0bf4af410d3eea0ca0bbf2e9c2785f1de0141a6a..70f6d2c2ea44a5b9e8f9a9ea5d7252bf82a03921 100644 (file)
@@ -1,40 +1,22 @@
 dnl Process this with autoconf to create configure
 
+AC_PREREQ(2.68)
 
-AC_INIT([libffi], [3.99999], [http://github.com/atgreen/libffi/issues])
+AC_INIT([libffi], [3.4.2], [http://github.com/libffi/libffi/issues])
 AC_CONFIG_HEADERS([fficonfig.h])
 
-AM_ENABLE_MULTILIB(, ..)
-
 AC_CANONICAL_SYSTEM
 target_alias=${target_alias-$host_alias}
 
-AM_INIT_AUTOMAKE([no-dist])
-
-# See if makeinfo has been installed and is modern enough
-# that we can use it.
-ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
-                   [GNU texinfo.* \([0-9][0-9.]*\)],
-                   [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
-AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
-
-# We would like our source tree to be readonly. However when releases or
-# pre-releases are generated, the flex/bison generated files as well as the
-# various formats of manuals need to be included along with the rest of the
-# sources.  Therefore we have --enable-generated-files-in-srcdir to do
-# just that.
-AC_MSG_CHECKING(generated-files-in-srcdir)
-AC_ARG_ENABLE(generated-files-in-srcdir,
-AS_HELP_STRING([--enable-generated-files-in-srcdir],
- [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex]),
-[case "$enableval" in
- yes) enable_generated_files_in_srcdir=yes ;;
- no)  enable_generated_files_in_srcdir=no ;;
- *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
- esac],
-[enable_generated_files_in_srcdir=no])
-AC_MSG_RESULT($enable_generated_files_in_srcdir)
-AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes)
+case "${host}" in
+  frv*-elf)
+    LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
+    ;;
+esac
+
+AX_ENABLE_BUILDDIR
+
+AM_INIT_AUTOMAKE
 
 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
 # We must force CC to /not/ be precious variables; otherwise
@@ -57,19 +39,38 @@ AC_SUBST(CFLAGS)
 AM_PROG_AS
 AM_PROG_CC_C_O
 AC_PROG_LIBTOOL
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_CHECK_TOOL(READELF, readelf)
 
 # Test for 64-bit build.
 AC_CHECK_SIZEOF([size_t])
 
+AX_COMPILER_VENDOR
+AX_CC_MAXOPT
+# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
+# compiler.
+if test "$ax_cv_c_compiler_vendor" != "sun"; then
+  AX_CFLAGS_WARN_ALL
+fi
+
+if test "x$GCC" = "xyes"; then
+  CFLAGS="$CFLAGS -fexceptions"
+fi
+
 cat > local.exp <<EOF
 set CC_FOR_TARGET "$CC"
 set CXX_FOR_TARGET "$CXX"
+set compiler_vendor "$ax_cv_c_compiler_vendor"
 EOF
 
 AM_MAINTAINER_MODE
 
+AC_CHECK_HEADERS(sys/memfd.h)
+AC_CHECK_FUNCS([memfd_create])
+
 AC_CHECK_HEADERS(sys/mman.h)
-AC_CHECK_FUNCS([mmap mkostemp])
+AC_CHECK_FUNCS([mmap mkostemp mkstemp])
 AC_FUNC_MMAP_BLACKLIST
 
 dnl The -no-testsuite modules omit the test subdir.
@@ -181,6 +182,28 @@ case "$TARGET" in
     ;;
 esac
 
+AC_CACHE_CHECK([whether compiler supports pointer authentication],
+   libffi_cv_as_ptrauth, [
+   libffi_cv_as_ptrauth=unknown
+   AC_TRY_COMPILE(,[
+#ifdef __clang__
+# if __has_feature(ptrauth_calls)
+#  define HAVE_PTRAUTH 1
+# endif
+#endif
+
+#ifndef HAVE_PTRAUTH
+# error Pointer authentication not supported
+#endif
+                  ],
+                  [libffi_cv_as_ptrauth=yes],
+                  [libffi_cv_as_ptrauth=no])
+])
+if test "x$libffi_cv_as_ptrauth" = xyes; then
+    AC_DEFINE(HAVE_PTRAUTH, 1,
+             [Define if your compiler supports pointer authentication.])
+fi
+
 # On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
 AC_ARG_ENABLE(pax_emutramp,
   [  --enable-pax_emutramp       enable pax emulated trampolines, for we can't use PROT_EXEC],
@@ -189,15 +212,20 @@ AC_ARG_ENABLE(pax_emutramp,
       [Define this if you want to enable pax emulated trampolines])
   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
 case "$target" in
-     *arm*-apple-darwin* | aarch64-apple-darwin*)
+     *arm*-apple-* | aarch64-apple-*)
        FFI_EXEC_TRAMPOLINE_TABLE=1
        AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1,
                  [Cannot use PROT_EXEC on this target, so, we revert to
                    alternative means])
      ;;
-     *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
+     *-apple-* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-linux-android*)
        AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
                  [Cannot use malloc on this target, so, we revert to
                    alternative means])
@@ -238,19 +266,15 @@ EOF
 fi
 
 if test "x$GCC" = "xyes"; then
+  AX_CHECK_COMPILE_FLAG(-fno-lto, libffi_cv_no_lto=-fno-lto)
+
   AC_CACHE_CHECK([whether .eh_frame section should be read-only],
       libffi_cv_ro_eh_frame, [
-       libffi_cv_ro_eh_frame=no
+       libffi_cv_ro_eh_frame=yes
        echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
-       if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then
-           objdump -h conftest.o > conftest.dump 2>&1
-           libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1`
-           if test "x$libffi_eh_frame_line" != "x"; then
-               libffi_test_line=`expr $libffi_eh_frame_line + 1`p
-               sed -n $libffi_test_line conftest.dump > conftest.line
-               if grep READONLY conftest.line > /dev/null; then
-                   libffi_cv_ro_eh_frame=yes
-               fi
+       if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
+           if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
+               libffi_cv_ro_eh_frame=no
            fi
        fi
        rm -f conftest.*
@@ -270,7 +294,7 @@ if test "x$GCC" = "xyes"; then
        echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1  ; }' > conftest.c
        libffi_cv_hidden_visibility_attribute=no
        if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
-           if grep '\.hidden.*foo' conftest.s >/dev/null; then
+           if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then
                libffi_cv_hidden_visibility_attribute=yes
            fi
        fi
@@ -282,10 +306,21 @@ if test "x$GCC" = "xyes"; then
   fi
 fi
 
+AC_ARG_ENABLE(docs,
+              AC_HELP_STRING([--disable-docs],
+                             [Disable building of docs (default: no)]),
+              [enable_docs=no],
+              [enable_docs=yes])
+AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
+
 AH_BOTTOM([
 #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
 #ifdef LIBFFI_ASM
+#ifdef __APPLE__
+#define FFI_HIDDEN(name) .private_extern name
+#else
 #define FFI_HIDDEN(name) .hidden name
+#endif
 #else
 #define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
 #endif
@@ -331,48 +366,56 @@ AC_ARG_ENABLE(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(exec-static-tramp,
+[  --disable-exec-static-tramp  disable use of static exec trampolines (enabled by default)])
+
+if test "$enable_exec_static_tramp" != no; then
+case "$target" in
+     *-cygwin*)
+     ;;
+     *arm*-*-linux-* | aarch64*-*-linux-* | i*86-*-linux-* | x86_64-*-linux-*)
+       AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1,
+                 [Define this if you want statically defined trampolines])
+     ;;
+esac
+fi
+
 AC_ARG_ENABLE(purify-safety,
 [  --enable-purify-safety  purify-safe mode],
   if test "$enable_purify_safety" = "yes"; then
     AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
   fi)
 
-GCC_WITH_TOOLEXECLIBDIR
-
-if test -n "$with_cross_host" &&
-   test x"$with_cross_host" != x"no"; then
-  toolexecdir='$(exec_prefix)/$(target_alias)'
-  case ${with_toolexeclibdir} in
-    no)
-      toolexeclibdir='$(toolexecdir)/lib'
-      ;;
-    *)
-      toolexeclibdir=${with_toolexeclibdir}
-      ;;
-  esac
+AC_ARG_ENABLE(multi-os-directory,
+[  --disable-multi-os-directory
+                          disable use of gcc --print-multi-os-directory to change the library installation directory])
+                          
+# These variables are only ever used when we cross-build to X86_WIN32.
+# And we only support this with GCC, so...
+if test "x$GCC" = "xyes"; then
+  if test -n "$with_cross_host" &&
+     test x"$with_cross_host" != x"no"; then
+    toolexecdir='${exec_prefix}'/'$(target_alias)'
+    toolexeclibdir='${toolexecdir}'/lib
+  else
+    toolexecdir='${libdir}'/gcc-lib/'$(target_alias)'
+    toolexeclibdir='${libdir}'
+  fi
+  if test x"$enable_multi_os_directory" != x"no"; then
+    multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
+    case $multi_os_directory in
+      .) ;; # Avoid trailing /.
+      ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+    esac
+  fi
+  AC_SUBST(toolexecdir)
 else
-  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
-  toolexeclibdir='$(libdir)'
+  toolexeclibdir='${libdir}'
 fi
-multi_os_directory=`$CC -print-multi-os-directory`
-case $multi_os_directory in
-  .) ;; # Avoid trailing /.
-  *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
-esac
-AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
-if test "${multilib}" = "yes"; then
-  multilib_arg="--enable-multilib"
-else
-  multilib_arg=
-fi
-
 # Check linker support.
-LIBAT_ENABLE_SYMVERS
-
-# Determine what GCC version number to use in filesystem paths.
-GCC_BASE_VER
+LIBFFI_ENABLE_SYMVERS
 
 AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
 AC_CONFIG_COMMANDS(src, [
@@ -380,8 +423,10 @@ test -d src || mkdir src
 test -d src/$TARGETDIR || mkdir src/$TARGETDIR
 ], [TARGETDIR="$TARGETDIR"])
 
-AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
-
-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
+AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc)
 
 AC_OUTPUT
+
+# Copy this file instead of using AC_CONFIG_LINK in order to support
+# compiling with MSVC, which won't understand cygwin style symlinks.
+cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h
index 7248acb7458f6e2f87b1c88d9f31caa31325874a..268267183a031c292a53d3ab11ec475f13c51392 100644 (file)
@@ -6,6 +6,13 @@
 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
 # Most of the time we can define all the variables all at once...
 case "${host}" in
+  aarch64*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* )
+       TARGET=ARM_WIN64; TARGETDIR=aarch64
+       if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
+         MSVC=1
+       fi
+       ;;
+
   aarch64*-*-*)
        TARGET=AARCH64; TARGETDIR=aarch64
        SOURCES="ffi.c sysv.S"
@@ -23,6 +30,13 @@ case "${host}" in
        SOURCES="ffi.c arcompact.S"
        ;;
 
+  arm*-*-cygwin* | arm*-*-mingw* | arm*-*-win* )
+       TARGET=ARM_WIN32; TARGETDIR=arm
+       if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
+         MSVC=1
+       fi
+       ;;
+
   arm*-*-*)
        TARGET=ARM; TARGETDIR=arm
        SOURCES="ffi.c sysv.S"
@@ -43,6 +57,11 @@ case "${host}" in
        SOURCES="ffi.c sysv.S"
        ;;
 
+  csky-*-*)
+        TARGET=CSKY; TARGETDIR=csky
+        SOURCES="ffi.c sysv.S"
+        ;;
+
   frv-*-*)
        TARGET=FRV; TARGETDIR=frv
        SOURCES="ffi.c eabi.S"
@@ -64,14 +83,17 @@ case "${host}" in
        TARGET=X86_FREEBSD; TARGETDIR=x86
        ;;
 
-  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
-  | x86_64-*-cygwin* | x86_64-*-mingw*)
+  i?86-*-cygwin* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \
+  | x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* )
        TARGETDIR=x86
        if test $ac_cv_sizeof_size_t = 4; then
          TARGET=X86_WIN32
        else
          TARGET=X86_WIN64
        fi
+       if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
+         MSVC=1
+       fi
        # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
        # We must also check with_cross_host to decide if this is a native
        # or cross-build and select where to install dlls appropriately.
@@ -83,12 +105,12 @@ case "${host}" in
        fi
        ;;
 
-  i?86-*-darwin* | x86_64-*-darwin*)
+  i?86-*-darwin* | x86_64-*-darwin* | i?86-*-ios | x86_64-*-ios)
        TARGETDIR=x86
        if test $ac_cv_sizeof_size_t = 4; then
          TARGET=X86_DARWIN
        else
-         TARGET=X86_64_DARWIN
+         TARGET=X86_64
        fi
        ;;
 
@@ -97,11 +119,12 @@ case "${host}" in
        if test $ac_cv_sizeof_size_t = 4; then
          echo 'int foo (void) { return __x86_64__; }' > conftest.c
          if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
-           TARGET=X86_64;
+           TARGET_X32=yes
+           TARGET=X86_64
          else
            TARGET=X86;
-          fi
-          rm -f conftest.*
+         fi
+         rm -f conftest.*
        else
          TARGET=X86_64;
        fi
@@ -112,6 +135,11 @@ case "${host}" in
        SOURCES="ffi.c unix.S"
        ;;
 
+  kvx-*-*)
+       TARGET=KVX; TARGETDIR=kvx
+       SOURCES="ffi.c sysv.S"
+       ;;
+
   m32r*-*-*)
        TARGET=M32R; TARGETDIR=m32r
        SOURCES="ffi.c sysv.S"
@@ -145,7 +173,7 @@ case "${host}" in
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
-  mips*-*linux* | mips*-*-openbsd*)
+  mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*)
        # Support 128-bit long double for NewABI.
        HAVE_LONG_DOUBLE='defined(__mips64)'
        TARGET=MIPS; TARGETDIR=mips
@@ -156,7 +184,7 @@ case "${host}" in
        SOURCES="ffi.c sysv.S"
        ;;
 
-  or1k*-linux*)
+  or1k*-*-*)
        TARGET=OR1K; TARGETDIR=or1k
        SOURCES="ffi.c sysv.S"
        ;;
@@ -168,6 +196,9 @@ case "${host}" in
   powerpc-*-amigaos*)
        TARGET=POWERPC; TARGETDIR=powerpc
        ;;
+  powerpc-*-eabi*)
+       TARGET=POWERPC; TARGETDIR=powerpc
+       ;;
   powerpc-*-beos*)
        TARGET=POWERPC; TARGETDIR=powerpc
        ;;
@@ -177,11 +208,15 @@ case "${host}" in
   powerpc-*-aix* | rs6000-*-aix*)
        TARGET=POWERPC_AIX; TARGETDIR=powerpc
        ;;
-  powerpc-*-freebsd* | powerpc-*-openbsd*)
+  powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
        TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
        HAVE_LONG_DOUBLE_VARIANT=1
        ;;
-  powerpc64-*-freebsd*)
+  powerpcspe-*-freebsd*)
+       TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
+       CFLAGS="$CFLAGS -D__NO_FPRS__"
+       ;;
+  powerpc64-*-freebsd* | powerpc64le-*-freebsd*)
        TARGET=POWERPC; TARGETDIR=powerpc
        ;;
   powerpc*-*-rtems*)
@@ -230,6 +265,20 @@ esac
 
 # ... but some of the cases above share configury.
 case "${TARGET}" in
+  ARM_WIN32)
+       if test "$MSVC" = 1; then
+               SOURCES="ffi.c sysv_msvc_arm32.S"
+       else
+               SOURCES="ffi.c sysv.S"
+       fi
+       ;;
+  ARM_WIN64)
+       if test "$MSVC" = 1; then
+               SOURCES="ffi.c win64_armasm.S"
+       else
+               SOURCES="ffi.c sysv.S"
+       fi
+       ;;
   MIPS)
        SOURCES="ffi.c o32.S n32.S"
        ;;
@@ -246,20 +295,26 @@ case "${TARGET}" in
   POWERPC_FREEBSD)
        SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
        ;;
-  X86 | X86_FREEBSD | X86_WIN32)
-       SOURCES="ffi.c sysv.S"
+  X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32)
+       if test "$MSVC" = 1; then
+               SOURCES="ffi.c sysv_intel.S"
+       else
+               SOURCES="ffi.c sysv.S"
+       fi
        ;;
   X86_64)
-       SOURCES="ffi64.c unix64.S"
+       if test x"$TARGET_X32" = xyes; then
+               SOURCES="ffi64.c unix64.S"
+       else
+               SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
+       fi
        ;;
   X86_WIN64)
-       SOURCES="ffiw64.c win64.S"
-       ;;
-  X86_DARWIN)
-       SOURCES="darwin_c.c darwin.S"
-       ;;
-  X86_64_DARWIN)
-       SOURCES="darwin64_c.c darwin64.S"
+       if test "$MSVC" = 1; then
+               SOURCES="ffiw64.c win64_intel.S"
+       else
+               SOURCES="ffiw64.c win64.S"
+       fi
        ;;
 esac
 
diff --git a/libffi/doc/Makefile.am b/libffi/doc/Makefile.am
new file mode 100644 (file)
index 0000000..43b650a
--- /dev/null
@@ -0,0 +1,3 @@
+## Process this with automake to create Makefile.in
+
+info_TEXINFOS = libffi.texi
index b9887a8c65b75a4908cb45ec71e9a419737150a7..7fd3625d992b50e713721f8bae60bb9b397e99dd 100644 (file)
@@ -1,7 +1,8 @@
 \input texinfo   @c -*-texinfo-*-
 @c %**start of header
 @setfilename libffi.info
-@settitle libffi
+@include version.texi
+@settitle libffi: the portable foreign function interface library
 @setchapternewpage off
 @c %**end of header
 
 @syncodeindex pg cp
 @syncodeindex tp cp
 
-@include version.texi
-
 @copying
 
-This manual is for Libffi, a portable foreign-function interface
+This manual is for libffi, a portable foreign function interface
 library.
 
-Copyright @copyright{} 2008, 2010, 2011 Red Hat, Inc.
+Copyright @copyright{} 2008--2019, 2021 Anthony Green and Red Hat, Inc.
+
+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:
 
-@quotation
-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''.
+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.
 
-@end quotation
 @end copying
 
 @dircategory Development
 @direntry
-* libffi: (libffi).             Portable foreign-function interface library.
+* libffi: (libffi).             Portable foreign function interface library.
 @end direntry
 
 @titlepage
-@title Libffi
+@title libffi: a foreign function interface library
+@subtitle For Version @value{VERSION} of libffi
+@author Anthony Green
 @page
 @vskip 0pt plus 1filll
 @insertcopying
@@ -53,6 +65,7 @@ section entitled ``GNU General Public License''.
 @menu
 * Introduction::                What is libffi?
 * Using libffi::                How to use libffi.
+* Memory Usage::                Where memory for closures comes from.
 * Missing Features::            Things libffi can't do.
 * Index::                       Index.
 @end menu
@@ -107,6 +120,7 @@ values passed between the two languages.
 * Multiple ABIs::               Different passing styles on one platform.
 * The Closure API::             Writing a generic function.
 * Closure Example::             A closure example.
+* Thread Safety::               Thread safety.
 @end menu
 
 
@@ -152,16 +166,21 @@ If the function being called is variadic (varargs) then
 @code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}.
 
 @findex ffi_prep_cif_var
-@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi var{abi}, unsigned int @var{nfixedargs}, unsigned int var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
+@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nfixedargs}, unsigned int @var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
 This initializes @var{cif} according to the given parameters for
-a call to a variadic function.  In general it's operation is the
+a call to a variadic function.  In general its operation is the
 same as for @code{ffi_prep_cif} except that:
 
 @var{nfixedargs} is the number of fixed arguments, prior to any
 variadic arguments.  It must be greater than zero.
 
 @var{ntotalargs} the total number of arguments, including variadic
-and fixed arguments.
+and fixed arguments.  @var{argtypes} must have this many elements.
+
+@code{ffi_prep_cif_var} will return @code{FFI_BAD_ARGTYPE} if any of
+the variable argument types are @code{ffi_type_float} (promote to
+@code{ffi_type_double} first), or any integer type small than an int
+(promote to an int-sized type first).
 
 Note that, different cif's must be prepped for calls to the same
 function when different numbers of arguments are passed.
@@ -172,6 +191,10 @@ Also note that a call to @code{ffi_prep_cif_var} with
 
 @end defun
 
+Note that the resulting @code{ffi_cif} holds pointers to all the
+@code{ffi_type} objects that were used during initialization.  You
+must ensure that these type objects have a lifetime at least as long
+as that of the @code{ffi_cif}.
 
 To call a function using an initialized @code{ffi_cif}, use the
 @code{ffi_call} function:
@@ -190,12 +213,29 @@ to ensure this.  If @var{cif} declares that the function returns
 @code{void} (using @code{ffi_type_void}), then @var{rvalue} is
 ignored.
 
+In most situations, @samp{libffi} will handle promotion according to
+the ABI.  However, for historical reasons, there is a special case
+with return values that must be handled by your code.  In particular,
+for integral (not @code{struct}) types that are narrower than the
+system register size, the return value will be widened by
+@samp{libffi}.  @samp{libffi} provides a type, @code{ffi_arg}, that
+can be used as the return type.  For example, if the CIF was defined
+with a return type of @code{char}, @samp{libffi} will try to store a
+full @code{ffi_arg} into the return value.
+
 @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}
 declares that the function has no arguments (i.e., @var{nargs} was 0),
 then @var{avalues} is ignored.  Note that argument values may be
 modified by the callee (for instance, structs passed by value); the
 burden of copying pass-by-value arguments is placed on the caller.
+
+Note that while the return value must be register-sized, arguments
+should exactly match their declared type.  For example, if an argument
+is a @code{short}, then the entry in @var{avalues} should point to an
+object declared as @code{short}; but if the return type is
+@code{short}, then @var{rvalue} should point to an object declared as
+a larger type -- usually @code{ffi_arg}.
 @end defun
 
 
@@ -215,26 +255,26 @@ int main()
   void *values[1];
   char *s;
   ffi_arg rc;
-  
-  /* Initialize the argument info vectors */    
+
+  /* Initialize the argument info vectors */
   args[0] = &ffi_type_pointer;
   values[0] = &s;
-  
+
   /* Initialize the cif */
-  if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
                       &ffi_type_sint, args) == FFI_OK)
     @{
       s = "Hello World!";
       ffi_call(&cif, puts, &rc, values);
       /* rc now holds the result of the call to puts */
-      
-      /* values holds a pointer to the function's arg, so to 
-         call puts() again all we need to do is change the 
+
+      /* values holds a pointer to the function's arg, so to
+         call puts() again all we need to do is change the
          value of s */
       s = "This is cool!";
       ffi_call(&cif, puts, &rc, values);
     @}
-  
+
   return 0;
 @}
 @end example
@@ -246,6 +286,8 @@ int main()
 @menu
 * Primitive Types::             Built-in types.
 * Structures::                  Structure types.
+* Size and Alignment::          Size and alignment of types.
+* Arrays Unions Enums::         Arrays, unions, and enumerations.
 * Type Example::                Structure type example.
 * Complex::                     Complex types.
 * Complex Type Example::        Complex type example.
@@ -370,8 +412,7 @@ when passing to @code{ffi_prep_cif}.
 @node Structures
 @subsection Structures
 
-Although @samp{libffi} has no special support for unions or
-bit-fields, it is perfectly happy passing structures back and forth.
+@samp{libffi} is perfectly happy passing structures back and forth.
 You must first describe the structure to @samp{libffi} by creating a
 new @code{ffi_type} object for it.
 
@@ -391,9 +432,166 @@ For a structure, this should be set to @code{FFI_TYPE_STRUCT}.
 @item ffi_type **elements
 This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
 objects.  There is one element per field of the struct.
+
+Note that @samp{libffi} has no special support for bit-fields.  You
+must manage these manually.
 @end table
 @end deftp
 
+The @code{size} and @code{alignment} fields will be filled in by
+@code{ffi_prep_cif} or @code{ffi_prep_cif_var}, as needed.
+
+@node Size and Alignment
+@subsection Size and Alignment
+
+@code{libffi} will set the @code{size} and @code{alignment} fields of
+an @code{ffi_type} object for you.  It does so using its knowledge of
+the ABI.
+
+You might expect that you can simply read these fields for a type that
+has been laid out by @code{libffi}.  However, there are some caveats.
+
+@itemize @bullet
+@item
+The size or alignment of some of the built-in types may vary depending
+on the chosen ABI.
+
+@item
+The size and alignment of a new structure type will not be set by
+@code{libffi} until it has been passed to @code{ffi_prep_cif} or
+@code{ffi_get_struct_offsets}.
+
+@item
+A structure type cannot be shared across ABIs.  Instead each ABI needs
+its own copy of the structure type.
+@end itemize
+
+So, before examining these fields, it is safest to pass the
+@code{ffi_type} object to @code{ffi_prep_cif} or
+@code{ffi_get_struct_offsets} first.  This function will do all the
+needed setup.
+
+@example
+ffi_type *desired_type;
+ffi_abi desired_abi;
+@dots{}
+ffi_cif cif;
+if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK)
+  @{
+    size_t size = desired_type->size;
+    unsigned short alignment = desired_type->alignment;
+  @}
+@end example
+
+@code{libffi} also provides a way to get the offsets of the members of
+a structure.
+
+@findex ffi_get_struct_offsets
+@defun ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets)
+Compute the offset of each element of the given structure type.
+@var{abi} is the ABI to use; this is needed because in some cases the
+layout depends on the ABI.
+
+@var{offsets} is an out parameter.  The caller is responsible for
+providing enough space for all the results to be written -- one
+element per element type in @var{struct_type}.  If @var{offsets} is
+@code{NULL}, then the type will be laid out but not otherwise
+modified.  This can be useful for accessing the type's size or layout,
+as mentioned above.
+
+This function returns @code{FFI_OK} on success; @code{FFI_BAD_ABI} if
+@var{abi} is invalid; or @code{FFI_BAD_TYPEDEF} if @var{struct_type}
+is invalid in some way.  Note that only @code{FFI_STRUCT} types are
+valid here.
+@end defun
+
+@node Arrays Unions Enums
+@subsection Arrays, Unions, and Enumerations
+
+@subsubsection Arrays
+
+@samp{libffi} does not have direct support for arrays or unions.
+However, they can be emulated using structures.
+
+To emulate an array, simply create an @code{ffi_type} using
+@code{FFI_TYPE_STRUCT} with as many members as there are elements in
+the array.
+
+@example
+ffi_type array_type;
+ffi_type **elements
+int i;
+
+elements = malloc ((n + 1) * sizeof (ffi_type *));
+for (i = 0; i < n; ++i)
+  elements[i] = array_element_type;
+elements[n] = NULL;
+
+array_type.size = array_type.alignment = 0;
+array_type.type = FFI_TYPE_STRUCT;
+array_type.elements = elements;
+@end example
+
+Note that arrays cannot be passed or returned by value in C --
+structure types created like this should only be used to refer to
+members of real @code{FFI_TYPE_STRUCT} objects.
+
+However, a phony array type like this will not cause any errors from
+@samp{libffi} if you use it as an argument or return type.  This may
+be confusing.
+
+@subsubsection Unions
+
+A union can also be emulated using @code{FFI_TYPE_STRUCT}.  In this
+case, however, you must make sure that the size and alignment match
+the real requirements of the union.
+
+One simple way to do this is to ensue that each element type is laid
+out.  Then, give the new structure type a single element; the size of
+the largest element; and the largest alignment seen as well.
+
+This example uses the @code{ffi_prep_cif} trick to ensure that each
+element type is laid out.
+
+@example
+ffi_abi desired_abi;
+ffi_type union_type;
+ffi_type **union_elements;
+
+int i;
+ffi_type element_types[2];
+
+element_types[1] = NULL;
+
+union_type.size = union_type.alignment = 0;
+union_type.type = FFI_TYPE_STRUCT;
+union_type.elements = element_types;
+
+for (i = 0; union_elements[i]; ++i)
+  @{
+    ffi_cif cif;
+    if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK)
+      @{
+        if (union_elements[i]->size > union_type.size)
+          @{
+            union_type.size = union_elements[i];
+            size = union_elements[i]->size;
+          @}
+        if (union_elements[i]->alignment > union_type.alignment)
+          union_type.alignment = union_elements[i]->alignment;
+      @}
+  @}
+@end example
+
+@subsubsection Enumerations
+
+@code{libffi} does not have any special support for C @code{enum}s.
+Although any given @code{enum} is implemented using a specific
+underlying integral type, exactly which type will be used cannot be
+determined by @code{libffi} -- it may depend on the values in the
+enumeration or on compiler flags such as @option{-fshort-enums}.
+@xref{Structures unions enumerations and bit-fields implementation, , , gcc},
+for more information about how GCC handles enumerations.
 
 @node Type Example
 @subsection Type Example
@@ -432,7 +630,7 @@ Here is the corresponding code to describe this struct to
       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++)
           tm_type_elements[i] = &ffi_type_sint;
 
@@ -630,30 +828,47 @@ the closure function:
 
 @findex ffi_prep_closure_loc
 @defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc})
-Prepare a closure function.
+Prepare a closure function.  The arguments to
+@code{ffi_prep_closure_loc} are:
 
-@var{closure} is the address of a @code{ffi_closure} object; this is
-the writable address returned by @code{ffi_closure_alloc}.
+@table @var
+@item closure
+The address of a @code{ffi_closure} object; this is the writable
+address returned by @code{ffi_closure_alloc}.
+
+@item cif
+The @code{ffi_cif} describing the function parameters.  Note that this
+object, and the types to which it refers, must be kept alive until the
+closure itself is freed.
 
-@var{cif} is the @code{ffi_cif} describing the function parameters.
+@item user_data
+An arbitrary datum that is passed, uninterpreted, to your closure
+function.
 
-@var{user_data} is an arbitrary datum that is passed, uninterpreted,
-to your closure function.
+@item codeloc
+The executable address returned by @code{ffi_closure_alloc}.
 
-@var{codeloc} is the executable address returned by
-@code{ffi_closure_alloc}.
+@item fun
+The function which will be called when the closure is invoked.  It is
+called with the arguments:
 
-@var{fun} is the function which will be called when the closure is
-invoked.  It is called with the arguments:
 @table @var
 @item cif
 The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}.
 
 @item ret
 A pointer to the memory used for the function's return value.
-@var{fun} must fill this, unless the function is declared as returning
-@code{void}.
-@c FIXME: is this NULL for void-returning functions?
+
+If the function is declared as returning @code{void}, then this value
+is garbage and should not be used.
+
+Otherwise, @var{fun} must fill the object to which this points,
+following the same special promotion behavior as @code{ffi_call}.
+That is, in most cases, @var{ret} points to an object of exactly the
+size of the type specified when @var{cif} was constructed.  However,
+integral types narrower than the system register size are widened.  In
+these cases your program may assume that @var{ret} points to an
+@code{ffi_arg} object.
 
 @item args
 A vector of pointers to memory holding the arguments to the function.
@@ -662,10 +877,10 @@ A vector of pointers to memory holding the arguments to the function.
 The same @var{user_data} that was passed to
 @code{ffi_prep_closure_loc}.
 @end table
+@end table
 
 @code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything
-went ok, and something else on error.
-@c FIXME: what?
+went ok, and one of the other @code{ffi_status} values on error.
 
 After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc}
 to the appropriate pointer-to-function type.
@@ -678,7 +893,7 @@ writable and executable addresses.
 @node Closure Example
 @section Closure Example
 
-A trivial example that creates a new @code{puts} by binding 
+A trivial example that creates a new @code{puts} by binding
 @code{fputs} with @code{stdout}.
 
 @example
@@ -733,6 +948,77 @@ int main()
 
 @end example
 
+@node Thread Safety
+@section Thread Safety
+
+@code{libffi} is not completely thread-safe.  However, many parts are,
+and if you follow some simple rules, you can use it safely in a
+multi-threaded program.
+
+@itemize @bullet
+@item
+@code{ffi_prep_cif} may modify the @code{ffi_type} objects passed to
+it.  It is best to ensure that only a single thread prepares a given
+@code{ffi_cif} at a time.
+
+@item
+On some platforms, @code{ffi_prep_cif} may modify the size and
+alignment of some types, depending on the chosen ABI.  On these
+platforms, if you switch between ABIs, you must ensure that there is
+only one call to @code{ffi_prep_cif} at a time.
+
+Currently the only affected platform is PowerPC and the only affected
+type is @code{long double}.
+@end itemize
+
+@node Memory Usage
+@chapter Memory Usage
+
+Note that memory allocated by @code{ffi_closure_alloc} and freed by
+@code{ffi_closure_free} does not come from the same general pool of
+memory that @code{malloc} and @code{free} use.  To accomodate security
+settings, @samp{libffi} may aquire memory, for example, by mapping
+temporary files into multiple places in the address space (once to
+write out the closure, a second to execute it).  The search follows
+this list, using the first that works:
+
+@itemize @bullet
+
+@item
+A anonymous mapping (i.e. not file-backed)
+
+@item
+@code{memfd_create()}, if the kernel supports it.
+
+@item
+A file created in the directory referenced by the environment variable
+@code{LIBFFI_TMPDIR}.
+
+@item
+Likewise for the environment variable @code{TMPDIR}.
+
+@item
+A file created in @code{/tmp}.
+
+@item
+A file created in @code{/var/tmp}.
+
+@item
+A file created in @code{/dev/shm}.
+
+@item
+A file created in the user's home directory (@code{$HOME}).
+
+@item
+A file created in any directory listed in @code{/etc/mtab}.
+
+@item
+A file created in any directory listed in @code{/proc/mounts}.
+
+@end itemize
+
+If security settings prohibit using any of these for closures,
+@code{ffi_closure_alloc} will fail.
 
 @node Missing Features
 @chapter Missing Features
@@ -749,13 +1035,11 @@ There is no support for bit fields in structures.
 
 @item
 The ``raw'' API is undocumented.
-@c argument promotion?
-@c unions?
 @c anything else?
-@end itemize
 
-Note that variadic support is very new and tested on a relatively
-small number of platforms.
+@item
+The Go API is undocumented.
+@end itemize
 
 @node Index
 @unnumbered Index
index ccef70f4931366583c4d4865681fbc4930eeaa3e..f2b741e87e467458bbfbd8a0d59441c7d8027aa0 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 8 November 2014
-@set UPDATED-MONTH November 2014
-@set EDITION 3.2.1
-@set VERSION 3.2.1
+@set UPDATED 27 June 2021
+@set UPDATED-MONTH June 2021
+@set EDITION 3.4.2
+@set VERSION 3.4.2
diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in
deleted file mode 100644 (file)
index 2cf8de9..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/* fficonfig.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* Define to the flags needed for the .section .eh_frame directive. */
-#undef EH_FRAME_FLAGS
-
-/* Define this if you want extra debugging. */
-#undef FFI_DEBUG
-
-/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
-#undef FFI_EXEC_TRAMPOLINE_TABLE
-
-/* Define this if you want to enable pax emulated trampolines */
-#undef FFI_MMAP_EXEC_EMUTRAMP_PAX
-
-/* Cannot use malloc on this target, so, we revert to alternative means */
-#undef FFI_MMAP_EXEC_WRIT
-
-/* Define this if you do not want support for the raw API. */
-#undef FFI_NO_RAW_API
-
-/* 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. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* Define if your assembler supports .cfi_* directives. */
-#undef HAVE_AS_CFI_PSEUDO_OP
-
-/* Define if your assembler supports .register. */
-#undef HAVE_AS_REGISTER_PSEUDO_OP
-
-/* Define if the compiler uses zarch features. */
-#undef HAVE_AS_S390_ZARCH
-
-/* Define if your assembler and linker support unaligned PC relative relocs.
-   */
-#undef HAVE_AS_SPARC_UA_PCREL
-
-/* Define if your assembler supports unwind section type. */
-#undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
-
-/* Define if your assembler supports PC relative relocs. */
-#undef HAVE_AS_X86_PCREL
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if __attribute__((visibility("hidden"))) is supported. */
-#undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* 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
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mkostemp' function. */
-#undef HAVE_MKOSTEMP
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define if mmap with MAP_ANON(YMOUS) works. */
-#undef HAVE_MMAP_ANON
-
-/* Define if mmap of /dev/zero works. */
-#undef HAVE_MMAP_DEV_ZERO
-
-/* Define if read-only mmap of a plain file works. */
-#undef HAVE_MMAP_FILE
-
-/* Define if .eh_frame sections should be read-only. */
-#undef HAVE_RO_EH_FRAME
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if GNU symbol versioning is used for libatomic. */
-#undef LIBAT_GNU_SYMBOL_VERSIONING
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* The size of `double', as computed by sizeof. */
-#undef SIZEOF_DOUBLE
-
-/* 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.
-       STACK_DIRECTION > 0 => grows toward higher addresses
-       STACK_DIRECTION < 0 => grows toward lower addresses
-       STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define this if you are using Purify and want to suppress spurious messages.
-   */
-#undef USING_PURIFY
-
-/* Version number of package */
-#undef VERSION
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-
-#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name) .hidden name
-#else
-#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
-#endif
-#else
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name)
-#else
-#define FFI_HIDDEN
-#endif
-#endif
-
old mode 100644 (file)
new mode 100755 (executable)
index 306136f..9921b0d
@@ -6,59 +6,73 @@ 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=7.0'
 
     prefix = "#ifdef __i386__\n\n"
     suffix = "\n\n#endif"
     src_dir = 'x86'
-    src_files = ['darwin.S', 'win32.S', 'ffi.c']
+    src_files = ['sysv.S', 'ffi.c', 'internal.h']
 
 
 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']
+    src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h']
 
 
 class device_platform(Platform):
-    directory = 'darwin_ios'
-    sdk = 'iphoneos'
     arch = 'armv7'
     triple = 'arm-apple-darwin11'
-    version_min = '-miphoneos-version-min=7.0'
 
     prefix = "#ifdef __arm__\n\n"
     suffix = "\n\n#endif"
     src_dir = 'arm'
-    src_files = ['sysv.S', 'trampoline.S', 'ffi.c']
+    src_files = ['sysv.S', 'ffi.c', 'internal.h']
 
 
 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']
+    src_files = ['sysv.S', 'ffi.c', 'internal.h']
+
+
+class ios_simulator_platform(simulator_platform):
+    directory = 'darwin_ios'
+    sdk = 'iphonesimulator'
+    version_min = '-miphoneos-version-min=7.0'
+
+
+class ios_simulator64_platform(simulator64_platform):
+    directory = 'darwin_ios'
+    sdk = 'iphonesimulator'
+    version_min = '-miphoneos-version-min=7.0'
+
+
+class ios_device_platform(device_platform):
+    directory = 'darwin_ios'
+    sdk = 'iphoneos'
+    version_min = '-miphoneos-version-min=7.0'
+
+
+class ios_device64_platform(device64_platform):
+    directory = 'darwin_ios'
+    sdk = 'iphoneos'
+    version_min = '-miphoneos-version-min=7.0'
 
 
 class desktop32_platform(Platform):
@@ -68,7 +82,7 @@ class desktop32_platform(Platform):
     triple = 'i386-apple-darwin10'
     version_min = '-mmacosx-version-min=10.6'
     src_dir = 'x86'
-    src_files = ['darwin.S', 'win32.S', 'ffi.c']
+    src_files = ['sysv.S', 'ffi.c', 'internal.h']
 
     prefix = "#ifdef __i386__\n\n"
     suffix = "\n\n#endif"
@@ -84,16 +98,39 @@ class desktop64_platform(Platform):
     prefix = "#ifdef __x86_64__\n\n"
     suffix = "\n\n#endif"
     src_dir = 'x86'
-    src_files = ['darwin64.S', 'ffi64.c']
+    src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h']
+
+
+class tvos_simulator64_platform(simulator64_platform):
+    directory = 'darwin_tvos'
+    sdk = 'appletvsimulator'
+    version_min = '-mtvos-version-min=9.0'
+
+
+class tvos_device64_platform(device64_platform):
+    directory = 'darwin_tvos'
+    sdk = 'appletvos'
+    version_min = '-mtvos-version-min=9.0'
+
+
+class watchos_simulator_platform(simulator_platform):
+    directory = 'darwin_watchos'
+    sdk = 'watchsimulator'
+    version_min = '-mwatchos-version-min=4.0'
+
+
+class watchos_device_platform(device_platform):
+    directory = 'darwin_watchos'
+    sdk = 'watchos'
+    arch = 'armv7k'
+    version_min = '-mwatchos-version-min=4.0'
 
 
 def mkdir_p(path):
     try:
         os.makedirs(path)
     except OSError as exc:  # Python >2.5
-        if exc.errno == errno.EEXIST:
-            pass
-        else:
+        if exc.errno != errno.EEXIST:
             raise
 
 
@@ -102,8 +139,11 @@ def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''
     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])
+        if filename in ['internal64.h', 'asmnames.h', 'internal.h']:
+            out_filename = filename
+        else:
+            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:
@@ -142,7 +182,7 @@ def build_target(platform, platform_headers):
     mkdir_p(build_dir)
     env = dict(CC=xcrun_cmd('clang'),
                LD=xcrun_cmd('ld'),
-               CFLAGS='%s' % (platform.version_min))
+               CFLAGS='%s -fembed-bitcode' % (platform.version_min))
     working_dir = os.getcwd()
     try:
         os.chdir(build_dir)
@@ -162,39 +202,47 @@ def build_target(platform, platform_headers):
             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):
+def generate_source_and_headers(
+    generate_osx=True,
+    generate_ios=True,
+    generate_tvos=True,
+    generate_watchos=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)
+        copy_src_platform_files(ios_simulator_platform)
+        copy_src_platform_files(ios_simulator64_platform)
+        copy_src_platform_files(ios_device_platform)
+        copy_src_platform_files(ios_device64_platform)
     if generate_osx:
-        copy_src_platform_files(desktop32_platform)
         copy_src_platform_files(desktop64_platform)
+    if generate_tvos:
+        copy_src_platform_files(tvos_simulator64_platform)
+        copy_src_platform_files(tvos_device64_platform)
+    if generate_watchos:
+        copy_src_platform_files(watchos_simulator_platform)
+        copy_src_platform_files(watchos_device_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)
+        build_target(ios_simulator_platform, platform_headers)
+        build_target(ios_simulator64_platform, platform_headers)
+        build_target(ios_device_platform, platform_headers)
+        build_target(ios_device64_platform, platform_headers)
     if generate_osx:
-        build_target(desktop32_platform, platform_headers)
         build_target(desktop64_platform, platform_headers)
+    if generate_tvos:
+        build_target(tvos_simulator64_platform, platform_headers)
+        build_target(tvos_device64_platform, platform_headers)
+    if generate_watchos:
+        build_target(watchos_simulator_platform, platform_headers)
+        build_target(watchos_device_platform, platform_headers)
 
     mkdir_p('darwin_common/include')
-    for header_name, tag_tuples in platform_headers.iteritems():
+    for header_name, tag_tuples in platform_headers.items():
         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:
@@ -204,6 +252,13 @@ 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)
+    parser.add_argument('--only-tvos', action='store_true', default=False)
+    parser.add_argument('--only-watchos', 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)
+    generate_source_and_headers(
+        generate_osx=not args.only_ios and not args.only_tvos and not args.only_watchos,
+        generate_ios=not args.only_osx and not args.only_tvos and not args.only_watchos,
+        generate_tvos=not args.only_ios and not args.only_osx and not args.only_watchos,
+        generate_watchos=not args.only_ios and not args.only_osx and not args.only_tvos,
+    )
index 37fde6e968066a66576020683c48e05be390c2cf..5f0d4066f4a97a95fc67c2c866664d46bf2d128d 100644 (file)
@@ -3,11 +3,7 @@
 AUTOMAKE_OPTIONS=foreign
 
 DISTCLEANFILES=ffitarget.h
-noinst_HEADERS=ffi_common.h ffi_cfi.h
+noinst_HEADERS=ffi_common.h ffi_cfi.h tramp.h
 EXTRA_DIST=ffi.h.in
 
-# Where generated headers like ffitarget.h get installed.
-gcc_version   := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
-toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
-
-toollibffi_HEADERS = ffi.h ffitarget.h
+nodist_include_HEADERS = ffi.h ffitarget.h
diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in
deleted file mode 100644 (file)
index 99da841..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-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 \
-      *\\[\ \  ]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
-    esac; \
-  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@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = include
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
-       $(top_srcdir)/../config/asmcfi.m4 \
-       $(top_srcdir)/../config/depstand.m4 \
-       $(top_srcdir)/../config/lead-dot.m4 \
-       $(top_srcdir)/../config/multi.m4 \
-       $(top_srcdir)/../config/override.m4 \
-       $(top_srcdir)/../config/toolexeclibdir.m4 \
-       $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
-       $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
-       $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
-       $(toollibffi_HEADERS)
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-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 =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(toollibffidir)"
-HEADERS = $(noinst_HEADERS) $(toollibffi_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
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-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@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OPT_LDFLAGS = @OPT_LDFLAGS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-TARGET_OBJ = @TARGET_OBJ@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-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@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-get_gcc_base_ver = @get_gcc_base_ver@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-multi_basedir = @multi_basedir@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-DISTCLEANFILES = ffitarget.h
-noinst_HEADERS = ffi_common.h ffi_cfi.h
-EXTRA_DIST = ffi.h.in
-
-# Where generated headers like ffitarget.h get installed.
-gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
-toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
-toollibffi_HEADERS = ffi.h ffitarget.h
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-               && { if test -f $@; then exit 0; else break; fi; }; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
-       $(am__cd) $(top_srcdir) && \
-         $(AUTOMAKE) --foreign include/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-       esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-ffi.h: $(top_builddir)/config.status $(srcdir)/ffi.h.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-install-toollibffiHEADERS: $(toollibffi_HEADERS)
-       @$(NORMAL_INSTALL)
-       @list='$(toollibffi_HEADERS)'; test -n "$(toollibffidir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(toollibffidir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(toollibffidir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(toollibffidir)'"; \
-         $(INSTALL_HEADER) $$files "$(DESTDIR)$(toollibffidir)" || exit $$?; \
-       done
-
-uninstall-toollibffiHEADERS:
-       @$(NORMAL_UNINSTALL)
-       @list='$(toollibffi_HEADERS)'; test -n "$(toollibffidir)" || list=; \
-       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(toollibffidir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-       $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-       set x; \
-       here=`pwd`; \
-       $(am__define_uniq_tagged_files); \
-       shift; \
-       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-         test -n "$$unique" || unique=$$empty_fix; \
-         if test $$# -gt 0; then \
-           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-             "$$@" $$unique; \
-         else \
-           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-             $$unique; \
-         fi; \
-       fi
-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
-
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && $(am__cd) $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-       list='$(am__tagged_files)'; \
-       case "$(srcdir)" in \
-         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-         *) sdir=$(subdir)/$(srcdir) ;; \
-       esac; \
-       for i in $$list; do \
-         if test -f "$$i"; then \
-           echo "$(subdir)/$$i"; \
-         else \
-           echo "$$sdir/$$i"; \
-         fi; \
-       done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am: all-am
-check: check-am
-all-am: Makefile $(HEADERS)
-installdirs:
-       for dir in "$(DESTDIR)$(toollibffidir)"; do \
-         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-       done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-       if test -z '$(STRIP)'; then \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-             install; \
-       else \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-       -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-toollibffiHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-toollibffiHEADERS
-
-.MAKE: install-am install-strip
-
-.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 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 \
-       install-toollibffiHEADERS 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-toollibffiHEADERS
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
index 191aef7bd3fd9d02dcc18652feba146d29653f2c..d16f307e64bebd72558a094d5df649e3947dd94d 100644 (file)
@@ -1,6 +1,7 @@
 /* -----------------------------------------------------------------*-C-*-
-   libffi @VERSION@ - Copyright (c) 2011, 2014 Anthony Green
-                    - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
+   libffi @VERSION@
+     - Copyright (c) 2011, 2014, 2019, 2021 Anthony Green
+     - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
 
    Permission is hereby granted, free of charge, to any person
    obtaining a copy of this software and associated documentation
    ----------------------------------------------------------------------- */
 
 /* -------------------------------------------------------------------
-   The basic API is described in the README file.
+   Most of the API is documented in doc/libffi.texi.
 
-   The raw API is designed to bypass some of the argument packing
-   and unpacking on architectures for which it can be avoided.
+   The raw API is designed to bypass some of the argument packing and
+   unpacking on architectures for which it can be avoided.  Routines
+   are provided to emulate the raw API if the underlying platform
+   doesn't allow faster implementation.
 
-   The closure API allows interpreted functions to be packaged up
-   inside a C function pointer, so that they can be called as C functions,
-   with no understanding on the client side that they are interpreted.
-   It can also be used in other cases in which it is necessary to package
-   up a user specified parameter and a function pointer as a single
-   function pointer.
-
-   The closure API must be implemented in order to get its functionality,
-   e.g. for use by gij.  Routines are provided to emulate the raw API
-   if the underlying platform doesn't allow faster implementation.
-
-   More details on the raw and cloure API can be found in:
+   More details on the raw API can be found in:
 
    http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
 
@@ -106,8 +98,8 @@ extern "C" {
 # endif
 #endif
 
-/* The closure code assumes that this works on pointers, i.e. a size_t */
-/* can hold a pointer.                                                 */
+/* The closure code assumes that this works on pointers, i.e. a size_t
+   can hold a pointer.  */
 
 typedef struct _ffi_type
 {
@@ -117,6 +109,32 @@ typedef struct _ffi_type
   struct _ffi_type **elements;
 } ffi_type;
 
+/* Need minimal decorations for DLLs to work on Windows.  GCC has
+   autoimport and autoexport.  Always mark externally visible symbols
+   as dllimport for MSVC clients, even if it means an extra indirection
+   when using the static version of the library.
+   Besides, as a workaround, they can define FFI_BUILDING if they
+   *know* they are going to link with the static library.  */
+#if defined _MSC_VER
+# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */
+#  define FFI_API __declspec(dllexport)
+# elif !defined FFI_BUILDING  /* Importing libffi.DLL */
+#  define FFI_API __declspec(dllimport)
+# else                        /* Building/linking static library */
+#  define FFI_API
+# endif
+#else
+# define FFI_API
+#endif
+
+/* The externally visible type declarations also need the MSVC DLL
+   decorations, or they will not be exported from the object file.  */
+#if defined LIBFFI_HIDE_BASIC_TYPES
+# define FFI_EXTERN FFI_API
+#else
+# define FFI_EXTERN extern FFI_API
+#endif
+
 #ifndef LIBFFI_HIDE_BASIC_TYPES
 #if SCHAR_MAX == 127
 # define ffi_type_uchar                ffi_type_uint8
@@ -166,21 +184,7 @@ typedef struct _ffi_type
  #error "long size not supported"
 #endif
 
-/* Need minimal decorations for DLLs to works on Windows. */
-/* GCC has autoimport and autoexport.  Rely on Libtool to */
-/* help MSVC export from a DLL, but always declare data   */
-/* to be imported for MSVC clients.  This costs an extra  */
-/* indirection for MSVC clients using the static version  */
-/* of the library, but don't worry about that.  Besides,  */
-/* as a workaround, they can define FFI_BUILDING if they  */
-/* *know* they are going to link with the static library. */
-#if defined _MSC_VER && !defined FFI_BUILDING
-#define FFI_EXTERN extern __declspec(dllimport)
-#else
-#define FFI_EXTERN extern
-#endif
-
-/* These are defined in types.c */
+/* These are defined in types.c.  */
 FFI_EXTERN ffi_type ffi_type_void;
 FFI_EXTERN ffi_type ffi_type_uint8;
 FFI_EXTERN ffi_type ffi_type_sint8;
@@ -214,11 +218,10 @@ FFI_EXTERN ffi_type ffi_type_complex_longdouble;
 typedef enum {
   FFI_OK = 0,
   FFI_BAD_TYPEDEF,
-  FFI_BAD_ABI
+  FFI_BAD_ABI,
+  FFI_BAD_ARGTYPE
 } ffi_status;
 
-typedef unsigned FFI_TYPE;
-
 typedef struct {
   ffi_abi abi;
   unsigned nargs;
@@ -231,20 +234,6 @@ 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,
-                            unsigned int isvariadic,
-                            unsigned int nfixedargs,
-                            unsigned int ntotalargs,
-                            ffi_type *rtype,
-                            ffi_type **atypes);
-
 /* ---- Definitions for the raw API -------------------------------------- */
 
 #ifndef FFI_SIZEOF_ARG
@@ -282,27 +271,34 @@ typedef ffi_raw ffi_java_raw;
 #endif
 
 
+FFI_API
 void ffi_raw_call (ffi_cif *cif,
                   void (*fn)(void),
                   void *rvalue,
                   ffi_raw *avalue);
 
-void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
-void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
-size_t ffi_raw_size (ffi_cif *cif);
+FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
+FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
+FFI_API size_t ffi_raw_size (ffi_cif *cif);
 
-/* This is analogous to the raw API, except it uses Java parameter     */
-/* packing, even on 64-bit machines.  I.e. on 64-bit machines          */
-/* longs and doubles are followed by an empty 64-bit word.             */
+/* This is analogous to the raw API, except it uses Java parameter
+   packing, even on 64-bit machines.  I.e. on 64-bit machines longs
+   and doubles are followed by an empty 64-bit word.  */
 
+#if !FFI_NATIVE_RAW_API
+FFI_API
 void ffi_java_raw_call (ffi_cif *cif,
                        void (*fn)(void),
                        void *rvalue,
-                       ffi_java_raw *avalue);
+                       ffi_java_raw *avalue) __attribute__((deprecated));
+#endif
 
-void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
-void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
-size_t ffi_java_raw_size (ffi_cif *cif);
+FFI_API
+void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
+FFI_API
+void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated));
+FFI_API
+size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
 
 /* ---- Definitions for closures ----------------------------------------- */
 
@@ -316,30 +312,50 @@ typedef struct {
   void *trampoline_table;
   void *trampoline_table_entry;
 #else
-  char tramp[FFI_TRAMPOLINE_SIZE];
+  union {
+    char tramp[FFI_TRAMPOLINE_SIZE];
+    void *ftramp;
+  };
 #endif
   ffi_cif   *cif;
   void     (*fun)(ffi_cif*,void*,void**,void*);
   void      *user_data;
+} ffi_closure
 #ifdef __GNUC__
-} ffi_closure __attribute__((aligned (8)));
-#else
-} ffi_closure;
+    __attribute__((aligned (8)))
+#endif
+    ;
+
+#ifndef __GNUC__
 # ifdef __sgi
 #  pragma pack 0
 # endif
 #endif
 
-void *ffi_closure_alloc (size_t size, void **code);
-void ffi_closure_free (void *);
+FFI_API void *ffi_closure_alloc (size_t size, void **code);
+FFI_API void ffi_closure_free (void *);
+
+#if defined(PA_LINUX) || defined(PA_HPUX)
+#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
+#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
+#else
+#define FFI_CLOSURE_PTR(X) (X)
+#define FFI_RESTORE_PTR(X) (X)
+#endif
 
-ffi_status
+FFI_API ffi_status
 ffi_prep_closure (ffi_closure*,
                  ffi_cif *,
                  void (*fun)(ffi_cif*,void*,void**,void*),
-                 void *user_data);
+                 void *user_data)
+#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405)
+  __attribute__((deprecated ("use ffi_prep_closure_loc instead")))
+#elif defined(__GNUC__) && __GNUC__ >= 3
+  __attribute__((deprecated))
+#endif
+  ;
 
-ffi_status
+FFI_API ffi_status
 ffi_prep_closure_loc (ffi_closure*,
                      ffi_cif *,
                      void (*fun)(ffi_cif*,void*,void**,void*),
@@ -360,9 +376,9 @@ typedef struct {
 
 #if !FFI_NATIVE_RAW_API
 
-  /* if this is enabled, then a raw closure has the same layout 
-     as a regular closure.  We use this to install an intermediate 
-     handler to do the transaltion, void** -> ffi_raw*. */
+  /* If this is enabled, then a raw closure has the same layout
+     as a regular closure.  We use this to install an intermediate
+     handler to do the transaltion, void** -> ffi_raw*.  */
 
   void     (*translate_args)(ffi_cif*,void*,void**,void*);
   void      *this_closure;
@@ -386,9 +402,9 @@ typedef struct {
 
 #if !FFI_NATIVE_RAW_API
 
-  /* if this is enabled, then a raw closure has the same layout 
-     as a regular closure.  We use this to install an intermediate 
-     handler to do the transaltion, void** -> ffi_raw*. */
+  /* If this is enabled, then a raw closure has the same layout
+     as a regular closure.  We use this to install an intermediate
+     handler to do the translation, void** -> ffi_raw*.  */
 
   void     (*translate_args)(ffi_cif*,void*,void**,void*);
   void      *this_closure;
@@ -400,31 +416,33 @@ typedef struct {
 
 } ffi_java_raw_closure;
 
-ffi_status
+FFI_API ffi_status
 ffi_prep_raw_closure (ffi_raw_closure*,
                      ffi_cif *cif,
                      void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
                      void *user_data);
 
-ffi_status
+FFI_API ffi_status
 ffi_prep_raw_closure_loc (ffi_raw_closure*,
                          ffi_cif *cif,
                          void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
                          void *user_data,
                          void *codeloc);
 
-ffi_status
+#if !FFI_NATIVE_RAW_API
+FFI_API ffi_status
 ffi_prep_java_raw_closure (ffi_java_raw_closure*,
                           ffi_cif *cif,
                           void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
-                          void *user_data);
+                          void *user_data) __attribute__((deprecated));
 
-ffi_status
+FFI_API ffi_status
 ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
                               ffi_cif *cif,
                               void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
                               void *user_data,
-                              void *codeloc);
+                              void *codeloc) __attribute__((deprecated));
+#endif
 
 #endif /* FFI_CLOSURES */
 
@@ -436,22 +454,24 @@ typedef struct {
   void     (*fun)(ffi_cif*,void*,void**,void*);
 } ffi_go_closure;
 
-ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *,
+FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *,
                                void (*fun)(ffi_cif*,void*,void**,void*));
 
-void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
+FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
                  void **avalue, void *closure);
 
 #endif /* FFI_GO_CLOSURES */
 
 /* ---- Public interface definition -------------------------------------- */
 
+FFI_API
 ffi_status ffi_prep_cif(ffi_cif *cif,
                        ffi_abi abi,
                        unsigned int nargs,
                        ffi_type *rtype,
                        ffi_type **atypes);
 
+FFI_API
 ffi_status ffi_prep_cif_var(ffi_cif *cif,
                            ffi_abi abi,
                            unsigned int nfixedargs,
@@ -459,12 +479,17 @@ ffi_status ffi_prep_cif_var(ffi_cif *cif,
                            ffi_type *rtype,
                            ffi_type **atypes);
 
+FFI_API
 void ffi_call(ffi_cif *cif,
              void (*fn)(void),
              void *rvalue,
              void **avalue);
 
-/* Useful for eliminating compiler warnings */
+FFI_API
+ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
+                                  size_t *offsets);
+
+/* Useful for eliminating compiler warnings.  */
 #define FFI_FN(f) ((void (*)(void))f)
 
 /* ---- Definitions shared with assembly code ---------------------------- */
@@ -472,18 +497,18 @@ void ffi_call(ffi_cif *cif,
 #endif
 
 /* If these change, update src/mips/ffitarget.h. */
-#define FFI_TYPE_VOID       0    
+#define FFI_TYPE_VOID       0
 #define FFI_TYPE_INT        1
-#define FFI_TYPE_FLOAT      2    
+#define FFI_TYPE_FLOAT      2
 #define FFI_TYPE_DOUBLE     3
 #if @HAVE_LONG_DOUBLE@
 #define FFI_TYPE_LONGDOUBLE 4
 #else
 #define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
 #endif
-#define FFI_TYPE_UINT8      5   
+#define FFI_TYPE_UINT8      5
 #define FFI_TYPE_SINT8      6
-#define FFI_TYPE_UINT16     7 
+#define FFI_TYPE_UINT16     7
 #define FFI_TYPE_SINT16     8
 #define FFI_TYPE_UINT32     9
 #define FFI_TYPE_SINT32     10
@@ -493,14 +518,8 @@ void ffi_call(ffi_cif *cif,
 #define FFI_TYPE_POINTER    14
 #define FFI_TYPE_COMPLEX    15
 
-/* This should always refer to the last type code (for sanity checks) */
-/* ??? Ideally, anyway.  There are assembly files that still depend
-   on this not including COMPLEX.  */
-#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
-# define FFI_TYPE_LAST      FFI_TYPE_COMPLEX
-#else
-# define FFI_TYPE_LAST      FFI_TYPE_POINTER
-#endif
+/* This should always refer to the last type code (for sanity checks).  */
+#define FFI_TYPE_LAST       FFI_TYPE_COMPLEX
 
 #ifdef __cplusplus
 }
index 244ce572be740e79b87d98229ef85d9c643cd3e5..f4c292d004049d031cbe4bd0ba16097da14b30a3 100644 (file)
@@ -2,6 +2,27 @@
    ffi_cfi.h - Copyright (c) 2014  Red Hat, Inc.
 
    Conditionally assemble cfi directives. Only necessary for building libffi.
+
+   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 FFI_CFI_H
index 37f5a9e92494d555530aed7cc9381806d3b2e0f8..2bd31b03d0f9d1252d637c57d81185a3049174b4 100644 (file)
@@ -5,6 +5,27 @@
                   
    Common internal definitions and macros. Only necessary for building
    libffi.
+
+   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 FFI_COMMON_H
@@ -74,14 +95,39 @@ void ffi_type_test(ffi_type *a, char *file, int line);
 #define FFI_ASSERT_VALID_TYPE(x)
 #endif
 
-#define ALIGN(v, a)  (((((size_t) (v))-1) | ((a)-1))+1)
-#define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
+/* v cast to size_t and aligned up to a multiple of a */
+#define FFI_ALIGN(v, a)  (((((size_t) (v))-1) | ((a)-1))+1)
+/* v cast to size_t and aligned down to a multiple of a */
+#define FFI_ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
 
 /* Perform machine dependent cif processing */
 ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
 ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
         unsigned int nfixedargs, unsigned int ntotalargs);
 
+
+#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,
+                            unsigned int isvariadic,
+                            unsigned int nfixedargs,
+                            unsigned int ntotalargs,
+                            ffi_type *rtype,
+                            ffi_type **atypes);
+
+/* Translate a data pointer to a code pointer.  Needed for closures on
+   some targets.  */
+void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;
+
+/* The arch code calls this to determine if a given closure has a
+   static trampoline. */
+int ffi_tramp_is_present (void *closure) FFI_HIDDEN;
+
 /* Extended cif, used in callback from assembly routine */
 typedef struct
 {
diff --git a/libffi/include/tramp.h b/libffi/include/tramp.h
new file mode 100644 (file)
index 0000000..e14e463
--- /dev/null
@@ -0,0 +1,45 @@
+/* -----------------------------------------------------------------------
+   ffi_tramp.h - Copyright (C) 2021  Microsoft, Inc.
+
+   Static trampoline definitions.
+
+   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 FFI_TRAMP_H
+#define FFI_TRAMP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ffi_tramp_is_supported(void);
+void *ffi_tramp_alloc (int flags);
+void ffi_tramp_set_parms (void *tramp, void *data, void *code);
+void *ffi_tramp_get_addr (void *tramp);
+void ffi_tramp_free (void *tramp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FFI_TRAMP_H */
index 8bd27ef693ab28755ffa0261cc6f32021dd20688..de8778ae40fb9c88398f1f96e978333699a8d141 100644 (file)
@@ -3,7 +3,10 @@
 #include <fficonfig.h>
 #include <ffitarget.h>
 
-LIBFFI_BASE_7.0 {
+/* These version numbers correspond to the libtool-version abi numbers,
+   not to the libffi release numbers.  */
+
+LIBFFI_BASE_8.0 {
   global:
        /* Exported data variables.  */
        ffi_type_void;
@@ -35,28 +38,23 @@ LIBFFI_BASE_7.0 {
        ffi_java_raw_to_ptrarray;
        ffi_java_raw_size;
 
-       /* Functions in the ffi.h header, but not exported.
-          These are listed here for documentation purposes only.
-       ffi_prep_types
-       ffi_prep_cif_core
-       */
-
+       ffi_get_struct_offsets;
   local:
        *;
 };
 
 #ifdef FFI_TARGET_HAS_COMPLEX_TYPE
-LIBFFI_COMPLEX_7.0 {
+LIBFFI_COMPLEX_8.0 {
   global:
        /* Exported data variables.  */
        ffi_type_complex_float;
        ffi_type_complex_double;
        ffi_type_complex_longdouble;
-} LIBFFI_BASE_7.0;
+} LIBFFI_BASE_8.0;
 #endif
 
 #if FFI_CLOSURES
-LIBFFI_CLOSURE_7.0 {
+LIBFFI_CLOSURE_8.0 {
   global:
        ffi_closure_alloc;
        ffi_closure_free;
@@ -66,13 +64,13 @@ LIBFFI_CLOSURE_7.0 {
        ffi_prep_raw_closure_loc;
        ffi_prep_java_raw_closure;
        ffi_prep_java_raw_closure_loc;
-} LIBFFI_BASE_7.0;
+} LIBFFI_BASE_8.0;
 #endif
 
 #if FFI_GO_CLOSURES
-LIBFFI_GO_CLOSURE_7.0 {
+LIBFFI_GO_CLOSURE_8.0 {
   global:
        ffi_call_go;
        ffi_prep_go_closure;
-} LIBFFI_CLOSURE_7.0;
+} LIBFFI_CLOSURE_8.0;
 #endif
index edf6fde5e2be6d624a78f40b8b29b26cdbf475f8..6fad83b4951c86bd96012fb14cadce69320d5df4 100644 (file)
@@ -2,7 +2,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 toolexeclibdir=@toolexeclibdir@
-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includedir=@includedir@
 
 Name: @PACKAGE_NAME@
 Description: Library supporting Foreign Function Interfaces
index 1cf396ffa1e42bfdf0c55d9d20f4c29a68f03490..480c4a4e4456c54d427caabe27d4f0ee424dfb00 100644 (file)
@@ -7,6 +7,9 @@
        objects = {
 
 /* Begin PBXBuildFile section */
+               43B5D3F81D35473200D1E1FD /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */; };
+               43B5D3FA1D3547CE00D1E1FD /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */; };
+               43E9A5C81D352C1500926A8F /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */; };
                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 */; };
                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 */; };
+               DBFA7194187F1DA100A76262 /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* unix64_x86_64.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 */; };
+               FDB52FB31F6144FA00AA92E6 /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */; };
+               FDB52FB51F6144FA00AA92E6 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; };
+               FDB52FB61F6144FA00AA92E6 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; };
+               FDB52FB71F6144FA00AA92E6 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
+               FDB52FB81F6144FA00AA92E6 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; };
+               FDB52FB91F6144FA00AA92E6 /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */; };
+               FDB52FBA1F6144FA00AA92E6 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
+               FDB52FBC1F6144FA00AA92E6 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
+               FDB52FBD1F6144FA00AA92E6 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; };
+               FDB52FBE1F6144FA00AA92E6 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
+               FDB52FBF1F6144FA00AA92E6 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; };
+               FDB52FC01F6144FA00AA92E6 /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */; };
+               FDB52FD01F614A8B00AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; };
+               FDB52FD11F614AA700AA92E6 /* ffi_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715E187F1D9B00A76262 /* ffi_arm64.h */; };
+               FDB52FD21F614AAB00AA92E6 /* ffi_armv7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715F187F1D9B00A76262 /* ffi_armv7.h */; };
+               FDB52FD41F614AB500AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */; };
+               FDB52FD51F614AE200AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; };
+               FDB52FD61F614AEA00AA92E6 /* ffi_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715E187F1D9B00A76262 /* ffi_arm64.h */; };
+               FDB52FD71F614AED00AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */; };
+               FDB52FD81F614B8700AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; };
+               FDB52FD91F614B8E00AA92E6 /* ffitarget_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */; };
+               FDB52FDA1F614B9300AA92E6 /* ffitarget_armv7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */; };
+               FDB52FDD1F614BA900AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */; };
+               FDB52FDE1F6155E300AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; };
+               FDB52FDF1F6155EA00AA92E6 /* ffitarget_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */; };
+               FDB52FE01F6155EF00AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */; };
+               FDB52FE21F6156FA00AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; };
+               FDB52FE31F61571A00AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; };
+               FDB52FE41F61571D00AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; };
+               FDB52FE61F61573100AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; };
+               FDDB2F411F5D66E200EF414E /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */; };
+               FDDB2F461F5D691E00EF414E /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F441F5D68C900EF414E /* win64_x86_64.S */; };
+               FDDB2F4A1F5D846400EF414E /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; };
+               FDDB2F4C1F5D846400EF414E /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
+               FDDB2F4E1F5D846400EF414E /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */; };
+               FDDB2F4F1F5D846400EF414E /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
+               FDDB2F501F5D846400EF414E /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
+               FDDB2F511F5D846400EF414E /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
+               FDDB2F521F5D846400EF414E /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* unix64_x86_64.S */; };
+               FDDB2F531F5D846400EF414E /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F441F5D68C900EF414E /* win64_x86_64.S */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
                DB13B1641849DF1E0010F42D /* CopyFiles */ = {
                        isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 8;
+                       buildActionMask = 12;
                        dstPath = "include/$(PRODUCT_NAME)";
                        dstSubfolderSpec = 16;
                        files = (
+                               FDB52FD01F614A8B00AA92E6 /* ffi.h in CopyFiles */,
+                               FDB52FD11F614AA700AA92E6 /* ffi_arm64.h in CopyFiles */,
+                               FDB52FD21F614AAB00AA92E6 /* ffi_armv7.h in CopyFiles */,
+                               FDB52FD41F614AB500AA92E6 /* ffi_x86_64.h in CopyFiles */,
+                               FDB52FD81F614B8700AA92E6 /* ffitarget.h in CopyFiles */,
+                               FDB52FD91F614B8E00AA92E6 /* ffitarget_arm64.h in CopyFiles */,
+                               FDB52FDA1F614B9300AA92E6 /* ffitarget_armv7.h in CopyFiles */,
+                               FDB52FDD1F614BA900AA92E6 /* ffitarget_x86_64.h in CopyFiles */,
                        );
-                       runOnlyForDeploymentPostprocessing = 1;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               FDB52FC11F6144FA00AA92E6 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 12;
+                       dstPath = "include/$(PRODUCT_NAME)";
+                       dstSubfolderSpec = 16;
+                       files = (
+                               FDB52FD51F614AE200AA92E6 /* ffi.h in CopyFiles */,
+                               FDB52FD61F614AEA00AA92E6 /* ffi_arm64.h in CopyFiles */,
+                               FDB52FD71F614AED00AA92E6 /* ffi_x86_64.h in CopyFiles */,
+                               FDB52FDE1F6155E300AA92E6 /* ffitarget.h in CopyFiles */,
+                               FDB52FDF1F6155EA00AA92E6 /* ffitarget_arm64.h in CopyFiles */,
+                               FDB52FE01F6155EF00AA92E6 /* ffitarget_x86_64.h in CopyFiles */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               FDB52FE11F6156E000AA92E6 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 2147483647;
+                       dstPath = "include/$(PRODUCT_NAME)";
+                       dstSubfolderSpec = 16;
+                       files = (
+                               FDB52FE21F6156FA00AA92E6 /* ffi.h in CopyFiles */,
+                               FDB52FE31F61571A00AA92E6 /* ffi_x86_64.h in CopyFiles */,
+                               FDB52FE41F61571D00AA92E6 /* ffitarget.h in CopyFiles */,
+                               FDB52FE61F61573100AA92E6 /* ffitarget_x86_64.h in CopyFiles */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
                };
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+               43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffiw64_x86_64.c; sourceTree = "<group>"; };
+               43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = win64_x86_64.S; sourceTree = "<group>"; };
+               43E9A5C61D352C1500926A8F /* unix64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = unix64_x86_64.S; sourceTree = "<group>"; };
+               43E9A5DA1D35373600926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
+               43E9A5DB1D35374400926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
+               43E9A5DC1D35375400926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
+               43E9A5DD1D35375400926A8F /* internal64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal64.h; sourceTree = "<group>"; };
                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>"; };
                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>"; };
+               DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; 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>"; };
+               DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; 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>"; };
+               DBFA718A187F1DA100A76262 /* unix64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = unix64_x86_64.S; sourceTree = "<group>"; };
+               DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
+               FDB52FC51F6144FA00AA92E6 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
+               FDDB2F3E1F5D61BC00EF414E /* asmnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asmnames.h; sourceTree = "<group>"; };
+               FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffiw64_x86_64.c; sourceTree = "<group>"; };
+               FDDB2F421F5D68C900EF414E /* internal64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal64.h; sourceTree = "<group>"; };
+               FDDB2F431F5D68C900EF414E /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
+               FDDB2F441F5D68C900EF414E /* win64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = win64_x86_64.S; sourceTree = "<group>"; };
+               FDDB2F621F5D846400EF414E /* libffi.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXGroup section */
                        children = (
                                DB13B1661849DF1E0010F42D /* libffi.a */,
                                DB13B1911849DF510010F42D /* ffi.dylib */,
+                               FDDB2F621F5D846400EF414E /* libffi.a */,
+                               FDB52FC51F6144FA00AA92E6 /* libffi.a */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                                DBFA713D187F1D8600A76262 /* include */,
                                DBFA7142187F1D8600A76262 /* src */,
                        );
-                       path = "darwin_common";
+                       path = darwin_common;
                        sourceTree = "<group>";
                };
                DBFA713D187F1D8600A76262 /* include */ = {
                                DBFA715D187F1D9B00A76262 /* include */,
                                DBFA716A187F1D9B00A76262 /* src */,
                        );
-                       path = "darwin_ios";
+                       path = darwin_ios;
                        sourceTree = "<group>";
                };
                DBFA715D187F1D9B00A76262 /* include */ = {
                        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;
                DBFA716B187F1D9B00A76262 /* aarch64 */ = {
                        isa = PBXGroup;
                        children = (
+                               43E9A5DA1D35373600926A8F /* internal.h */,
                                DBFA716C187F1D9B00A76262 /* ffi_arm64.c */,
                                DBFA716D187F1D9B00A76262 /* sysv_arm64.S */,
                        );
                DBFA716E187F1D9B00A76262 /* arm */ = {
                        isa = PBXGroup;
                        children = (
+                               43E9A5DB1D35374400926A8F /* internal.h */,
                                DBFA716F187F1D9B00A76262 /* ffi_armv7.c */,
                                DBFA7170187F1D9B00A76262 /* sysv_armv7.S */,
-                               DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */,
                        );
                        path = arm;
                        sourceTree = "<group>";
                DBFA7172187F1D9B00A76262 /* x86 */ = {
                        isa = PBXGroup;
                        children = (
-                               DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */,
-                               DBFA7174187F1D9B00A76262 /* darwin_i386.S */,
+                               43E9A5DC1D35375400926A8F /* internal.h */,
+                               43E9A5DD1D35375400926A8F /* internal64.h */,
                                DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */,
-                               DBFA7176187F1D9B00A76262 /* ffi_i386.c */,
+                               43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */,
+                               43E9A5C61D352C1500926A8F /* unix64_x86_64.S */,
+                               43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */,
                        );
                        path = x86;
                        sourceTree = "<group>";
                                DBFA7181187F1DA100A76262 /* include */,
                                DBFA7188187F1DA100A76262 /* src */,
                        );
-                       path = "darwin_osx";
+                       path = darwin_osx;
                        sourceTree = "<group>";
                };
                DBFA7181187F1DA100A76262 /* include */ = {
                        isa = PBXGroup;
                        children = (
-                               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;
                DBFA7189187F1DA100A76262 /* x86 */ = {
                        isa = PBXGroup;
                        children = (
-                               DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */,
-                               DBFA718B187F1DA100A76262 /* darwin_i386.S */,
+                               FDDB2F431F5D68C900EF414E /* internal.h */,
+                               FDDB2F421F5D68C900EF414E /* internal64.h */,
+                               FDDB2F3E1F5D61BC00EF414E /* asmnames.h */,
                                DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */,
-                               DBFA718D187F1DA100A76262 /* ffi_i386.c */,
+                               FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */,
+                               DBFA718A187F1DA100A76262 /* unix64_x86_64.S */,
+                               FDDB2F441F5D68C900EF414E /* win64_x86_64.S */,
                        );
                        path = x86;
                        sourceTree = "<group>";
                                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;
                };
                        isa = PBXNativeTarget;
                        buildConfigurationList = DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */;
                        buildPhases = (
-                               DB13B3051849E01C0010F42D /* ShellScript */,
+                               43B5D3FB1D35480D00D1E1FD /* Run Script */,
                                DB13B1621849DF1E0010F42D /* Sources */,
                                DB13B1641849DF1E0010F42D /* CopyFiles */,
                        );
                        productReference = DB13B1911849DF510010F42D /* ffi.dylib */;
                        productType = "com.apple.product-type.library.dynamic";
                };
+               FDB52FB01F6144FA00AA92E6 /* libffi-tvOS */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = FDB52FC21F6144FA00AA92E6 /* Build configuration list for PBXNativeTarget "libffi-tvOS" */;
+                       buildPhases = (
+                               FDB52FB11F6144FA00AA92E6 /* Run Script */,
+                               FDB52FB21F6144FA00AA92E6 /* Sources */,
+                               FDB52FC11F6144FA00AA92E6 /* CopyFiles */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = "libffi-tvOS";
+                       productName = ffi;
+                       productReference = FDB52FC51F6144FA00AA92E6 /* libffi.a */;
+                       productType = "com.apple.product-type.library.static";
+               };
+               FDDB2F471F5D846400EF414E /* libffi-static-Mac */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = FDDB2F5F1F5D846400EF414E /* Build configuration list for PBXNativeTarget "libffi-static-Mac" */;
+                       buildPhases = (
+                               FDDB2F481F5D846400EF414E /* ShellScript */,
+                               FDDB2F491F5D846400EF414E /* Sources */,
+                               FDB52FE11F6156E000AA92E6 /* CopyFiles */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = "libffi-static-Mac";
+                       productName = ffi;
+                       productReference = FDDB2F621F5D846400EF414E /* libffi.a */;
+                       productType = "com.apple.product-type.library.dynamic";
+               };
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
                DB13B15C1849DEB70010F42D /* Project object */ = {
                        isa = PBXProject;
                        attributes = {
-                               LastUpgradeCheck = 0510;
+                               LastUpgradeCheck = 0830;
                        };
                        buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */;
                        compatibilityVersion = "Xcode 3.2";
                        projectRoot = "";
                        targets = (
                                DB13B1651849DF1E0010F42D /* libffi-iOS */,
+                               FDB52FB01F6144FA00AA92E6 /* libffi-tvOS */,
                                DB13B1901849DF510010F42D /* libffi-Mac */,
+                               FDDB2F471F5D846400EF414E /* libffi-static-Mac */,
                        );
                };
 /* End PBXProject section */
 
 /* Begin PBXShellScriptBuildPhase section */
-               DB13B3051849E01C0010F42D /* ShellScript */ = {
+               43B5D3FB1D35480D00D1E1FD /* Run Script */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
                        );
                        inputPaths = (
                        );
+                       name = "Run Script";
                        outputPaths = (
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-ios";
+                       shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-ios\nfi";
                };
                DB13B3061849E0490010F42D /* ShellScript */ = {
                        isa = PBXShellScriptBuildPhase;
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx";
+                       shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-osx\nfi";
+               };
+               FDB52FB11F6144FA00AA92E6 /* Run Script */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputPaths = (
+                       );
+                       name = "Run Script";
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-ios\nfi";
+               };
+               FDDB2F481F5D846400EF414E /* ShellScript */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputPaths = (
+                       );
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-osx\nfi";
                };
 /* End PBXShellScriptBuildPhase section */
 
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               43E9A5C81D352C1500926A8F /* unix64_x86_64.S 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 */,
+                               43B5D3F81D35473200D1E1FD /* ffiw64_x86_64.c 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 */,
+                               43B5D3FA1D3547CE00D1E1FD /* win64_x86_64.S in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        buildActionMask = 2147483647;
                        files = (
                                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 */,
+                               FDDB2F411F5D66E200EF414E /* ffiw64_x86_64.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 */,
+                               DBFA7194187F1DA100A76262 /* unix64_x86_64.S in Sources */,
+                               FDDB2F461F5D691E00EF414E /* win64_x86_64.S in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               FDB52FB21F6144FA00AA92E6 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               FDB52FB31F6144FA00AA92E6 /* unix64_x86_64.S in Sources */,
+                               FDB52FB51F6144FA00AA92E6 /* ffi64_x86_64.c in Sources */,
+                               FDB52FB61F6144FA00AA92E6 /* ffi_armv7.c in Sources */,
+                               FDB52FB71F6144FA00AA92E6 /* closures.c in Sources */,
+                               FDB52FB81F6144FA00AA92E6 /* sysv_armv7.S in Sources */,
+                               FDB52FB91F6144FA00AA92E6 /* ffiw64_x86_64.c in Sources */,
+                               FDB52FBA1F6144FA00AA92E6 /* prep_cif.c in Sources */,
+                               FDB52FBC1F6144FA00AA92E6 /* raw_api.c in Sources */,
+                               FDB52FBD1F6144FA00AA92E6 /* sysv_arm64.S in Sources */,
+                               FDB52FBE1F6144FA00AA92E6 /* types.c in Sources */,
+                               FDB52FBF1F6144FA00AA92E6 /* ffi_arm64.c in Sources */,
+                               FDB52FC01F6144FA00AA92E6 /* win64_x86_64.S in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               FDDB2F491F5D846400EF414E /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               FDDB2F4A1F5D846400EF414E /* ffi64_x86_64.c in Sources */,
+                               FDDB2F4C1F5D846400EF414E /* prep_cif.c in Sources */,
+                               FDDB2F4E1F5D846400EF414E /* ffiw64_x86_64.c in Sources */,
+                               FDDB2F4F1F5D846400EF414E /* types.c in Sources */,
+                               FDDB2F501F5D846400EF414E /* raw_api.c in Sources */,
+                               FDDB2F511F5D846400EF414E /* closures.c in Sources */,
+                               FDDB2F521F5D846400EF414E /* unix64_x86_64.S in Sources */,
+                               FDDB2F531F5D846400EF414E /* win64_x86_64.S in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                DB13B1601849DEB70010F42D /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               ENABLE_TESTABILITY = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
                                HEADER_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "darwin_common/include",
+                                       darwin_common/include,
                                );
                                ONLY_ACTIVE_ARCH = YES;
                        };
                DB13B1611849DEB70010F42D /* Release */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
                                HEADER_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "darwin_common/include",
+                                       darwin_common/include,
                                );
                        };
                        name = Release;
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                ALWAYS_SEARCH_USER_PATHS = NO;
-                               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__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;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                        "DEBUG=1",
                                        "$(inherited)",
                                );
-                               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_UNUSED_VARIABLE = YES;
                                HEADER_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "darwin_ios/include",
+                                       darwin_ios/include,
                                );
-                               IPHONEOS_DEPLOYMENT_TARGET = 5.0;
-                               "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
-                               OTHER_LDFLAGS = "-ObjC";
+                               IPHONEOS_DEPLOYMENT_TARGET = 8.0;
                                PRODUCT_NAME = ffi;
                                SDKROOT = iphoneos;
                                SKIP_INSTALL = YES;
+                               VALID_ARCHS = "arm64 armv7 armv7s x86_64";
                        };
                        name = Debug;
                };
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                ALWAYS_SEARCH_USER_PATHS = NO;
-                               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;
                                COPY_PHASE_STRIP = YES;
                                DSTROOT = /tmp/ffi.dst;
                                ENABLE_NS_ASSERTIONS = NO;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
                                GCC_WARN_UNDECLARED_SELECTOR = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                HEADER_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "darwin_ios/include",
+                                       darwin_ios/include,
                                );
-                               IPHONEOS_DEPLOYMENT_TARGET = 5.0;
-                               "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
-                               OTHER_LDFLAGS = "-ObjC";
+                               IPHONEOS_DEPLOYMENT_TARGET = 8.0;
                                PRODUCT_NAME = ffi;
                                SDKROOT = iphoneos;
                                SKIP_INSTALL = YES;
                                VALIDATE_PRODUCT = YES;
+                               VALID_ARCHS = "arm64 armv7 armv7s x86_64";
                        };
                        name = Release;
                };
                                CLANG_WARN_INT_CONVERSION = YES;
                                CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               COMBINE_HIDPI_IMAGES = YES;
                                COPY_PHASE_STRIP = NO;
                                DYLIB_COMPATIBILITY_VERSION = 1;
                                DYLIB_CURRENT_VERSION = 1;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                HEADER_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "darwin_osx/include",
+                                       darwin_osx/include,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.6;
                                ONLY_ACTIVE_ARCH = YES;
                                CLANG_WARN_INT_CONVERSION = YES;
                                CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               COMBINE_HIDPI_IMAGES = YES;
                                COPY_PHASE_STRIP = YES;
                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
                                DYLIB_COMPATIBILITY_VERSION = 1;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                HEADER_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "darwin_osx/include",
+                                       darwin_osx/include,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.6;
                                OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
                        };
                        name = Release;
                };
+               FDB52FC31F6144FA00AA92E6 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               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;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               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_ios/include,
+                               );
+                               PRODUCT_NAME = ffi;
+                               SDKROOT = appletvos;
+                               SKIP_INSTALL = YES;
+                               TVOS_DEPLOYMENT_TARGET = 9.0;
+                       };
+                       name = Debug;
+               };
+               FDB52FC41F6144FA00AA92E6 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               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;
+                               ENABLE_NS_ASSERTIONS = 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_ios/include,
+                               );
+                               PRODUCT_NAME = ffi;
+                               SDKROOT = appletvos;
+                               SKIP_INSTALL = YES;
+                               TVOS_DEPLOYMENT_TARGET = 9.0;
+                               VALIDATE_PRODUCT = YES;
+                       };
+                       name = Release;
+               };
+               FDDB2F601F5D846400EF414E /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               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;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               EXECUTABLE_EXTENSION = a;
+                               EXECUTABLE_PREFIX = lib;
+                               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)",
+                               );
+                               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,
+                               );
+                               MACH_O_TYPE = staticlib;
+                               MACOSX_DEPLOYMENT_TARGET = 10.6;
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_NAME = ffi;
+                               SDKROOT = macosx;
+                       };
+                       name = Debug;
+               };
+               FDDB2F611F5D846400EF414E /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               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;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = YES;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_NS_ASSERTIONS = NO;
+                               EXECUTABLE_EXTENSION = a;
+                               EXECUTABLE_PREFIX = lib;
+                               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,
+                               );
+                               MACH_O_TYPE = staticlib;
+                               MACOSX_DEPLOYMENT_TARGET = 10.6;
+                               PRODUCT_NAME = ffi;
+                               SDKROOT = macosx;
+                       };
+                       name = Release;
+               };
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = Release;
                };
+               FDB52FC21F6144FA00AA92E6 /* Build configuration list for PBXNativeTarget "libffi-tvOS" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               FDB52FC31F6144FA00AA92E6 /* Debug */,
+                               FDB52FC41F6144FA00AA92E6 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               FDDB2F5F1F5D846400EF414E /* Build configuration list for PBXNativeTarget "libffi-static-Mac" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               FDDB2F601F5D846400EF414E /* Debug */,
+                               FDDB2F611F5D846400EF414E /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
 /* End XCConfigurationList section */
        };
        rootObject = DB13B15C1849DEB70010F42D /* Project object */;
index dfb8b111d0bd757a683a4a11558dadfac55835ab..607fee5585d9c7afec826675689a56abad43966d 100644 (file)
@@ -2,5 +2,28 @@
 # the libtool manual to understand the meaning of the fields.  This is
 # a separate file so that version updates don't involve re-running
 # automake.
+#
+# Here are a set of rules to help you update your library version
+# information:
+# 
+# 1. Start with version information of `0:0:0' for each libtool library.
+#
+# 2. Update the version information only immediately before a public
+#    release of your software. More frequent updates are unnecessary,
+#    and only guarantee that the current interface number gets larger
+#    faster.
+#
+# 3. If the library source code has changed at all since the last
+#    update, then increment revision (`c:r:a' becomes `c:r+1:a').
+#
+# 4. If any interfaces have been added, removed, or changed since the
+#    last update, increment current, and set revision to 0.
+#
+# 5. If any interfaces have been added since the last public release,
+#    then increment age.
+#
+# 6. If any interfaces have been removed since the last public
+#    release, then set age to 0.
+#
 # CURRENT:REVISION:AGE
-7:0:0
+9:0:1
diff --git a/libffi/man/Makefile.in b/libffi/man/Makefile.in
deleted file mode 100644 (file)
index 7546910..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-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 \
-      *\\[\ \  ]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
-    esac; \
-  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@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = man
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
-       $(top_srcdir)/../config/asmcfi.m4 \
-       $(top_srcdir)/../config/depstand.m4 \
-       $(top_srcdir)/../config/lead-dot.m4 \
-       $(top_srcdir)/../config/multi.m4 \
-       $(top_srcdir)/../config/override.m4 \
-       $(top_srcdir)/../config/toolexeclibdir.m4 \
-       $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
-       $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
-       $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-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 =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-man3dir = $(mandir)/man3
-am__installdirs = "$(DESTDIR)$(man3dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-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@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OPT_LDFLAGS = @OPT_LDFLAGS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-TARGET_OBJ = @TARGET_OBJ@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-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@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-get_gcc_base_ver = @get_gcc_base_ver@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-multi_basedir = @multi_basedir@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-               && { if test -f $@; then exit 0; else break; fi; }; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
-       $(am__cd) $(top_srcdir) && \
-         $(AUTOMAKE) --foreign man/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-       esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-install-man3: $(man_MANS)
-       @$(NORMAL_INSTALL)
-       @list1=''; \
-       list2='$(man_MANS)'; \
-       test -n "$(man3dir)" \
-         && test -n "`echo $$list1$$list2`" \
-         || exit 0; \
-       echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
-       $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
-       { for i in $$list1; do echo "$$i"; done;  \
-       if test -n "$$list2"; then \
-         for i in $$list2; do echo "$$i"; done \
-           | sed -n '/\.3[a-z]*$$/p'; \
-       fi; \
-       } | while read p; do \
-         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; echo "$$p"; \
-       done | \
-       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-       sed 'N;N;s,\n, ,g' | { \
-       list=; while read file base inst; do \
-         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
-           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
-         fi; \
-       done; \
-       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-       while read files; do \
-         test -z "$$files" || { \
-           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
-           $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
-       done; }
-
-uninstall-man3:
-       @$(NORMAL_UNINSTALL)
-       @list=''; test -n "$(man3dir)" || exit 0; \
-       files=`{ for i in $$list; do echo "$$i"; done; \
-       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-         sed -n '/\.3[a-z]*$$/p'; \
-       } | 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:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
-       for dir in "$(DESTDIR)$(man3dir)"; do \
-         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-       done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-       if test -z '$(STRIP)'; then \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-             install; \
-       else \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-       -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man3
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man3
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-       cscopelist-am ctags-am distclean distclean-generic \
-       distclean-libtool 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
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libffi/mdate-sh b/libffi/mdate-sh
deleted file mode 100644 (file)
index e631b22..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/bin/sh
-# Get modification time of a file or directory and pretty-print it.
-
-scriptversion=2009-04-28.21; # UTC
-
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 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
-# it 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.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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, 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
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-case $1 in
-  '')
-     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.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "mdate-sh $scriptversion"
-    exit $?
-    ;;
-esac
-
-# Prevent date giving response in another language.
-LANG=C
-export LANG
-LC_ALL=C
-export LC_ALL
-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 to its documented default.
-if test "${TIME_STYLE+set}" = set; then
-  TIME_STYLE=posix-long-iso
-  export TIME_STYLE
-fi
-
-save_arg1=$1
-
-# Find out how to get the extended ls output of a file or directory.
-if ls -L /dev/null 1>/dev/null 2>&1; then
-  ls_command='ls -L -l -d'
-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.
-#  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 `/'
-# 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_command /`
-
-# Find which argument is the month.
-month=
-command=
-until test $month
-do
-  shift
-  # Add another shift to the command.
-  command="$command shift;"
-  case $1 in
-    Jan) month=January; nummonth=1;;
-    Feb) month=February; nummonth=2;;
-    Mar) month=March; nummonth=3;;
-    Apr) month=April; nummonth=4;;
-    May) month=May; nummonth=5;;
-    Jun) month=June; nummonth=6;;
-    Jul) month=July; nummonth=7;;
-    Aug) month=August; nummonth=8;;
-    Sep) month=September; nummonth=9;;
-    Oct) month=October; nummonth=10;;
-    Nov) month=November; nummonth=11;;
-    Dec) month=December; nummonth=12;;
-  esac
-done
-
-# Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\$save_arg1\""`
-
-# Remove all preceding arguments
-eval $command
-
-# Because of the dummy argument above, month is in $2.
-#
-# On a POSIX system, we should have
-#
-# $# = 5
-# $1 = file size
-# $2 = month
-# $3 = day
-# $4 = year or time
-# $5 = filename
-#
-# On Darwin 7.7.0 and 7.6.0, we have
-#
-# $# = 4
-# $1 = day
-# $2 = month
-# $3 = year or time
-# $4 = filename
-
-# Get the month.
-case $2 in
-  Jan) month=January; nummonth=1;;
-  Feb) month=February; nummonth=2;;
-  Mar) month=March; nummonth=3;;
-  Apr) month=April; nummonth=4;;
-  May) month=May; nummonth=5;;
-  Jun) month=June; nummonth=6;;
-  Jul) month=July; nummonth=7;;
-  Aug) month=August; nummonth=8;;
-  Sep) month=September; nummonth=9;;
-  Oct) month=October; nummonth=10;;
-  Nov) month=November; nummonth=11;;
-  Dec) month=December; nummonth=12;;
-esac
-
-case $3 in
-  ???*) day=$1;;
-  *) day=$3; shift;;
-esac
-
-# Here we have to deal with the problem that the ls output gives either
-# the time of day or the year.
-case $3 in
-  *:*) set `date`; eval year=\$$#
-       case $2 in
-        Jan) nummonthtod=1;;
-        Feb) nummonthtod=2;;
-        Mar) nummonthtod=3;;
-        Apr) nummonthtod=4;;
-        May) nummonthtod=5;;
-        Jun) nummonthtod=6;;
-        Jul) nummonthtod=7;;
-        Aug) nummonthtod=8;;
-        Sep) nummonthtod=9;;
-        Oct) nummonthtod=10;;
-        Nov) nummonthtod=11;;
-        Dec) nummonthtod=12;;
-       esac
-       # For the first six month of the year the time notation can also
-       # be used for files modified in the last year.
-       if (expr $nummonth \> $nummonthtod) > /dev/null;
-       then
-        year=`expr $year - 1`
-       fi;;
-  *) year=$3;;
-esac
-
-# The result.
-echo $day $month $year
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
index 65fbfef7e35b88ebab245112e19d229b43241bf2..301e2fbd6840feae9944add823a829b1c89bda8f 100755 (executable)
 
 args_orig=$@
 args="-nologo -W3"
+linkargs=
 static_crt=
 debug_crt=
 cl="cl"
 ml="ml"
 safeseh="-safeseh"
 output=
+libpaths=
+libversion=8
+verbose=
 
 while [ $# -gt 0 ]
 do
   case $1
   in
+    --verbose)
+      verbose=1
+      shift 1
+    ;;
+    --version)
+      args="-help"
+      shift 1
+    ;;
     -fexceptions)
       # Don't enable exceptions for now.
       #args="$args -EHac"
@@ -68,9 +80,18 @@ do
       safeseh=
       shift 1
     ;;
+    -marm)
+      ml='armasm'
+      safeseh=
+      shift 1
+    ;;
+    -marm64)
+      ml='armasm64'
+      safeseh=
+      shift 1
+    ;;
     -clang-cl)
       cl="clang-cl"
-      safeseh=
       shift 1
     ;;
     -O0)
@@ -144,13 +165,44 @@ do
       shift 1
     ;;
     -I)
-      args="$args -I$2"
-      includes="$includes -I$2"
+      p=$(cygpath -ma "$2")
+      args="$args -I\"$p\""
+      includes="$includes -I\"$p\""
       shift 2
     ;;
     -I*)
-      args="$args $1"
-      includes="$includes $1"
+      p=$(cygpath -ma "${1#-I}")
+      args="$args -I\"$p\""
+      includes="$includes -I\"$p\""
+      shift 1
+    ;;
+    -L)
+      p=$(cygpath -ma $2)
+      linkargs="$linkargs -LIBPATH:$p"
+      shift 2
+    ;;
+    -L*)
+      p=$(cygpath -ma ${1#-L})
+      linkargs="$linkargs -LIBPATH:$p"
+      shift 1
+    ;;
+    -link)
+      # add next argument verbatim to linker args
+      linkargs="$linkargs $2"
+      shift 2
+      ;;
+    -l*)
+      case $1
+      in
+        -lffi)
+          linkargs="$linkargs lib${1#-l}-${libversion}.lib"
+          ;;
+        *)
+          # ignore other libraries like -lm, hope they are
+          # covered by MSVCRT
+          # linkargs="$linkargs ${1#-l}.lib"
+          ;;
+      esac
       shift 1
     ;;
     -W|-Wextra)
@@ -166,6 +218,15 @@ do
       # libffi tests -pedantic with -Wall, so drop it also.
       shift 1
     ;;
+    -warn)
+      # ignore -warn all from libtool as well.
+      if test "$2" = "all"; then
+        shift 2
+      else
+        args="$args -warn"
+        shift 1
+      fi
+    ;;
     -Werror)
       args="$args -WX"
       shift 1
@@ -186,6 +247,7 @@ do
       else
         output="-Fe$2"
       fi
+      armasm_output="-o $2"
       if [ -n "$assembly" ]; then
         args="$args $output"
       else
@@ -194,12 +256,12 @@ do
       shift 2
     ;;
     *.S)
-      src=$1
+      src="$(cygpath -ma $1)"
       assembly="true"
       shift 1
     ;;
     *.c)
-      args="$args $1"
+      args="$args $(cygpath -ma $1)"
       shift 1
     ;;
     *)
@@ -210,11 +272,16 @@ 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"
+if [ -n "$linkargs" ]; then
+
+    # 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
+       linkargs="$linkargs -OPT:REF -OPT:ICF -INCREMENTAL:NO"
+    fi
+
+    args="$args -link $linkargs"
 fi
 
 if [ -n "$static_crt" ]; then
@@ -232,12 +299,33 @@ if [ -n "$assembly" ]; then
       outdir="."
     fi
     ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')"
-    echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
-    "$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
+
+    if [ $ml = "armasm" ]; then
+      defines="$defines -D_M_ARM"
+    fi
+
+    if [ $ml = "armasm64" ]; then
+      defines="$defines -D_M_ARM64"
+    fi
+
+    if test -n "$verbose"; then
+      echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
+    fi
+
+    eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $?
     output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
-    args="-nologo $safeseh $single $output $ppsrc"
+    if [ $ml = "armasm" ]; then
+      args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt"
+    elif [ $ml = "armasm64" ]; then
+      args="-nologo -g $armasm_output $ppsrc -errorReport:prompt"
+    else
+      args="-nologo $safeseh $single $output $ppsrc"
+    fi
+
+    if test -n "$verbose"; then
+      echo "$ml $args"
+    fi
 
-    echo "$ml $args"
     eval "\"$ml\" $args"
     result=$?
 
@@ -245,13 +333,21 @@ if [ -n "$assembly" ]; then
     #mv *.obj $outdir
 else
     args="$md $args"
-    echo "$cl $args"
+
+    if test -n "$verbose"; then
+      echo "$cl $args"
+    fi
     # Return an error code of 1 if an invalid command line parameter is passed
-    # instead of just ignoring it.
+    # instead of just ignoring it. Any output that is not a warning or an
+    # error is filtered so this command behaves more like gcc. cl.exe prints
+    # the name of the compiled file otherwise, which breaks the dejagnu checks
+    # for excess warnings and errors.
     eval "(\"$cl\" $args 2>&1 1>&3 | \
-          awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1"
+          awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1 | \
+          awk '/warning|error/'"
     result=$?
 fi
 
 exit $result
 
+# vim: noai:ts=4:sw=4
index f79602bb7b8b7611be975b25337484a2331b81ba..5c85fcd0e9c9ba7dd77ebdc14b980c507776d451 100644 (file)
@@ -19,12 +19,18 @@ 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.  */
 
+#if defined(__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
+#include <fficonfig.h>
 #include <ffi.h>
 #include <ffi_common.h>
 #include "internal.h"
+#ifdef _WIN32
+#include <windows.h> /* FlushInstructionCache */
+#endif
+#include <tramp.h>
 
 /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
    all further uses in this file will refer to the 128-bit type.  */
@@ -54,6 +60,17 @@ struct call_context
   UINT64 x[N_X_ARG_REG];
 };
 
+#if FFI_EXEC_TRAMPOLINE_TABLE
+
+#ifdef __MACH__
+#ifdef HAVE_PTRAUTH
+#include <ptrauth.h>
+#endif
+#include <mach/vm_param.h>
+#endif
+
+#else
+
 #if defined (__clang__) && defined (__APPLE__)
 extern void sys_icache_invalidate (void *start, size_t len);
 #endif
@@ -65,11 +82,15 @@ ffi_clear_cache (void *start, void *end)
   sys_icache_invalidate (start, (char *)end - (char *)start);
 #elif defined (__GNUC__)
   __builtin___clear_cache (start, end);
+#elif defined (_WIN32)
+  FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start);
 #else
 #error "Missing builtin to flush instruction cache"
 #endif
 }
 
+#endif
+
 /* A subroutine of is_vfp_type.  Given a structure type, return the type code
    of the first non-structure element.  Recurse for structure elements.
    Return -1 if the structure is in fact empty, i.e. no nested elements.  */
@@ -220,7 +241,7 @@ is_vfp_type (const ffi_type *ty)
 
   /* All tests succeeded.  Encode the result.  */
  done:
-  return candidate * 4 + (4 - ele_count);
+  return candidate * 4 + (4 - (int)ele_count);
 }
 
 /* Representation of the procedure call argument marshalling
@@ -269,7 +290,7 @@ allocate_to_stack (struct arg_state *state, void *stack,
     alignment = 8;
 #endif
     
-  nsaa = ALIGN (nsaa, alignment);
+  nsaa = FFI_ALIGN (nsaa, alignment);
   state->nsaa = nsaa + size;
 
   return (char *)stack + nsaa;
@@ -304,10 +325,13 @@ extend_integer_type (void *source, int type)
     }
 }
 
+#if defined(_MSC_VER)
+void extend_hfa_type (void *dest, void *src, int h);
+#else
 static void
 extend_hfa_type (void *dest, void *src, int h)
 {
-  int f = h - AARCH64_RET_S4;
+  ssize_t f = h - AARCH64_RET_S4;
   void *x0;
 
   asm volatile (
@@ -339,10 +363,10 @@ extend_hfa_type (void *dest, void *src, int h)
 "      b       1f\n"
 "      nop\n"
 "      ldp     q16, q17, [%3]\n"       /* Q4 */
-"      ldp     q18, q19, [%3, #16]\n"
+"      ldp     q18, q19, [%3, #32]\n"
 "      b       4f\n"
 "      ldp     q16, q17, [%3]\n"       /* Q3 */
-"      ldr     q18, [%3, #16]\n"
+"      ldr     q18, [%3, #32]\n"
 "      b       3f\n"
 "      ldp     q16, q17, [%3]\n"       /* Q2 */
 "      b       2f\n"
@@ -357,7 +381,11 @@ extend_hfa_type (void *dest, void *src, int h)
     : "r"(f * 12), "r"(dest), "r"(src)
     : "memory", "v16", "v17", "v18", "v19");
 }
+#endif
 
+#if defined(_MSC_VER)
+void* compress_hfa_type (void *dest, void *src, int h);
+#else
 static void *
 compress_hfa_type (void *dest, void *reg, int h)
 {
@@ -426,6 +454,7 @@ compress_hfa_type (void *dest, void *reg, int h)
     }
   return dest;
 }
+#endif
 
 /* Either allocate an appropriate register for the argument type, or if
    none are available, allocate a stack slot and return a pointer
@@ -443,7 +472,7 @@ allocate_int_to_reg_or_stack (struct call_context *context,
   return allocate_to_stack (state, stack, size, size);
 }
 
-ffi_status
+ffi_status FFI_HIDDEN
 ffi_prep_cif_machdep (ffi_cif *cif)
 {
   ffi_type *rtype = cif->rtype;
@@ -517,7 +546,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
       }
 
   /* Round the stack up to a multiple of the stack alignment requirement. */
-  cif->bytes = ALIGN(bytes, 16);
+  cif->bytes = (unsigned) FFI_ALIGN(bytes, 16);
   cif->flags = flags;
 #if defined (__APPLE__)
   cif->aarch64_nfixedargs = 0;
@@ -528,14 +557,22 @@ ffi_prep_cif_machdep (ffi_cif *cif)
 
 #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)
+ffi_status FFI_HIDDEN
+ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs,
+                        unsigned int ntotalargs)
 {
   ffi_status status = ffi_prep_cif_machdep (cif);
   cif->aarch64_nfixedargs = nfixedargs;
   return status;
 }
+#else
+ffi_status FFI_HIDDEN
+ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs)
+{
+  ffi_status status = ffi_prep_cif_machdep (cif);
+  cif->flags |= AARCH64_FLAG_VARARG;
+  return status;
+}
 #endif /* __APPLE__ */
 
 extern void ffi_call_SYSV (struct call_context *context, void *frame,
@@ -552,7 +589,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
   void *stack, *frame, *rvalue;
   struct arg_state state;
   size_t stack_bytes, rtype_size, rsize;
-  int i, nargs, flags;
+  int i, nargs, flags, isvariadic = 0;
   ffi_type *rtype;
 
   flags = cif->flags;
@@ -560,6 +597,12 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
   rtype_size = rtype->size;
   stack_bytes = cif->bytes;
 
+  if (flags & AARCH64_FLAG_VARARG)
+  {
+    isvariadic = 1;
+    flags &= ~AARCH64_FLAG_VARARG;
+  }
+
   /* If the target function returns a structure via hidden pointer,
      then we cannot allow a null rvalue.  Otherwise, mash a null
      rvalue to void return type.  */
@@ -574,11 +617,12 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
   else if (flags & AARCH64_RET_NEED_COPY)
     rsize = 16;
 
-  /* Allocate consectutive stack for everything we'll need.  */
-  context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize);
+  /* Allocate consectutive stack for everything we'll need.
+     The frame uses 40 bytes for: lr, fp, rvalue, flags, sp */
+  context = alloca (sizeof(struct call_context) + stack_bytes + 40 + rsize);
   stack = context + 1;
-  frame = stack + stack_bytes;
-  rvalue = (rsize ? frame + 32 : orig_rvalue);
+  frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes);
+  rvalue = (rsize ? (void*)((uintptr_t)frame + 40) : orig_rvalue);
 
   arg_init (&state);
   for (i = 0, nargs = cif->nargs; i < nargs; i++)
@@ -639,16 +683,31 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
            h = is_vfp_type (ty);
            if (h)
              {
-               int elems = 4 - (h & 3);
-               if (state.nsrn + elems <= N_V_ARG_REG)
-                 {
-                   dest = &context->v[state.nsrn];
-                   state.nsrn += elems;
-                   extend_hfa_type (dest, a, h);
-                   break;
-                 }
-               state.nsrn = N_V_ARG_REG;
-               dest = allocate_to_stack (&state, stack, ty->alignment, s);
+              int elems = 4 - (h & 3);
+              if (cif->abi == FFI_WIN64 && isvariadic)
+              {
+                if (state.ngrn + elems <= N_X_ARG_REG)
+                {
+                  dest = &context->x[state.ngrn];
+                  state.ngrn += elems;
+                  extend_hfa_type(dest, a, h);
+                  break;
+                }
+                state.nsrn = N_X_ARG_REG;
+                dest = allocate_to_stack(&state, stack, ty->alignment, s);
+              }
+              else
+              {
+                if (state.nsrn + elems <= N_V_ARG_REG)
+                {
+                  dest = &context->v[state.nsrn];
+                  state.nsrn += elems;
+                  extend_hfa_type (dest, a, h);
+                  break;
+                }
+                state.nsrn = N_V_ARG_REG;
+                dest = allocate_to_stack (&state, stack, ty->alignment, s);
+              }
              }
            else if (s > 16)
              {
@@ -657,6 +716,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
                   the argument is replaced by a pointer to the copy.  */
                a = &avalue[i];
                t = FFI_TYPE_POINTER;
+               s = sizeof (void *);
                goto do_pointer;
              }
            else
@@ -669,7 +729,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
                       X registers, then the argument is copied into
                       consecutive X registers.  */
                    dest = &context->x[state.ngrn];
-                   state.ngrn += n;
+                    state.ngrn += (unsigned int)n;
                  }
                else
                  {
@@ -711,6 +771,8 @@ ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue)
   ffi_call_int (cif, fn, rvalue, avalue, NULL);
 }
 
+#if FFI_CLOSURES
+
 #ifdef FFI_GO_CLOSURES
 void
 ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue,
@@ -724,239 +786,9 @@ ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue,
 
 extern void ffi_closure_SYSV (void) FFI_HIDDEN;
 extern void ffi_closure_SYSV_V (void) FFI_HIDDEN;
-
-#if FFI_EXEC_TRAMPOLINE_TABLE
-
-#include <mach/mach.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-extern void *ffi_closure_trampoline_table_page;
-
-typedef struct ffi_trampoline_table ffi_trampoline_table;
-typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
-
-struct ffi_trampoline_table
-{
-  /* contiguous writable and executable pages */
-  vm_address_t config_page;
-  vm_address_t trampoline_page;
-
-  /* free list tracking */
-  uint16_t free_count;
-  ffi_trampoline_table_entry *free_list;
-  ffi_trampoline_table_entry *free_list_pool;
-
-  ffi_trampoline_table *prev;
-  ffi_trampoline_table *next;
-};
-
-struct ffi_trampoline_table_entry
-{
-  void *(*trampoline) ();
-  ffi_trampoline_table_entry *next;
-};
-
-/* The trampoline configuration is placed a page prior to the trampoline's entry point */
-#define FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc) ((void **) (((uint8_t *) codeloc) - PAGE_SIZE));
-
-/* Total number of trampolines that fit in one trampoline table */
-#define FFI_TRAMPOLINE_COUNT (PAGE_SIZE / FFI_TRAMPOLINE_SIZE)
-
-static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER;
-static ffi_trampoline_table *ffi_trampoline_tables = NULL;
-
-static ffi_trampoline_table *
-ffi_trampoline_table_alloc ()
-{
-  ffi_trampoline_table *table = NULL;
-
-  /* Loop until we can allocate two contiguous pages */
-  while (table == NULL)
-    {
-      vm_address_t config_page = 0x0;
-      kern_return_t kt;
-
-      /* Try to allocate two pages */
-      kt =
-       vm_allocate (mach_task_self (), &config_page, PAGE_SIZE * 2,
-                    VM_FLAGS_ANYWHERE);
-      if (kt != KERN_SUCCESS)
-       {
-         fprintf (stderr, "vm_allocate() failure: %d at %s:%d\n", kt,
-                  __FILE__, __LINE__);
-         break;
-       }
-
-      /* Now drop the second half of the allocation to make room for the trampoline table */
-      vm_address_t trampoline_page = config_page + PAGE_SIZE;
-      kt = vm_deallocate (mach_task_self (), trampoline_page, PAGE_SIZE);
-      if (kt != KERN_SUCCESS)
-       {
-         fprintf (stderr, "vm_deallocate() failure: %d at %s:%d\n", kt,
-                  __FILE__, __LINE__);
-         break;
-       }
-
-      /* Remap the trampoline table to directly follow the config page */
-      vm_prot_t cur_prot;
-      vm_prot_t max_prot;
-
-      kt =
-       vm_remap (mach_task_self (), &trampoline_page, PAGE_SIZE, 0x0, FALSE,
-                 mach_task_self (),
-                 (vm_address_t) & ffi_closure_trampoline_table_page, FALSE,
-                 &cur_prot, &max_prot, VM_INHERIT_SHARE);
-
-      /* If we lost access to the destination trampoline page, drop our config allocation mapping and retry */
-      if (kt != KERN_SUCCESS)
-       {
-         /* Log unexpected failures */
-         if (kt != KERN_NO_SPACE)
-           {
-             fprintf (stderr, "vm_remap() failure: %d at %s:%d\n", kt,
-                      __FILE__, __LINE__);
-           }
-
-         vm_deallocate (mach_task_self (), config_page, PAGE_SIZE);
-         continue;
-       }
-
-      /* We have valid trampoline and config pages */
-      table = calloc (1, sizeof (ffi_trampoline_table));
-      table->free_count = FFI_TRAMPOLINE_COUNT;
-      table->config_page = config_page;
-      table->trampoline_page = trampoline_page;
-
-      /* Create and initialize the free list */
-      table->free_list_pool =
-       calloc (FFI_TRAMPOLINE_COUNT, sizeof (ffi_trampoline_table_entry));
-
-      uint16_t i;
-      for (i = 0; i < table->free_count; i++)
-       {
-         ffi_trampoline_table_entry *entry = &table->free_list_pool[i];
-         entry->trampoline =
-           (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE));
-
-         if (i < table->free_count - 1)
-           entry->next = &table->free_list_pool[i + 1];
-       }
-
-      table->free_list = table->free_list_pool;
-    }
-
-  return table;
-}
-
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
-  /* Create the closure */
-  ffi_closure *closure = malloc (size);
-  if (closure == NULL)
-    return NULL;
-
-  pthread_mutex_lock (&ffi_trampoline_lock);
-
-  /* Check for an active trampoline table with available entries. */
-  ffi_trampoline_table *table = ffi_trampoline_tables;
-  if (table == NULL || table->free_list == NULL)
-    {
-      table = ffi_trampoline_table_alloc ();
-      if (table == NULL)
-       {
-         free (closure);
-         return NULL;
-       }
-
-      /* Insert the new table at the top of the list */
-      table->next = ffi_trampoline_tables;
-      if (table->next != NULL)
-       table->next->prev = table;
-
-      ffi_trampoline_tables = table;
-    }
-
-  /* Claim the free entry */
-  ffi_trampoline_table_entry *entry = ffi_trampoline_tables->free_list;
-  ffi_trampoline_tables->free_list = entry->next;
-  ffi_trampoline_tables->free_count--;
-  entry->next = NULL;
-
-  pthread_mutex_unlock (&ffi_trampoline_lock);
-
-  /* Initialize the return values */
-  *code = entry->trampoline;
-  closure->trampoline_table = table;
-  closure->trampoline_table_entry = entry;
-
-  return closure;
-}
-
-void
-ffi_closure_free (void *ptr)
-{
-  ffi_closure *closure = ptr;
-
-  pthread_mutex_lock (&ffi_trampoline_lock);
-
-  /* Fetch the table and entry references */
-  ffi_trampoline_table *table = closure->trampoline_table;
-  ffi_trampoline_table_entry *entry = closure->trampoline_table_entry;
-
-  /* Return the entry to the free list */
-  entry->next = table->free_list;
-  table->free_list = entry;
-  table->free_count++;
-
-  /* If all trampolines within this table are free, and at least one other table exists, deallocate
-   * the table */
-  if (table->free_count == FFI_TRAMPOLINE_COUNT
-      && ffi_trampoline_tables != table)
-    {
-      /* Remove from the list */
-      if (table->prev != NULL)
-       table->prev->next = table->next;
-
-      if (table->next != NULL)
-       table->next->prev = table->prev;
-
-      /* Deallocate pages */
-      kern_return_t kt;
-      kt = vm_deallocate (mach_task_self (), table->config_page, PAGE_SIZE);
-      if (kt != KERN_SUCCESS)
-       fprintf (stderr, "vm_deallocate() failure: %d at %s:%d\n", kt,
-                __FILE__, __LINE__);
-
-      kt =
-       vm_deallocate (mach_task_self (), table->trampoline_page, PAGE_SIZE);
-      if (kt != KERN_SUCCESS)
-       fprintf (stderr, "vm_deallocate() failure: %d at %s:%d\n", kt,
-                __FILE__, __LINE__);
-
-      /* Deallocate free list */
-      free (table->free_list_pool);
-      free (table);
-    }
-  else if (ffi_trampoline_tables != table)
-    {
-      /* Otherwise, bump this table to the top of the list */
-      table->prev = NULL;
-      table->next = ffi_trampoline_tables;
-      if (ffi_trampoline_tables != NULL)
-       ffi_trampoline_tables->prev = table;
-
-      ffi_trampoline_tables = table;
-    }
-
-  pthread_mutex_unlock (&ffi_trampoline_lock);
-
-  /* Free the closure */
-  free (closure);
-}
-
+#if defined(FFI_EXEC_STATIC_TRAMP)
+extern void ffi_closure_SYSV_alt (void) FFI_HIDDEN;
+extern void ffi_closure_SYSV_V_alt (void) FFI_HIDDEN;
 #endif
 
 ffi_status
@@ -966,7 +798,7 @@ ffi_prep_closure_loc (ffi_closure *closure,
                       void *user_data,
                       void *codeloc)
 {
-  if (cif->abi != FFI_SYSV)
+  if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64)
     return FFI_BAD_ABI;
 
   void (*start)(void);
@@ -977,9 +809,14 @@ ffi_prep_closure_loc (ffi_closure *closure,
     start = ffi_closure_SYSV;
 
 #if FFI_EXEC_TRAMPOLINE_TABLE
-  void **config = FFI_TRAMPOLINE_CODELOC_CONFIG (codeloc);
+#ifdef __MACH__
+#ifdef HAVE_PTRAUTH
+  codeloc = ptrauth_auth_data(codeloc, ptrauth_key_function_pointer, 0);
+#endif
+  void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE);
   config[0] = closure;
   config[1] = start;
+#endif
 #else
   static const unsigned char trampoline[16] = {
     0x90, 0x00, 0x00, 0x58,    /* ldr  x16, tramp+16   */
@@ -987,12 +824,37 @@ ffi_prep_closure_loc (ffi_closure *closure,
     0x00, 0x02, 0x1f, 0xd6     /* br   x16             */
   };
   char *tramp = closure->tramp;
-  
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+  if (ffi_tramp_is_present(closure))
+    {
+      /* Initialize the static trampoline's parameters. */
+      if (start == ffi_closure_SYSV_V)
+          start = ffi_closure_SYSV_V_alt;
+      else
+          start = ffi_closure_SYSV_alt;
+      ffi_tramp_set_parms (closure->ftramp, start, closure);
+      goto out;
+    }
+#endif
+
+  /* Initialize the dynamic trampoline. */
   memcpy (tramp, trampoline, sizeof(trampoline));
   
   *(UINT64 *)(tramp + 16) = (uintptr_t)start;
 
   ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
+
+  /* Also flush the cache for code mapping.  */
+#ifdef _WIN32
+  // Not using dlmalloc.c for Windows ARM64 builds
+  // so calling ffi_data_to_code_pointer() isn't necessary
+  unsigned char *tramp_code = tramp;
+  #else
+  unsigned char *tramp_code = ffi_data_to_code_pointer (tramp);
+  #endif
+  ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE);
+out:
 #endif
 
   closure->cif = cif;
@@ -1012,7 +874,7 @@ ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif* cif,
 {
   void (*start)(void);
 
-  if (cif->abi != FFI_SYSV)
+  if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64)
     return FFI_BAD_ABI;
 
   if (cif->flags & AARCH64_FLAG_ARG_V)
@@ -1052,11 +914,18 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
                        void *stack, void *rvalue, void *struct_rvalue)
 {
   void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
-  int i, h, nargs, flags;
+  int i, h, nargs, flags, isvariadic = 0;
   struct arg_state state;
 
   arg_init (&state);
 
+  flags = cif->flags;
+  if (flags & AARCH64_FLAG_VARARG)
+  {
+    isvariadic = 1;
+    flags &= ~AARCH64_FLAG_VARARG;
+  }
+
   for (i = 0, nargs = cif->nargs; i < nargs; i++)
     {
       ffi_type *ty = cif->arg_types[i];
@@ -1091,58 +960,85 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
          if (h)
            {
              n = 4 - (h & 3);
-             if (state.nsrn + n <= N_V_ARG_REG)
-               {
-                 void *reg = &context->v[state.nsrn];
-                 state.nsrn += n;
-
-                 /* Eeek! We need a pointer to the structure, however the
-                    homogeneous float elements are being passed in individual
-                    registers, therefore for float and double the structure
-                    is not represented as a contiguous sequence of bytes in
-                    our saved register context.  We don't need the original
-                    contents of the register storage, so we reformat the
-                    structure into the same memory.  */
-                 avalue[i] = compress_hfa_type (reg, reg, h);
-               }
-             else
-               {
-                 state.nsrn = N_V_ARG_REG;
-                 avalue[i] = allocate_to_stack (&state, stack,
-                                                ty->alignment, s);
-               }
-           }
-         else if (s > 16)
-           {
-             /* Replace Composite type of size greater than 16 with a
-                pointer.  */
-             avalue[i] = *(void **)
-               allocate_int_to_reg_or_stack (context, &state, stack,
-                                             sizeof (void *));
-           }
-         else
-           {
-             n = (s + 7) / 8;
-             if (state.ngrn + n <= N_X_ARG_REG)
-               {
-                 avalue[i] = &context->x[state.ngrn];
-                 state.ngrn += n;
-               }
-             else
-               {
-                 state.ngrn = N_X_ARG_REG;
-                 avalue[i] = allocate_to_stack (&state, stack,
-                                                ty->alignment, s);
-               }
-           }
-         break;
+              if (cif->abi == FFI_WIN64 && isvariadic)
+                {
+                  if (state.ngrn + n <= N_X_ARG_REG)
+                    {
+                      void *reg = &context->x[state.ngrn];
+                      state.ngrn += (unsigned int)n;
+    
+                      /* Eeek! We need a pointer to the structure, however the
+                       homogeneous float elements are being passed in individual
+                       registers, therefore for float and double the structure
+                       is not represented as a contiguous sequence of bytes in
+                       our saved register context.  We don't need the original
+                       contents of the register storage, so we reformat the
+                       structure into the same memory.  */
+                      avalue[i] = compress_hfa_type(reg, reg, h);
+                    }
+                  else
+                    {
+                      state.ngrn = N_X_ARG_REG;
+                      state.nsrn = N_V_ARG_REG;
+                      avalue[i] = allocate_to_stack(&state, stack,
+                             ty->alignment, s);
+                    }
+                }
+              else
+                {
+                  if (state.nsrn + n <= N_V_ARG_REG)
+                    {
+                      void *reg = &context->v[state.nsrn];
+                      state.nsrn += (unsigned int)n;
+                      avalue[i] = compress_hfa_type(reg, reg, h);
+                    }
+                  else
+                    {
+                      state.nsrn = N_V_ARG_REG;
+                      avalue[i] = allocate_to_stack(&state, stack,
+                                                   ty->alignment, s);
+                    }
+                }
+            }
+          else if (s > 16)
+            {
+              /* Replace Composite type of size greater than 16 with a
+                  pointer.  */
+              avalue[i] = *(void **)
+              allocate_int_to_reg_or_stack (context, &state, stack,
+                                         sizeof (void *));
+            }
+          else
+            {
+              n = (s + 7) / 8;
+              if (state.ngrn + n <= N_X_ARG_REG)
+                {
+                  avalue[i] = &context->x[state.ngrn];
+                  state.ngrn += (unsigned int)n;
+                }
+              else
+                {
+                  state.ngrn = N_X_ARG_REG;
+                  avalue[i] = allocate_to_stack(&state, stack,
+                                           ty->alignment, s);
+                }
+            }
+          break;
+
+        default:
+          abort();
+      }
 
-       default:
-         abort();
+#if defined (__APPLE__)
+      if (i + 1 == cif->aarch64_nfixedargs)
+       {
+         state.ngrn = N_X_ARG_REG;
+         state.nsrn = N_V_ARG_REG;
+         state.allocating_variadic = 1;
        }
+#endif
     }
 
-  flags = cif->flags;
   if (flags & AARCH64_RET_IN_MEM)
     rvalue = struct_rvalue;
 
@@ -1150,3 +1046,19 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
 
   return flags;
 }
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+void *
+ffi_tramp_arch (size_t *tramp_size, size_t *map_size)
+{
+  extern void *trampoline_code_table;
+
+  *tramp_size = AARCH64_TRAMP_SIZE;
+  *map_size = AARCH64_TRAMP_MAP_SIZE;
+  return &trampoline_code_table;
+}
+#endif
+
+#endif /* FFI_CLOSURES */
+
+#endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/
index 34200ad9325be0f06409c4f4cede9f5c7fca208e..d5622e133625cac90c334476b41d7b6b1aee6f88 100644 (file)
@@ -32,6 +32,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 #define FFI_SIZEOF_JAVA_RAW  4
 typedef unsigned long long ffi_arg;
 typedef signed long long ffi_sarg;
+#elif defined(_WIN32)
+#define FFI_SIZEOF_ARG 8
+typedef unsigned long long ffi_arg;
+typedef signed long long ffi_sarg;
 #else
 typedef unsigned long ffi_arg;
 typedef signed long ffi_sarg;
@@ -41,34 +45,53 @@ typedef enum ffi_abi
   {
     FFI_FIRST_ABI = 0,
     FFI_SYSV,
+    FFI_WIN64,
     FFI_LAST_ABI,
+#if defined(_WIN32)
+    FFI_DEFAULT_ABI = FFI_WIN64
+#else
     FFI_DEFAULT_ABI = FFI_SYSV
+#endif
   } ffi_abi;
 #endif
 
 /* ---- Definitions for closures ----------------------------------------- */
 
 #define FFI_CLOSURES 1
-#if defined (__APPLE__)
-#define FFI_TRAMPOLINE_SIZE 20
+#define FFI_NATIVE_RAW_API 0
+
+#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE
+
+#ifdef __MACH__
+#define FFI_TRAMPOLINE_SIZE 16
 #define FFI_TRAMPOLINE_CLOSURE_OFFSET 16
+#else
+#error "No trampoline table implementation"
+#endif
+
 #else
 #define FFI_TRAMPOLINE_SIZE 24
 #define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
 #endif
-#define FFI_NATIVE_RAW_API 0
+
+#ifdef _WIN32
+#define FFI_EXTRA_CIF_FIELDS unsigned is_variadic
+#endif
+#define FFI_TARGET_SPECIFIC_VARIADIC
 
 /* ---- Internal ---- */
 
 #if defined (__APPLE__)
-#define FFI_TARGET_SPECIFIC_VARIADIC
 #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
-#else
-/* iOS reserves x18 for the system.  Disable Go closures until
+#elif !defined(_WIN32)
+/* iOS and Windows reserve x18 for the system.  Disable Go closures until
    a new static chain is chosen.  */
 #define FFI_GO_CLOSURES 1
 #endif
 
+#ifndef _WIN32
+/* No complex type on Windows */
 #define FFI_TARGET_HAS_COMPLEX_TYPE
+#endif
 
 #endif
index 9c3e07725a0583e472fd4e72c2f909cc837da429..b5d102b4add2c5948a9309b23f79977e52458d8a 100644 (file)
@@ -61,7 +61,40 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
 #define AARCH64_FLAG_ARG_V_BIT 7
 #define AARCH64_FLAG_ARG_V     (1 << AARCH64_FLAG_ARG_V_BIT)
+#define AARCH64_FLAG_VARARG    (1 << 8)
 
 #define N_X_ARG_REG            8
 #define N_V_ARG_REG            8
 #define CALL_CONTEXT_SIZE      (N_V_ARG_REG * 16 + N_X_ARG_REG * 8)
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+/*
+ * For the trampoline code table mapping, a mapping size of 16K is chosen to
+ * cover the base page sizes of 4K and 16K.
+ */
+#define AARCH64_TRAMP_MAP_SHIFT        14
+#define AARCH64_TRAMP_MAP_SIZE (1 << AARCH64_TRAMP_MAP_SHIFT)
+#define AARCH64_TRAMP_SIZE     32
+
+#endif
+
+/* Helpers for writing assembly compatible with arm ptr auth */
+#ifdef LIBFFI_ASM
+
+#ifdef HAVE_PTRAUTH
+#define SIGN_LR pacibsp
+#define SIGN_LR_WITH_REG(x) pacib lr, x
+#define AUTH_LR_AND_RET retab
+#define AUTH_LR_WITH_REG(x) autib lr, x
+#define BRANCH_AND_LINK_TO_REG blraaz
+#define BRANCH_TO_REG braaz
+#else
+#define SIGN_LR
+#define SIGN_LR_WITH_REG(x)
+#define AUTH_LR_AND_RET ret
+#define AUTH_LR_WITH_REG(x)
+#define BRANCH_AND_LINK_TO_REG blr
+#define BRANCH_TO_REG br
+#endif
+
+#endif
index c1bf9b98e0393f055ec3aa73614b46049585311a..eeaf3f85140f4877e2c28d043c11491bdadb0782 100644 (file)
@@ -19,6 +19,7 @@ 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.  */
 
+#if defined(__aarch64__) || defined(__arm64__)
 #define LIBFFI_ASM
 #include <fficonfig.h>
 #include <ffi.h>
@@ -77,9 +78,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
        cfi_startproc
 CNAME(ffi_call_SYSV):
+       /* Sign the lr with x1 since that is where it will be stored */
+       SIGN_LR_WITH_REG(x1)
+
        /* Use a stack frame allocated by our caller.  */
-       cfi_def_cfa(x1, 32);
+#if defined(HAVE_PTRAUTH) && defined(__APPLE__)
+       /* darwin's libunwind assumes that the cfa is the sp and that's the data
+        * used to sign the lr.  In order to allow unwinding through this
+        * function it is necessary to point the cfa at the signing register.
+        */
+       cfi_def_cfa(x1, 0);
+#else
+       cfi_def_cfa(x1, 40);
+#endif
        stp     x29, x30, [x1]
+       mov     x9, sp
+       str     x9, [x1, #32]
        mov     x29, x1
        mov     sp, x0
        cfi_def_cfa_register(x29)
@@ -110,13 +124,15 @@ CNAME(ffi_call_SYSV):
        /* Deallocate the context, leaving the stacked arguments.  */
        add     sp, sp, #CALL_CONTEXT_SIZE
 
-       blr     x9                      /* call fn */
+       BRANCH_AND_LINK_TO_REG     x9                   /* call fn */
 
        ldp     x3, x4, [x29, #16]      /* reload rvalue and flags */
 
        /* Partially deconstruct the stack frame.  */
-       mov     sp, x29
+       ldr     x9, [x29, #32]
+       mov     sp, x9
        cfi_def_cfa_register (sp)
+       mov     x2, x29                 /* Preserve for auth */
        ldp     x29, x30, [x29]
 
        /* Save the return value as directed.  */
@@ -130,80 +146,87 @@ CNAME(ffi_call_SYSV):
           and therefore we want to extend to 64 bits; these types
           have two consecutive entries allocated for them.  */
        .align  4
-0:     ret                             /* VOID */
+0:     b 99f                           /* VOID */
        nop
 1:     str     x0, [x3]                /* INT64 */
-       ret
+       b 99f
 2:     stp     x0, x1, [x3]            /* INT128 */
-       ret
+       b 99f
 3:     brk     #1000                   /* UNUSED */
-       ret
+       b 99f
 4:     brk     #1000                   /* UNUSED */
-       ret
+       b 99f
 5:     brk     #1000                   /* UNUSED */
-       ret
+       b 99f
 6:     brk     #1000                   /* UNUSED */
-       ret
+       b 99f
 7:     brk     #1000                   /* UNUSED */
-       ret
+       b 99f
 8:     st4     { v0.s, v1.s, v2.s, v3.s }[0], [x3]     /* S4 */
-       ret
+       b 99f
 9:     st3     { v0.s, v1.s, v2.s }[0], [x3]   /* S3 */
-       ret
+       b 99f
 10:    stp     s0, s1, [x3]            /* S2 */
-       ret
+       b 99f
 11:    str     s0, [x3]                /* S1 */
-       ret
+       b 99f
 12:    st4     { v0.d, v1.d, v2.d, v3.d }[0], [x3]     /* D4 */
-       ret
+       b 99f
 13:    st3     { v0.d, v1.d, v2.d }[0], [x3]   /* D3 */
-       ret
+       b 99f
 14:    stp     d0, d1, [x3]            /* D2 */
-       ret
+       b 99f
 15:    str     d0, [x3]                /* D1 */
-       ret
+       b 99f
 16:    str     q3, [x3, #48]           /* Q4 */
        nop
 17:    str     q2, [x3, #32]           /* Q3 */
        nop
 18:    stp     q0, q1, [x3]            /* Q2 */
-       ret
+       b 99f
 19:    str     q0, [x3]                /* Q1 */
-       ret
+       b 99f
 20:    uxtb    w0, w0                  /* UINT8 */
        str     x0, [x3]
-21:    ret                             /* reserved */
+21:    b 99f                           /* reserved */
        nop
 22:    uxth    w0, w0                  /* UINT16 */
        str     x0, [x3]
-23:    ret                             /* reserved */
+23:    b 99f                           /* reserved */
        nop
 24:    mov     w0, w0                  /* UINT32 */
        str     x0, [x3]
-25:    ret                             /* reserved */
+25:    b 99f                           /* reserved */
        nop
 26:    sxtb    x0, w0                  /* SINT8 */
        str     x0, [x3]
-27:    ret                             /* reserved */
+27:    b 99f                           /* reserved */
        nop
 28:    sxth    x0, w0                  /* SINT16 */
        str     x0, [x3]
-29:    ret                             /* reserved */
+29:    b 99f                           /* reserved */
        nop
 30:    sxtw    x0, w0                  /* SINT32 */
        str     x0, [x3]
-31:    ret                             /* reserved */
+31:    b 99f                           /* reserved */
        nop
 
+       /* Return now that result has been populated. */
+99:
+       AUTH_LR_WITH_REG(x2)
+       ret
+
        cfi_endproc
 
        .globl  CNAME(ffi_call_SYSV)
+       FFI_HIDDEN(CNAME(ffi_call_SYSV))
 #ifdef __ELF__
        .type   CNAME(ffi_call_SYSV), #function
-       .hidden CNAME(ffi_call_SYSV)
        .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
 #endif
 
+#if FFI_CLOSURES
+
 /* ffi_closure_SYSV
 
    Closure invocation glue. This is the low level code invoked directly by
@@ -223,6 +246,7 @@ CNAME(ffi_call_SYSV):
        .align 4
 CNAME(ffi_closure_SYSV_V):
        cfi_startproc
+       SIGN_LR
        stp     x29, x30, [sp, #-ffi_closure_SYSV_FS]!
        cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
        cfi_rel_offset (x29, 0)
@@ -237,15 +261,16 @@ CNAME(ffi_closure_SYSV_V):
        cfi_endproc
 
        .globl  CNAME(ffi_closure_SYSV_V)
+       FFI_HIDDEN(CNAME(ffi_closure_SYSV_V))
 #ifdef __ELF__
        .type   CNAME(ffi_closure_SYSV_V), #function
-       .hidden CNAME(ffi_closure_SYSV_V)
        .size   CNAME(ffi_closure_SYSV_V), . - CNAME(ffi_closure_SYSV_V)
 #endif
 
        .align  4
        cfi_startproc
 CNAME(ffi_closure_SYSV):
+       SIGN_LR
        stp     x29, x30, [sp, #-ffi_closure_SYSV_FS]!
        cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
        cfi_rel_offset (x29, 0)
@@ -262,7 +287,9 @@ CNAME(ffi_closure_SYSV):
        /* Load ffi_closure_inner arguments.  */
        ldp     PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET]   /* load cif, fn */
        ldr     PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2]    /* load user_data */
+#ifdef FFI_GO_CLOSURES
 .Ldo_closure:
+#endif
        add     x3, sp, #16                             /* load context */
        add     x4, sp, #ffi_closure_SYSV_FS            /* load stack */
        add     x5, sp, #16+CALL_CONTEXT_SIZE           /* load rvalue */
@@ -296,7 +323,7 @@ CNAME(ffi_closure_SYSV):
        nop
 8:     ldr     s3, [x3, #12]           /* S4 */
        nop
-9:     ldr     s2, [x2, #8]            /* S3 */
+9:     ldr     s2, [x3, #8]            /* S3 */
        nop
 10:    ldp     s0, s1, [x3]            /* S2 */
        b       99f
@@ -345,35 +372,109 @@ CNAME(ffi_closure_SYSV):
        cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS)
        cfi_restore (x29)
        cfi_restore (x30)
-       ret
+       AUTH_LR_AND_RET
        cfi_endproc
 
        .globl  CNAME(ffi_closure_SYSV)
+       FFI_HIDDEN(CNAME(ffi_closure_SYSV))
 #ifdef __ELF__
        .type   CNAME(ffi_closure_SYSV), #function
-       .hidden CNAME(ffi_closure_SYSV)
        .size   CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV)
 #endif
 
+#if defined(FFI_EXEC_STATIC_TRAMP)
+       .align 4
+CNAME(ffi_closure_SYSV_V_alt):
+       /* See the comments above trampoline_code_table. */
+       ldr     x17, [sp, #8]                   /* Load closure in x17 */
+       add     sp, sp, #16                     /* Restore the stack */
+       b       CNAME(ffi_closure_SYSV_V)
+
+       .globl  CNAME(ffi_closure_SYSV_V_alt)
+       FFI_HIDDEN(CNAME(ffi_closure_SYSV_V_alt))
+#ifdef __ELF__
+       .type   CNAME(ffi_closure_SYSV_V_alt), #function
+       .size   CNAME(ffi_closure_SYSV_V_alt), . - CNAME(ffi_closure_SYSV_V_alt)
+#endif
+
+       .align 4
+CNAME(ffi_closure_SYSV_alt):
+       /* See the comments above trampoline_code_table. */
+       ldr     x17, [sp, #8]                   /* Load closure in x17 */
+       add     sp, sp, #16                     /* Restore the stack */
+       b       CNAME(ffi_closure_SYSV)
+
+       .globl  CNAME(ffi_closure_SYSV_alt)
+       FFI_HIDDEN(CNAME(ffi_closure_SYSV_alt))
+#ifdef __ELF__
+       .type   CNAME(ffi_closure_SYSV_alt), #function
+       .size   CNAME(ffi_closure_SYSV_alt), . - CNAME(ffi_closure_SYSV_alt)
+#endif
+
+/*
+ * Below is the definition of the trampoline code table. Each element in
+ * the code table is a trampoline.
+ */
+/*
+ * The trampoline uses register x17. It saves the original value of x17 on
+ * the stack.
+ *
+ * The trampoline has two parameters - target code to jump to and data for
+ * the target code. The trampoline extracts the parameters from its parameter
+ * block (see tramp_table_map()). The trampoline saves the data address on
+ * the stack. Finally, it jumps to the target code.
+ *
+ * The target code can choose to:
+ *
+ * - restore the value of x17
+ * - load the data address in a register
+ * - restore the stack pointer to what it was when the trampoline was invoked.
+ */
+       .align  AARCH64_TRAMP_MAP_SHIFT
+CNAME(trampoline_code_table):
+       .rept   AARCH64_TRAMP_MAP_SIZE / AARCH64_TRAMP_SIZE
+       sub     sp, sp, #16             /* Make space on the stack */
+       str     x17, [sp]               /* Save x17 on stack */
+       adr     x17, #16376             /* Get data address */
+       ldr     x17, [x17]              /* Copy data into x17 */
+       str     x17, [sp, #8]           /* Save data on stack */
+       adr     x17, #16372             /* Get code address */
+       ldr     x17, [x17]              /* Load code address into x17 */
+       br      x17                     /* Jump to code */
+       .endr
+
+       .globl CNAME(trampoline_code_table)
+       FFI_HIDDEN(CNAME(trampoline_code_table))
+#ifdef __ELF__
+       .type   CNAME(trampoline_code_table), #function
+       .size   CNAME(trampoline_code_table), . - CNAME(trampoline_code_table)
+#endif
+       .align  AARCH64_TRAMP_MAP_SHIFT
+#endif /* FFI_EXEC_STATIC_TRAMP */
+
 #if FFI_EXEC_TRAMPOLINE_TABLE
-    .align 12
+
+#ifdef __MACH__
+#include <mach/machine/vm_param.h>
+    .align PAGE_MAX_SHIFT
 CNAME(ffi_closure_trampoline_table_page):
-    .rept 16384 / FFI_TRAMPOLINE_SIZE
-    adr        x17, -16384
-    adr        x16, -16380
-    ldr x16, [x16]
-    ldr x17, [x17]
-    br x16
+    .rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE
+    adr x16, -PAGE_MAX_SIZE
+    ldp x17, x16, [x16]
+    br x16
+       nop             /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller than 16 bytes */
     .endr
-    
+
     .globl CNAME(ffi_closure_trampoline_table_page)
+    FFI_HIDDEN(CNAME(ffi_closure_trampoline_table_page))
     #ifdef __ELF__
        .type   CNAME(ffi_closure_trampoline_table_page), #function
-       .hidden CNAME(ffi_closure_trampoline_table_page)
        .size   CNAME(ffi_closure_trampoline_table_page), . - CNAME(ffi_closure_trampoline_table_page)
     #endif
 #endif
 
+#endif /* FFI_EXEC_TRAMPOLINE_TABLE */
+
 #ifdef FFI_GO_CLOSURES
        .align 4
 CNAME(ffi_go_closure_SYSV_V):
@@ -392,9 +493,9 @@ CNAME(ffi_go_closure_SYSV_V):
        cfi_endproc
 
        .globl  CNAME(ffi_go_closure_SYSV_V)
+       FFI_HIDDEN(CNAME(ffi_go_closure_SYSV_V))
 #ifdef __ELF__
        .type   CNAME(ffi_go_closure_SYSV_V), #function
-       .hidden CNAME(ffi_go_closure_SYSV_V)
        .size   CNAME(ffi_go_closure_SYSV_V), . - CNAME(ffi_go_closure_SYSV_V)
 #endif
 
@@ -421,12 +522,14 @@ CNAME(ffi_go_closure_SYSV):
        cfi_endproc
 
        .globl  CNAME(ffi_go_closure_SYSV)
+       FFI_HIDDEN(CNAME(ffi_go_closure_SYSV))
 #ifdef __ELF__
        .type   CNAME(ffi_go_closure_SYSV), #function
-       .hidden CNAME(ffi_go_closure_SYSV)
        .size   CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV)
 #endif
 #endif /* FFI_GO_CLOSURES */
+#endif /* FFI_CLOSURES */
+#endif /* __arm64__ */
 
 #if defined __ELF__ && defined __linux__
        .section .note.GNU-stack,"",%progbits
diff --git a/libffi/src/aarch64/win64_armasm.S b/libffi/src/aarch64/win64_armasm.S
new file mode 100644 (file)
index 0000000..7fc185b
--- /dev/null
@@ -0,0 +1,506 @@
+/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
+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.  */
+
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+#include <ffi_cfi.h>
+#include "internal.h"
+
+       OPT     2 /*disable listing */
+/* For some macros to add unwind information */
+#include "ksarm64.h"
+       OPT     1 /*re-enable listing */
+
+#define BE(X)  0
+#define PTR_REG(n)      x##n
+#define PTR_SIZE       8
+
+       IMPORT ffi_closure_SYSV_inner
+       EXPORT  ffi_call_SYSV
+       EXPORT  ffi_closure_SYSV_V
+       EXPORT  ffi_closure_SYSV
+       EXPORT  extend_hfa_type
+       EXPORT  compress_hfa_type
+#ifdef FFI_GO_CLOSURES
+       EXPORT  ffi_go_closure_SYSV_V
+       EXPORT  ffi_go_closure_SYSV
+#endif
+
+       TEXTAREA, ALIGN=8
+
+/* ffi_call_SYSV
+   extern void ffi_call_SYSV (void *stack, void *frame,
+                             void (*fn)(void), void *rvalue,
+                             int flags, void *closure);
+   Therefore on entry we have:
+   x0 stack
+   x1 frame
+   x2 fn
+   x3 rvalue
+   x4 flags
+   x5 closure
+*/
+
+       NESTED_ENTRY ffi_call_SYSV_fake
+
+       /* For unwind information, Windows has to store fp and lr  */
+       PROLOG_SAVE_REG_PAIR    x29, x30, #-32!
+
+       ALTERNATE_ENTRY ffi_call_SYSV
+       /* Use a stack frame allocated by our caller. */
+       stp     x29, x30, [x1]
+       mov     x29, x1
+       mov     sp, x0
+
+       mov     x9, x2                  /* save fn */
+       mov     x8, x3                  /* install structure return */
+#ifdef FFI_GO_CLOSURES
+       /*mov   x18, x5                 install static chain */
+#endif
+       stp     x3, x4, [x29, #16]      /* save rvalue and flags */
+       
+       /* Load the vector argument passing registers, if necessary.  */
+       tbz     x4, #AARCH64_FLAG_ARG_V_BIT, ffi_call_SYSV_L1
+       ldp     q0, q1, [sp, #0]
+       ldp     q2, q3, [sp, #32]
+       ldp     q4, q5, [sp, #64]
+       ldp     q6, q7, [sp, #96]
+
+ffi_call_SYSV_L1
+       /* Load the core argument passing registers, including
+          the structure return pointer.  */
+       ldp     x0, x1, [sp, #16*N_V_ARG_REG + 0]
+       ldp     x2, x3, [sp, #16*N_V_ARG_REG + 16]
+       ldp     x4, x5, [sp, #16*N_V_ARG_REG + 32]
+       ldp     x6, x7, [sp, #16*N_V_ARG_REG + 48]
+
+       /* Deallocate the context, leaving the stacked arguments.  */
+       add     sp, sp, #CALL_CONTEXT_SIZE      
+
+       blr     x9                      /* call fn */
+
+       ldp     x3, x4, [x29, #16]      /* reload rvalue and flags */
+
+       /* Partially deconstruct the stack frame. */
+       mov     sp, x29 
+       ldp     x29, x30, [x29]
+
+       /* Save the return value as directed.  */
+       adr     x5, ffi_call_SYSV_return
+       and     w4, w4, #AARCH64_RET_MASK
+       add     x5, x5, x4, lsl #3
+       br      x5
+       
+       /* Note that each table entry is 2 insns, and thus 8 bytes.
+          For integer data, note that we're storing into ffi_arg
+          and therefore we want to extend to 64 bits; these types
+          have two consecutive entries allocated for them.  */
+       ALIGN 4
+ffi_call_SYSV_return
+       ret                             /* VOID */
+       nop
+       str     x0, [x3]                /* INT64 */
+       ret
+       stp     x0, x1, [x3]            /* INT128 */
+       ret
+       brk     #1000                   /* UNUSED */
+       ret
+       brk     #1000                   /* UNUSED */
+       ret
+       brk     #1000                   /* UNUSED */
+       ret
+       brk     #1000                   /* UNUSED */
+       ret
+       brk     #1000                   /* UNUSED */
+       ret
+       st4     { v0.s, v1.s, v2.s, v3.s }[0], [x3]     /* S4 */
+       ret
+       st3     { v0.s, v1.s, v2.s }[0], [x3]   /* S3 */
+       ret
+       stp     s0, s1, [x3]            /* S2 */
+       ret
+       str     s0, [x3]                /* S1 */
+       ret
+       st4     { v0.d, v1.d, v2.d, v3.d }[0], [x3]     /* D4 */
+       ret
+       st3     { v0.d, v1.d, v2.d }[0], [x3]   /* D3 */
+       ret
+       stp     d0, d1, [x3]            /* D2 */
+       ret
+       str     d0, [x3]                /* D1 */
+       ret
+       str     q3, [x3, #48]           /* Q4 */
+       nop
+       str     q2, [x3, #32]           /* Q3 */
+       nop
+       stp     q0, q1, [x3]            /* Q2 */
+       ret
+       str     q0, [x3]                /* Q1 */
+       ret
+       uxtb    w0, w0                  /* UINT8 */
+       str     x0, [x3]
+       ret                             /* reserved */
+       nop
+       uxth    w0, w0                  /* UINT16 */
+       str     x0, [x3]
+       ret                             /* reserved */
+       nop
+       mov     w0, w0                  /* UINT32 */
+       str     x0, [x3]
+       ret                             /* reserved */
+       nop
+       sxtb    x0, w0                  /* SINT8 */
+       str     x0, [x3]
+       ret                             /* reserved */
+       nop
+       sxth    x0, w0                  /* SINT16 */
+       str     x0, [x3]
+       ret                             /* reserved */
+       nop
+       sxtw    x0, w0                  /* SINT32 */
+       str     x0, [x3]
+       ret                             /* reserved */
+       nop
+       
+       
+       NESTED_END ffi_call_SYSV_fake
+       
+
+/* ffi_closure_SYSV
+   Closure invocation glue. This is the low level code invoked directly by
+   the closure trampoline to setup and call a closure.
+   On entry x17 points to a struct ffi_closure, x16 has been clobbered
+   all other registers are preserved.
+   We allocate a call context and save the argument passing registers,
+   then invoked the generic C ffi_closure_SYSV_inner() function to do all
+   the real work, on return we load the result passing registers back from
+   the call context.
+*/
+
+#define ffi_closure_SYSV_FS (8*2 + CALL_CONTEXT_SIZE + 64)
+
+       NESTED_ENTRY    ffi_closure_SYSV_V
+       PROLOG_SAVE_REG_PAIR    x29, x30, #-ffi_closure_SYSV_FS!
+
+       /* Save the argument passing vector registers.  */
+       stp     q0, q1, [sp, #16 + 0]
+       stp     q2, q3, [sp, #16 + 32]
+       stp     q4, q5, [sp, #16 + 64]
+       stp     q6, q7, [sp, #16 + 96]
+
+       b       ffi_closure_SYSV_save_argument
+       NESTED_END      ffi_closure_SYSV_V
+
+       NESTED_ENTRY    ffi_closure_SYSV
+       PROLOG_SAVE_REG_PAIR    x29, x30, #-ffi_closure_SYSV_FS!
+
+ffi_closure_SYSV_save_argument
+       /* Save the argument passing core registers.  */
+       stp     x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0]
+       stp     x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16]
+       stp     x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32]
+       stp     x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48]
+
+       /* Load ffi_closure_inner arguments.  */
+       ldp     PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET]   /* load cif, fn */
+       ldr     PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2]    /* load user_data */
+
+do_closure
+       add     x3, sp, #16                                                     /* load context */
+       add     x4, sp, #ffi_closure_SYSV_FS            /* load stack */
+       add     x5, sp, #16+CALL_CONTEXT_SIZE           /* load rvalue */
+       mov     x6, x8                                  /* load struct_rval */
+
+       bl      ffi_closure_SYSV_inner
+
+       /* Load the return value as directed.  */
+       adr     x1, ffi_closure_SYSV_return_base
+       and     w0, w0, #AARCH64_RET_MASK
+       add     x1, x1, x0, lsl #3
+       add     x3, sp, #16+CALL_CONTEXT_SIZE
+       br      x1
+
+       /* Note that each table entry is 2 insns, and thus 8 bytes.  */
+       ALIGN   8
+ffi_closure_SYSV_return_base
+       b       ffi_closure_SYSV_epilog                 /* VOID */
+       nop
+       ldr     x0, [x3]                /* INT64 */
+       b       ffi_closure_SYSV_epilog
+       ldp     x0, x1, [x3]            /* INT128 */
+       b       ffi_closure_SYSV_epilog
+       brk     #1000                   /* UNUSED */
+       nop
+       brk     #1000                   /* UNUSED */
+       nop
+       brk     #1000                   /* UNUSED */
+       nop
+       brk     #1000                   /* UNUSED */
+       nop
+       brk     #1000                   /* UNUSED */
+       nop
+       ldr     s3, [x3, #12]           /* S4 */
+       nop
+       ldr     s2, [x3, #8]            /* S3 */
+       nop
+       ldp     s0, s1, [x3]            /* S2 */
+       b       ffi_closure_SYSV_epilog
+       ldr     s0, [x3]                /* S1 */
+       b       ffi_closure_SYSV_epilog
+       ldr     d3, [x3, #24]           /* D4 */
+       nop
+       ldr     d2, [x3, #16]           /* D3 */
+       nop
+       ldp     d0, d1, [x3]            /* D2 */
+       b       ffi_closure_SYSV_epilog
+       ldr     d0, [x3]                /* D1 */
+       b       ffi_closure_SYSV_epilog
+       ldr     q3, [x3, #48]           /* Q4 */
+       nop
+       ldr     q2, [x3, #32]           /* Q3 */
+       nop
+       ldp     q0, q1, [x3]            /* Q2 */
+       b       ffi_closure_SYSV_epilog
+       ldr     q0, [x3]                /* Q1 */
+       b       ffi_closure_SYSV_epilog
+       ldrb    w0, [x3, #BE(7)]        /* UINT8 */
+       b       ffi_closure_SYSV_epilog
+       brk     #1000                   /* reserved */
+       nop
+       ldrh    w0, [x3, #BE(6)]        /* UINT16 */
+       b       ffi_closure_SYSV_epilog
+       brk     #1000                   /* reserved */
+       nop
+       ldr     w0, [x3, #BE(4)]        /* UINT32 */
+       b       ffi_closure_SYSV_epilog
+       brk     #1000                   /* reserved */
+       nop
+       ldrsb   x0, [x3, #BE(7)]        /* SINT8 */
+       b       ffi_closure_SYSV_epilog
+       brk     #1000                   /* reserved */
+       nop
+       ldrsh   x0, [x3, #BE(6)]        /* SINT16 */
+       b       ffi_closure_SYSV_epilog
+       brk     #1000                   /* reserved */
+       nop
+       ldrsw   x0, [x3, #BE(4)]        /* SINT32 */
+       nop
+                                       /* reserved */
+
+ffi_closure_SYSV_epilog
+       EPILOG_RESTORE_REG_PAIR x29, x30, #ffi_closure_SYSV_FS!
+       EPILOG_RETURN
+       NESTED_END      ffi_closure_SYSV
+
+
+#ifdef FFI_GO_CLOSURES
+       NESTED_ENTRY    ffi_go_closure_SYSV_V
+       PROLOG_SAVE_REG_PAIR    x29, x30, #-ffi_closure_SYSV_FS!
+
+       /* Save the argument passing vector registers.  */
+       stp     q0, q1, [sp, #16 + 0]
+       stp     q2, q3, [sp, #16 + 32]
+       stp     q4, q5, [sp, #16 + 64]
+       stp     q6, q7, [sp, #16 + 96]
+       b       ffi_go_closure_SYSV_save_argument
+       NESTED_END      ffi_go_closure_SYSV_V
+
+       NESTED_ENTRY    ffi_go_closure_SYSV
+       PROLOG_SAVE_REG_PAIR    x29, x30, #-ffi_closure_SYSV_FS!
+
+ffi_go_closure_SYSV_save_argument
+       /* Save the argument passing core registers.  */
+       stp     x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0]
+       stp     x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16]
+       stp     x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32]
+       stp     x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48]
+
+       /* Load ffi_closure_inner arguments.  */
+       ldp     PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */
+       mov     x2, x18                                 /* load user_data */
+       b       do_closure
+       NESTED_END      ffi_go_closure_SYSV
+
+#endif /* FFI_GO_CLOSURES */
+
+
+/* void extend_hfa_type (void *dest, void *src, int h) */
+
+       LEAF_ENTRY      extend_hfa_type
+
+       adr     x3, extend_hfa_type_jump_base
+       and     w2, w2, #AARCH64_RET_MASK
+       sub     x2, x2, #AARCH64_RET_S4
+       add     x3, x3, x2, lsl #4
+       br      x3
+
+       ALIGN   4
+extend_hfa_type_jump_base
+       ldp     s16, s17, [x1]          /* S4 */
+       ldp     s18, s19, [x1, #8]
+       b       extend_hfa_type_store_4
+       nop
+
+       ldp     s16, s17, [x1]          /* S3 */
+       ldr     s18, [x1, #8]
+       b       extend_hfa_type_store_3
+       nop
+
+       ldp     s16, s17, [x1]          /* S2 */
+       b       extend_hfa_type_store_2
+       nop
+       nop
+
+       ldr     s16, [x1]               /* S1 */
+       b       extend_hfa_type_store_1
+       nop
+       nop
+
+       ldp     d16, d17, [x1]          /* D4 */
+       ldp     d18, d19, [x1, #16]
+       b       extend_hfa_type_store_4
+       nop
+
+       ldp     d16, d17, [x1]          /* D3 */
+       ldr     d18, [x1, #16]
+       b       extend_hfa_type_store_3
+       nop
+
+       ldp     d16, d17, [x1]          /* D2 */
+       b       extend_hfa_type_store_2
+       nop
+       nop
+
+       ldr     d16, [x1]               /* D1 */
+       b       extend_hfa_type_store_1
+       nop
+       nop
+
+       ldp     q16, q17, [x1]          /* Q4 */
+       ldp     q18, q19, [x1, #16]
+       b       extend_hfa_type_store_4
+       nop
+
+       ldp     q16, q17, [x1]          /* Q3 */
+       ldr     q18, [x1, #16]
+       b       extend_hfa_type_store_3
+       nop
+
+       ldp     q16, q17, [x1]          /* Q2 */
+       b       extend_hfa_type_store_2
+       nop
+       nop
+
+       ldr     q16, [x1]               /* Q1 */
+       b       extend_hfa_type_store_1
+
+extend_hfa_type_store_4
+       str     q19, [x0, #48]
+extend_hfa_type_store_3
+       str     q18, [x0, #32]
+extend_hfa_type_store_2
+       str     q17, [x0, #16]
+extend_hfa_type_store_1
+       str     q16, [x0]
+       ret
+
+       LEAF_END        extend_hfa_type
+
+
+/* void compress_hfa_type (void *dest, void *reg, int h) */
+
+       LEAF_ENTRY      compress_hfa_type
+
+       adr     x3, compress_hfa_type_jump_base
+       and     w2, w2, #AARCH64_RET_MASK
+       sub     x2, x2, #AARCH64_RET_S4
+       add     x3, x3, x2, lsl #4
+       br      x3
+
+       ALIGN   4
+compress_hfa_type_jump_base
+       ldp     q16, q17, [x1]          /* S4 */
+       ldp     q18, q19, [x1, #32]
+       st4     { v16.s, v17.s, v18.s, v19.s }[0], [x0]
+       ret
+
+       ldp     q16, q17, [x1]          /* S3 */
+       ldr     q18, [x1, #32]
+       st3     { v16.s, v17.s, v18.s }[0], [x0]
+       ret
+
+       ldp     q16, q17, [x1]          /* S2 */
+       st2     { v16.s, v17.s }[0], [x0]
+       ret
+       nop
+
+       ldr     q16, [x1]               /* S1 */
+       st1     { v16.s }[0], [x0]
+       ret
+       nop
+
+       ldp     q16, q17, [x1]          /* D4 */
+       ldp     q18, q19, [x1, #32]
+       st4     { v16.d, v17.d, v18.d, v19.d }[0], [x0]
+       ret
+
+       ldp     q16, q17, [x1]          /* D3 */
+       ldr     q18, [x1, #32]
+       st3     { v16.d, v17.d, v18.d }[0], [x0]
+       ret
+
+       ldp     q16, q17, [x1]          /* D2 */
+       st2     { v16.d, v17.d }[0], [x0]
+       ret
+       nop
+
+       ldr     q16, [x1]               /* D1 */
+       st1     { v16.d }[0], [x0]
+       ret
+       nop
+
+       ldp     q16, q17, [x1]          /* Q4 */
+       ldp     q18, q19, [x1, #32]
+       b       compress_hfa_type_store_q4
+       nop
+
+       ldp     q16, q17, [x1]          /* Q3 */
+       ldr     q18, [x1, #32]
+       b       compress_hfa_type_store_q3
+       nop
+
+       ldp     q16, q17, [x1]          /* Q2 */
+       stp     q16, q17, [x0]
+       ret
+       nop
+
+       ldr     q16, [x1]               /* Q1 */
+       str     q16, [x0]
+       ret
+
+compress_hfa_type_store_q4
+       str     q19, [x0, #48]
+compress_hfa_type_store_q3
+       str     q18, [x0, #32]
+       stp     q16, q17, [x0]
+       ret
+
+       LEAF_END        compress_hfa_type
+
+       END
\ No newline at end of file
index efae4cc3d671a549852130ae57515e94f043bb00..7a95e9707c3a0f6e1b175a43cdb1499d16d65e3a 100644 (file)
@@ -98,7 +98,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
        case FFI_TYPE_VOID:
        case FFI_TYPE_STRUCT:
          /* Passed by value in N slots.  */
-         bytes += ALIGN(itype->size, FFI_SIZEOF_ARG);
+         bytes += FFI_ALIGN(itype->size, FFI_SIZEOF_ARG);
          break;
 
        case FFI_TYPE_COMPLEX:
@@ -285,7 +285,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
        case FFI_TYPE_STRUCT:
          size = ty->size;
          memcpy(argp + argn, valp, size);
-         argn += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+         argn += FFI_ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
          break;
 
        case FFI_TYPE_COMPLEX:
@@ -421,7 +421,7 @@ ffi_closure_osf_inner (ffi_cif *cif,
        case FFI_TYPE_VOID:
        case FFI_TYPE_STRUCT:
          size = ty->size;
-         argn += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+         argn += FFI_ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
          break;
 
        case FFI_TYPE_FLOAT:
index 32f82a7d5bb54fcb674c43590f4d9bfa646e69ad..4d10b21a5d95d9a7a4ec1fa2991d2dd2680d8b97 100644 (file)
@@ -46,12 +46,10 @@ 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)
@@ -73,7 +71,7 @@ ffi_prep_args (char *stack, extended_cif * ecif)
 
       /* Align if necessary.  */
       if ((alignment - 1) & (unsigned) argp)
-       argp = (char *) ALIGN (argp, alignment);
+       argp = (char *) FFI_ALIGN (argp, alignment);
 
       z = (*p_arg)->size;
       if (z < sizeof (int))
@@ -225,7 +223,7 @@ ffi_closure_inner_ARCompact (ffi_closure * closure, void *rvalue,
 
       /* Align if necessary.  */
       if ((alignment - 1) & (unsigned) argp)
-       argp = (char *) ALIGN (argp, alignment);
+       argp = (char *) FFI_ALIGN (argp, alignment);
 
       z = (*p_argt)->size;
       *p_argv = (void *) argp;
index 9c8732d158cd1573544e095cd5e568e7c4a1e9f3..593ab4d48b8b003f606b1f795284823420656d35 100644 (file)
    DEALINGS IN THE SOFTWARE.
    ----------------------------------------------------------------------- */
 
+#if defined(__arm__) || defined(_M_ARM)
+#include <fficonfig.h>
 #include <ffi.h>
 #include <ffi_common.h>
+#include <stdint.h>
 #include <stdlib.h>
+#include <tramp.h>
 #include "internal.h"
 
+#if defined(_WIN32)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+#if FFI_EXEC_TRAMPOLINE_TABLE
+
+#ifdef __MACH__
+#include <mach/machine/vm_param.h>
+#endif
+
+#else
+#ifndef _WIN32
+extern unsigned int ffi_arm_trampoline[2] FFI_HIDDEN;
+#else
+// Declare this as an array of char, instead of array of int,
+// otherwise Clang optimizes out the "& 0xFFFFFFFE" for clearing
+// the thumb bit.
+extern unsigned char ffi_arm_trampoline[12] FFI_HIDDEN;
+#endif
+#endif
+
+#if defined(__FreeBSD__) && defined(__arm__)
+#include <sys/types.h>
+#include <machine/sysarch.h>
+#endif
+
 /* Forward declares. */
 static int vfp_type_p (const ffi_type *);
 static void layout_vfp_args (ffi_cif *);
@@ -49,7 +80,7 @@ ffi_align (ffi_type *ty, void *p)
   if (alignment < 4)
     alignment = 4;
 #endif
-  return (void *) ALIGN (p, alignment);
+  return (void *) FFI_ALIGN (p, alignment);
 }
 
 static size_t
@@ -76,10 +107,20 @@ ffi_put_arg (ffi_type *ty, void *src, void *dst)
     case FFI_TYPE_SINT32:
     case FFI_TYPE_UINT32:
     case FFI_TYPE_POINTER:
+#ifndef _WIN32
     case FFI_TYPE_FLOAT:
+#endif
       *(UINT32 *)dst = *(UINT32 *)src;
       break;
 
+#ifdef _WIN32
+    // casting a float* to a UINT32* doesn't work on Windows
+    case FFI_TYPE_FLOAT:
+        *(uintptr_t *)dst = 0;
+        *(float *)dst = *(float *)src;
+        break;
+#endif
+
     case FFI_TYPE_SINT64:
     case FFI_TYPE_UINT64:
     case FFI_TYPE_DOUBLE:
@@ -95,7 +136,7 @@ ffi_put_arg (ffi_type *ty, void *src, void *dst)
       abort();
     }
 
-  return ALIGN (z, 4);
+  return FFI_ALIGN (z, 4);
 }
 
 /* ffi_prep_args is called once stack space has been allocated
@@ -198,7 +239,7 @@ ffi_prep_args_VFP (ffi_cif *cif, int flags, void *rvalue,
 }
 
 /* Perform machine dependent cif processing */
-ffi_status
+ffi_status FFI_HIDDEN
 ffi_prep_cif_machdep (ffi_cif *cif)
 {
   int flags = 0, cabi = cif->abi;
@@ -276,7 +317,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
   /* Round the stack up to a multiple of 8 bytes.  This isn't needed
      everywhere, but it is on some platforms, and it doesn't harm anything
      when it isn't needed.  */
-  bytes = ALIGN (bytes, 8);
+  bytes = FFI_ALIGN (bytes, 8);
 
   /* Minimum stack space is the 4 register arguments that we pop.  */
   if (bytes < 4*4)
@@ -289,7 +330,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
 }
 
 /* Perform machine dependent cif processing for variadic calls */
-ffi_status
+ffi_status FFI_HIDDEN
 ffi_prep_cif_machdep_var (ffi_cif * cif,
                          unsigned int nfixedargs, unsigned int ntotalargs)
 {
@@ -389,12 +430,14 @@ ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue)
   ffi_call_int (cif, fn, rvalue, avalue, NULL);
 }
 
+#ifdef FFI_GO_CLOSURES
 void
 ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue,
             void **avalue, void *closure)
 {
   ffi_call_int (cif, fn, rvalue, avalue, closure);
 }
+#endif
 
 static void *
 ffi_prep_incoming_args_SYSV (ffi_cif *cif, void *rvalue,
@@ -408,6 +451,11 @@ ffi_prep_incoming_args_SYSV (ffi_cif *cif, void *rvalue,
       rvalue = *(void **) argp;
       argp += 4;
     }
+  else
+    {
+      if (cif->rtype->size && cif->rtype->size < 4)
+        *(uint32_t *) rvalue = 0;
+    }
 
   for (i = 0, n = cif->nargs; i < n; i++)
     {
@@ -492,6 +540,8 @@ ffi_prep_incoming_args_VFP (ffi_cif *cif, void *rvalue, char *stack,
   return rvalue;
 }
 
+#if FFI_CLOSURES
+
 struct closure_frame
 {
   char vfp_space[8*8] __attribute__((aligned(8)));
@@ -527,257 +577,28 @@ ffi_closure_inner_VFP (ffi_cif *cif,
 
 void ffi_closure_SYSV (void) FFI_HIDDEN;
 void ffi_closure_VFP (void) FFI_HIDDEN;
+#if defined(FFI_EXEC_STATIC_TRAMP)
+void ffi_closure_SYSV_alt (void) FFI_HIDDEN;
+void ffi_closure_VFP_alt (void) FFI_HIDDEN;
+#endif
+
+#ifdef FFI_GO_CLOSURES
 void ffi_go_closure_SYSV (void) FFI_HIDDEN;
 void ffi_go_closure_VFP (void) FFI_HIDDEN;
-
-#if FFI_EXEC_TRAMPOLINE_TABLE
-
-#include <mach/mach.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-extern void *ffi_closure_trampoline_table_page;
-
-typedef struct ffi_trampoline_table ffi_trampoline_table;
-typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
-
-struct ffi_trampoline_table
-{
-  /* contiguous writable and executable pages */
-  vm_address_t config_page;
-  vm_address_t trampoline_page;
-
-  /* free list tracking */
-  uint16_t free_count;
-  ffi_trampoline_table_entry *free_list;
-  ffi_trampoline_table_entry *free_list_pool;
-
-  ffi_trampoline_table *prev;
-  ffi_trampoline_table *next;
-};
-
-struct ffi_trampoline_table_entry
-{
-  void *(*trampoline) ();
-  ffi_trampoline_table_entry *next;
-};
-
-/* Override the standard architecture trampoline size */
-// XXX TODO - Fix
-#undef FFI_TRAMPOLINE_SIZE
-#define FFI_TRAMPOLINE_SIZE 12
-
-/* The trampoline configuration is placed at 4080 bytes prior to the trampoline's entry point */
-#define FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc) ((void **) (((uint8_t *) codeloc) - 4080));
-
-/* The first 16 bytes of the config page are unused, as they are unaddressable from the trampoline page. */
-#define FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET 16
-
-/* Total number of trampolines that fit in one trampoline table */
-#define FFI_TRAMPOLINE_COUNT ((PAGE_SIZE - FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET) / FFI_TRAMPOLINE_SIZE)
-
-static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER;
-static ffi_trampoline_table *ffi_trampoline_tables = NULL;
-
-static ffi_trampoline_table *
-ffi_trampoline_table_alloc ()
-{
-  ffi_trampoline_table *table = NULL;
-
-  /* Loop until we can allocate two contiguous pages */
-  while (table == NULL)
-    {
-      vm_address_t config_page = 0x0;
-      kern_return_t kt;
-
-      /* Try to allocate two pages */
-      kt =
-       vm_allocate (mach_task_self (), &config_page, PAGE_SIZE * 2,
-                    VM_FLAGS_ANYWHERE);
-      if (kt != KERN_SUCCESS)
-       {
-         fprintf (stderr, "vm_allocate() failure: %d at %s:%d\n", kt,
-                  __FILE__, __LINE__);
-         break;
-       }
-
-      /* Now drop the second half of the allocation to make room for the trampoline table */
-      vm_address_t trampoline_page = config_page + PAGE_SIZE;
-      kt = vm_deallocate (mach_task_self (), trampoline_page, PAGE_SIZE);
-      if (kt != KERN_SUCCESS)
-       {
-         fprintf (stderr, "vm_deallocate() failure: %d at %s:%d\n", kt,
-                  __FILE__, __LINE__);
-         break;
-       }
-
-      /* Remap the trampoline table to directly follow the config page */
-      vm_prot_t cur_prot;
-      vm_prot_t max_prot;
-
-      kt =
-       vm_remap (mach_task_self (), &trampoline_page, PAGE_SIZE, 0x0, FALSE,
-                 mach_task_self (),
-                 (vm_address_t) & ffi_closure_trampoline_table_page, FALSE,
-                 &cur_prot, &max_prot, VM_INHERIT_SHARE);
-
-      /* If we lost access to the destination trampoline page, drop our config allocation mapping and retry */
-      if (kt != KERN_SUCCESS)
-       {
-         /* Log unexpected failures */
-         if (kt != KERN_NO_SPACE)
-           {
-             fprintf (stderr, "vm_remap() failure: %d at %s:%d\n", kt,
-                      __FILE__, __LINE__);
-           }
-
-         vm_deallocate (mach_task_self (), config_page, PAGE_SIZE);
-         continue;
-       }
-
-      /* We have valid trampoline and config pages */
-      table = calloc (1, sizeof (ffi_trampoline_table));
-      table->free_count = FFI_TRAMPOLINE_COUNT;
-      table->config_page = config_page;
-      table->trampoline_page = trampoline_page;
-
-      /* Create and initialize the free list */
-      table->free_list_pool =
-       calloc (FFI_TRAMPOLINE_COUNT, sizeof (ffi_trampoline_table_entry));
-
-      uint16_t i;
-      for (i = 0; i < table->free_count; i++)
-       {
-         ffi_trampoline_table_entry *entry = &table->free_list_pool[i];
-         entry->trampoline =
-           (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE));
-
-         if (i < table->free_count - 1)
-           entry->next = &table->free_list_pool[i + 1];
-       }
-
-      table->free_list = table->free_list_pool;
-    }
-
-  return table;
-}
-
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
-  /* Create the closure */
-  ffi_closure *closure = malloc (size);
-  if (closure == NULL)
-    return NULL;
-
-  pthread_mutex_lock (&ffi_trampoline_lock);
-
-  /* Check for an active trampoline table with available entries. */
-  ffi_trampoline_table *table = ffi_trampoline_tables;
-  if (table == NULL || table->free_list == NULL)
-    {
-      table = ffi_trampoline_table_alloc ();
-      if (table == NULL)
-       {
-         free (closure);
-         return NULL;
-       }
-
-      /* Insert the new table at the top of the list */
-      table->next = ffi_trampoline_tables;
-      if (table->next != NULL)
-       table->next->prev = table;
-
-      ffi_trampoline_tables = table;
-    }
-
-  /* Claim the free entry */
-  ffi_trampoline_table_entry *entry = ffi_trampoline_tables->free_list;
-  ffi_trampoline_tables->free_list = entry->next;
-  ffi_trampoline_tables->free_count--;
-  entry->next = NULL;
-
-  pthread_mutex_unlock (&ffi_trampoline_lock);
-
-  /* Initialize the return values */
-  *code = entry->trampoline;
-  closure->trampoline_table = table;
-  closure->trampoline_table_entry = entry;
-
-  return closure;
-}
-
-void
-ffi_closure_free (void *ptr)
-{
-  ffi_closure *closure = ptr;
-
-  pthread_mutex_lock (&ffi_trampoline_lock);
-
-  /* Fetch the table and entry references */
-  ffi_trampoline_table *table = closure->trampoline_table;
-  ffi_trampoline_table_entry *entry = closure->trampoline_table_entry;
-
-  /* Return the entry to the free list */
-  entry->next = table->free_list;
-  table->free_list = entry;
-  table->free_count++;
-
-  /* If all trampolines within this table are free, and at least one other table exists, deallocate
-   * the table */
-  if (table->free_count == FFI_TRAMPOLINE_COUNT
-      && ffi_trampoline_tables != table)
-    {
-      /* Remove from the list */
-      if (table->prev != NULL)
-       table->prev->next = table->next;
-
-      if (table->next != NULL)
-       table->next->prev = table->prev;
-
-      /* Deallocate pages */
-      kern_return_t kt;
-      kt = vm_deallocate (mach_task_self (), table->config_page, PAGE_SIZE);
-      if (kt != KERN_SUCCESS)
-       fprintf (stderr, "vm_deallocate() failure: %d at %s:%d\n", kt,
-                __FILE__, __LINE__);
-
-      kt =
-       vm_deallocate (mach_task_self (), table->trampoline_page, PAGE_SIZE);
-      if (kt != KERN_SUCCESS)
-       fprintf (stderr, "vm_deallocate() failure: %d at %s:%d\n", kt,
-                __FILE__, __LINE__);
-
-      /* Deallocate free list */
-      free (table->free_list_pool);
-      free (table);
-    }
-  else if (ffi_trampoline_tables != table)
-    {
-      /* Otherwise, bump this table to the top of the list */
-      table->prev = NULL;
-      table->next = ffi_trampoline_tables;
-      if (ffi_trampoline_tables != NULL)
-       ffi_trampoline_tables->prev = table;
-
-      ffi_trampoline_tables = table;
-    }
-
-  pthread_mutex_unlock (&ffi_trampoline_lock);
-
-  /* Free the closure */
-  free (closure);
-}
-
-#else
-
-extern unsigned int ffi_arm_trampoline[2] FFI_HIDDEN;
-
 #endif
 
 /* the cif must already be prep'ed */
 
+#if defined(__FreeBSD__) && defined(__arm__)
+#define __clear_cache(start, end) do { \
+               struct arm_sync_icache_args ua;                 \
+                                                               \
+               ua.addr = (uintptr_t)(start);                   \
+               ua.len = (char *)(end) - (char *)start;         \
+               sysarch(ARM_SYNC_ICACHE, &ua);                  \
+       } while (0);
+#endif
+
 ffi_status
 ffi_prep_closure_loc (ffi_closure * closure,
                      ffi_cif * cif,
@@ -796,14 +617,47 @@ ffi_prep_closure_loc (ffi_closure * closure,
     return FFI_BAD_ABI;
 
 #if FFI_EXEC_TRAMPOLINE_TABLE
-  void **config = FFI_TRAMPOLINE_CODELOC_CONFIG (codeloc);
+  void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE);
   config[0] = closure;
   config[1] = closure_func;
 #else
-  memcpy (closure->tramp, ffi_arm_trampoline, 8);
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+  if (ffi_tramp_is_present(closure))
+    {
+      /* Initialize the static trampoline's parameters. */
+      if (closure_func == ffi_closure_SYSV)
+        closure_func = ffi_closure_SYSV_alt;
+      else
+        closure_func = ffi_closure_VFP_alt;
+      ffi_tramp_set_parms (closure->ftramp, closure_func, closure);
+      goto out;
+    }
+#endif
+
+  /* Initialize the dynamic trampoline. */
+#ifndef _WIN32
+  memcpy(closure->tramp, ffi_arm_trampoline, 8);
+#else
+  // cast away function type so MSVC doesn't set the lower bit of the function pointer
+  memcpy(closure->tramp, (void*)((uintptr_t)ffi_arm_trampoline & 0xFFFFFFFE), FFI_TRAMPOLINE_CLOSURE_OFFSET);
+#endif
+
+#if defined (__QNX__)
+  msync(closure->tramp, 8, 0x1000000); /* clear data map */
+  msync(codeloc, 8, 0x1000000);        /* clear insn map */
+#elif defined(_WIN32)
+  FlushInstructionCache(GetCurrentProcess(), closure->tramp, FFI_TRAMPOLINE_SIZE);
+#else
   __clear_cache(closure->tramp, closure->tramp + 8);   /* clear data map */
   __clear_cache(codeloc, codeloc + 8);                 /* clear insn map */
+#endif
+#ifdef _WIN32
+  *(void(**)(void))(closure->tramp + FFI_TRAMPOLINE_CLOSURE_FUNCTION) = closure_func;
+#else
   *(void (**)(void))(closure->tramp + 8) = closure_func;
+#endif
+out:
 #endif
 
   closure->cif = cif;
@@ -813,6 +667,7 @@ ffi_prep_closure_loc (ffi_closure * closure,
   return FFI_OK;
 }
 
+#ifdef FFI_GO_CLOSURES
 ffi_status
 ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif,
                     void (*fun) (ffi_cif *, void *, void **, void *))
@@ -834,6 +689,9 @@ ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif,
 
   return FFI_OK;
 }
+#endif
+
+#endif /* FFI_CLOSURES */
 
 /* Below are routines for VFP hard-float support. */
 
@@ -1005,7 +863,7 @@ place_vfp_arg (ffi_cif *cif, int h)
        }
       /* Found regs to allocate. */
       cif->vfp_used |= new_used;
-      cif->vfp_args[cif->vfp_nargs++] = reg;
+      cif->vfp_args[cif->vfp_nargs++] = (signed char)reg;
 
       /* Update vfp_reg_free. */
       if (cif->vfp_used & (1 << cif->vfp_reg_free))
@@ -1027,7 +885,7 @@ place_vfp_arg (ffi_cif *cif, int h)
 static void
 layout_vfp_args (ffi_cif * cif)
 {
-  int i;
+  unsigned int i;
   /* Init VFP fields */
   cif->vfp_used = 0;
   cif->vfp_nargs = 0;
@@ -1041,3 +899,17 @@ layout_vfp_args (ffi_cif * cif)
        break;
     }
 }
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+void *
+ffi_tramp_arch (size_t *tramp_size, size_t *map_size)
+{
+  extern void *trampoline_code_table;
+
+  *tramp_size = ARM_TRAMP_SIZE;
+  *map_size = ARM_TRAMP_MAP_SIZE;
+  return &trampoline_code_table;
+}
+#endif
+
+#endif /* __arm__ or _M_ARM */
index 4f473f929b4f4cea1b3e7dac71251c3b6e5d1bee..12d5d206953490121548df9e4f03ed30c03494a9 100644 (file)
@@ -43,7 +43,7 @@ typedef enum ffi_abi {
   FFI_SYSV,
   FFI_VFP,
   FFI_LAST_ABI,
-#ifdef __ARM_PCS_VFP
+#if defined(__ARM_PCS_VFP) || defined(_WIN32)
   FFI_DEFAULT_ABI = FFI_VFP,
 #else
   FFI_DEFAULT_ABI = FFI_SYSV,
@@ -57,13 +57,33 @@ typedef enum ffi_abi {
   signed char vfp_args[16]                     \
 
 #define FFI_TARGET_SPECIFIC_VARIADIC
+#ifndef _WIN32
 #define FFI_TARGET_HAS_COMPLEX_TYPE
+#endif
 
 /* ---- Definitions for closures ----------------------------------------- */
 
 #define FFI_CLOSURES 1
 #define FFI_GO_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 12
 #define FFI_NATIVE_RAW_API 0
 
+#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE
+
+#ifdef __MACH__
+#define FFI_TRAMPOLINE_SIZE 12
+#define FFI_TRAMPOLINE_CLOSURE_OFFSET 8
+#else
+#error "No trampoline table implementation"
+#endif
+
+#else
+#ifdef _WIN32
+#define FFI_TRAMPOLINE_SIZE 16
+#define FFI_TRAMPOLINE_CLOSURE_FUNCTION 12
+#else
+#define FFI_TRAMPOLINE_SIZE 12
+#endif
+#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
+#endif
+
 #endif
index 6cf0b2ae5dab8105ca110af96d668958b69abed3..fa8ab0b6ebcd70b71e7269c02e11eb8e272e2103 100644 (file)
@@ -5,3 +5,13 @@
 #define ARM_TYPE_INT   4
 #define ARM_TYPE_VOID  5
 #define ARM_TYPE_STRUCT        6
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+/*
+ * For the trampoline table mapping, a mapping size of 4K (base page size)
+ * is chosen.
+ */
+#define ARM_TRAMP_MAP_SHIFT    12
+#define ARM_TRAMP_MAP_SIZE     (1 << ARM_TRAMP_MAP_SHIFT)
+#define ARM_TRAMP_SIZE         20
+#endif
index fd165890e02cbe73da7915419b0edc268abe543f..fb36213c6805fa5017154328e094daeaf902a0c5 100644 (file)
@@ -25,7 +25,8 @@
    DEALINGS IN THE SOFTWARE.
    ----------------------------------------------------------------------- */
 
-#define LIBFFI_ASM     
+#ifdef __arm__
+#define LIBFFI_ASM
 #include <fficonfig.h>
 #include <ffi.h>
 #include <ffi_cfi.h>
 #endif
 
 /* Conditionally compile unwinder directives.  */
-.macro UNWIND text:vararg
 #ifdef __ARM_EABI__
-       \text
-#endif 
-.endm
+# define UNWIND(...)   __VA_ARGS__
+#else
+# define UNWIND(...)
+#endif
+
 #if defined(HAVE_AS_CFI_PSEUDO_OP) && defined(__ARM_EABI__)
        .cfi_sections   .debug_frame
 #endif
 # define TYPE(X, Y)
 #endif
 
-#define ARM_FUNC_START(name, gl) \
-       .align  3; \
-       .ifne gl; .globl CNAME(name); FFI_HIDDEN(CNAME(name)); .endif; \
-       TYPE(name, %function); \
+#define ARM_FUNC_START_LOCAL(name)     \
+       .align  3;                      \
+       TYPE(CNAME(name), %function);   \
        CNAME(name):
 
+#define ARM_FUNC_START(name)           \
+       .globl CNAME(name);             \
+       FFI_HIDDEN(CNAME(name));        \
+       ARM_FUNC_START_LOCAL(name)
+
 #define ARM_FUNC_END(name) \
        SIZE(name)
 
-/* Aid in defining a jump table with 8 bytes between entries.  */
-.macro E index
-       .if . - 0b - 8*\index
-       .error "type table out of sync"
-       .endif
-.endm
-
        .text
        .syntax unified
+#if defined(_WIN32)
+       /* Windows on ARM is thumb-only */
+       .thumb
+#else
+       /* Keep the assembly in ARM mode in other cases, for simplicity
+        * (to avoid interworking issues). */
+#undef __thumb__
        .arm
+#endif
 
+/* Aid in defining a jump table with 8 bytes between entries.  */
+#ifdef __thumb__
+/* In thumb mode, instructions can be shorter than expected in arm mode, so
+ * we need to align the start of each case. */
+# define E(index) .align 3
+#elif defined(__clang__)
+/* ??? The clang assembler doesn't handle .if with symbolic expressions.  */
+# define E(index)
+#else
+# define E(index)                              \
+       .if . - 0b - 8*index;                   \
+       .error "type table out of sync";        \
+       .endif
+#endif
+
+
+#ifndef __clang__
        /* We require interworking on LDM, which implies ARMv5T,
           which implies the existance of BLX.  */
-       .arch   armv5t
+       .arch   armv5t
+#endif
 
        /* Note that we use STC and LDC to encode VFP instructions,
           so that we do not need ".fpu vfp", nor get that added to
        @ r2:   fn
        @ r3:   vfp_used
 
-ARM_FUNC_START(ffi_call_VFP, 1)
-       UNWIND  .fnstart
+ARM_FUNC_START(ffi_call_VFP)
+       UNWIND(.fnstart)
        cfi_startproc
 
        cmp     r3, #3                  @ load only d0 if possible
-       ldcle   p11, cr0, [r0]          @ vldrle d0, [sp]
-       ldcgt   p11, cr0, [r0], {16}    @ vldmgt sp, {d0-d7}
+       ite     le
+#ifdef __clang__
+       vldrle d0, [r0]
+       vldmgt r0, {d0-d7}
+#else
+       ldcle   p11, cr0, [r0]          @ vldrle d0, [r0]
+       ldcgt   p11, cr0, [r0], {16}    @ vldmgt r0, {d0-d7}
+#endif
        add     r0, r0, #64             @ discard the vfp register args
        /* FALLTHRU */
 ARM_FUNC_END(ffi_call_VFP)
 
-ARM_FUNC_START(ffi_call_SYSV, 1)
+ARM_FUNC_START(ffi_call_SYSV)
        stm     r1, {fp, lr}
        mov     fp, r1
 
        @ This is a bit of a lie wrt the origin of the unwind info, but
        @ now we've got the usual frame pointer and two saved registers.
-       UNWIND  .save {fp,lr}
-       UNWIND  .setfp fp, sp
+       UNWIND(.save {fp,lr})
+       UNWIND(.setfp fp, sp)
        cfi_def_cfa(fp, 8)
        cfi_rel_offset(fp, 0)
        cfi_rel_offset(lr, 4)
@@ -150,41 +181,61 @@ ARM_FUNC_START(ffi_call_SYSV, 1)
        cfi_def_cfa_register(sp)
 
        @ Store values stored in registers.
+#ifndef __thumb__
        .align  3
        add     pc, pc, r3, lsl #3
        nop
+#else
+       adr     ip, 0f
+       add     ip, ip, r3, lsl #3
+       mov     pc, ip
+       .align  3
+#endif
 0:
-E ARM_TYPE_VFP_S
+E(ARM_TYPE_VFP_S)
+#ifdef __clang__
+       vstr s0, [r2]
+#else
        stc     p10, cr0, [r2]          @ vstr s0, [r2]
+#endif
        pop     {fp,pc}
-E ARM_TYPE_VFP_D
+E(ARM_TYPE_VFP_D)
+#ifdef __clang__
+       vstr d0, [r2]
+#else
        stc     p11, cr0, [r2]          @ vstr d0, [r2]
+#endif
        pop     {fp,pc}
-E ARM_TYPE_VFP_N
+E(ARM_TYPE_VFP_N)
+#ifdef __clang__
+       vstm r2, {d0-d3}
+#else
        stc     p11, cr0, [r2], {8}     @ vstm r2, {d0-d3}
+#endif
        pop     {fp,pc}
-E ARM_TYPE_INT64
+E(ARM_TYPE_INT64)
        str     r1, [r2, #4]
        nop
-E ARM_TYPE_INT
+E(ARM_TYPE_INT)
        str     r0, [r2]
        pop     {fp,pc}
-E ARM_TYPE_VOID
+E(ARM_TYPE_VOID)
        pop     {fp,pc}
        nop
-E ARM_TYPE_STRUCT
+E(ARM_TYPE_STRUCT)
        pop     {fp,pc}
 
        cfi_endproc
-       UNWIND  .fnend
+       UNWIND(.fnend)
 ARM_FUNC_END(ffi_call_SYSV)
 
+#if FFI_CLOSURES
 
 /*
        int ffi_closure_inner_* (cif, fun, user_data, frame)
 */
 
-ARM_FUNC_START(ffi_go_closure_SYSV, 1)
+ARM_FUNC_START(ffi_go_closure_SYSV)
        cfi_startproc
        stmdb   sp!, {r0-r3}                    @ save argument regs
        cfi_adjust_cfa_offset(16)
@@ -195,14 +246,21 @@ ARM_FUNC_START(ffi_go_closure_SYSV, 1)
        cfi_endproc
 ARM_FUNC_END(ffi_go_closure_SYSV)
 
-ARM_FUNC_START(ffi_closure_SYSV, 1)
-       UNWIND  .fnstart
+ARM_FUNC_START(ffi_closure_SYSV)
+       UNWIND(.fnstart)
        cfi_startproc
+#ifdef _WIN32
+       ldmfd   sp!, {r0, ip}                   @ restore fp (r0 is used for stack alignment)
+#endif
        stmdb   sp!, {r0-r3}                    @ save argument regs
        cfi_adjust_cfa_offset(16)
-       ldr     r0, [ip, #FFI_TRAMPOLINE_SIZE]    @ load cif
-       ldr     r1, [ip, #FFI_TRAMPOLINE_SIZE+4]  @ load fun
-       ldr     r2, [ip, #FFI_TRAMPOLINE_SIZE+8]  @ load user_data
+
+#if FFI_EXEC_TRAMPOLINE_TABLE
+       ldr ip, [ip]                            @ ip points to the config page, dereference to get the ffi_closure*
+#endif
+       ldr     r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET]        @ load cif
+       ldr     r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4]  @ load fun
+       ldr     r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8]  @ load user_data
 0:
        add     ip, sp, #16                     @ compute entry sp
        sub     sp, sp, #64+32                  @ allocate frame
@@ -212,7 +270,7 @@ ARM_FUNC_START(ffi_closure_SYSV, 1)
        /* Remember that EABI unwind info only applies at call sites.
           We need do nothing except note the save of the stack pointer
           and the link registers.  */
-       UNWIND  .save {sp,lr}
+       UNWIND(.save {sp,lr})
        cfi_adjust_cfa_offset(8)
        cfi_rel_offset(lr, 4)
 
@@ -222,12 +280,17 @@ ARM_FUNC_START(ffi_closure_SYSV, 1)
        @ Load values returned in registers.
        add     r2, sp, #8+64                   @ load result
        adr     r3, CNAME(ffi_closure_ret)
+#ifndef __thumb__
        add     pc, r3, r0, lsl #3
+#else
+       add     r3, r3, r0, lsl #3
+       mov     pc, r3
+#endif
        cfi_endproc
-       UNWIND  .fnend
+       UNWIND(.fnend)
 ARM_FUNC_END(ffi_closure_SYSV)
 
-ARM_FUNC_START(ffi_go_closure_VFP, 1)
+ARM_FUNC_START(ffi_go_closure_VFP)
        cfi_startproc
        stmdb   sp!, {r0-r3}                    @ save argument regs
        cfi_adjust_cfa_offset(16)
@@ -238,23 +301,34 @@ ARM_FUNC_START(ffi_go_closure_VFP, 1)
        cfi_endproc
 ARM_FUNC_END(ffi_go_closure_VFP)
 
-ARM_FUNC_START(ffi_closure_VFP, 1)
-       UNWIND  .fnstart
+ARM_FUNC_START(ffi_closure_VFP)
+       UNWIND(.fnstart)
        cfi_startproc
+#ifdef _WIN32
+       ldmfd   sp!, {r0, ip}                   @ restore fp (r0 is used for stack alignment)
+#endif
        stmdb   sp!, {r0-r3}                    @ save argument regs
        cfi_adjust_cfa_offset(16)
-       ldr     r0, [ip, #FFI_TRAMPOLINE_SIZE]    @ load cif
-       ldr     r1, [ip, #FFI_TRAMPOLINE_SIZE+4]  @ load fun
-       ldr     r2, [ip, #FFI_TRAMPOLINE_SIZE+8]  @ load user_data
+
+#if FFI_EXEC_TRAMPOLINE_TABLE
+       ldr ip, [ip]                            @ ip points to the config page, dereference to get the ffi_closure*
+#endif
+       ldr     r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET]        @ load cif
+       ldr     r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4]  @ load fun
+       ldr     r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8]  @ load user_data
 0:
        add     ip, sp, #16
        sub     sp, sp, #64+32                  @ allocate frame
        cfi_adjust_cfa_offset(64+32)
+#ifdef __clang__
+       vstm sp, {d0-d7}
+#else
        stc     p11, cr0, [sp], {16}            @ vstm sp, {d0-d7}
+#endif
        stmdb   sp!, {ip,lr}
 
        /* See above.  */
-       UNWIND  .save {sp,lr}
+       UNWIND(.save {sp,lr})
        cfi_adjust_cfa_offset(8)
        cfi_rel_offset(lr, 4)
 
@@ -264,71 +338,151 @@ ARM_FUNC_START(ffi_closure_VFP, 1)
        @ Load values returned in registers.
        add     r2, sp, #8+64                   @ load result
        adr     r3, CNAME(ffi_closure_ret)
+#ifndef __thumb__
        add     pc, r3, r0, lsl #3
+#else
+       add     r3, r3, r0, lsl #3
+       mov     pc, r3
+#endif
        cfi_endproc
-       UNWIND  .fnend
+       UNWIND(.fnend)
 ARM_FUNC_END(ffi_closure_VFP)
 
 /* Load values returned in registers for both closure entry points.
    Note that we use LDM with SP in the register set.  This is deprecated
    by ARM, but not yet unpredictable.  */
 
-ARM_FUNC_START(ffi_closure_ret, 0)
+ARM_FUNC_START_LOCAL(ffi_closure_ret)
        cfi_startproc
        cfi_rel_offset(sp, 0)
        cfi_rel_offset(lr, 4)
 0:
-E ARM_TYPE_VFP_S
+E(ARM_TYPE_VFP_S)
+#ifdef __clang__
+       vldr s0, [r2]
+#else
        ldc     p10, cr0, [r2]                  @ vldr s0, [r2]
-       ldm     sp, {sp,pc}
-E ARM_TYPE_VFP_D
+#endif
+       b       call_epilogue
+E(ARM_TYPE_VFP_D)
+#ifdef __clang__
+       vldr d0, [r2]
+#else
        ldc     p11, cr0, [r2]                  @ vldr d0, [r2]
-       ldm     sp, {sp,pc}
-E ARM_TYPE_VFP_N
+#endif
+       b       call_epilogue
+E(ARM_TYPE_VFP_N)
+#ifdef __clang__
+       vldm r2, {d0-d3}
+#else
        ldc     p11, cr0, [r2], {8}             @ vldm r2, {d0-d3}
-       ldm     sp, {sp,pc}
-E ARM_TYPE_INT64
+#endif
+       b       call_epilogue
+E(ARM_TYPE_INT64)
        ldr     r1, [r2, #4]
        nop
-E ARM_TYPE_INT
+E(ARM_TYPE_INT)
        ldr     r0, [r2]
-       ldm     sp, {sp,pc}
-E ARM_TYPE_VOID
-       ldm     sp, {sp,pc}
+       b       call_epilogue
+E(ARM_TYPE_VOID)
+       b       call_epilogue
        nop
-E ARM_TYPE_STRUCT
+E(ARM_TYPE_STRUCT)
+       b       call_epilogue
+call_epilogue:
+#ifndef __thumb__
        ldm     sp, {sp,pc}
+#else
+       ldm     sp, {ip,lr}
+       mov     sp, ip
+       bx      lr
+#endif
        cfi_endproc
 ARM_FUNC_END(ffi_closure_ret)
 
-#if FFI_EXEC_TRAMPOLINE_TABLE
+#if defined(FFI_EXEC_STATIC_TRAMP)
+ARM_FUNC_START(ffi_closure_SYSV_alt)
+       /* See the comments above trampoline_code_table. */
+       ldr     ip, [sp, #4]                    /* Load closure in ip */
+       add     sp, sp, 8                       /* Restore the stack */
+       b       CNAME(ffi_closure_SYSV)
+ARM_FUNC_END(ffi_closure_SYSV_alt)
+
+ARM_FUNC_START(ffi_closure_VFP_alt)
+       /* See the comments above trampoline_code_table. */
+       ldr     ip, [sp, #4]                    /* Load closure in ip */
+       add     sp, sp, 8                       /* Restore the stack */
+       b       CNAME(ffi_closure_VFP)
+ARM_FUNC_END(ffi_closure_VFP_alt)
 
-/* ??? The iOS support should be updated.  The first insn used to
-   be STMFD, but that's been moved into ffi_closure_SYSV.  If the
-   writable page is put after this one we can make use of the
-   pc+8 feature of the architecture.  We can also reduce the size
-   of the thunk to 8 and pack more of these into the page.
+/*
+ * Below is the definition of the trampoline code table. Each element in
+ * the code table is a trampoline.
+ */
+/*
+ * The trampoline uses register ip (r12). It saves the original value of ip
+ * on the stack.
+ *
+ * The trampoline has two parameters - target code to jump to and data for
+ * the target code. The trampoline extracts the parameters from its parameter
+ * block (see tramp_table_map()). The trampoline saves the data address on
+ * the stack. Finally, it jumps to the target code.
+ *
+ * The target code can choose to:
+ *
+ * - restore the value of ip
+ * - load the data address in a register
+ * - restore the stack pointer to what it was when the trampoline was invoked.
+ */
+       .align  ARM_TRAMP_MAP_SHIFT
+ARM_FUNC_START(trampoline_code_table)
+       .rept   ARM_TRAMP_MAP_SIZE / ARM_TRAMP_SIZE
+       sub     sp, sp, #8              /* Make space on the stack */
+       str     ip, [sp]                /* Save ip on stack */
+       ldr     ip, [pc, #4080]         /* Copy data into ip */
+       str     ip, [sp, #4]            /* Save data on stack */
+       ldr     pc, [pc, #4076]         /* Copy code into PC */
+       .endr
+ARM_FUNC_END(trampoline_code_table)
+       .align  ARM_TRAMP_MAP_SHIFT
+#endif /* FFI_EXEC_STATIC_TRAMP */
+
+#endif /* FFI_CLOSURES */
+
+#if FFI_EXEC_TRAMPOLINE_TABLE
 
-   In the meantime, simply replace the STMFD with a NOP so as to
-   keep all the magic numbers the same within ffi.c.  */
+#ifdef __MACH__
+#include <mach/machine/vm_param.h>
 
-       .align  12
+.align PAGE_MAX_SHIFT
 ARM_FUNC_START(ffi_closure_trampoline_table_page)
-.rept  4096 / 12
-       nop
-       ldr     ip, [pc, #-4092]
-       ldr     pc, [pc, #-4092]
+.rept  PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE
+       adr ip, #-PAGE_MAX_SIZE   @ the config page is PAGE_MAX_SIZE behind the trampoline page
+       sub ip, #8                                @ account for pc bias
+       ldr     pc, [ip, #4]              @ jump to ffi_closure_SYSV or ffi_closure_VFP
 .endr
+ARM_FUNC_END(ffi_closure_trampoline_table_page)
+#endif
+
+#elif defined(_WIN32)
+
+ARM_FUNC_START(ffi_arm_trampoline)
+0:     adr     ip, 0b
+       stmdb   sp!, {r0, ip}
+       ldr     pc, 1f
+1:     .long   0
+ARM_FUNC_END(ffi_arm_trampoline)
 
 #else
 
-ARM_FUNC_START(ffi_arm_trampoline, 1)
+ARM_FUNC_START(ffi_arm_trampoline)
 0:     adr     ip, 0b
        ldr     pc, 1f
 1:     .long   0
 ARM_FUNC_END(ffi_arm_trampoline)
 
 #endif /* FFI_EXEC_TRAMPOLINE_TABLE */
+#endif /* __arm__ */
 
 #if defined __ELF__ && defined __linux__
        .section        .note.GNU-stack,"",%progbits
diff --git a/libffi/src/arm/sysv_msvc_arm32.S b/libffi/src/arm/sysv_msvc_arm32.S
new file mode 100644 (file)
index 0000000..5c99d02
--- /dev/null
@@ -0,0 +1,311 @@
+/* -----------------------------------------------------------------------
+   sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
+        Copyright (c) 2011 Plausible Labs Cooperative, Inc.
+        Copyright (c) 2019 Microsoft Corporation.
+
+   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
+   ``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.
+   ----------------------------------------------------------------------- */
+
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+#include <ffi_cfi.h>
+#include "internal.h"
+#include "ksarm.h"
+
+
+        ; 8 byte aligned AREA to support 8 byte aligned jump tables
+        MACRO
+        NESTED_ENTRY_FFI $FuncName, $AreaName, $ExceptHandler
+
+        ; compute the function's labels
+        __DeriveFunctionLabels $FuncName
+
+        ; determine the area we will put the function into
+__FuncArea   SETS    "|.text|"
+        IF "$AreaName" != ""
+__FuncArea   SETS    "$AreaName"
+        ENDIF
+
+        ; set up the exception handler itself
+__FuncExceptionHandler SETS ""
+        IF "$ExceptHandler" != ""
+__FuncExceptionHandler SETS    "|$ExceptHandler|"
+        ENDIF
+
+        ; switch to the specified area, jump tables require 8 byte alignment
+        AREA    $__FuncArea,CODE,CODEALIGN,ALIGN=3,READONLY
+
+        ; export the function name
+        __ExportProc $FuncName
+
+        ; flush any pending literal pool stuff
+        ROUT
+
+        ; reset the state of the unwind code tracking
+        __ResetUnwindState
+
+        MEND
+
+;        MACRO
+;        TABLE_ENTRY $Type, $Table
+;$Type_$Table
+;        MEND
+
+#define E(index,table) return_##index##_##table
+
+    ; r0:   stack
+    ; r1:   frame
+    ; r2:   fn
+    ; r3:   vfp_used
+
+    ; fake entry point exists only to generate exists only to 
+    ; generate .pdata for exception unwinding
+    NESTED_ENTRY_FFI ffi_call_VFP_fake
+    PROLOG_PUSH  {r11, lr}          ; save fp and lr for unwind
+
+    ALTERNATE_ENTRY ffi_call_VFP
+    cmp    r3, #3                   ; load only d0 if possible
+    vldrle d0, [r0]
+    vldmgt r0, {d0-d7}
+    add    r0, r0, #64              ; discard the vfp register args
+    b ffi_call_SYSV
+    NESTED_END ffi_call_VFP_fake
+
+    ; fake entry point exists only to generate exists only to 
+    ; generate .pdata for exception unwinding
+    NESTED_ENTRY_FFI ffi_call_SYSV_fake
+    PROLOG_PUSH  {r11, lr}          ; save fp and lr for unwind
+
+    ALTERNATE_ENTRY ffi_call_SYSV
+    stm    r1, {fp, lr}
+    mov    fp, r1
+
+    mov    sp, r0                   ; install the stack pointer
+    mov    lr, r2                   ; move the fn pointer out of the way
+    ldr    ip, [fp, #16]            ; install the static chain
+    ldmia  sp!, {r0-r3}             ; move first 4 parameters in registers.
+    blx    lr                       ; call fn
+
+    ; Load r2 with the pointer to storage for the return value
+    ; Load r3 with the return type code
+    ldr    r2, [fp, #8]
+    ldr    r3, [fp, #12]
+
+    ; Deallocate the stack with the arguments.
+    mov    sp, fp
+
+    ; Store values stored in registers.
+    ALIGN 8
+    lsl     r3, #3
+    add     r3, r3, pc
+    add     r3, #8
+    mov     pc, r3
+
+
+E(ARM_TYPE_VFP_S, ffi_call)
+    ALIGN 8
+    vstr s0, [r2]
+    pop    {fp,pc}
+E(ARM_TYPE_VFP_D, ffi_call)
+    ALIGN 8
+    vstr d0, [r2]
+    pop    {fp,pc}
+E(ARM_TYPE_VFP_N, ffi_call)
+    ALIGN 8
+    vstm r2, {d0-d3}
+    pop    {fp,pc}
+E(ARM_TYPE_INT64, ffi_call)
+    ALIGN 8
+    str    r1, [r2, #4]
+    nop
+E(ARM_TYPE_INT, ffi_call)
+    ALIGN 8
+    str    r0, [r2]
+    pop    {fp,pc}
+E(ARM_TYPE_VOID, ffi_call)
+    ALIGN 8
+    pop    {fp,pc}
+    nop
+E(ARM_TYPE_STRUCT, ffi_call)
+    ALIGN 8
+    cmp r3, #ARM_TYPE_STRUCT
+    pop    {fp,pc}
+    NESTED_END ffi_call_SYSV_fake
+
+    IMPORT |ffi_closure_inner_SYSV|
+    /*
+    int ffi_closure_inner_SYSV
+    (
+        cif,        ; r0
+        fun,        ; r1
+        user_data,  ; r2
+        frame       ; r3
+    )
+    */
+
+    NESTED_ENTRY_FFI ffi_go_closure_SYSV
+    stmdb   sp!, {r0-r3}            ; save argument regs
+    ldr     r0, [ip, #4]            ; load cif
+    ldr     r1, [ip, #8]            ; load fun
+    mov     r2, ip                  ; load user_data
+    b       ffi_go_closure_SYSV_0
+    NESTED_END ffi_go_closure_SYSV
+
+    ; r3:    ffi_closure
+
+    ; fake entry point exists only to generate exists only to 
+    ; generate .pdata for exception unwinding
+    NESTED_ENTRY_FFI ffi_closure_SYSV_fake  
+    PROLOG_PUSH  {r11, lr}          ; save fp and lr for unwind
+    ALTERNATE_ENTRY ffi_closure_SYSV
+    ldmfd   sp!, {ip,r0}            ; restore fp (r0 is used for stack alignment)
+    stmdb   sp!, {r0-r3}            ; save argument regs
+
+    ldr     r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET]    ; ffi_closure->cif
+    ldr     r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4]  ; ffi_closure->fun
+    ldr     r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8]  ; ffi_closure->user_data
+
+    ALTERNATE_ENTRY ffi_go_closure_SYSV_0
+    add     ip, sp, #16             ; compute entry sp
+
+    sub     sp, sp, #64+32          ; allocate frame parameter (sizeof(vfp_space) = 64, sizeof(result) = 32)
+    mov     r3, sp                  ; set frame parameter
+    stmdb   sp!, {ip,lr}
+
+    bl      ffi_closure_inner_SYSV  ; call the Python closure
+
+                                    ; Load values returned in registers.
+    add     r2, sp, #64+8           ; address of closure_frame->result
+    bl      ffi_closure_ret         ; move result to correct register or memory for type
+
+    ldmfd   sp!, {ip,lr}
+    mov     sp, ip                  ; restore stack pointer
+    mov     pc, lr
+    NESTED_END ffi_closure_SYSV_fake
+
+    IMPORT |ffi_closure_inner_VFP|
+    /*
+    int ffi_closure_inner_VFP
+    (
+        cif,        ; r0
+        fun,        ; r1
+        user_data,  ; r2
+        frame       ; r3
+    )
+    */
+
+    NESTED_ENTRY_FFI ffi_go_closure_VFP
+    stmdb   sp!, {r0-r3}                       ; save argument regs
+    ldr        r0, [ip, #4]                    ; load cif
+    ldr        r1, [ip, #8]                    ; load fun
+    mov        r2, ip                          ; load user_data
+    b  ffi_go_closure_VFP_0
+    NESTED_END ffi_go_closure_VFP
+
+    ; fake entry point exists only to generate exists only to 
+    ; generate .pdata for exception unwinding
+    ; r3:    closure
+    NESTED_ENTRY_FFI ffi_closure_VFP_fake
+    PROLOG_PUSH  {r11, lr}          ; save fp and lr for unwind
+
+    ALTERNATE_ENTRY ffi_closure_VFP
+    ldmfd   sp!, {ip,r0}            ; restore fp (r0 is used for stack alignment)
+    stmdb   sp!, {r0-r3}            ; save argument regs
+
+    ldr     r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET]    ; load cif
+    ldr     r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4]  ; load fun
+    ldr     r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8]  ; load user_data
+
+    ALTERNATE_ENTRY ffi_go_closure_VFP_0
+    add     ip, sp, #16             ; compute entry sp
+    sub     sp, sp, #32             ; save space for closure_frame->result
+    vstmdb  sp!, {d0-d7}            ; push closure_frame->vfp_space
+
+    mov     r3, sp                  ; save closure_frame
+    stmdb   sp!, {ip,lr}
+
+    bl      ffi_closure_inner_VFP
+
+    ; Load values returned in registers.
+    add     r2, sp, #64+8           ; load result
+    bl      ffi_closure_ret
+    ldmfd   sp!, {ip,lr}
+    mov     sp, ip                  ; restore stack pointer
+    mov     pc, lr
+    NESTED_END ffi_closure_VFP_fake
+
+/* Load values returned in registers for both closure entry points.
+   Note that we use LDM with SP in the register set.  This is deprecated
+   by ARM, but not yet unpredictable.  */
+
+    NESTED_ENTRY_FFI ffi_closure_ret
+    stmdb sp!, {fp,lr}
+
+    ALIGN 8
+    lsl     r0, #3
+    add     r0, r0, pc
+    add     r0, #8
+    mov     pc, r0
+
+E(ARM_TYPE_VFP_S, ffi_closure)
+    ALIGN 8
+    vldr s0, [r2]
+    b call_epilogue
+E(ARM_TYPE_VFP_D, ffi_closure)
+    ALIGN 8
+    vldr d0, [r2]
+    b call_epilogue
+E(ARM_TYPE_VFP_N, ffi_closure)
+    ALIGN 8
+    vldm r2, {d0-d3}
+    b call_epilogue
+E(ARM_TYPE_INT64, ffi_closure)
+    ALIGN 8
+    ldr    r1, [r2, #4]
+    nop
+E(ARM_TYPE_INT, ffi_closure)
+    ALIGN 8
+    ldr    r0, [r2]
+    b call_epilogue
+E(ARM_TYPE_VOID, ffi_closure)
+    ALIGN 8
+    b call_epilogue
+    nop
+E(ARM_TYPE_STRUCT, ffi_closure)
+    ALIGN 8
+    b call_epilogue
+call_epilogue
+    ldmfd sp!, {fp,pc}
+    NESTED_END ffi_closure_ret
+
+    AREA |.trampoline|, DATA, THUMB, READONLY
+    EXPORT |ffi_arm_trampoline|
+|ffi_arm_trampoline| DATA
+thisproc    adr    ip, thisproc
+            stmdb  sp!, {ip, r0}
+            ldr    pc, [pc, #0]
+            DCD    0
+            ;ENDP
+
+    END
\ No newline at end of file
index 721ff00ea43bce8decb67d9fef6a233d55ddd6ba..f7bead67b54ebc08f99d07505374693f34624916 100644 (file)
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   closures.c - Copyright (c) 2007, 2009, 2010  Red Hat, Inc.
+   closures.c - Copyright (c) 2019 Anthony Green
+                Copyright (c) 2007, 2009, 2010 Red Hat, Inc.
                 Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc
                 Copyright (c) 2011 Plausible Labs Cooperative, Inc.
 
 #define _GNU_SOURCE 1
 #endif
 
+#include <fficonfig.h>
 #include <ffi.h>
 #include <ffi_common.h>
+#include <tramp.h>
+
+#ifdef __NetBSD__
+#include <sys/param.h>
+#endif
+
+#if __NetBSD_Version__ - 0 >= 799007200
+/* NetBSD with PROT_MPROTECT */
+#include <sys/mman.h>
+
+#include <stddef.h>
+#include <unistd.h>
+#ifdef  HAVE_SYS_MEMFD_H
+#include <sys/memfd.h>
+#endif
+
+static const size_t overhead =
+  (sizeof(max_align_t) > sizeof(void *) + sizeof(size_t)) ?
+    sizeof(max_align_t)
+    : sizeof(void *) + sizeof(size_t);
+
+#define ADD_TO_POINTER(p, d) ((void *)((uintptr_t)(p) + (d)))
+
+void *
+ffi_closure_alloc (size_t size, void **code)
+{
+  static size_t page_size;
+  size_t rounded_size;
+  void *codeseg, *dataseg;
+  int prot;
+
+  /* Expect that PAX mprotect is active and a separate code mapping is necessary. */
+  if (!code)
+    return NULL;
+
+  /* Obtain system page size. */
+  if (!page_size)
+    page_size = sysconf(_SC_PAGESIZE);
+
+  /* Round allocation size up to the next page, keeping in mind the size field and pointer to code map. */
+  rounded_size = (size + overhead + page_size - 1) & ~(page_size - 1);
+
+  /* Primary mapping is RW, but request permission to switch to PROT_EXEC later. */
+  prot = PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC);
+  dataseg = mmap(NULL, rounded_size, prot, MAP_ANON | MAP_PRIVATE, -1, 0);
+  if (dataseg == MAP_FAILED)
+    return NULL;
+
+  /* Create secondary mapping and switch it to RX. */
+  codeseg = mremap(dataseg, rounded_size, NULL, rounded_size, MAP_REMAPDUP);
+  if (codeseg == MAP_FAILED) {
+    munmap(dataseg, rounded_size);
+    return NULL;
+  }
+  if (mprotect(codeseg, rounded_size, PROT_READ | PROT_EXEC) == -1) {
+    munmap(codeseg, rounded_size);
+    munmap(dataseg, rounded_size);
+    return NULL;
+  }
+
+  /* Remember allocation size and location of the secondary mapping for ffi_closure_free. */
+  memcpy(dataseg, &rounded_size, sizeof(rounded_size));
+  memcpy(ADD_TO_POINTER(dataseg, sizeof(size_t)), &codeseg, sizeof(void *));
+  *code = ADD_TO_POINTER(codeseg, overhead);
+  return ADD_TO_POINTER(dataseg, overhead);
+}
+
+void
+ffi_closure_free (void *ptr)
+{
+  void *codeseg, *dataseg;
+  size_t rounded_size;
+
+  dataseg = ADD_TO_POINTER(ptr, -overhead);
+  memcpy(&rounded_size, dataseg, sizeof(rounded_size));
+  memcpy(&codeseg, ADD_TO_POINTER(dataseg, sizeof(size_t)), sizeof(void *));
+  munmap(dataseg, rounded_size);
+  munmap(codeseg, rounded_size);
+}
+
+int
+ffi_tramp_is_present (__attribute__((unused)) void *ptr)
+{
+  return 0;
+}
+#else /* !NetBSD with PROT_MPROTECT */
 
 #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
+# if __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
 #  define FFI_MMAP_EXEC_WRIT 1
 #  define HAVE_MNTENT 1
 # endif
-# if defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)
+# if defined(_WIN32) || defined(__OS2__)
 /* Windows systems may have Data Execution Protection (DEP) enabled, 
    which requires the use of VirtualMalloc/VirtualFree to alloc/free
    executable memory. */
 #endif
 
 #if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX
-# ifdef __linux__
+# if defined(__linux__) && !defined(__ANDROID__)
 /* When defined to 1 check for SELinux and if SELinux is active,
    don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that
    might cause audit messages.  */
 
 #if FFI_CLOSURES
 
-# if FFI_EXEC_TRAMPOLINE_TABLE
+#if FFI_EXEC_TRAMPOLINE_TABLE
+
+#ifdef __MACH__
+
+#include <mach/mach.h>
+#include <pthread.h>
+#ifdef HAVE_PTRAUTH
+#include <ptrauth.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+extern void *ffi_closure_trampoline_table_page;
+
+typedef struct ffi_trampoline_table ffi_trampoline_table;
+typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
+
+struct ffi_trampoline_table
+{
+  /* contiguous writable and executable pages */
+  vm_address_t config_page;
+
+  /* free list tracking */
+  uint16_t free_count;
+  ffi_trampoline_table_entry *free_list;
+  ffi_trampoline_table_entry *free_list_pool;
+
+  ffi_trampoline_table *prev;
+  ffi_trampoline_table *next;
+};
+
+struct ffi_trampoline_table_entry
+{
+  void *(*trampoline) (void);
+  ffi_trampoline_table_entry *next;
+};
+
+/* Total number of trampolines that fit in one trampoline table */
+#define FFI_TRAMPOLINE_COUNT (PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE)
+
+static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER;
+static ffi_trampoline_table *ffi_trampoline_tables = NULL;
+
+static ffi_trampoline_table *
+ffi_trampoline_table_alloc (void)
+{
+  ffi_trampoline_table *table;
+  vm_address_t config_page;
+  vm_address_t trampoline_page;
+  vm_address_t trampoline_page_template;
+  vm_prot_t cur_prot;
+  vm_prot_t max_prot;
+  kern_return_t kt;
+  uint16_t i;
+
+  /* Allocate two pages -- a config page and a placeholder page */
+  config_page = 0x0;
+  kt = vm_allocate (mach_task_self (), &config_page, PAGE_MAX_SIZE * 2,
+                   VM_FLAGS_ANYWHERE);
+  if (kt != KERN_SUCCESS)
+    return NULL;
+
+  /* Remap the trampoline table on top of the placeholder page */
+  trampoline_page = config_page + PAGE_MAX_SIZE;
+
+#ifdef HAVE_PTRAUTH
+  trampoline_page_template = (vm_address_t)(uintptr_t)ptrauth_auth_data((void *)&ffi_closure_trampoline_table_page, ptrauth_key_function_pointer, 0);
+#else
+  trampoline_page_template = (vm_address_t)&ffi_closure_trampoline_table_page;
+#endif
+
+#ifdef __arm__
+  /* ffi_closure_trampoline_table_page can be thumb-biased on some ARM archs */
+  trampoline_page_template &= ~1UL;
+#endif
+  kt = vm_remap (mach_task_self (), &trampoline_page, PAGE_MAX_SIZE, 0x0,
+                VM_FLAGS_OVERWRITE, mach_task_self (), trampoline_page_template,
+                FALSE, &cur_prot, &max_prot, VM_INHERIT_SHARE);
+  if (kt != KERN_SUCCESS || !(cur_prot & VM_PROT_EXECUTE))
+    {
+      vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2);
+      return NULL;
+    }
+
+  /* We have valid trampoline and config pages */
+  table = calloc (1, sizeof (ffi_trampoline_table));
+  table->free_count = FFI_TRAMPOLINE_COUNT;
+  table->config_page = config_page;
+
+  /* Create and initialize the free list */
+  table->free_list_pool =
+    calloc (FFI_TRAMPOLINE_COUNT, sizeof (ffi_trampoline_table_entry));
+
+  for (i = 0; i < table->free_count; i++)
+    {
+      ffi_trampoline_table_entry *entry = &table->free_list_pool[i];
+      entry->trampoline =
+       (void *) (trampoline_page + (i * FFI_TRAMPOLINE_SIZE));
+#ifdef HAVE_PTRAUTH
+      entry->trampoline = ptrauth_sign_unauthenticated(entry->trampoline, ptrauth_key_function_pointer, 0);
+#endif
+
+      if (i < table->free_count - 1)
+       entry->next = &table->free_list_pool[i + 1];
+    }
+
+  table->free_list = table->free_list_pool;
+
+  return table;
+}
+
+static void
+ffi_trampoline_table_free (ffi_trampoline_table *table)
+{
+  /* Remove from the list */
+  if (table->prev != NULL)
+    table->prev->next = table->next;
+
+  if (table->next != NULL)
+    table->next->prev = table->prev;
+
+  /* Deallocate pages */
+  vm_deallocate (mach_task_self (), table->config_page, PAGE_MAX_SIZE * 2);
+
+  /* Deallocate free list */
+  free (table->free_list_pool);
+  free (table);
+}
+
+void *
+ffi_closure_alloc (size_t size, void **code)
+{
+  /* Create the closure */
+  ffi_closure *closure = malloc (size);
+  if (closure == NULL)
+    return NULL;
+
+  pthread_mutex_lock (&ffi_trampoline_lock);
+
+  /* Check for an active trampoline table with available entries. */
+  ffi_trampoline_table *table = ffi_trampoline_tables;
+  if (table == NULL || table->free_list == NULL)
+    {
+      table = ffi_trampoline_table_alloc ();
+      if (table == NULL)
+       {
+         pthread_mutex_unlock (&ffi_trampoline_lock);
+         free (closure);
+         return NULL;
+       }
+
+      /* Insert the new table at the top of the list */
+      table->next = ffi_trampoline_tables;
+      if (table->next != NULL)
+       table->next->prev = table;
+
+      ffi_trampoline_tables = table;
+    }
+
+  /* Claim the free entry */
+  ffi_trampoline_table_entry *entry = ffi_trampoline_tables->free_list;
+  ffi_trampoline_tables->free_list = entry->next;
+  ffi_trampoline_tables->free_count--;
+  entry->next = NULL;
+
+  pthread_mutex_unlock (&ffi_trampoline_lock);
+
+  /* Initialize the return values */
+  *code = entry->trampoline;
+  closure->trampoline_table = table;
+  closure->trampoline_table_entry = entry;
+
+  return closure;
+}
+
+void
+ffi_closure_free (void *ptr)
+{
+  ffi_closure *closure = ptr;
+
+  pthread_mutex_lock (&ffi_trampoline_lock);
+
+  /* Fetch the table and entry references */
+  ffi_trampoline_table *table = closure->trampoline_table;
+  ffi_trampoline_table_entry *entry = closure->trampoline_table_entry;
+
+  /* Return the entry to the free list */
+  entry->next = table->free_list;
+  table->free_list = entry;
+  table->free_count++;
+
+  /* If all trampolines within this table are free, and at least one other table exists, deallocate
+   * the table */
+  if (table->free_count == FFI_TRAMPOLINE_COUNT
+      && ffi_trampoline_tables != table)
+    {
+      ffi_trampoline_table_free (table);
+    }
+  else if (ffi_trampoline_tables != table)
+    {
+      /* Otherwise, bump this table to the top of the list */
+      table->prev = NULL;
+      table->next = ffi_trampoline_tables;
+      if (ffi_trampoline_tables != NULL)
+       ffi_trampoline_tables->prev = table;
+
+      ffi_trampoline_tables = table;
+    }
+
+  pthread_mutex_unlock (&ffi_trampoline_lock);
+
+  /* Free the closure */
+  free (closure);
+}
+
+#endif
 
 // Per-target implementation; It's unclear what can reasonable be shared between two OS/architecture implementations.
 
-# elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */
+#elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */
 
 #define USE_LOCKS 1
 #define USE_DL_PREFIX 1
 /* Don't allocate more than a page unless needed.  */
 #define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize)
 
-#if FFI_CLOSURE_TEST
-/* Don't release single pages, to avoid a worst-case scenario of
-   continuously allocating and releasing single pages, but release
-   pairs of pages, which should do just as well given that allocations
-   are likely to be small.  */
-#define DEFAULT_TRIM_THRESHOLD ((size_t)malloc_getpagesize)
-#endif
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #endif
 #include <string.h>
 #include <stdio.h>
-#if !defined(X86_WIN32) && !defined(X86_WIN64)
+#if !defined(_WIN32)
 #ifdef HAVE_MNTENT
 #include <mntent.h>
 #endif /* HAVE_MNTENT */
@@ -237,11 +532,11 @@ static int dlmalloc_trim(size_t) MAYBE_UNUSED;
 static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED;
 static void dlmalloc_stats(void) MAYBE_UNUSED;
 
-#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
+#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
 /* Use these for mmap and munmap within dlmalloc.c.  */
 static void *dlmmap(void *, size_t, int, int, int, off_t);
 static int dlmunmap(void *, size_t);
-#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
+#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
 
 #define mmap dlmmap
 #define munmap dlmunmap
@@ -251,7 +546,7 @@ static int dlmunmap(void *, size_t);
 #undef mmap
 #undef munmap
 
-#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
+#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
 
 /* A mutex used to synchronize access to *exec* variables in this file.  */
 static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -263,6 +558,17 @@ static int execfd = -1;
 /* The amount of space already allocated from the temporary file.  */
 static size_t execsize = 0;
 
+#ifdef HAVE_MEMFD_CREATE
+/* Open a temporary file name, and immediately unlink it.  */
+static int
+open_temp_exec_file_memfd (const char *name)
+{
+  int fd;
+  fd = memfd_create (name, MFD_CLOEXEC);
+  return fd;
+}
+#endif
+
 /* Open a temporary file name, and immediately unlink it.  */
 static int
 open_temp_exec_file_name (char *name, int flags)
@@ -308,7 +614,7 @@ open_temp_exec_file_dir (const char *dir)
   }
 #endif
 
-  lendir = strlen (dir);
+  lendir = (int) strlen (dir);
   tempname = __builtin_alloca (lendir + sizeof (suffix));
 
   if (!tempname)
@@ -390,6 +696,10 @@ static struct
   const char *arg;
   int repeat;
 } open_temp_exec_file_opts[] = {
+#ifdef HAVE_MEMFD_CREATE
+  { open_temp_exec_file_memfd, "libffi", 0 },
+#endif
+  { open_temp_exec_file_env, "LIBFFI_TMPDIR", 0 },
   { open_temp_exec_file_env, "TMPDIR", 0 },
   { open_temp_exec_file_dir, "/tmp", 0 },
   { open_temp_exec_file_dir, "/var/tmp", 0 },
@@ -449,6 +759,36 @@ open_temp_exec_file (void)
   return fd;
 }
 
+/* We need to allocate space in a file that will be backing a writable
+   mapping.  Several problems exist with the usual approaches:
+   - fallocate() is Linux-only
+   - posix_fallocate() is not available on all platforms
+   - ftruncate() does not allocate space on filesystems with sparse files
+   Failure to allocate the space will cause SIGBUS to be thrown when
+   the mapping is subsequently written to.  */
+static int
+allocate_space (int fd, off_t offset, off_t len)
+{
+  static size_t page_size;
+
+  /* Obtain system page size. */
+  if (!page_size)
+    page_size = sysconf(_SC_PAGESIZE);
+
+  unsigned char buf[page_size];
+  memset (buf, 0, page_size);
+
+  while (len > 0)
+    {
+      off_t to_write = (len < page_size) ? len : page_size;
+      if (write (fd, buf, to_write) < to_write)
+        return -1;
+      len -= to_write;
+    }
+
+  return 0;
+}
+
 /* Map in a chunk of memory from the temporary exec file into separate
    locations in the virtual memory address space, one writable and one
    executable.  Returns the address of the writable portion, after
@@ -470,7 +810,7 @@ dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
 
   offset = execsize;
 
-  if (ftruncate (execfd, offset + length))
+  if (allocate_space (execfd, offset, length))
     return MFAIL;
 
   flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS);
@@ -485,7 +825,13 @@ dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
          close (execfd);
          goto retry_open;
        }
-      ftruncate (execfd, offset);
+      if (ftruncate (execfd, offset) != 0)
+      {
+        /* Fixme : Error logs can be added here. Returning an error for
+         * ftruncte() will not add any advantage as it is being
+         * validating in the error case. */
+      }
+
       return MFAIL;
     }
   else if (!offset
@@ -497,7 +843,12 @@ dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
   if (start == MFAIL)
     {
       munmap (ptr, length);
-      ftruncate (execfd, offset);
+      if (ftruncate (execfd, offset) != 0)
+      {
+        /* Fixme : Error logs can be added here. Returning an error for
+         * ftruncte() will not add any advantage as it is being
+         * validating in the error case. */
+      }
       return start;
     }
 
@@ -521,9 +872,11 @@ dlmmap (void *start, size_t length, int prot,
          && flags == (MAP_PRIVATE | MAP_ANONYMOUS)
          && fd == -1 && offset == 0);
 
-#if FFI_CLOSURE_TEST
-  printf ("mapping in %zi\n", length);
-#endif
+  if (execfd == -1 && ffi_tramp_is_supported ())
+    {
+      ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset);
+      return ptr;
+    }
 
   if (execfd == -1 && is_emutramp_enabled ())
     {
@@ -570,10 +923,6 @@ dlmunmap (void *start, size_t length)
   msegmentptr seg = segment_holding (gm, start);
   void *code;
 
-#if FFI_CLOSURE_TEST
-  printf ("unmapping %zi\n", length);
-#endif
-
   if (seg && (code = add_segment_exec_offset (start, seg)) != start)
     {
       int ret = munmap (code, length);
@@ -600,7 +949,7 @@ segment_holding_code (mstate m, char* addr)
 }
 #endif
 
-#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
+#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
 
 /* Allocate a chunk of memory with the given size.  Returns a pointer
    to the writable address, and sets *CODE to the executable
@@ -608,23 +957,52 @@ segment_holding_code (mstate m, char* addr)
 void *
 ffi_closure_alloc (size_t size, void **code)
 {
-  void *ptr;
+  void *ptr, *ftramp;
 
   if (!code)
     return NULL;
 
-  ptr = dlmalloc (size);
+  ptr = FFI_CLOSURE_PTR (dlmalloc (size));
 
   if (ptr)
     {
       msegmentptr seg = segment_holding (gm, ptr);
 
       *code = add_segment_exec_offset (ptr, seg);
+      if (!ffi_tramp_is_supported ())
+        return ptr;
+
+      ftramp = ffi_tramp_alloc (0);
+      if (ftramp == NULL)
+      {
+        dlfree (FFI_RESTORE_PTR (ptr));
+        return NULL;
+      }
+      *code = ffi_tramp_get_addr (ftramp);
+      ((ffi_closure *) ptr)->ftramp = ftramp;
     }
 
   return ptr;
 }
 
+void *
+ffi_data_to_code_pointer (void *data)
+{
+  msegmentptr seg = segment_holding (gm, data);
+  /* We expect closures to be allocated with ffi_closure_alloc(), in
+     which case seg will be non-NULL.  However, some users take on the
+     burden of managing this memory themselves, in which case this
+     we'll just return data. */
+  if (seg)
+    {
+      if (!ffi_tramp_is_supported ())
+        return add_segment_exec_offset (data, seg);
+      return ffi_tramp_get_addr (((ffi_closure *) data)->ftramp);
+    }
+  else
+    return data;
+}
+
 /* Release a chunk of memory allocated with ffi_closure_alloc.  If
    FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the
    writable or the executable address given.  Otherwise, only the
@@ -638,30 +1016,19 @@ ffi_closure_free (void *ptr)
   if (seg)
     ptr = sub_segment_exec_offset (ptr, seg);
 #endif
+  if (ffi_tramp_is_supported ())
+    ffi_tramp_free (((ffi_closure *) ptr)->ftramp);
 
-  dlfree (ptr);
+  dlfree (FFI_RESTORE_PTR (ptr));
 }
 
-
-#if FFI_CLOSURE_TEST
-/* Do some internal sanity testing to make sure allocation and
-   deallocation of pages are working as intended.  */
-int main ()
-{
-  void *p[3];
-#define GET(idx, len) do { p[idx] = dlmalloc (len); printf ("allocated %zi for p[%i]\n", (len), (idx)); } while (0)
-#define PUT(idx) do { printf ("freeing p[%i]\n", (idx)); dlfree (p[idx]); } while (0)
-  GET (0, malloc_getpagesize / 2);
-  GET (1, 2 * malloc_getpagesize - 64 * sizeof (void*));
-  PUT (1);
-  GET (1, 2 * malloc_getpagesize);
-  GET (2, malloc_getpagesize / 2);
-  PUT (1);
-  PUT (0);
-  PUT (2);
-  return 0;
+int
+ffi_tramp_is_present (void *ptr)
+{
+  msegmentptr seg = segment_holding (gm, ptr);
+  return seg != NULL && ffi_tramp_is_supported();
 }
-#endif /* FFI_CLOSURE_TEST */
+
 # else /* ! FFI_MMAP_EXEC_WRIT */
 
 /* On many systems, memory returned by malloc is writable and
@@ -675,14 +1042,28 @@ ffi_closure_alloc (size_t size, void **code)
   if (!code)
     return NULL;
 
-  return *code = malloc (size);
+  return *code = FFI_CLOSURE_PTR (malloc (size));
 }
 
 void
 ffi_closure_free (void *ptr)
 {
-  free (ptr);
+  free (FFI_RESTORE_PTR (ptr));
+}
+
+void *
+ffi_data_to_code_pointer (void *data)
+{
+  return data;
+}
+
+int
+ffi_tramp_is_present (__attribute__((unused)) void *ptr)
+{
+  return 0;
 }
 
 # endif /* ! FFI_MMAP_EXEC_WRIT */
 #endif /* FFI_CLOSURES */
+
+#endif /* NetBSD with PROT_MPROTECT */
index aaca5b1cbaa4d17732a0b3d8c8b612d8be9e1f64..9011fdec03a877521536ac8c2a64d0afe60d0816 100644 (file)
@@ -29,7 +29,7 @@
 #include <ffi.h>
 #include <ffi_common.h>
 
-#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
+#define STACK_ARG_SIZE(x) FFI_ALIGN(x, FFI_SIZEOF_ARG)
 
 static ffi_status
 initialize_aggregate_packed_struct (ffi_type * arg)
@@ -190,7 +190,7 @@ ffi_prep_cif_core (ffi_cif * cif,
       FFI_ASSERT_VALID_TYPE (*ptr);
 
       if (((*ptr)->alignment - 1) & bytes)
-       bytes = ALIGN (bytes, (*ptr)->alignment);
+       bytes = FFI_ALIGN (bytes, (*ptr)->alignment);
       if ((*ptr)->type == FFI_TYPE_STRUCT)
        {
          if ((*ptr)->size > 8)
diff --git a/libffi/src/csky/ffi.c b/libffi/src/csky/ffi.c
new file mode 100644 (file)
index 0000000..af50b7c
--- /dev/null
@@ -0,0 +1,395 @@
+/* -----------------------------------------------------------------------
+   ffi.c
+
+   CSKY 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 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>
+
+/* 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)
+{
+ 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;
+  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;
+  size_t alignment;
+
+  /* Align if necessary */
+  alignment = (*p_arg)->alignment;
+#ifdef __CSKYABIV1__
+  /*
+   * Adapt ABIV1 bug.
+   * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes.
+   */
+  if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) {
+   alignment = 4;
+  }
+#endif
+
+  if ((alignment - 1) & (unsigned) argp) {
+   argp = (char *) FFI_ALIGN(argp, alignment);
+  }
+
+  if ((*p_arg)->type == FFI_TYPE_STRUCT)
+   argp = (char *) FFI_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:
+#ifdef __CSKYBE__
+    memcpy((argp + 4 - (*p_arg)->size), *p_argv, (*p_arg)->size);
+#else
+    memcpy(argp, *p_argv, (*p_arg)->size);
+#endif
+    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;
+ }
+
+ return;
+}
+
+/* Perform machine dependent cif processing */
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+{
+  /* Round the stack up to a multiple of 8 bytes.  This isn't needed
+     everywhere, but it is on some platforms, and it doesn't hcsky anything
+     when it isn't needed.  */
+  cif->bytes = (cif->bytes + 7) & ~7;
+
+  /* Set the return type flag */
+  switch (cif->rtype->type)
+    {
+
+    case FFI_TYPE_DOUBLE:
+    case FFI_TYPE_SINT64:
+    case FFI_TYPE_UINT64:
+      cif->flags = (unsigned) FFI_TYPE_SINT64;
+      break;
+
+    case FFI_TYPE_STRUCT:
+      if (cif->rtype->size <= 4)
+ /* A Composite Type not larger than 4 bytes is returned in r0.  */
+ cif->flags = (unsigned)FFI_TYPE_INT;
+      else if (cif->rtype->size <= 8)
+ /* A Composite Type not larger than 8 bytes is returned in r0, r1.  */
+ cif->flags = (unsigned)FFI_TYPE_SINT64;
+      else
+ /* A Composite Type larger than 8 bytes, or whose size cannot
+    be determined statically ... is stored in memory at an
+    address passed [in r0].  */
+ cif->flags = (unsigned)FFI_TYPE_STRUCT;
+      break;
+
+    default:
+      cif->flags = FFI_TYPE_INT;
+      break;
+    }
+
+  return FFI_OK;
+}
+
+/* Perform machine dependent cif processing for variadic calls */
+ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
+        unsigned int nfixedargs,
+        unsigned int ntotalargs)
+{
+  return ffi_prep_cif_machdep(cif);
+}
+
+/* Prototypes for assembly functions, in sysv.S */
+extern void ffi_call_SYSV (void (*fn)(void), extended_cif *, unsigned, unsigned, unsigned *);
+
+void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+{
+  extended_cif ecif;
+
+  int small_struct = (cif->flags == FFI_TYPE_INT
+        && cif->rtype->type == FFI_TYPE_STRUCT);
+
+  ecif.cif = cif;
+  ecif.avalue = avalue;
+
+  unsigned int temp;
+
+  /* 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->flags == FFI_TYPE_STRUCT))
+    {
+      ecif.rvalue = alloca(cif->rtype->size);
+    }
+  else if (small_struct)
+    ecif.rvalue = &temp;
+  else
+    ecif.rvalue = rvalue;
+
+  switch (cif->abi)
+    {
+    case FFI_SYSV:
+      ffi_call_SYSV (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue);
+      break;
+
+    default:
+      FFI_ASSERT(0);
+      break;
+    }
+  if (small_struct)
+#ifdef __CSKYBE__
+    memcpy (rvalue, ((unsigned char *)&temp + (4 - cif->rtype->size)), cif->rtype->size);
+#else
+    memcpy (rvalue, &temp, cif->rtype->size);
+#endif
+}
+
+/** private members **/
+
+static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
+      void** args, ffi_cif* cif);
+
+void ffi_closure_SYSV (ffi_closure *);
+
+/* This function is jumped to by the trampoline */
+
+unsigned int
+ffi_closure_SYSV_inner (closure, respp, args)
+     ffi_closure *closure;
+     void **respp;
+     void *args;
+{
+  // our various things...
+  ffi_cif       *cif;
+  void         **arg_area;
+
+  cif         = closure->cif;
+  arg_area    = (void**) alloca (cif->nargs * sizeof (void*));
+
+  /* this call will initialize ARG_AREA, such that each
+   * element in that array points to the corresponding
+   * 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);
+
+  (closure->fun) (cif, *respp, arg_area, closure->user_data);
+
+#ifdef __CSKYBE__
+  if (cif->flags == FFI_TYPE_INT && cif->rtype->type == FFI_TYPE_STRUCT) {
+      unsigned int tmp = 0;
+      tmp = *(unsigned int *)(*respp);
+      *(unsigned int *)(*respp) = (tmp >> ((4 - cif->rtype->size) * 8));
+  }
+#endif
+
+  return cif->flags;
+}
+
+
+static void
+ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
+       void **avalue, ffi_cif *cif)
+{
+  register unsigned int i;
+  register void **p_argv;
+  register char *argp;
+  register ffi_type **p_arg;
+
+  argp = stack;
+
+  if ( cif->flags == FFI_TYPE_STRUCT ) {
+    *rvalue = *(void **) argp;
+    argp += 4;
+  }
+
+  p_argv = avalue;
+
+  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
+    {
+      size_t z;
+      size_t alignment;
+
+      alignment = (*p_arg)->alignment;
+      if (alignment < 4)
+ alignment = 4;
+
+#ifdef __CSKYABIV1__
+      /*
+       * Adapt ABIV1 bug.
+       * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes.
+       */
+      if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) {
+        alignment = 4;
+      }
+#endif
+
+      /* Align if necessary */
+      if ((alignment - 1) & (unsigned) argp) {
+ argp = (char *) FFI_ALIGN(argp, alignment);
+      }
+
+      z = (*p_arg)->size;
+
+#ifdef __CSKYBE__
+      unsigned int tmp = 0;
+      if ((*p_arg)->size < 4) {
+        tmp = *(unsigned int *)argp;
+        memcpy(argp, ((unsigned char *)&tmp + (4 - (*p_arg)->size)), (*p_arg)->size);
+      }
+#else
+      /* because we're little endian, this is what it turns into.   */
+#endif
+      *p_argv = (void*) argp;
+
+      p_argv++;
+      argp += z;
+    }
+
+  return;
+}
+
+/* How to make a trampoline.  */
+
+extern unsigned char ffi_csky_trampoline[TRAMPOLINE_SIZE];
+
+/*
+ * Since there is no __clear_cache in libgcc in csky toolchain.
+ * define ffi_csky_cacheflush in sysv.S.
+ * void ffi_csky_cacheflush(uint32 start_addr, uint32 size, int cache)
+ */
+#define CACHEFLUSH_IN_FFI 1
+#if CACHEFLUSH_IN_FFI
+extern void ffi_csky_cacheflush(unsigned char *__tramp, unsigned int k,
+  int i);
+#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX)                              \
+({ unsigned char *__tramp = (unsigned char*)(TRAMP);                    \
+   unsigned int  __fun = (unsigned int)(FUN);                           \
+   unsigned int  __ctx = (unsigned int)(CTX);                           \
+   unsigned char *insns = (unsigned char *)(CTX);                       \
+   memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE);              \
+   *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx;                  \
+   *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun;              \
+   ffi_csky_cacheflush(&__tramp[0], TRAMPOLINE_SIZE, 3); /* Clear data mapping.  */ \
+   ffi_csky_cacheflush(insns, TRAMPOLINE_SIZE, 3);                       \
+                                                 /* Clear instruction   \
+                                                    mapping.  */        \
+ })
+#else
+#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX)                              \
+({ unsigned char *__tramp = (unsigned char*)(TRAMP);                    \
+   unsigned int  __fun = (unsigned int)(FUN);                           \
+   unsigned int  __ctx = (unsigned int)(CTX);                           \
+   unsigned char *insns = (unsigned char *)(CTX);                       \
+   memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE);              \
+   *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx;                  \
+   *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun;              \
+   __clear_cache((&__tramp[0]), (&__tramp[TRAMPOLINE_SIZE-1])); /* Clear data mapping.  */ \
+   __clear_cache(insns, insns + TRAMPOLINE_SIZE);                       \
+                                                 /* Clear instruction   \
+                                                    mapping.  */        \
+ })
+#endif
+
+/* the cif must already be prep'ed */
+
+ffi_status
+ffi_prep_closure_loc (ffi_closure* closure,
+        ffi_cif* cif,
+        void (*fun)(ffi_cif*,void*,void**,void*),
+        void *user_data,
+        void *codeloc)
+{
+  void (*closure_func)(ffi_closure*) = NULL;
+
+  if (cif->abi == FFI_SYSV)
+    closure_func = &ffi_closure_SYSV;
+  else
+    return FFI_BAD_ABI;
+
+  FFI_INIT_TRAMPOLINE (&closure->tramp[0], \
+         closure_func,  \
+         codeloc);
+
+  closure->cif  = cif;
+  closure->user_data = user_data;
+  closure->fun  = fun;
+
+  return FFI_OK;
+}
+
+
diff --git a/libffi/src/csky/ffitarget.h b/libffi/src/csky/ffitarget.h
new file mode 100644 (file)
index 0000000..f770aac
--- /dev/null
@@ -0,0 +1,63 @@
+/* -----------------------------------------------------------------*-C-*-
+   ffitarget.h - Copyright (c) 2012  Anthony Green
+                 Copyright (c) 2010  CodeSourcery
+                 Copyright (c) 1996-2003  Red Hat, Inc.
+
+   Target configuration macros for CSKY.
+
+   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
+
+#ifdef __CSKYABIV2__
+#define FFI_ASM_ARGREG_SIZE 16
+#define TRAMPOLINE_SIZE 16
+#define FFI_TRAMPOLINE_SIZE 24
+#else
+#define FFI_ASM_ARGREG_SIZE 24
+#define TRAMPOLINE_SIZE 20
+#define FFI_TRAMPOLINE_SIZE 28
+#endif
+
+/* ---- Definitions for closures ----------------------------------------- */
+
+#define FFI_CLOSURES 1
+#define FFI_NATIVE_RAW_API 0
+#endif
diff --git a/libffi/src/csky/sysv.S b/libffi/src/csky/sysv.S
new file mode 100644 (file)
index 0000000..21670bf
--- /dev/null
@@ -0,0 +1,371 @@
+/* -----------------------------------------------------------------------
+   sysv.S
+
+   CSKY 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 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.
+   ----------------------------------------------------------------------- */
+
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+
+.macro CSKY_FUNC_START name
+ .text
+ .align 2
+ .globl \name
+ .type \name, @function
+ \name:
+.endm
+
+#ifdef __CSKYABIV2__
+
+ /*
+  * a0:   fn
+  * a1:   &ecif
+  * a2:   cif->bytes
+  * a3:   fig->flags
+  * sp+0: ecif.rvalue
+  */
+CSKY_FUNC_START ffi_call_SYSV
+ /* Save registers */
+ .cfi_startproc
+ subi sp, 28
+ .cfi_def_cfa_offset 28
+ stw a0, (sp, 0x0)
+ .cfi_offset 0, -28
+ stw a1, (sp, 0x4)
+ .cfi_offset 1, -24
+ stw a2, (sp, 0x8)
+ .cfi_offset 2, -20
+ stw a3, (sp, 0xC)
+ .cfi_offset 3, -16
+ stw l0, (sp, 0x10)
+ .cfi_offset 4, -12
+ stw l1, (sp, 0x14)
+ .cfi_offset 5, -8
+ stw lr, (sp, 0x18)
+ .cfi_offset 15, -4
+
+ mov l0, sp
+ .cfi_def_cfa_register 4
+
+ /* Make room for all of the new args. */
+ subu sp, sp, a2
+
+ /* Place all of the ffi_prep_args in position */
+ mov a0, sp
+ /*     a1 already set */
+
+ /* Call ffi_prep_args(stack, &ecif) */
+ jsri ffi_prep_args
+
+ /* move first 4 parameters in registers */
+ ldw a0, (sp, 0x0)
+ ldw a1, (sp, 0x4)
+ ldw a2, (sp, 0x8)
+ ldw a3, (sp, 0xC)
+
+ /* and adjust stack */
+ subu lr, l0, sp /* cif->bytes == l0 - sp */
+ cmphsi lr, 16
+ movi l1, 16
+ movt lr, l1
+ addu sp, sp, lr
+
+ ldw l1, (l0, 0) /* load fn() in advance */
+
+ /* call (fn) (...) */
+ jsr l1
+
+ /* Remove the space we pushed for the args */
+ mov sp, l0
+
+ /* Load r2 with the pointer to storage for the return value */
+ ldw a2, (sp, 0x1C)
+
+ /* Load r3 with the return type code */
+ ldw a3, (sp, 0xC)
+
+ /* If the return value pointer is NULL, assume no return value. */
+ cmpnei a2, 0
+ bf .Lepilogue
+
+ cmpnei a3, FFI_TYPE_STRUCT
+ bf .Lepilogue
+
+ /* return INT64 */
+ cmpnei a3, FFI_TYPE_SINT64
+ bt .Lretint
+ /* stw a0, (a2, 0x0) at .Lretint */
+ stw a1, (a2, 0x4)
+
+.Lretint:
+ /* return INT */
+ stw a0, (a2, 0x0)
+
+.Lepilogue:
+ ldw a0, (sp, 0x0)
+ ldw a1, (sp, 0x4)
+ ldw a2, (sp, 0x8)
+ ldw a3, (sp, 0xC)
+ ldw l0, (sp, 0x10)
+ ldw l1, (sp, 0x14)
+ ldw lr, (sp, 0x18)
+ addi sp, sp, 28
+ rts
+ .cfi_endproc
+        .size    ffi_call_SYSV, .-ffi_call_SYSV
+
+
+ /*
+  * unsigned int FFI_HIDDEN
+  * ffi_closure_SYSV_inner (closure, respp, args)
+  *      ffi_closure *closure;
+  *      void **respp;
+  *      void *args;
+  */
+CSKY_FUNC_START ffi_closure_SYSV
+ .cfi_startproc
+ mov a2, sp
+ addi a1, sp, 16
+ subi sp, sp, 24
+ .cfi_def_cfa_offset 40
+ stw a1, (sp, 0x10)
+ .cfi_offset 1, -24
+ stw lr, (sp, 0x14)
+ .cfi_offset 15, -20
+ stw sp, (sp, 0x8)
+ addi a1, sp, 8
+ jsri ffi_closure_SYSV_inner
+ ldw a0, (sp, 0x0)
+ /*
+  * if FFI_TYPE_SINT64, need a1.
+  * if FFI_TYPE_INT, ignore a1.
+  */
+ ldw a1, (sp, 0x4)
+
+ ldw lr, (sp, 0x14)
+ addi sp, sp, 40
+ rts
+ .cfi_endproc
+        .size    ffi_closure_SYSV, .-ffi_closure_SYSV
+
+CSKY_FUNC_START ffi_csky_trampoline
+ subi sp, sp, 16
+ stw a0, (sp, 0x0)
+ stw a1, (sp, 0x4)
+ stw a2, (sp, 0x8)
+ stw a3, (sp, 0xC)
+ lrw a0, [.Lctx]
+ lrw a1, [.Lfun]
+ jmp a1
+.Lctx:
+ mov a0, a0
+ mov a0, a0
+.Lfun:
+
+        .size    ffi_csky_trampoline, .-ffi_csky_trampoline
+
+CSKY_FUNC_START ffi_csky_cacheflush
+ mov t0, r7
+ movi r7, 123
+ trap 0
+ mov r7, t0
+ rts
+
+        .size    ffi_csky_cacheflush, .-ffi_csky_cacheflush
+
+#else /* !__CSKYABIV2__ */
+
+ /*
+  * a0:   fn
+  * a1:   &ecif
+  * a2:   cif->bytes
+  * a3:   fig->flags
+  * a4:   ecif.rvalue
+  */
+CSKY_FUNC_START ffi_call_SYSV
+ /* Save registers */
+ .cfi_startproc
+ subi sp, 32
+ subi sp, 8
+ .cfi_def_cfa_offset 40
+ stw a0, (sp, 0x0)
+ .cfi_offset 2, -40
+ stw a1, (sp, 0x4)
+ .cfi_offset 3, -36
+ stw a2, (sp, 0x8)
+ .cfi_offset 4, -32
+ stw a3, (sp, 0xC)
+ .cfi_offset 5, -28
+ stw a4, (sp, 0x10)
+ .cfi_offset 6, -24
+ stw a5, (sp, 0x14)
+ .cfi_offset 7, -20
+ stw l0, (sp, 0x18)
+ .cfi_offset 8, -16
+ stw l1, (sp, 0x1C)
+ .cfi_offset 9, -12
+ stw lr, (sp, 0x20)
+ .cfi_offset 15, -8
+
+ mov l0, sp
+ .cfi_def_cfa_register 8
+
+ /* Make room for all of the new args. */
+ subu sp, sp, a2
+
+ /* Place all of the ffi_prep_args in position */
+ mov a0, sp
+ /*     a1 already set */
+
+ /* Call ffi_prep_args(stack, &ecif) */
+ jsri ffi_prep_args
+
+ /* move first 4 parameters in registers */
+ ldw a0, (sp, 0x0)
+ ldw a1, (sp, 0x4)
+ ldw a2, (sp, 0x8)
+ ldw a3, (sp, 0xC)
+ ldw a4, (sp, 0x10)
+ ldw a5, (sp, 0x14)
+
+ /* and adjust stack */
+ mov lr, l0
+ subu lr, sp  /* cif->bytes == l0 - sp */
+ movi l1, 24
+ cmphs lr, l1
+ movt lr, l1
+ addu sp, sp, lr
+
+ ldw l1, (l0, 0) /* load fn() in advance */
+
+ /* call (fn) (...) */
+ jsr l1
+
+ /* Remove the space we pushed for the args */
+ mov sp, l0
+
+ /* Load r2 with the pointer to storage for the return value */
+ ldw a2, (sp, 0x10)
+
+ /* Load r3 with the return type code */
+ ldw a3, (sp, 0xC)
+
+ /* If the return value pointer is NULL, assume no return value. */
+ cmpnei a2, 0
+ bf .Lepilogue
+
+ cmpnei a3, FFI_TYPE_STRUCT
+ bf .Lepilogue
+
+ /* return INT64 */
+ cmpnei a3, FFI_TYPE_SINT64
+ bt .Lretint
+ /* stw a0, (a2, 0x0) at .Lretint */
+ stw a1, (a2, 0x4)
+
+.Lretint:
+ /* return INT */
+ stw a0, (a2, 0x0)
+
+.Lepilogue:
+ ldw a0, (sp, 0x0)
+ ldw a1, (sp, 0x4)
+ ldw a2, (sp, 0x8)
+ ldw a3, (sp, 0xC)
+ ldw a4, (sp, 0x10)
+ ldw a5, (sp, 0x14)
+ ldw l0, (sp, 0x18)
+ ldw l1, (sp, 0x1C)
+ ldw lr, (sp, 0x20)
+ addi sp, sp, 32
+ addi sp, sp, 8
+ rts
+ .cfi_endproc
+
+        .size    ffi_call_SYSV, .-ffi_call_SYSV
+
+
+ /*
+  * unsigned int FFI_HIDDEN
+  * ffi_closure_SYSV_inner (closure, respp, args)
+  *      ffi_closure *closure;
+  *      void **respp;
+  *      void *args;
+  */
+CSKY_FUNC_START ffi_closure_SYSV
+ .cfi_startproc
+ mov a2, sp
+ mov a1, sp
+ addi a1, 24
+ subi sp, sp, 24
+ .cfi_def_cfa_offset 48
+ stw a1, (sp, 0x10)
+ .cfi_offset 3, -32
+ stw lr, (sp, 0x14)
+ .cfi_offset 15, -28
+ stw sp, (sp, 0x8)
+ mov a1, sp
+ addi a1, 8
+ jsri ffi_closure_SYSV_inner
+ ldw a0, (sp, 0x0)
+ /*
+  * if FFI_TYPE_SINT64, need a1.
+  * if FFI_TYPE_INT, ignore a1.
+  */
+ ldw a1, (sp, 0x4)
+
+ ldw lr, (sp, 0x14)
+ addi sp, sp, 24
+ addi sp, sp, 24
+ rts
+ .cfi_endproc
+
+        .size    ffi_closure_SYSV, .-ffi_closure_SYSV
+
+CSKY_FUNC_START ffi_csky_trampoline
+ subi sp, 24
+ stw a0, (sp, 0x0)
+ stw a1, (sp, 0x4)
+ stw a2, (sp, 0x8)
+ stw a3, (sp, 0xC)
+ stw a4, (sp, 0x10)
+ stw a5, (sp, 0x14)
+ lrw a0, [.Lctx]
+ lrw a1, [.Lfun]
+ jmp a1
+.Lctx:
+ mov a0, a0
+ mov a0, a0
+.Lfun:
+
+        .size    ffi_csky_trampoline, .-ffi_csky_trampoline
+
+CSKY_FUNC_START ffi_csky_cacheflush
+ lrw r1, 123
+ trap 0
+ rts
+
+        .size    ffi_csky_cacheflush, .-ffi_csky_cacheflush
+
+#endif /* __CSKYABIV2__ */
index 7e4ea83b7d2beac958d49311bc8ff9e05fa64684..1aba657edb51fb8d067985d3a8e707b5cf4adb5c 100644 (file)
@@ -438,6 +438,11 @@ DEFAULT_MMAP_THRESHOLD       default: 256K
 
 */
 
+#if defined __linux__ && !defined _GNU_SOURCE
+/* mremap() on Linux requires this via sys/mman.h */
+#define _GNU_SOURCE 1
+#endif
+
 #ifndef WIN32
 #ifdef _WIN32
 #define WIN32 1
@@ -2366,7 +2371,7 @@ static size_t traverse_and_check(mstate m);
 
 #else /* GNUC */
 #if  USE_BUILTIN_FFS
-#define compute_bit2idx(X, I) I = ffs(X)-1
+#define compute_bit2idx(X, I) I = __builtin_ffs(X)-1
 
 #else /* USE_BUILTIN_FFS */
 #define compute_bit2idx(X, I)\
index 5698c89c351f8b9bfc013d34e9b49ad3ef703f69..ed1c65a1a362b09a8b60af72d0230c04d9afa4eb 100644 (file)
@@ -107,7 +107,7 @@ void *ffi_prep_args(char *stack, extended_cif *ecif)
       count += z;
     }
 
-  return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
+  return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8)));
 }
 
 /* Perform machine dependent cif processing */
@@ -118,7 +118,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   else
     cif->flags = cif->rtype->size;
 
-  cif->bytes = ALIGN (cif->bytes, 8);
+  cif->bytes = FFI_ALIGN (cif->bytes, 8);
 
   return FFI_OK;
 }
index b77a836ddcf7d9c16bbb3bc386d78536a32f973e..b1d04c3e749b0c6111f32207fad873b64c347a9b 100644 (file)
@@ -220,8 +220,8 @@ hfa_element_type (ffi_type *type, int nested)
 
 /* Perform machine dependent cif processing. */
 
-ffi_status
-ffi_prep_cif_machdep(ffi_cif *cif)
+static ffi_status
+ffi_prep_cif_machdep_core(ffi_cif *cif)
 {
   int flags;
 
@@ -271,6 +271,22 @@ ffi_prep_cif_machdep(ffi_cif *cif)
   return FFI_OK;
 }
 
+ffi_status
+ffi_prep_cif_machdep(ffi_cif *cif)
+{
+  cif->nfixedargs = cif->nargs;
+  return ffi_prep_cif_machdep_core(cif);
+}
+
+ffi_status
+ffi_prep_cif_machdep_var(ffi_cif *cif,
+                        unsigned int nfixedargs,
+                        unsigned int ntotalargs MAYBE_UNUSED)
+{
+  cif->nfixedargs = nfixedargs;
+  return ffi_prep_cif_machdep_core(cif);
+}
+
 extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(void), UINT64);
 
 void
@@ -454,10 +470,11 @@ ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack,
   ffi_cif *cif;
   void **avalue;
   ffi_type **p_arg;
-  long i, avn, gpcount, fpcount;
+  long i, avn, gpcount, fpcount, nfixedargs;
 
   cif = closure->cif;
   avn = cif->nargs;
+  nfixedargs = cif->nfixedargs;
   avalue = alloca (avn * sizeof (void *));
 
   /* If the structure return value is passed in memory get that location
@@ -468,6 +485,7 @@ ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack,
   gpcount = fpcount = 0;
   for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
     {
+      int named = i < nfixedargs;
       switch ((*p_arg)->type)
        {
        case FFI_TYPE_SINT8:
@@ -491,7 +509,7 @@ ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack,
          break;
 
        case FFI_TYPE_FLOAT:
-         if (gpcount < 8 && fpcount < 8)
+         if (named && gpcount < 8 && fpcount < 8)
            {
              fpreg *addr = &stack->fp_regs[fpcount++];
              float result;
@@ -505,7 +523,7 @@ ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack,
          break;
 
        case FFI_TYPE_DOUBLE:
-         if (gpcount < 8 && fpcount < 8)
+         if (named && gpcount < 8 && fpcount < 8)
            {
              fpreg *addr = &stack->fp_regs[fpcount++];
              double result;
@@ -521,7 +539,7 @@ ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack,
        case FFI_TYPE_LONGDOUBLE:
          if (gpcount & 1)
            gpcount++;
-         if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8)
+         if (LDBL_MANT_DIG == 64 && named && gpcount < 8 && fpcount < 8)
            {
              fpreg *addr = &stack->fp_regs[fpcount++];
              __float80 result;
index e68cea61544c55b819b1b9cc483159ee8244c1b1..fd5b9a0ee1c7c90d77042dafd4c73c08a1a93b65 100644 (file)
@@ -50,6 +50,7 @@ typedef enum ffi_abi {
 #define FFI_TRAMPOLINE_SIZE 24  /* Really the following struct, which  */
                                /* can be interpreted as a C function   */
                                /* descriptor:                          */
+#define FFI_TARGET_SPECIFIC_VARIADIC 1
+#define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs
 
 #endif
-
index 4d2a86d421f3a0ef8153684f6c665f8854271fbb..e2547e02b3aa1c173bdbc80fc8ef78c00194c34f 100644 (file)
@@ -175,7 +175,6 @@ ffi_call_unix:
        ;;
 
 .Lst_small_struct:
-       add     sp = -16, sp
        cmp.lt  p6, p0 = 8, in3
        cmp.lt  p7, p0 = 16, in3
        cmp.lt  p8, p0 = 24, in3
@@ -191,6 +190,12 @@ ffi_call_unix:
 (p8)   st8     [r18] = r11
        mov     out1 = sp
        mov     out2 = in3
+       ;;
+       // ia64 software calling convention requires
+       // top 16 bytes of stack to be scratch space
+       // PLT resolver uses that scratch space at
+       // 'memcpy' symbol reolution time
+       add     sp = -16, sp
        br.call.sptk.many b0 = memcpy#
        ;;
        mov     ar.pfs = loc0
@@ -529,6 +534,7 @@ ffi_closure_unix:
        data8   @pcrel(.Lst_int64)              // FFI_TYPE_SINT64
        data8   @pcrel(.Lst_void)               // FFI_TYPE_STRUCT
        data8   @pcrel(.Lst_int64)              // FFI_TYPE_POINTER
+       data8   @pcrel(.Lst_void)               // FFI_TYPE_COMPLEX (not implemented)
        data8   @pcrel(.Lst_small_struct)       // FFI_IA64_TYPE_SMALL_STRUCT
        data8   @pcrel(.Lst_hfa_float)          // FFI_IA64_TYPE_HFA_FLOAT
        data8   @pcrel(.Lst_hfa_double)         // FFI_IA64_TYPE_HFA_DOUBLE
@@ -550,6 +556,7 @@ ffi_closure_unix:
        data8   @pcrel(.Lld_int)                // FFI_TYPE_SINT64
        data8   @pcrel(.Lld_void)               // FFI_TYPE_STRUCT
        data8   @pcrel(.Lld_int)                // FFI_TYPE_POINTER
+       data8   @pcrel(.Lld_void)               // FFI_TYPE_COMPLEX (not implemented)
        data8   @pcrel(.Lld_small_struct)       // FFI_IA64_TYPE_SMALL_STRUCT
        data8   @pcrel(.Lld_hfa_float)          // FFI_IA64_TYPE_HFA_FLOAT
        data8   @pcrel(.Lld_hfa_double)         // FFI_IA64_TYPE_HFA_DOUBLE
index 127123d5bc3a09b99116f264b88bd38769a86c2c..114d3e47fcdef36a29172a23e8b5acad30cdd584 100644 (file)
@@ -114,7 +114,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
        default:
          *args = raw;
          raw +=
-           ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+           FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
        }
     }
 
@@ -142,7 +142,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
 #else /* FFI_SIZEOF_JAVA_RAW != 8 */
        *args = (void*) raw;
        raw +=
-         ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+         FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
 #endif /* FFI_SIZEOF_JAVA_RAW == 8 */
     }
 
@@ -234,7 +234,7 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
 #else
          memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
          raw +=
-           ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+           FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
 #endif
        }
     }
diff --git a/libffi/src/kvx/asm.h b/libffi/src/kvx/asm.h
new file mode 100644 (file)
index 0000000..4edba41
--- /dev/null
@@ -0,0 +1,5 @@
+/* args are passed on registers from r0 up to r11 => 12*8 bytes */
+#define REG_ARGS_SIZE (12*8)
+#define KVX_REGISTER_SIZE (8)
+#define KVX_ABI_SLOT_SIZE (KVX_REGISTER_SIZE)
+#define KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE (4*KVX_ABI_SLOT_SIZE)
diff --git a/libffi/src/kvx/ffi.c b/libffi/src/kvx/ffi.c
new file mode 100644 (file)
index 0000000..58f6aef
--- /dev/null
@@ -0,0 +1,273 @@
+/* Copyright (c) 2020 Kalray
+
+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.  */
+
+#if defined(__kvx__)
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <fficonfig.h>
+#include <ffi.h>
+#include "ffi_common.h"
+#include "asm.h"
+
+#define ALIGN(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1)
+#define ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
+#define KVX_ABI_STACK_ALIGNMENT (32)
+#define KVX_ABI_STACK_ARG_ALIGNMENT (8)
+#define max(a,b) ((a) > (b) ? (a) : (b))
+
+#ifdef FFI_DEBUG
+#define DEBUG_PRINT(...) do{ fprintf( stderr, __VA_ARGS__ ); } while(0)
+#else
+#define DEBUG_PRINT(...)
+#endif
+
+struct ret_value {
+       unsigned long int r0;
+       unsigned long int r1;
+       unsigned long int r2;
+       unsigned long int r3;
+};
+
+extern struct ret_value ffi_call_SYSV(unsigned total_size,
+                                      unsigned size,
+                                      extended_cif *ecif,
+                                      unsigned *rvalue_addr,
+                                      void *fn,
+                                      unsigned int_ext_method);
+
+/* Perform machine dependent cif processing */
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+{
+  cif->flags = cif->rtype->size;
+  return FFI_OK;
+}
+
+/* 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, unsigned int arg_slots_size, extended_cif *ecif)
+{
+  char *stacktemp = stack;
+  char *current_arg_passed_by_value = stack + arg_slots_size;
+  int i, s;
+  ffi_type **arg;
+  int count = 0;
+  ffi_cif *cif = ecif->cif;
+  void **argv = ecif->avalue;
+
+  arg = cif->arg_types;
+
+  DEBUG_PRINT("stack: %p\n", stack);
+  DEBUG_PRINT("arg_slots_size: %u\n", arg_slots_size);
+  DEBUG_PRINT("current_arg_passed_by_value: %p\n", current_arg_passed_by_value);
+  DEBUG_PRINT("ecif: %p\n", ecif);
+  DEBUG_PRINT("ecif->avalue: %p\n", ecif->avalue);
+
+  for (i = 0; i < cif->nargs; i++) {
+
+    s = KVX_ABI_SLOT_SIZE;
+    switch((*arg)->type) {
+      case FFI_TYPE_SINT8:
+      case FFI_TYPE_UINT8:
+      case FFI_TYPE_SINT16:
+      case FFI_TYPE_UINT16:
+      case FFI_TYPE_SINT32:
+      case FFI_TYPE_UINT32:
+      case FFI_TYPE_FLOAT:
+      case FFI_TYPE_DOUBLE:
+      case FFI_TYPE_UINT64:
+      case FFI_TYPE_SINT64:
+      case FFI_TYPE_POINTER:
+        DEBUG_PRINT("INT64/32/16/8/FLOAT/DOUBLE or POINTER @%p\n", stack);
+        *(uint64_t *) stack = *(uint64_t *)(* argv);
+        break;
+
+      case FFI_TYPE_COMPLEX:
+        if ((*arg)->size == 8)
+          *(_Complex float *) stack = *(_Complex float *)(* argv);
+        else if ((*arg)->size == 16) {
+          *(_Complex double *) stack = *(_Complex double *)(* argv);
+          s = 16;
+        } else
+          abort();
+        break;
+      case FFI_TYPE_STRUCT: {
+        char *value;
+        unsigned int written_size = 0;
+        DEBUG_PRINT("struct by value @%p\n", stack);
+        if ((*arg)->size > KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) {
+          DEBUG_PRINT("big struct\n");
+          *(uint64_t *) stack = (uintptr_t)current_arg_passed_by_value;
+          value = current_arg_passed_by_value;
+          current_arg_passed_by_value += (*arg)->size;
+          written_size = KVX_ABI_SLOT_SIZE;
+        } else {
+          value = stack;
+          written_size = (*arg)->size;
+        }
+        memcpy(value, *argv, (*arg)->size);
+        s = ALIGN(written_size, KVX_ABI_STACK_ARG_ALIGNMENT);
+        break;
+      }
+      default:
+        printf("Error: unsupported arg type %d\n", (*arg)->type);
+        abort();
+        break;
+
+    }
+    stack += s;
+    count += s;
+    argv++;
+    arg++;
+  }
+#ifdef FFI_DEBUG
+  FFI_ASSERT(((intptr_t)(stacktemp + REG_ARGS_SIZE) & (KVX_ABI_STACK_ALIGNMENT-1)) == 0);
+#endif
+  return stacktemp + REG_ARGS_SIZE;
+}
+
+/* Perform machine dependent cif processing when we have a variadic function */
+
+ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs,
+                                    unsigned int ntotalargs)
+{
+  cif->flags = cif->rtype->size;
+  return FFI_OK;
+}
+
+static unsigned long handle_small_int_ext(kvx_intext_method *int_ext_method,
+                                          const ffi_type *rtype)
+{
+  switch (rtype->type) {
+    case FFI_TYPE_SINT8:
+      *int_ext_method = KVX_RET_SXBD;
+      return KVX_REGISTER_SIZE;
+
+    case FFI_TYPE_SINT16:
+      *int_ext_method = KVX_RET_SXHD;
+      return KVX_REGISTER_SIZE;
+
+    case FFI_TYPE_SINT32:
+      *int_ext_method = KVX_RET_SXWD;
+      return KVX_REGISTER_SIZE;
+
+    case FFI_TYPE_UINT8:
+      *int_ext_method = KVX_RET_ZXBD;
+      return KVX_REGISTER_SIZE;
+
+    case FFI_TYPE_UINT16:
+      *int_ext_method = KVX_RET_ZXHD;
+      return KVX_REGISTER_SIZE;
+
+    case FFI_TYPE_UINT32:
+      *int_ext_method = KVX_RET_ZXWD;
+      return KVX_REGISTER_SIZE;
+
+    default:
+      *int_ext_method = KVX_RET_NONE;
+      return rtype->size;
+  }
+}
+
+void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+{
+  int i;
+  unsigned long int slot_fitting_args_size = 0;
+  unsigned long int total_size = 0;
+  unsigned long int big_struct_size = 0;
+  kvx_intext_method int_extension_method;
+  ffi_type **arg;
+  struct ret_value local_rvalue = {0};
+  size_t wb_size;
+
+
+  /* Calculate size to allocate on stack */
+  for (i = 0, arg = cif->arg_types; i < cif->nargs; i++, arg++) {
+    DEBUG_PRINT("argument %d, type %d, size %lu\n", i, (*arg)->type, (*arg)->size);
+    if (((*arg)->type == FFI_TYPE_STRUCT) || ((*arg)->type == FFI_TYPE_COMPLEX)) {
+      if ((*arg)->size <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) {
+        slot_fitting_args_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE);
+      } else {
+        slot_fitting_args_size += KVX_ABI_SLOT_SIZE; /* aggregate passed by reference */
+        big_struct_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE);
+      }
+    } else if ((*arg)->size <= KVX_ABI_SLOT_SIZE) {
+      slot_fitting_args_size += KVX_ABI_SLOT_SIZE;
+    } else {
+      printf("Error: unsupported arg size %ld arg type %d\n", (*arg)->size, (*arg)->type);
+      abort(); /* should never happen? */
+    }
+  }
+
+  extended_cif ecif;
+  ecif.cif = cif;
+  ecif.avalue = avalue;
+  ecif.rvalue = rvalue;
+
+  /* This implementation allocates anyway for all register based args */
+  slot_fitting_args_size = max(slot_fitting_args_size, REG_ARGS_SIZE);
+  total_size = slot_fitting_args_size + big_struct_size;
+  total_size = ALIGN(total_size, KVX_ABI_STACK_ALIGNMENT);
+
+  /* wb_size: write back size, the size we will need to write back to user
+   * provided buffer. In theory it should always be cif->flags which is
+   * cif->rtype->size. But libffi API mandates that for integral types
+   * of size <= system register size, then we *MUST* write back
+   * the size of system register size.
+   * in our case, if size <= 8 bytes we must write back 8 bytes.
+   * floats, complex and structs are not affected, only integrals.
+   */
+  wb_size = handle_small_int_ext(&int_extension_method, cif->rtype);
+
+  switch (cif->abi) {
+    case FFI_SYSV:
+      DEBUG_PRINT("total_size: %lu\n", total_size);
+      DEBUG_PRINT("slot fitting args size: %lu\n", slot_fitting_args_size);
+      DEBUG_PRINT("rvalue: %p\n", rvalue);
+      DEBUG_PRINT("fn: %p\n", fn);
+      DEBUG_PRINT("rsize: %u\n", cif->flags);
+      DEBUG_PRINT("wb_size: %u\n", wb_size);
+      DEBUG_PRINT("int_extension_method: %u\n", int_extension_method);
+      local_rvalue = ffi_call_SYSV(total_size, slot_fitting_args_size,
+                                   &ecif, rvalue, fn, int_extension_method);
+      if ((cif->flags <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE)
+          && (cif->rtype->type != FFI_TYPE_VOID))
+        memcpy(rvalue, &local_rvalue, wb_size);
+      break;
+    default:
+      abort();
+      break;
+  }
+}
+
+/* Closures not supported yet */
+ffi_status
+ffi_prep_closure_loc (ffi_closure* closure,
+                      ffi_cif* cif,
+                      void (*fun)(ffi_cif*,void*,void**,void*),
+                      void *user_data,
+                      void *codeloc)
+{
+  return FFI_BAD_ABI;
+}
+
+#endif /* (__kvx__) */
diff --git a/libffi/src/kvx/ffitarget.h b/libffi/src/kvx/ffitarget.h
new file mode 100644 (file)
index 0000000..8df8735
--- /dev/null
@@ -0,0 +1,75 @@
+/* -----------------------------------------------------------------------
+   ffitarget.h - Copyright (c) 2020 Kalray
+
+   KVX Target configuration macros
+
+   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
+
+/* ---- System specific configurations ----------------------------------- */
+
+#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;
+
+/* Those values are set depending on return type
+ * they are used in the assembly code in sysv.S
+ */
+typedef enum kvx_intext_method {
+  KVX_RET_NONE = 0,
+  KVX_RET_SXBD = 1,
+  KVX_RET_SXHD = 2,
+  KVX_RET_SXWD = 3,
+  KVX_RET_ZXBD = 4,
+  KVX_RET_ZXHD = 5,
+  KVX_RET_ZXWD = 6
+} kvx_intext_method;
+
+#endif
+
+/* ---- Definitions for closures ----------------------------------------- */
+
+/* This is only to allow Python to compile
+ * but closures are not supported yet
+ */
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 0
+
+#define FFI_NATIVE_RAW_API 0
+#define FFI_TARGET_SPECIFIC_VARIADIC 1
+#define FFI_TARGET_HAS_COMPLEX_TYPE
+
+#endif
+
diff --git a/libffi/src/kvx/sysv.S b/libffi/src/kvx/sysv.S
new file mode 100644 (file)
index 0000000..952afc7
--- /dev/null
@@ -0,0 +1,127 @@
+/* Copyright (c) 2020 Kalray
+
+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.  */
+
+#if defined(__kvx__)
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+#include <ffi_cfi.h>
+#include <kvx/asm.h>
+
+.text
+.global ffi_call_SYSV
+.type ffi_call_SYSV, @function
+.type ffi_prep_args, @function
+.align 8
+
+/* ffi_call_SYSV
+
+  r0: total size to allocate on stack
+  r1: size of arg slots
+  r2: extended cif structure, DO NOT REMOVE: it is used by ffi_prep_args()
+  r3: return value address
+  r4: function to call
+  r5: integer sign extension method to be used
+*/
+ffi_call_SYSV:
+       addd $r12 = $r12, -64
+       so (-32)[$r12] = $r20r21r22r23
+       ;;
+       sd (0)[$r12] = $r24
+       ;;
+       get $r23 = $ra
+       copyd $r20 = $r12
+       sbfd $r12 = $r0, $r12
+       ;;
+       copyd $r0 = $r12
+       copyd $r21 = $r3
+       copyd $r22 = $r4
+       copyd $r24 = $r5
+       call ffi_prep_args
+       ;;
+       lo $r8r9r10r11 = (64)[$r12]
+       ;;
+       lo $r4r5r6r7 = (32)[$r12]
+       ;;
+       lo $r0r1r2r3 = (0)[$r12]
+       copyd $r12 = $r0
+       /* $r15 is the register used by the ABI to return big (>32 bytes)
+        * structs by value.
+        * It is also referred to as the "struct register" in the ABI.
+        */
+       copyd $r15 = $r21
+       icall $r22
+       ;;
+       pcrel $r4 = @pcrel(.Ltable)
+       cb.deqz $r24 ? .Lend
+       ;;
+       addx8d $r24 = $r24, $r4
+       ;;
+       igoto $r24
+       ;;
+.Ltable:
+0: /* we should never arrive here */
+       goto .Lerror
+       nop
+       ;;
+1: /* Sign extend byte to double */
+       sxbd $r0 = $r0
+       goto .Lend
+       ;;
+2: /* Sign extend half to double */
+       sxhd $r0 = $r0
+       goto .Lend
+       ;;
+3: /* Sign extend word to double */
+       sxwd $r0 = $r0
+       goto .Lend
+       ;;
+4: /* Zero extend byte to double */
+       zxbd $r0 = $r0
+       goto .Lend
+       ;;
+5: /* Zero extend half to double */
+       zxhd $r0 = $r0
+       goto .Lend
+       ;;
+6: /* Zero extend word to double */
+       zxwd $r0 = $r0
+       /* Fallthrough to .Lend */
+       ;;
+.Lend:
+       ld $r24 = (0)[$r12]
+       ;;
+       set $ra = $r23
+       lo $r20r21r22r23 = (32)[$r20]
+       addd $r12 = $r20, 64
+       ;;
+       ret
+       ;;
+.Lerror:
+       errop
+       ;;
+
+#endif /* __kvx__ */
+
+#if defined __ELF__ && defined __linux__
+       .section .note.GNU-stack,"",%progbits
+#endif
+
index 300006349bf62187c2ebab82959581836dd0dcd0..ab8fc4e48a250a14d8d14f4f3d247a55524b8692 100644 (file)
@@ -61,7 +61,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
 
       /* Align if necessary.  */
       if (((*p_arg)->alignment - 1) & (unsigned) argp)
-       argp = (char *) ALIGN (argp, (*p_arg)->alignment);
+       argp = (char *) FFI_ALIGN (argp, (*p_arg)->alignment);
 
       if (avn != 0) 
        {
index 0dee9383a8d88778d36f2a594ba37ef04c9cd035..033018480ca93347a9bca559789e7685315abb51 100644 (file)
@@ -105,7 +105,7 @@ ffi_prep_args (void *stack, extended_cif *ecif)
 
          /* Align if necessary.  */
          if ((sizeof(int) - 1) & z)
-           z = ALIGN(z, sizeof(int));
+           z = FFI_ALIGN(z, sizeof(int));
        }
 
       p_argv++;
@@ -297,7 +297,7 @@ ffi_prep_incoming_args_SYSV (char *stack, void **avalue, ffi_cif *cif)
 
          /* Align if necessary */
          if ((sizeof(int) - 1) & z)
-           z = ALIGN(z, sizeof(int));
+           z = FFI_ALIGN(z, sizeof(int));
        }
 
       p_argv++;
index ec2b14f3d9817daf396b5dcb4cd80fc5c48d51d4..ea40f1100ba9e426327773b99ef20cf3153457c9 100644 (file)
@@ -3,7 +3,7 @@
    sysv.S - Copyright (c) 2012 Alan Hourihane
            Copyright (c) 1998, 2012 Andreas Schwab
            Copyright (c) 2008 Red Hat, Inc.
-           Copyright (c) 2012 Thorsten Glaser
+           Copyright (c) 2012, 2016 Thorsten Glaser
 
    m68k Foreign Function Interface
 
@@ -72,6 +72,15 @@ CALLFUNC(ffi_call_SYSV):
        pea     4(%sp)
 #if !defined __PIC__
        jsr     CALLFUNC(ffi_prep_args)
+#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
+       move.l  _current_shared_library_a5_offset_(%a5),%a0
+       move.l  CALLFUNC(ffi_prep_args@GOT)(%a0),%a0
+       jsr     (%a0)
+#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
+       move.l  #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0
+       lea     (-6,%pc,%a0),%a0
+       move.l  CALLFUNC(ffi_prep_args@GOT)(%a0),%a0
+       jsr     (%a0)
 #else
        bsr.l   CALLFUNC(ffi_prep_args@PLTPC)
 #endif
@@ -215,6 +224,15 @@ CALLFUNC(ffi_closure_SYSV):
        move.l  %a0,-(%sp)
 #if !defined __PIC__
        jsr     CALLFUNC(ffi_closure_SYSV_inner)
+#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
+       move.l  _current_shared_library_a5_offset_(%a5),%a0
+       move.l  CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
+       jsr     (%a0)
+#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
+       move.l  #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0
+       lea     (-6,%pc,%a0),%a0
+       move.l  CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
+       jsr     (%a0)
 #else
        bsr.l   CALLFUNC(ffi_closure_SYSV_inner@PLTPC)
 #endif
@@ -317,6 +335,15 @@ CALLFUNC(ffi_closure_struct_SYSV):
        move.l  %a0,-(%sp)
 #if !defined __PIC__
        jsr     CALLFUNC(ffi_closure_SYSV_inner)
+#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
+       move.l  _current_shared_library_a5_offset_(%a5),%a0
+       move.l  CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
+       jsr     (%a0)
+#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
+       move.l  #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0
+       lea     (-6,%pc,%a0),%a0
+       move.l  CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
+       jsr     (%a0)
 #else
        bsr.l   CALLFUNC(ffi_closure_SYSV_inner@PLTPC)
 #endif
index 68df494955e49f3b2c6c2e60e311c4bca495226e..57b344f4b9a0e8620b80c1f54abd65e547753388 100644 (file)
@@ -134,7 +134,7 @@ ffi_prep_args (void *stack, extended_cif *ecif)
       /* Enforce proper stack alignment of 64-bit types */
       if (argp == stackp && a > sizeof (int))
        {
-         stackp = (char *) ALIGN(stackp, a);
+         stackp = (char *) FFI_ALIGN(stackp, a);
          argp = stackp;
        }
 
@@ -177,7 +177,7 @@ ffi_prep_args (void *stack, extended_cif *ecif)
 
       /* Align if necessary.  */
       if ((sizeof (int) - 1) & z)
-       z = ALIGN(z, sizeof (int));
+       z = FFI_ALIGN(z, sizeof (int));
 
       p_argv++;
 
@@ -320,7 +320,7 @@ ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp,
       /* Enforce proper stack alignment of 64-bit types */
       if (argp == stackp && a > sizeof (int))
        {
-         stackp = (char *) ALIGN(stackp, a);
+         stackp = (char *) FFI_ALIGN(stackp, a);
          argp = stackp;
        }
 
@@ -331,7 +331,7 @@ ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp,
 
       /* Align if necessary */
       if ((sizeof (int) - 1) & z)
-       z = ALIGN(z, sizeof (int));
+       z = FFI_ALIGN(z, sizeof (int));
 
       p_argv++;
 
index 46b383e7a3c4486d466916abeccf4b3ba30be148..3aecb0b8115631efdacea339e75a43c3da5b855b 100644 (file)
@@ -61,7 +61,7 @@ unsigned int ffi_prep_args(char *stack, extended_cif *ecif)
                argp -= z;
 
                /* Align if necessary */
-               argp = (char *) ALIGN_DOWN(ALIGN_DOWN(argp, (*p_arg)->alignment), 4);
+               argp = (char *) FFI_ALIGN_DOWN(FFI_ALIGN_DOWN(argp, (*p_arg)->alignment), 4);
 
                if (z < sizeof(int)) {
                        z = sizeof(int);
@@ -93,7 +93,7 @@ unsigned int ffi_prep_args(char *stack, extended_cif *ecif)
 
        /* return the size of the arguments to be passed in registers,
           padded to an 8 byte boundary to preserve stack alignment */
-       return ALIGN(MIN(stack - argp, 6*4), 8);
+       return FFI_ALIGN(MIN(stack - argp, 6*4), 8);
 }
 
 /* Perform machine dependent cif processing */
@@ -112,20 +112,20 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
 
                /* Add any padding if necessary */
                if (((*ptr)->alignment - 1) & bytes)
-                       bytes = ALIGN(bytes, (*ptr)->alignment);
+                       bytes = FFI_ALIGN(bytes, (*ptr)->alignment);
 
-               bytes += ALIGN((*ptr)->size, 4);
+               bytes += FFI_ALIGN((*ptr)->size, 4);
        }
 
        /* Ensure arg space is aligned to an 8-byte boundary */
-       bytes = ALIGN(bytes, 8);
+       bytes = FFI_ALIGN(bytes, 8);
 
        /* Make space for the return structure pointer */
        if (cif->rtype->type == FFI_TYPE_STRUCT) {
                bytes += sizeof(void*);
 
                /* Ensure stack is aligned to an 8-byte boundary */
-               bytes = ALIGN(bytes, 8);
+               bytes = FFI_ALIGN(bytes, 8);
        }
 
        cif->bytes = bytes;
@@ -319,7 +319,7 @@ static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
                if (alignment < 4)
                        alignment = 4;
                if ((alignment - 1) & (unsigned)argp)
-                       argp = (char *) ALIGN(argp, alignment);
+                       argp = (char *) FFI_ALIGN(argp, alignment);
 
                z = (*p_arg)->size;
                *p_argv = (void*) argp;
index ea962ea4837d76693f7e6e85787a573bbfe90374..df6e33c97d4c0090f9179fa3910edf89ee9c57d4 100644 (file)
@@ -35,7 +35,7 @@ extern void ffi_closure_SYSV(void);
 
 #define WORD_SIZE                      sizeof(unsigned int)
 #define ARGS_REGISTER_SIZE     (WORD_SIZE * 6)
-#define WORD_ALIGN(x)          ALIGN(x, WORD_SIZE)
+#define WORD_FFI_ALIGN(x)              FFI_ALIGN(x, WORD_SIZE)
 
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments */
@@ -46,12 +46,12 @@ void ffi_prep_args(void* stack, extended_cif* ecif)
        void** p_argv;
        void* stack_args_p = stack;
 
-       p_argv = ecif->avalue;
-
        if (ecif == NULL || ecif->cif == NULL) {
                return; /* no description to prepare */
        }
 
+       p_argv = ecif->avalue;
+
        if ((ecif->cif->rtype != NULL) &&
                        (ecif->cif->rtype->type == FFI_TYPE_STRUCT))
        {
@@ -74,7 +74,7 @@ void ffi_prep_args(void* stack, extended_cif* ecif)
                int type = (*p_arg)->type;
                void* value = p_argv[i];
                char* addr = stack_args_p;
-               int aligned_size = WORD_ALIGN(size);
+               int aligned_size = WORD_FFI_ALIGN(size);
 
                /* force word alignment on the stack */
                stack_args_p += aligned_size;
@@ -259,7 +259,7 @@ void ffi_closure_call_SYSV(void* register_args, void* stack_args,
                                avalue[i] = ptr;
                                break;
                }
-               ptr += WORD_ALIGN(arg_types[i]->size);
+               ptr += WORD_FFI_ALIGN(arg_types[i]->size);
        }
 
        /* set the return type info passed back to the wrapper */
index ecd783a56c553bd9d2a49c58b2d463969a4bf481..979ca49f1bd64b7b49c7f757709bc6eacc9e134c 100644 (file)
@@ -29,6 +29,7 @@
 #include <ffi.h>
 #include <ffi_common.h>
 
+#include <stdint.h>
 #include <stdlib.h>
 
 #ifdef __GNUC__
@@ -38,7 +39,9 @@
 #endif
 
 #ifndef USE__BUILTIN___CLEAR_CACHE
-#  if defined(__OpenBSD__)
+#  if defined(__FreeBSD__)
+#    include <machine/sysarch.h>
+#  elif defined(__OpenBSD__)
 #    include <mips64/sysarch.h>
 #  else
 #    include <sys/cachectl.h>
@@ -116,7 +119,7 @@ static void ffi_prep_args(char *stack,
       
       if ((a - 1) & (unsigned long) argp)
        {
-         argp = (char *) ALIGN(argp, a);
+         argp = (char *) FFI_ALIGN(argp, a);
          FIX_ARGP;
        }
 
@@ -247,7 +250,7 @@ calc_n32_struct_flags(int soft_float, ffi_type *arg,
   while ((e = arg->elements[index]))
     {
       /* Align this object.  */
-      *loc = ALIGN(*loc, e->alignment);
+      *loc = FFI_ALIGN(*loc, e->alignment);
       if (e->type == FFI_TYPE_DOUBLE)
        {
           /* Already aligned to FFI_SIZEOF_ARG.  */
@@ -262,7 +265,7 @@ calc_n32_struct_flags(int soft_float, ffi_type *arg,
       index++;
     }
   /* Next Argument register at alignment of FFI_SIZEOF_ARG.  */
-  *arg_reg = ALIGN(*loc, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+  *arg_reg = FFI_ALIGN(*loc, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
 
   return flags;
 }
@@ -322,9 +325,10 @@ calc_n32_return_struct_flags(int soft_float, ffi_type *arg)
 #endif
 
 /* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs)
 {
   cif->flags = 0;
+  cif->mips_nfixedargs = nfixedargs;
 
 #ifdef FFI_MIPS_O32
   /* Set the flags necessary for O32 processing.  FFI_O32_SOFT_FLOAT
@@ -333,7 +337,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
 
   if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32)
     {
-      if (cif->nargs > 0)
+      if (cif->nargs > 0 && cif->nargs == nfixedargs)
        {
          switch ((cif->arg_types)[0]->type)
            {
@@ -450,7 +454,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
     while (count-- > 0 && arg_reg < 8)
       {
        type = (cif->arg_types)[index]->type;
-       if (soft_float)
+
+       // Pass variadic arguments in integer registers even if they're floats
+       if (soft_float || index >= nfixedargs)
          {
            switch (type)
              {
@@ -474,9 +480,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
            break;
           case FFI_TYPE_LONGDOUBLE:
             /* Align it.  */
-            arg_reg = ALIGN(arg_reg, 2);
+            arg_reg = FFI_ALIGN(arg_reg, 2);
             /* Treat it as two adjacent doubles.  */
-           if (soft_float
+           if (soft_float || index >= nfixedargs)
              {
                arg_reg += 2;
              }
@@ -493,7 +499,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
 
          case FFI_TYPE_STRUCT:
             loc = arg_reg * FFI_SIZEOF_ARG;
-           cif->flags += calc_n32_struct_flags(soft_float,
+           cif->flags += calc_n32_struct_flags(soft_float || index >= nfixedargs,
                                                (cif->arg_types)[index],
                                                &loc, &arg_reg);
            break;
@@ -578,17 +584,30 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   return FFI_OK;
 }
 
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+{
+    return ffi_prep_cif_machdep_int(cif, cif->nargs);
+}
+
+ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
+                                    unsigned nfixedargs,
+                                    unsigned ntotalargs MAYBE_UNUSED)
+{
+    return ffi_prep_cif_machdep_int(cif, nfixedargs);
+}
+
 /* Low level routine for calling O32 functions */
 extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int), 
                        extended_cif *, unsigned, 
-                       unsigned, unsigned *, void (*)(void));
+                       unsigned, unsigned *, void (*)(void), void *closure);
 
 /* Low level routine for calling N32 functions */
 extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int), 
                        extended_cif *, unsigned, 
-                       unsigned, void *, void (*)(void));
+                       unsigned, void *, void (*)(void), void *closure);
 
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+void ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, 
+             void **avalue, void *closure)
 {
   extended_cif ecif;
 
@@ -610,7 +629,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
     case FFI_O32:
     case FFI_O32_SOFT_FLOAT:
       ffi_call_O32(ffi_prep_args, &ecif, cif->bytes, 
-                  cif->flags, ecif.rvalue, fn);
+                  cif->flags, ecif.rvalue, fn, closure);
       break;
 #endif
 
@@ -642,7 +661,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 #endif
          }
         ffi_call_N32(ffi_prep_args, &ecif, cif->bytes,
-                     cif->flags, rvalue_copy, fn);
+                     cif->flags, rvalue_copy, fn, closure);
         if (copy_rvalue)
           memcpy(ecif.rvalue, rvalue_copy + copy_offset, cif->rtype->size);
       }
@@ -655,11 +674,27 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
     }
 }
 
+void
+ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+{
+  ffi_call_int (cif, fn, rvalue, avalue, NULL);
+}
+
+void
+ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
+            void **avalue, void *closure)
+{
+  ffi_call_int (cif, fn, rvalue, avalue, closure);
+}
+
+
 #if FFI_CLOSURES
 #if defined(FFI_MIPS_O32)
 extern void ffi_closure_O32(void);
+extern void ffi_go_closure_O32(void);
 #else
 extern void ffi_closure_N32(void);
+extern void ffi_go_closure_N32(void);
 #endif /* FFI_MIPS_O32 */
 
 ffi_status
@@ -744,11 +779,13 @@ ffi_prep_closure_loc (ffi_closure *closure,
   closure->fun = fun;
   closure->user_data = user_data;
 
+#if !defined(__FreeBSD__)
 #ifdef USE__BUILTIN___CLEAR_CACHE
   __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE);
 #else
   cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE);
 #endif
+#endif /* ! __FreeBSD__ */
   return FFI_OK;
 }
 
@@ -770,27 +807,28 @@ ffi_prep_closure_loc (ffi_closure *closure,
  * Based on the similar routine for sparc.
  */
 int
-ffi_closure_mips_inner_O32 (ffi_closure *closure,
+ffi_closure_mips_inner_O32 (ffi_cif *cif,
+                            void (*fun)(ffi_cif*, void*, void**, void*),
+                           void *user_data,
                            void *rvalue, ffi_arg *ar,
                            double *fpr)
 {
-  ffi_cif *cif;
   void **avaluep;
   ffi_arg *avalue;
   ffi_type **arg_types;
   int i, avn, argn, seen_int;
 
-  cif = closure->cif;
   avalue = alloca (cif->nargs * sizeof (ffi_arg));
   avaluep = alloca (cif->nargs * sizeof (ffi_arg));
 
-  seen_int = (cif->abi == FFI_O32_SOFT_FLOAT);
+  seen_int = (cif->abi == FFI_O32_SOFT_FLOAT) || (cif->mips_nfixedargs != cif->nargs);
   argn = 0;
 
   if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT)
     {
-      rvalue = (void *)(UINT32)ar[0];
+      rvalue = (void *)(uintptr_t)ar[0];
       argn = 1;
+      seen_int = 1;
     }
 
   i = 0;
@@ -799,6 +837,8 @@ ffi_closure_mips_inner_O32 (ffi_closure *closure,
 
   while (i < avn)
     {
+      if (arg_types[i]->alignment == 8 && (argn & 0x1))
+        argn++;
       if (i < 2 && !seen_int &&
          (arg_types[i]->type == FFI_TYPE_FLOAT ||
           arg_types[i]->type == FFI_TYPE_DOUBLE ||
@@ -813,8 +853,6 @@ ffi_closure_mips_inner_O32 (ffi_closure *closure,
        }
       else
        {
-         if (arg_types[i]->alignment == 8 && (argn & 0x1))
-           argn++;
          switch (arg_types[i]->type)
            {
              case FFI_TYPE_SINT8:
@@ -843,12 +881,12 @@ ffi_closure_mips_inner_O32 (ffi_closure *closure,
            }
          seen_int = 1;
        }
-      argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+      argn += FFI_ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
       i++;
     }
 
   /* Invoke the closure. */
-  (closure->fun) (cif, rvalue, avaluep, closure->user_data);
+  fun(cif, rvalue, avaluep, user_data);
 
   if (cif->abi == FFI_O32_SOFT_FLOAT)
     {
@@ -884,7 +922,7 @@ copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type,
       char *argp;
       char *fpp;
 
-      o = ALIGN(offset, elt_type->alignment);
+      o = FFI_ALIGN(offset, elt_type->alignment);
       arg_offset += o - offset;
       offset = o;
       argn += arg_offset / sizeof(ffi_arg);
@@ -924,11 +962,12 @@ copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type,
  *
  */
 int
-ffi_closure_mips_inner_N32 (ffi_closure *closure,
+ffi_closure_mips_inner_N32 (ffi_cif *cif, 
+                           void (*fun)(ffi_cif*, void*, void**, void*),
+                            void *user_data,
                            void *rvalue, ffi_arg *ar,
                            ffi_arg *fpr)
 {
-  ffi_cif *cif;
   void **avaluep;
   ffi_arg *avalue;
   ffi_type **arg_types;
@@ -936,7 +975,6 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
   int soft_float;
   ffi_arg *argp;
 
-  cif = closure->cif;
   soft_float = cif->abi == FFI_N64_SOFT_FLOAT
     || cif->abi == FFI_N32_SOFT_FLOAT;
   avalue = alloca (cif->nargs * sizeof (ffi_arg));
@@ -964,10 +1002,10 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
          || arg_types[i]->type == FFI_TYPE_DOUBLE
          || arg_types[i]->type == FFI_TYPE_LONGDOUBLE)
         {
-          argp = (argn >= 8 || soft_float) ? ar + argn : fpr + argn;
-          if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((unsigned)argp & (arg_types[i]->alignment-1)))
+          argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn;
+          if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((uintptr_t)argp & (arg_types[i]->alignment-1)))
             {
-              argp=(ffi_arg*)ALIGN(argp,arg_types[i]->alignment);
+              argp=(ffi_arg*)FFI_ALIGN(argp,arg_types[i]->alignment);
               argn++;
             }
 #if defined(__MIPSEB__) || defined(_MIPSEB)
@@ -982,7 +1020,7 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
           unsigned type = arg_types[i]->type;
 
           if (arg_types[i]->alignment > sizeof(ffi_arg))
-            argn = ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg));
+            argn = FFI_ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg));
 
           argp = ar + argn;
 
@@ -1033,7 +1071,7 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
                      it was passed in registers.  */
                   avaluep[i] = alloca(arg_types[i]->size);
                   copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i],
-                                  argn, 0, ar, fpr, soft_float);
+                                  argn, 0, ar, fpr, i >= cif->mips_nfixedargs || soft_float);
 
                   break;
                 }
@@ -1043,16 +1081,54 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
               break;
             }
         }
-      argn += ALIGN(arg_types[i]->size, sizeof(ffi_arg)) / sizeof(ffi_arg);
+      argn += FFI_ALIGN(arg_types[i]->size, sizeof(ffi_arg)) / sizeof(ffi_arg);
       i++;
     }
 
   /* Invoke the closure. */
-  (closure->fun) (cif, rvalue, avaluep, closure->user_data);
+  fun (cif, rvalue, avaluep, user_data);
 
   return cif->flags >> (FFI_FLAG_BITS * 8);
 }
 
 #endif /* FFI_MIPS_N32 */
 
+#if defined(FFI_MIPS_O32)
+extern void ffi_closure_O32(void);
+extern void ffi_go_closure_O32(void);
+#else
+extern void ffi_closure_N32(void);
+extern void ffi_go_closure_N32(void);
+#endif /* FFI_MIPS_O32 */
+
+ffi_status
+ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
+                    void (*fun)(ffi_cif*,void*,void**,void*))
+{
+  void * fn;
+
+#if defined(FFI_MIPS_O32)
+  if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT)
+    return FFI_BAD_ABI;
+  fn = ffi_go_closure_O32;
+#else
+#if _MIPS_SIM ==_ABIN32
+  if (cif->abi != FFI_N32
+      && cif->abi != FFI_N32_SOFT_FLOAT)
+    return FFI_BAD_ABI;
+#else
+  if (cif->abi != FFI_N64
+      && cif->abi != FFI_N64_SOFT_FLOAT)
+    return FFI_BAD_ABI;
+#endif
+  fn = ffi_go_closure_N32;
+#endif /* FFI_MIPS_O32 */
+
+  closure->tramp = (void *)fn;
+  closure->cif = cif;
+  closure->fun = fun;
+
+  return FFI_OK;
+}
+
 #endif /* FFI_CLOSURES */
index 717d65951c36393540f018c5eea9dd119b30880b..fdd5ca90ac432e271d36feea82a21ab540e6617c 100644 (file)
@@ -32,7 +32,7 @@
 #error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
 #endif
 
-#ifdef linux
+#ifdef __linux__
 # include <asm/sgidefs.h>
 #elif defined(__rtems__)
 /*
@@ -41,7 +41,7 @@
 #define _MIPS_SIM_ABI32                1
 #define _MIPS_SIM_NABI32       2
 #define _MIPS_SIM_ABI64                3
-#elif !defined(__OpenBSD__)
+#elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 # include <sgidefs.h>
 #endif
 
@@ -224,24 +224,21 @@ typedef enum ffi_abi {
 #endif
 } ffi_abi;
 
-#define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag
+#define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag; unsigned mips_nfixedargs
+#define FFI_TARGET_SPECIFIC_VARIADIC
 #endif /* !LIBFFI_ASM */
 
 /* ---- Definitions for closures ----------------------------------------- */
 
-#if defined(FFI_MIPS_O32)
 #define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 20
-#else
-/* N32/N64. */
-# define FFI_CLOSURES 1
-#if _MIPS_SIM==_ABI64
-#define FFI_TRAMPOLINE_SIZE 52
+#define FFI_GO_CLOSURES 1
+#define FFI_NATIVE_RAW_API 0
+
+#if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32)
+# define FFI_TRAMPOLINE_SIZE 20
 #else
-#define FFI_TRAMPOLINE_SIZE 20
+# define FFI_TRAMPOLINE_SIZE 56
 #endif
-#endif /* FFI_MIPS_O32 */
-#define FFI_NATIVE_RAW_API 0
 
 #endif
 
index 06e6c46076bf7c3cd697b51e6e00163c8cd7ba65..23b77fdfde5071c7ed4e0eefc83d35c04b8b0e9c 100644 (file)
 #define flags   a3
 #define raddr    a4
 #define fn       a5
+#define closure  a6
 
-#define SIZEOF_FRAME   ( 8 * FFI_SIZEOF_ARG )
+/* Note: to keep stack 16 byte aligned we need even number slots 
+   used 9 slots here
+*/
+#define SIZEOF_FRAME   ( 10 * FFI_SIZEOF_ARG )
 
 #ifdef __GNUC__
        .abicalls
        .globl  ffi_call_N32
        .ent    ffi_call_N32
 ffi_call_N32:  
-.LFB3:
+.LFB0:
        .frame  $fp, SIZEOF_FRAME, ra
        .mask   0xc0000000,-FFI_SIZEOF_ARG
        .fmask  0x00000000,0
 
        # Prologue
        SUBU    $sp, SIZEOF_FRAME                       # Frame size
-.LCFI0:
+.LCFI00:
        REG_S   $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp)       # Save frame pointer
        REG_S   ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp)        # Save return address
-.LCFI1:
+.LCFI01:
        move    $fp, $sp
-.LCFI3:
+.LCFI02:
        move    t9, callback    # callback function pointer
        REG_S   bytes, 2*FFI_SIZEOF_ARG($fp) # bytes
        REG_S   flags, 3*FFI_SIZEOF_ARG($fp) # flags
        REG_S   raddr, 4*FFI_SIZEOF_ARG($fp) # raddr
        REG_S   fn,    5*FFI_SIZEOF_ARG($fp) # fn
+       REG_S   closure, 6*FFI_SIZEOF_ARG($fp) # closure
 
        # Allocate at least 4 words in the argstack
        move    v0, bytes
@@ -109,6 +114,16 @@ loadregs:
 
        REG_L   t6, 3*FFI_SIZEOF_ARG($fp)  # load the flags word into t6.
 
+#ifdef __mips_soft_float
+       REG_L   a0, 0*FFI_SIZEOF_ARG(t9)
+       REG_L   a1, 1*FFI_SIZEOF_ARG(t9)
+       REG_L   a2, 2*FFI_SIZEOF_ARG(t9)
+       REG_L   a3, 3*FFI_SIZEOF_ARG(t9)
+       REG_L   a4, 4*FFI_SIZEOF_ARG(t9)
+       REG_L   a5, 5*FFI_SIZEOF_ARG(t9)
+       REG_L   a6, 6*FFI_SIZEOF_ARG(t9)
+       REG_L   a7, 7*FFI_SIZEOF_ARG(t9)
+#else
        and     t4, t6, ((1<<FFI_FLAG_BITS)-1)
        REG_L   a0, 0*FFI_SIZEOF_ARG(t9)
        beqz    t4, arg1_next
@@ -195,11 +210,15 @@ arg7_next:
 arg8_doublep:  
        l.d     $f19, 7*FFI_SIZEOF_ARG(t9)      
 arg8_next:     
+#endif
 
 callit:                
        # Load the function pointer
        REG_L   t9, 5*FFI_SIZEOF_ARG($fp)
 
+       # install the static chain(t7=$15)
+       REG_L   t7, 6*FFI_SIZEOF_ARG($fp)
+
        # If the return value pointer is NULL, assume no return value.
        REG_L   t5, 4*FFI_SIZEOF_ARG($fp)
        beqz    t5, noretval
@@ -216,6 +235,7 @@ retint:
        b       epilogue
 
 retfloat:
+#ifndef __mips_soft_float
        bne     t6, FFI_TYPE_FLOAT, retdouble
        jal     t9
        REG_L   t4, 4*FFI_SIZEOF_ARG($fp)
@@ -274,6 +294,7 @@ retstruct_f_d:
        s.s     $f0, 0(t4)
        s.d     $f2, 8(t4)
        b       epilogue
+#endif
 
 retstruct_d_soft:
        bne     t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
@@ -348,7 +369,7 @@ epilogue:
        ADDU    $sp, SIZEOF_FRAME                     # Fix stack pointer
        j       ra
 
-.LFE3:
+.LFE0:
        .end    ffi_call_N32
 
 /* ffi_closure_N32. Expects address of the passed-in ffi_closure in t0
@@ -407,6 +428,41 @@ epilogue:
 #define RA_OFF2                (1  * FFI_SIZEOF_ARG)
 #define GP_OFF2                (0  * FFI_SIZEOF_ARG)
 
+       .align  2
+       .globl  ffi_go_closure_N32
+       .ent    ffi_go_closure_N32
+ffi_go_closure_N32:
+.LFB1:
+       .frame  $sp, SIZEOF_FRAME2, ra
+       .mask   0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
+       .fmask  0x00000000,0
+       SUBU    $sp, SIZEOF_FRAME2
+.LCFI10:
+       .cpsetup t9, GP_OFF2, ffi_go_closure_N32
+       REG_S   ra, RA_OFF2($sp)        # Save return address
+.LCFI11:
+
+       REG_S   a0, A0_OFF2($sp)
+       REG_S   a1, A1_OFF2($sp)
+       REG_S   a2, A2_OFF2($sp)
+       REG_S   a3, A3_OFF2($sp)
+       REG_S   a4, A4_OFF2($sp)
+       REG_S   a5, A5_OFF2($sp)
+
+       # Call ffi_closure_mips_inner_N32 to do the real work.
+       LA      t9, ffi_closure_mips_inner_N32
+       REG_L   a0, 8($15)   # cif
+       REG_L   a1, 16($15) # fun
+       move    a2, t7                     # userdata=closure
+       ADDU    a3, $sp, V0_OFF2           # rvalue
+       ADDU    a4, $sp, A0_OFF2           # ar
+       ADDU    a5, $sp, F12_OFF2          # fpr
+
+       b       $do_closure
+
+.LFE1: 
+       .end    ffi_go_closure_N32
+
        .align  2
        .globl  ffi_closure_N32
        .ent    ffi_closure_N32
@@ -416,21 +472,33 @@ ffi_closure_N32:
        .mask   0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
        .fmask  0x00000000,0
        SUBU    $sp, SIZEOF_FRAME2
-.LCFI5:
+.LCFI20:
        .cpsetup t9, GP_OFF2, ffi_closure_N32
        REG_S   ra, RA_OFF2($sp)        # Save return address
-.LCFI6:
-       # Store all possible argument registers. If there are more than
-       # fit in registers, then they were stored on the stack.
+.LCFI21:
        REG_S   a0, A0_OFF2($sp)
        REG_S   a1, A1_OFF2($sp)
        REG_S   a2, A2_OFF2($sp)
        REG_S   a3, A3_OFF2($sp)
        REG_S   a4, A4_OFF2($sp)
        REG_S   a5, A5_OFF2($sp)
+
+       # Call ffi_closure_mips_inner_N32 to do the real work.
+       LA      t9, ffi_closure_mips_inner_N32
+       REG_L   a0, 56($12)   # cif
+       REG_L   a1, 64($12)   # fun
+       REG_L   a2, 72($12) # user_data
+       ADDU    a3, $sp, V0_OFF2
+       ADDU    a4, $sp, A0_OFF2
+       ADDU    a5, $sp, F12_OFF2
+
+$do_closure:
+       # Store all possible argument registers. If there are more than
+       # fit in registers, then they were stored on the stack.
        REG_S   a6, A6_OFF2($sp)
        REG_S   a7, A7_OFF2($sp)
 
+#ifndef __mips_soft_float
        # Store all possible float/double registers.
        s.d     $f12, F12_OFF2($sp)
        s.d     $f13, F13_OFF2($sp)
@@ -440,13 +508,8 @@ ffi_closure_N32:
        s.d     $f17, F17_OFF2($sp)
        s.d     $f18, F18_OFF2($sp)
        s.d     $f19, F19_OFF2($sp)
+#endif
 
-       # Call ffi_closure_mips_inner_N32 to do the real work.
-       LA      t9, ffi_closure_mips_inner_N32
-       move    a0, $12  # Pointer to the ffi_closure
-       ADDU    a1, $sp, V0_OFF2
-       ADDU    a2, $sp, A0_OFF2
-       ADDU    a3, $sp, F12_OFF2
        jalr    t9
 
        # Return flags are in v0
@@ -460,6 +523,7 @@ cls_retint:
        b       cls_epilogue
 
 cls_retfloat:
+#ifndef __mips_soft_float
        bne     v0, FFI_TYPE_FLOAT, cls_retdouble
        l.s     $f0, V0_OFF2($sp)
        b       cls_epilogue
@@ -502,6 +566,7 @@ cls_retstruct_f_d:
        l.s     $f0, V0_OFF2($sp)
        l.d     $f2, V1_OFF2($sp)
        b       cls_epilogue
+#endif
        
 cls_retstruct_small2:  
        REG_L   v0, V0_OFF2($sp)
@@ -517,7 +582,7 @@ cls_epilogue:
        .end    ffi_closure_N32
 
 #ifdef __GNUC__
-        .section        .eh_frame,"aw",@progbits
+        .section        .eh_frame,EH_FRAME_FLAGS,@progbits
 .Lframe1:
         .4byte  .LECIE1-.LSCIE1                # length
 .LSCIE1:
@@ -533,46 +598,66 @@ cls_epilogue:
         .align  EH_FRAME_ALIGN
 .LECIE1:
 
-.LSFDE1:
-        .4byte  .LEFDE1-.LASFDE1       # length.
-.LASFDE1:
-        .4byte  .LASFDE1-.Lframe1      # CIE_pointer.
-        FDE_ADDR_BYTES  .LFB3          # initial_location.
-        FDE_ADDR_BYTES  .LFE3-.LFB3    # address_range.
+.LSFDE0:
+        .4byte  .LEFDE0-.LASFDE0       # length.
+.LASFDE0:
+        .4byte  .LASFDE0-.Lframe1      # CIE_pointer.
+        FDE_ADDR_BYTES  .LFB0          # initial_location.
+        FDE_ADDR_BYTES  .LFE0-.LFB0    # address_range.
         .byte   0x4                    # DW_CFA_advance_loc4
-        .4byte  .LCFI0-.LFB3           # to .LCFI0
+        .4byte  .LCFI00-.LFB0          # to .LCFI00
         .byte   0xe                    # DW_CFA_def_cfa_offset
         .uleb128 SIZEOF_FRAME          # adjust stack.by SIZEOF_FRAME
         .byte   0x4                    # DW_CFA_advance_loc4
-        .4byte  .LCFI1-.LCFI0          # to .LCFI1
+        .4byte  .LCFI01-.LCFI00                # to .LCFI01
         .byte   0x9e                   # DW_CFA_offset of $fp
         .uleb128 2*FFI_SIZEOF_ARG/4    # 
         .byte   0x9f                   # DW_CFA_offset of ra
         .uleb128 1*FFI_SIZEOF_ARG/4    # 
         .byte   0x4                    # DW_CFA_advance_loc4
-        .4byte  .LCFI3-.LCFI1          # to .LCFI3
+        .4byte  .LCFI02-.LCFI01                # to .LCFI02
         .byte   0xd                    # DW_CFA_def_cfa_register
         .uleb128 0x1e                  # in $fp
         .align  EH_FRAME_ALIGN
+.LEFDE0:
+
+.LSFDE1:
+       .4byte  .LEFDE1-.LASFDE1        # length
+.LASFDE1:
+       .4byte  .LASFDE1-.Lframe1       # CIE_pointer.
+       FDE_ADDR_BYTES  .LFB1           # initial_location.
+       FDE_ADDR_BYTES  .LFE1-.LFB1     # address_range.
+       .byte   0x4                     # DW_CFA_advance_loc4
+       .4byte  .LCFI10-.LFB1           # to .LCFI10
+       .byte   0xe                     # DW_CFA_def_cfa_offset
+       .uleb128 SIZEOF_FRAME2          # adjust stack.by SIZEOF_FRAME
+       .byte   0x4                     # DW_CFA_advance_loc4
+       .4byte  .LCFI11-.LCFI10         # to .LCFI11
+       .byte   0x9c                    # DW_CFA_offset of $gp ($28)
+       .uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
+       .byte   0x9f                    # DW_CFA_offset of ra ($31)
+       .uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
+       .align  EH_FRAME_ALIGN
 .LEFDE1:
-.LSFDE3:
-       .4byte  .LEFDE3-.LASFDE3        # length
-.LASFDE3:
-       .4byte  .LASFDE3-.Lframe1       # CIE_pointer.
+
+.LSFDE2:
+       .4byte  .LEFDE2-.LASFDE2        # length
+.LASFDE2:
+       .4byte  .LASFDE2-.Lframe1       # CIE_pointer.
        FDE_ADDR_BYTES  .LFB2           # initial_location.
        FDE_ADDR_BYTES  .LFE2-.LFB2     # address_range.
        .byte   0x4                     # DW_CFA_advance_loc4
-       .4byte  .LCFI5-.LFB2            # to .LCFI5
+       .4byte  .LCFI20-.LFB2           # to .LCFI20
        .byte   0xe                     # DW_CFA_def_cfa_offset
        .uleb128 SIZEOF_FRAME2          # adjust stack.by SIZEOF_FRAME
        .byte   0x4                     # DW_CFA_advance_loc4
-       .4byte  .LCFI6-.LCFI5           # to .LCFI6
+       .4byte  .LCFI21-.LCFI20         # to .LCFI21
        .byte   0x9c                    # DW_CFA_offset of $gp ($28)
        .uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
        .byte   0x9f                    # DW_CFA_offset of ra ($31)
        .uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
        .align  EH_FRAME_ALIGN
-.LEFDE3:
+.LEFDE2:
 #endif /* __GNUC__ */  
        
 #endif
index eb279813a764dc840427a79bd9dfa9a2561bd0b0..799139b2968b10e43788590a49c86d5adb065673 100644 (file)
@@ -50,14 +50,14 @@ ffi_call_O32:
 $LFB0:
        # Prologue
        SUBU    $sp, SIZEOF_FRAME       # Frame size
-$LCFI0:
+$LCFI00:
        REG_S   $fp, FP_OFF($sp)        # Save frame pointer
-$LCFI1:
+$LCFI01:
        REG_S   ra, RA_OFF($sp)         # Save return address
-$LCFI2:
+$LCFI02:
        move    $fp, $sp
 
-$LCFI3:
+$LCFI03:
        move    t9, callback            # callback function pointer
        REG_S   flags, A3_OFF($fp)      # flags
 
@@ -82,13 +82,16 @@ sixteen:
                
        ADDU    $sp, 4 * FFI_SIZEOF_ARG         # adjust $sp to new args
 
+#ifndef __mips_soft_float
        bnez    t0, pass_d                      # make it quick for int
+#endif
        REG_L   a0, 0*FFI_SIZEOF_ARG($sp)       # just go ahead and load the
        REG_L   a1, 1*FFI_SIZEOF_ARG($sp)       # four regs.
        REG_L   a2, 2*FFI_SIZEOF_ARG($sp)
        REG_L   a3, 3*FFI_SIZEOF_ARG($sp)
        b       call_it
 
+#ifndef __mips_soft_float
 pass_d:
        bne     t0, FFI_ARGS_D, pass_f
        l.d     $f12, 0*FFI_SIZEOF_ARG($sp)     # load $fp regs from args
@@ -130,8 +133,12 @@ pass_f_d:
  #     bne     t0, FFI_ARGS_F_D, call_it
        l.s     $f12, 0*FFI_SIZEOF_ARG($sp)     # load $fp regs from args
        l.d     $f14, 2*FFI_SIZEOF_ARG($sp)     # passing double and float
+#endif
 
 call_it:       
+       # Load the static chain pointer
+       REG_L   t7, SIZEOF_FRAME + 6*FFI_SIZEOF_ARG($fp)
+
        # Load the function pointer
        REG_L   t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp)
 
@@ -158,14 +165,23 @@ retfloat:
        bne     t2, FFI_TYPE_FLOAT, retdouble
        jalr    t9
        REG_L   t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
+#ifndef __mips_soft_float
        s.s     $f0, 0(t0)
+#else
+       REG_S   v0, 0(t0)
+#endif
        b       epilogue
 
 retdouble:     
        bne     t2, FFI_TYPE_DOUBLE, noretval
        jalr    t9
        REG_L   t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
+#ifndef __mips_soft_float
        s.d     $f0, 0(t0)
+#else
+       REG_S   v1, 4(t0)
+       REG_S   v0, 0(t0)
+#endif
        b       epilogue
        
 noretval:      
@@ -204,13 +220,15 @@ $LFE0:
        -8 - f14 (le low, be high)
        -9 - f12 (le high, be low)
        -10 - f12 (le low, be high)
-       -11 - Called function a3 save
-       -12 - Called function a2 save
-       -13 - Called function a1 save
-       -14 - Called function a0 save, our sp and fp point here
+       -11 - Called function a5 save
+       -12 - Called function a4 save
+       -13 - Called function a3 save
+       -14 - Called function a2 save
+       -15 - Called function a1 save
+       -16 - Called function a0 save, our sp and fp point here
         */
        
-#define SIZEOF_FRAME2  (14 * FFI_SIZEOF_ARG)
+#define SIZEOF_FRAME2  (16 * FFI_SIZEOF_ARG)
 #define A3_OFF2                (SIZEOF_FRAME2 + 3 * FFI_SIZEOF_ARG)
 #define A2_OFF2                (SIZEOF_FRAME2 + 2 * FFI_SIZEOF_ARG)
 #define A1_OFF2                (SIZEOF_FRAME2 + 1 * FFI_SIZEOF_ARG)
@@ -225,13 +243,73 @@ $LFE0:
 #define FA_1_0_OFF2    (SIZEOF_FRAME2 - 8 * FFI_SIZEOF_ARG)
 #define FA_0_1_OFF2    (SIZEOF_FRAME2 - 9 * FFI_SIZEOF_ARG)
 #define FA_0_0_OFF2    (SIZEOF_FRAME2 - 10 * FFI_SIZEOF_ARG)
+#define CALLED_A5_OFF2  (SIZEOF_FRAME2 - 11 * FFI_SIZEOF_ARG)
+#define CALLED_A4_OFF2  (SIZEOF_FRAME2 - 12 * FFI_SIZEOF_ARG)
 
        .text
+
+       .align  2
+       .globl  ffi_go_closure_O32
+       .ent    ffi_go_closure_O32
+ffi_go_closure_O32:
+$LFB1:
+       # Prologue
+       .frame  $fp, SIZEOF_FRAME2, ra
+       .set    noreorder
+       .cpload t9
+       .set    reorder
+       SUBU    $sp, SIZEOF_FRAME2
+       .cprestore GP_OFF2
+$LCFI10:
+
+       REG_S   $16, S0_OFF2($sp)        # Save s0
+       REG_S   $fp, FP_OFF2($sp)        # Save frame pointer
+       REG_S   ra, RA_OFF2($sp)         # Save return address
+$LCFI11:
+
+       move    $fp, $sp
+$LCFI12:
+
+       REG_S   a0, A0_OFF2($fp)
+       REG_S   a1, A1_OFF2($fp)
+       REG_S   a2, A2_OFF2($fp)
+       REG_S   a3, A3_OFF2($fp)
+
+       # Load ABI enum to s0
+       REG_L   $16, 4($15)     # cif 
+       REG_L   $16, 0($16)     # abi is first member.
+
+       li      $13, 1          # FFI_O32
+       bne     $16, $13, 1f    # Skip fp save if FFI_O32_SOFT_FLOAT
+       
+#ifndef __mips_soft_float
+       # Store all possible float/double registers.
+       s.d     $f12, FA_0_0_OFF2($fp)
+       s.d     $f14, FA_1_0_OFF2($fp)
+#endif
+1:
+       # prepare arguments for ffi_closure_mips_inner_O32
+       REG_L   a0, 4($15)       # cif 
+       REG_L   a1, 8($15)       # fun
+       move    a2, $15          # user_data = go closure
+       addu    a3, $fp, V0_OFF2 # rvalue
+
+       addu    t9, $fp, A0_OFF2 # ar
+       REG_S   t9, CALLED_A4_OFF2($fp)
+
+       addu    t9, $fp, FA_0_0_OFF2 #fpr
+       REG_S   t9, CALLED_A5_OFF2($fp)
+
+       b $do_closure
+
+$LFE1:
+       .end ffi_go_closure_O32
+
        .align  2
        .globl  ffi_closure_O32
        .ent    ffi_closure_O32
 ffi_closure_O32:
-$LFB1:
+$LFB2:
        # Prologue
        .frame  $fp, SIZEOF_FRAME2, ra
        .set    noreorder
@@ -239,14 +317,14 @@ $LFB1:
        .set    reorder
        SUBU    $sp, SIZEOF_FRAME2
        .cprestore GP_OFF2
-$LCFI4:
+$LCFI20:
        REG_S   $16, S0_OFF2($sp)        # Save s0
        REG_S   $fp, FP_OFF2($sp)        # Save frame pointer
        REG_S   ra, RA_OFF2($sp)         # Save return address
-$LCFI6:
+$LCFI21:
        move    $fp, $sp
 
-$LCFI7:
+$LCFI22:
        # Store all possible argument registers. If there are more than
        # four arguments, then they are stored above where we put a3.
        REG_S   a0, A0_OFF2($fp)
@@ -261,16 +339,27 @@ $LCFI7:
        li      $13, 1          # FFI_O32
        bne     $16, $13, 1f    # Skip fp save if FFI_O32_SOFT_FLOAT
        
+#ifndef __mips_soft_float
        # Store all possible float/double registers.
        s.d     $f12, FA_0_0_OFF2($fp)
        s.d     $f14, FA_1_0_OFF2($fp)
+#endif
 1:     
-       # Call ffi_closure_mips_inner_O32 to do the work.
+       # prepare arguments for ffi_closure_mips_inner_O32
+       REG_L   a0, 20($12)      # cif pointer follows tramp.
+       REG_L   a1, 24($12)      # fun
+       REG_L   a2, 28($12)      # user_data
+       addu    a3, $fp, V0_OFF2 # rvalue
+
+       addu    t9, $fp, A0_OFF2 # ar
+       REG_S   t9, CALLED_A4_OFF2($fp)
+
+       addu    t9, $fp, FA_0_0_OFF2 #fpr
+       REG_S   t9, CALLED_A5_OFF2($fp)
+
+$do_closure:
        la      t9, ffi_closure_mips_inner_O32
-       move    a0, $12  # Pointer to the ffi_closure
-       addu    a1, $fp, V0_OFF2
-       addu    a2, $fp, A0_OFF2
-       addu    a3, $fp, FA_0_0_OFF2
+       # Call ffi_closure_mips_inner_O32 to do the work.
        jalr    t9
 
        # Load the return value into the appropriate register.
@@ -281,6 +370,7 @@ $LCFI7:
        li      $13, 1          # FFI_O32
        bne     $16, $13, 1f    # Skip fp restore if FFI_O32_SOFT_FLOAT
 
+#ifndef __mips_soft_float
        li      $9, FFI_TYPE_FLOAT
        l.s     $f0, V0_OFF2($fp)
        beq     $8, $9, closure_done
@@ -288,6 +378,7 @@ $LCFI7:
        li      $9, FFI_TYPE_DOUBLE
        l.d     $f0, V0_OFF2($fp)
        beq     $8, $9, closure_done
+#endif
 1:     
        REG_L   $3, V1_OFF2($fp)
        REG_L   $2, V0_OFF2($fp)
@@ -300,7 +391,7 @@ closure_done:
        REG_L   ra,  RA_OFF2($sp)        # Restore return address
        ADDU    $sp, SIZEOF_FRAME2
        j       ra
-$LFE1:
+$LFE2:
        .end    ffi_closure_O32
 
 /* DWARF-2 unwind info. */
@@ -322,6 +413,7 @@ $LSCIE0:
        .uleb128 0x0
        .align  2
 $LECIE0:
+
 $LSFDE0:
        .4byte  $LEFDE0-$LASFDE0         # FDE Length
 $LASFDE0:
@@ -330,11 +422,11 @@ $LASFDE0:
        .4byte  $LFE0-$LFB0      # FDE address range
        .uleb128 0x0     # Augmentation size
        .byte   0x4      # DW_CFA_advance_loc4
-       .4byte  $LCFI0-$LFB0
+       .4byte  $LCFI00-$LFB0
        .byte   0xe      # DW_CFA_def_cfa_offset
        .uleb128 0x18
        .byte   0x4      # DW_CFA_advance_loc4
-       .4byte  $LCFI2-$LCFI0
+       .4byte  $LCFI01-$LCFI00
        .byte   0x11     # DW_CFA_offset_extended_sf
        .uleb128 0x1e    # $fp
        .sleb128 -2      # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp)
@@ -342,12 +434,13 @@ $LASFDE0:
        .uleb128 0x1f    # $ra
        .sleb128 -1      # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
        .byte   0x4      # DW_CFA_advance_loc4
-       .4byte  $LCFI3-$LCFI2
+       .4byte  $LCFI02-$LCFI01
        .byte   0xc      # DW_CFA_def_cfa
        .uleb128 0x1e
        .uleb128 0x18
        .align  2
 $LEFDE0:
+
 $LSFDE1:
        .4byte  $LEFDE1-$LASFDE1         # FDE Length
 $LASFDE1:
@@ -356,11 +449,11 @@ $LASFDE1:
        .4byte  $LFE1-$LFB1      # FDE address range
        .uleb128 0x0     # Augmentation size
        .byte   0x4      # DW_CFA_advance_loc4
-       .4byte  $LCFI4-$LFB1
+       .4byte  $LCFI10-$LFB1
        .byte   0xe      # DW_CFA_def_cfa_offset
-       .uleb128 0x38
+       .uleb128 SIZEOF_FRAME2
        .byte   0x4      # DW_CFA_advance_loc4
-       .4byte  $LCFI6-$LCFI4
+       .4byte  $LCFI11-$LCFI10
        .byte   0x11     # DW_CFA_offset_extended_sf
        .uleb128 0x10    # $16
        .sleb128 -3      # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp)
@@ -371,11 +464,41 @@ $LASFDE1:
        .uleb128 0x1f    # $ra
        .sleb128 -1      # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
        .byte   0x4      # DW_CFA_advance_loc4
-       .4byte  $LCFI7-$LCFI6
+       .4byte  $LCFI12-$LCFI11
        .byte   0xc      # DW_CFA_def_cfa
        .uleb128 0x1e
-       .uleb128 0x38
+       .uleb128 SIZEOF_FRAME2
        .align  2
 $LEFDE1:
 
+$LSFDE2:
+       .4byte  $LEFDE2-$LASFDE2         # FDE Length
+$LASFDE2:
+       .4byte  $LASFDE2-$Lframe0        # FDE CIE offset
+       .4byte  $LFB2    # FDE initial location
+       .4byte  $LFE2-$LFB2      # FDE address range
+       .uleb128 0x0     # Augmentation size
+       .byte   0x4      # DW_CFA_advance_loc4
+       .4byte  $LCFI20-$LFB2
+       .byte   0xe      # DW_CFA_def_cfa_offset
+       .uleb128 SIZEOF_FRAME2
+       .byte   0x4      # DW_CFA_advance_loc4
+       .4byte  $LCFI21-$LCFI20
+       .byte   0x11     # DW_CFA_offset_extended_sf
+       .uleb128 0x10    # $16
+       .sleb128 -3      # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp)
+       .byte   0x11     # DW_CFA_offset_extended_sf
+       .uleb128 0x1e    # $fp
+       .sleb128 -2      # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp)
+       .byte   0x11     # DW_CFA_offset_extended_sf
+       .uleb128 0x1f    # $ra
+       .sleb128 -1      # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
+       .byte   0x4      # DW_CFA_advance_loc4
+       .4byte  $LCFI22-$LCFI21
+       .byte   0xc      # DW_CFA_def_cfa
+       .uleb128 0x1e
+       .uleb128 SIZEOF_FRAME2
+       .align  2
+$LEFDE2:
+
 #endif
index ac7aceb1a6bb12ff2e4994ccb6ab930793e1bf8c..10cfb0448ea937a1c258cb6545af15b062376b9b 100644 (file)
@@ -59,7 +59,7 @@ ffi_call_EABI:
        mov     $r6, $r4 /* Save result buffer */
        mov     $r7, $r5 /* Save the target fn */
        mov     $r8, $r3 /* Save the flags */
-       sub.l   $sp, $r2 /* Allocate stack space */
+       sub     $sp, $r2 /* Allocate stack space */
        mov     $r0, $sp /* We can stomp over $r0 */
        /* $r1 is already set up */
        jsra    ffi_prep_args
index 540a042996f5f672819f62d983d2b78f40cc333d..16d2bb37c8eaa19bec89b15cbbcc8ca061050f51 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
-   ffi.c - Copyright (C) 2012, 2013  Anthony Green
+   ffi.c - Copyright (C) 2012, 2013, 2018  Anthony Green
    
    Moxie Foreign Function Interface 
 
@@ -100,7 +100,7 @@ void *ffi_prep_args(char *stack, extended_cif *ecif)
       count += z;
     }
 
-  return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
+  return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8)));
 }
 
 /* Perform machine dependent cif processing */
@@ -111,7 +111,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   else
     cif->flags = cif->rtype->size;
 
-  cif->bytes = ALIGN (cif->bytes, 8);
+  cif->bytes = FFI_ALIGN (cif->bytes, 8);
 
   return FFI_OK;
 }
@@ -159,7 +159,7 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
                       unsigned arg4, unsigned arg5, unsigned arg6)
 {
   /* This function is called by a trampoline.  The trampoline stows a
-     pointer to the ffi_closure object in $r7.  We must save this
+     pointer to the ffi_closure object in $r12.  We must save this
      pointer in a place that will persist while we do our work.  */
   register ffi_closure *creg __asm__ ("$r12");
   ffi_closure *closure = creg;
@@ -215,7 +215,18 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
          break;
        default:
          /* This is an 8-byte value.  */
-         avalue[i] = ptr;
+         if (ptr == (char *) &register_args[5])
+           {
+             /* The value is split across two locations */
+             unsigned *ip = alloca(8);
+             avalue[i] = ip;
+             ip[0] = *(unsigned *) ptr;
+             ip[1] = *(unsigned *) stack_args;
+           }
+         else
+           {
+             avalue[i] = ptr;
+           }
          ptr += 4;
          break;
        }
@@ -223,8 +234,10 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
 
       /* If we've handled more arguments than fit in registers,
         start looking at the those passed on the stack.  */
-      if (ptr == &register_args[6])
+      if (ptr == (char *) &register_args[6])
        ptr = stack_args;
+      else if (ptr == (char *) &register_args[7])
+       ptr = stack_args + 4;
     }
 
   /* Invoke the closure.  */
@@ -257,7 +270,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
 
   fn = (unsigned long) ffi_closure_eabi;
 
-  tramp[0] = 0x01e0; /* ldi.l $r7, .... */
+  tramp[0] = 0x01e0; /* ldi.l $r12, .... */
   tramp[1] = cls >> 16;
   tramp[2] = cls & 0xffff;
   tramp[3] = 0x1a00; /* jmpa .... */
index 2efa033f9cd61f15164f3f45230bed715e486492..721080d45ebe2990aa46cad8b899feef5b86c210 100644 (file)
@@ -101,7 +101,7 @@ void ffi_prep_args (char *stack, extended_cif *ecif)
 
       /* Align argp as appropriate for the argument type.  */
       if ((alignment - 1) & (unsigned) argp)
-       argp = (char *) ALIGN (argp, alignment);
+       argp = (char *) FFI_ALIGN (argp, alignment);
 
       /* Copy the argument, promoting integral types smaller than a
         word to word size.  */
@@ -230,7 +230,7 @@ ffi_closure_helper (unsigned char *args,
 
       /* Align argp as appropriate for the argument type.  */
       if ((alignment - 1) & (unsigned) argp)
-       argp = (char *) ALIGN (argp, alignment);
+       argp = (char *) FFI_ALIGN (argp, alignment);
 
       /* Arguments smaller than an int are promoted to int.  */
       if (size < sizeof (int))
index 0da81849deefdfa5ab2d579c45df5fdf5b8df409..95e669473e1ecda58a1d5f50e05b7b132b414b5c 100644 (file)
@@ -1,6 +1,5 @@
 /* -----------------------------------------------------------------------
-   ffi.c - (c) 2016 John David Anglin
-          (c) 2011 Anthony Green
+   ffi.c - (c) 2011 Anthony Green
            (c) 2008 Red Hat, Inc.
           (c) 2006 Free Software Foundation, Inc.
            (c) 2003-2004 Randolph Chung <tausq@debian.org>
@@ -52,8 +51,7 @@
 
 #define debug(lvl, x...) do { if (lvl <= DEBUG_LEVEL) { printf(x); } } while (0)
 
-static inline int
-ffi_struct_type (ffi_type *t)
+static inline int ffi_struct_type(ffi_type *t)
 {
   size_t sz = t->size;
 
@@ -141,8 +139,7 @@ ffi_struct_type (ffi_type *t)
    NOTE: We load floating point args in this function... that means we
    assume gcc will not mess with fp regs in here.  */
 
-void
-ffi_prep_args_pa32 (UINT32 *stack, extended_cif *ecif, unsigned bytes)
+void ffi_prep_args_pa32(UINT32 *stack, extended_cif *ecif, unsigned bytes)
 {
   register unsigned int i;
   register ffi_type **p_arg;
@@ -278,8 +275,7 @@ ffi_prep_args_pa32 (UINT32 *stack, extended_cif *ecif, unsigned bytes)
   return;
 }
 
-static void
-ffi_size_stack_pa32 (ffi_cif *cif)
+static void ffi_size_stack_pa32(ffi_cif *cif)
 {
   ffi_type **ptr;
   int i;
@@ -320,8 +316,7 @@ ffi_size_stack_pa32 (ffi_cif *cif)
 }
 
 /* Perform machine dependent cif processing.  */
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
 {
   /* Set the return type flag */
   switch (cif->rtype->type)
@@ -374,13 +369,11 @@ ffi_prep_cif_machdep (ffi_cif *cif)
   return FFI_OK;
 }
 
-extern void ffi_call_pa32 (void (*)(UINT32 *, extended_cif *, unsigned),
-                          extended_cif *, unsigned, unsigned, unsigned *,
-                          void (*fn)(void), void *closure);
+extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned),
+                         extended_cif *, unsigned, unsigned, unsigned *,
+                         void (*fn)(void));
 
-static void
-ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue,
-             void *closure)
+void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 {
   extended_cif ecif;
 
@@ -408,8 +401,8 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue,
     {
     case FFI_PA32:
       debug(3, "Calling ffi_call_pa32: ecif=%p, bytes=%u, flags=%u, rvalue=%p, fn=%p\n", &ecif, cif->bytes, cif->flags, ecif.rvalue, (void *)fn);
-      ffi_call_pa32 (ffi_prep_args_pa32, &ecif, cif->bytes,
-                    cif->flags, ecif.rvalue, fn, closure);
+      ffi_call_pa32(ffi_prep_args_pa32, &ecif, cif->bytes,
+                    cif->flags, ecif.rvalue, fn);
       break;
 
     default:
@@ -418,60 +411,35 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue,
     }
 }
 
-void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
-  ffi_call_int (cif, fn, rvalue, avalue, NULL);
-}
-
-void
-ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue,
-            void *closure)
-{
-  ffi_call_int (cif, fn, rvalue, avalue, closure);
-}
-
 #if FFI_CLOSURES
 /* This is more-or-less an inverse of ffi_call -- we have arguments on
    the stack, and we need to fill them into a cif structure and invoke
    the user function. This really ought to be in asm to make sure
    the compiler doesn't do things we don't expect.  */
-ffi_status
-ffi_closure_inner_pa32 (void *closure, UINT32 *stack, int closure_type)
+ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
 {
   ffi_cif *cif;
-  void (*fun)(ffi_cif *,void *,void **,void *); 
-  void *user_data;
   void **avalue;
   void *rvalue;
-  UINT32 ret[2]; /* function can return up to 64-bits in registers */
+  /* Functions can return up to 64-bits in registers.  Return address
+     must be double word aligned.  */
+  union { double rd; UINT32 ret[2]; } u;
   ffi_type **p_arg;
   char *tmp;
   int i, avn;
   unsigned int slot = FIRST_ARG_SLOT;
   register UINT32 r28 asm("r28");
+  ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure);
 
-  /* A non-zero closure type indicates a go closure.  */
-  if (closure_type)
-    {
-      cif = ((ffi_go_closure *)closure)->cif;
-      fun = ((ffi_go_closure *)closure)->fun;
-      user_data = closure;
-    }
-  else
-    {
-      cif = ((ffi_closure *)closure)->cif;
-      fun = ((ffi_closure *)closure)->fun;
-      user_data = ((ffi_closure *)closure)->user_data;
-    }
+  cif = closure->cif;
 
   /* If returning via structure, callee will write to our pointer.  */
   if (cif->flags == FFI_TYPE_STRUCT)
     rvalue = (void *)r28;
   else
-    rvalue = &ret[0];
+    rvalue = &u;
 
-  avalue = (void **) alloca (cif->nargs * FFI_SIZEOF_ARG);
+  avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG);
   avn = cif->nargs;
   p_arg = cif->arg_types;
 
@@ -564,35 +532,35 @@ ffi_closure_inner_pa32 (void *closure, UINT32 *stack, int closure_type)
     }
 
   /* Invoke the closure.  */
-  fun (cif, rvalue, avalue, user_data);
+  (c->fun) (cif, rvalue, avalue, c->user_data);
 
-  debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", ret[0],
-       ret[1]);
+  debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", u.ret[0],
+       u.ret[1]);
 
   /* Store the result using the lower 2 bytes of the flags.  */
   switch (cif->flags)
     {
     case FFI_TYPE_UINT8:
-      *(stack - FIRST_ARG_SLOT) = (UINT8)(ret[0] >> 24);
+      *(stack - FIRST_ARG_SLOT) = (UINT8)(u.ret[0] >> 24);
       break;
     case FFI_TYPE_SINT8:
-      *(stack - FIRST_ARG_SLOT) = (SINT8)(ret[0] >> 24);
+      *(stack - FIRST_ARG_SLOT) = (SINT8)(u.ret[0] >> 24);
       break;
     case FFI_TYPE_UINT16:
-      *(stack - FIRST_ARG_SLOT) = (UINT16)(ret[0] >> 16);
+      *(stack - FIRST_ARG_SLOT) = (UINT16)(u.ret[0] >> 16);
       break;
     case FFI_TYPE_SINT16:
-      *(stack - FIRST_ARG_SLOT) = (SINT16)(ret[0] >> 16);
+      *(stack - FIRST_ARG_SLOT) = (SINT16)(u.ret[0] >> 16);
       break;
     case FFI_TYPE_INT:
     case FFI_TYPE_SINT32:
     case FFI_TYPE_UINT32:
-      *(stack - FIRST_ARG_SLOT) = ret[0];
+      *(stack - FIRST_ARG_SLOT) = u.ret[0];
       break;
     case FFI_TYPE_SINT64:
     case FFI_TYPE_UINT64:
-      *(stack - FIRST_ARG_SLOT) = ret[0];
-      *(stack - FIRST_ARG_SLOT - 1) = ret[1];
+      *(stack - FIRST_ARG_SLOT) = u.ret[0];
+      *(stack - FIRST_ARG_SLOT - 1) = u.ret[1];
       break;
 
     case FFI_TYPE_DOUBLE:
@@ -612,7 +580,7 @@ ffi_closure_inner_pa32 (void *closure, UINT32 *stack, int closure_type)
     case FFI_TYPE_SMALL_STRUCT4:
       tmp = (void*)(stack -  FIRST_ARG_SLOT);
       tmp += 4 - cif->rtype->size;
-      memcpy((void*)tmp, &ret[0], cif->rtype->size);
+      memcpy((void*)tmp, &u, cif->rtype->size);
       break;
 
     case FFI_TYPE_SMALL_STRUCT5:
@@ -633,7 +601,7 @@ ffi_closure_inner_pa32 (void *closure, UINT32 *stack, int closure_type)
          }
 
        memset (ret2, 0, sizeof (ret2));
-       memcpy ((char *)ret2 + off, ret, 8 - off);
+       memcpy ((char *)ret2 + off, &u, 8 - off);
 
        *(stack - FIRST_ARG_SLOT) = ret2[0];
        *(stack - FIRST_ARG_SLOT - 1) = ret2[1];
@@ -656,7 +624,6 @@ ffi_closure_inner_pa32 (void *closure, UINT32 *stack, int closure_type)
    cif specifies the argument and result types for fun.
    The cif must already be prep'ed.  */
 
-extern void ffi_go_closure_pa32(void);
 extern void ffi_closure_pa32(void);
 
 ffi_status
@@ -666,107 +633,42 @@ ffi_prep_closure_loc (ffi_closure* closure,
                      void *user_data,
                      void *codeloc)
 {
-  UINT32 *tramp = (UINT32 *)(closure->tramp);
-#ifdef PA_HPUX
-  UINT32 *tmp;
-#endif
-
-  if (cif->abi != FFI_PA32)
-    return FFI_BAD_ABI;
-
-  /* Make a small trampoline that will branch to our
-     handler function. Use PC-relative addressing.  */
-
-#ifdef PA_LINUX
-  tramp[0] = 0xeaa00000; /* b,l .+8,%r21        ; %r21 <- pc+8 */
-  tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21    ; mask priv bits */
-  tramp[2] = 0x4aa10028; /* ldw 20(%r21),%r1    ; load plabel */
-  tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21   ; get closure addr */
-  tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22     ; address of handler */
-  tramp[5] = 0xeac0c000; /* bv%r0(%r22)         ; branch to handler */
-  tramp[6] = 0x0c281093; /* ldw 4(%r1),%r19     ; GP of handler */
-  tramp[7] = ((UINT32)(ffi_closure_pa32) & ~2);
-
-  /* Flush d/icache -- have to flush up 2 two lines because of
-     alignment.  */
-  __asm__ volatile(
-                  "fdc 0(%0)\n\t"
-                  "fdc %1(%0)\n\t"
-                  "fic 0(%%sr4, %0)\n\t"
-                  "fic %1(%%sr4, %0)\n\t"
-                  "sync\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n"
-                  :
-                  : "r"((unsigned long)tramp & ~31),
-                    "r"(32 /* stride */)
-                  : "memory");
-#endif
+  ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure);
 
-#ifdef PA_HPUX
-  tramp[0] = 0xeaa00000; /* b,l .+8,%r21        ; %r21 <- pc+8  */
-  tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21    ; mask priv bits  */
-  tramp[2] = 0x4aa10038; /* ldw 28(%r21),%r1    ; load plabel  */
-  tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21   ; get closure addr  */
-  tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22     ; address of handler  */
-  tramp[5] = 0x02c010b4; /* ldsid (%r22),%r20   ; load space id  */
-  tramp[6] = 0x00141820; /* mtsp %r20,%sr0      ; into %sr0  */
-  tramp[7] = 0xe2c00000; /* be 0(%sr0,%r22)     ; branch to handler  */
-  tramp[8] = 0x0c281093; /* ldw 4(%r1),%r19     ; GP of handler  */
-  tramp[9] = ((UINT32)(ffi_closure_pa32) & ~2);
-
-  /* Flush d/icache -- have to flush three lines because of alignment.  */
-  __asm__ volatile(
-                  "copy %1,%0\n\t"
-                  "fdc,m %2(%0)\n\t"
-                  "fdc,m %2(%0)\n\t"
-                  "fdc,m %2(%0)\n\t"
-                  "ldsid (%1),%0\n\t"
-                  "mtsp %0,%%sr0\n\t"
-                  "copy %1,%0\n\t"
-                  "fic,m %2(%%sr0,%0)\n\t"
-                  "fic,m %2(%%sr0,%0)\n\t"
-                  "fic,m %2(%%sr0,%0)\n\t"
-                  "sync\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n\t"
-                  "nop\n"
-                  : "=&r" ((unsigned long)tmp)
-                  : "r" ((unsigned long)tramp & ~31),
-                    "r" (32/* stride */)
-                  : "memory");
-#endif
+  /* The layout of a function descriptor.  A function pointer with the PLABEL
+     bit set points to a function descriptor.  */
+  struct pa32_fd
+  {
+    UINT32 code_pointer;
+    UINT32 gp;
+  };
 
-  closure->cif  = cif;
-  closure->user_data = user_data;
-  closure->fun  = fun;
+  struct ffi_pa32_trampoline_struct
+  {
+     UINT32 code_pointer;        /* Pointer to ffi_closure_unix.  */
+     UINT32 fake_gp;             /* Pointer to closure, installed as gp.  */
+     UINT32 real_gp;             /* Real gp value.  */
+  };
 
-  return FFI_OK;
-}
+  struct ffi_pa32_trampoline_struct *tramp;
+  struct pa32_fd *fd;
 
-#ifdef FFI_GO_CLOSURES
-ffi_status
-ffi_prep_go_closure (ffi_go_closure *closure,
-                    ffi_cif *cif,
-                    void (*fun)(ffi_cif *, void *, void **, void *))
-{
   if (cif->abi != FFI_PA32)
     return FFI_BAD_ABI;
 
-  closure->tramp = &ffi_go_closure_pa32;
-  closure->cif = cif;
-  closure->fun = fun;
+  /* Get function descriptor address for ffi_closure_pa32.  */
+  fd = (struct pa32_fd *)((UINT32)ffi_closure_pa32 & ~3);
+
+  /* Setup trampoline.  */
+  tramp = (struct ffi_pa32_trampoline_struct *)c->tramp;
+  tramp->code_pointer = fd->code_pointer;
+  tramp->fake_gp = (UINT32)codeloc & ~3;
+  tramp->real_gp = fd->gp;
+
+  c->cif  = cif;
+  c->user_data = user_data;
+  c->fun  = fun;
 
   return FFI_OK;
 }
-#endif /* FFI_GO_CLOSURES */
 #endif
index 024ac81a8073b0c3bfa822f4a5e7998f482f50e7..df1209eb16700e0284d114ed134bca2fa0afdecd 100644 (file)
@@ -1,6 +1,5 @@
 /* -----------------------------------------------------------------*-C-*-
-   ffitarget.h - Copyright (c) 2016  John David Anglin
-                Copyright (c) 2012  Anthony Green
+   ffitarget.h - Copyright (c) 2012  Anthony Green
                  Copyright (c) 1996-2003  Red Hat, Inc.
    Target configuration macros for hppa.
 
@@ -68,14 +67,8 @@ typedef enum ffi_abi {
 /* ---- Definitions for closures ----------------------------------------- */
 
 #define FFI_CLOSURES 1
-#define FFI_GO_CLOSURES 1
 #define FFI_NATIVE_RAW_API 0
-
-#ifdef PA_LINUX
-#define FFI_TRAMPOLINE_SIZE 32
-#else
-#define FFI_TRAMPOLINE_SIZE 40
-#endif
+#define FFI_TRAMPOLINE_SIZE 12
 
 #define FFI_TYPE_SMALL_STRUCT2 -1
 #define FFI_TYPE_SMALL_STRUCT3 -2
index 4a47da3791a96d486efaa51aab2189adfb09d4f8..d0e5f695297bb837f3a360e5af27b0c4010da508 100644 (file)
@@ -1,7 +1,6 @@
 /* -----------------------------------------------------------------------
    hpux32.S - Copyright (c) 2006 Free Software Foundation, Inc.
                        (c) 2008 Red Hat, Inc.
-                       (c) 2016 John David Anglin
    based on src/pa/linux.S
 
    HP-UX PA Foreign Function Interface
@@ -42,8 +41,7 @@
                               unsigned bytes,
                               unsigned flags,
                               unsigned *rvalue,
-                              void (*fn)(void),
-                              ffi_go_closure *closure);
+                              void (*fn)(void));
         */
 
        .export ffi_call_pa32,ENTRY,PRIV_LEV=3
@@ -106,7 +104,6 @@ L$CFI13
           we need to give it a place to put the result.  */
        ldw     -52(%r3), %ret0         ; %ret0 <- rvalue
        ldw     -56(%r3), %r22          ; %r22 <- function to call
-       ldw     -60(%r3), %ret1         ; %ret1 <- closure
        bl      $$dyncall, %r31         ; Call the user function
        copy    %r31, %rp
 
@@ -262,7 +259,7 @@ L$done
 L$FE1
 
        /* void ffi_closure_pa32(void);
-          Called with closure argument in %r21 */
+          Called with closure argument in %r19 */
 
        .SPACE $TEXT$
        .SUBSPA $CODE$
@@ -288,9 +285,9 @@ L$CFI22
        stw     %arg2, -44(%r3)
        stw     %arg3, -48(%r3)
 
-       /* Closure type 0.  */
-       copy    %r21, %arg0
-       copy    %r0, %arg2
+       /* Retrieve closure pointer and real gp.  */
+       copy    %r19, %arg0
+       ldw     8(%r19), %r19
        bl      ffi_closure_inner_pa32, %r2
        copy    %r3, %arg1
        ldwm    -64(%sp), %r3
@@ -302,47 +299,6 @@ L$CFI22
        .procend
 L$FE2:
 
-       /* void ffi_go_closure_pa32(void);
-          Called with closure argument in %ret1 */
-
-       .SPACE $TEXT$
-       .SUBSPA $CODE$
-       .export ffi_go_closure_pa32,ENTRY,PRIV_LEV=3,RTNVAL=GR
-       .import ffi_closure_inner_pa32,CODE
-       .align 4
-L$FB3
-ffi_go_closure_pa32
-       .proc
-       .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
-       .entry
-
-       stw     %rp, -20(%sp)
-       copy    %r3, %r1
-L$CFI31
-       copy    %sp, %r3
-L$CFI32
-       stwm    %r1, 64(%sp)
-
-       /* Put arguments onto the stack and call ffi_closure_inner.  */
-       stw     %arg0, -36(%r3)
-       stw     %arg1, -40(%r3)
-       stw     %arg2, -44(%r3)
-       stw     %arg3, -48(%r3)
-
-       /* Closure type 1.  */
-       copy    %ret1, %arg0
-       ldi     1, %arg2
-       bl      ffi_closure_inner_pa32, %r2
-       copy    %r3, %arg1
-       ldwm    -64(%sp), %r3
-       ldw     -20(%sp), %rp
-       ldw     -36(%sp), %ret0
-       bv      %r0(%rp)
-       ldw     -40(%sp), %ret1
-       .exit
-       .procend
-L$FE3:
-
        .SPACE $PRIVATE$
        .SUBSPA $DATA$
 
@@ -412,25 +368,3 @@ L$ASFDE2:
 
        .align 4
 L$EFDE2:
-
-L$SFDE3:
-       .word   L$EFDE3-L$ASFDE3        ;# FDE Length
-L$ASFDE3:
-       .word   L$ASFDE3-L$frame1       ;# FDE CIE offset
-       .word   L$FB3   ;# FDE initial location
-       .word   L$FE3-L$FB3     ;# FDE address range
-       .byte   0x4     ;# DW_CFA_advance_loc4
-       .word   L$CFI31-L$FB3
-       .byte   0x83    ;# DW_CFA_offset, column 0x3
-       .uleb128 0x0
-       .byte   0x11    ;# DW_CFA_offset_extended_sf
-       .uleb128 0x2
-       .sleb128 -5
-
-       .byte   0x4     ;# DW_CFA_advance_loc4
-       .word   L$CFI32-L$CFI31
-       .byte   0xd     ;# DW_CFA_def_cfa_register = r3
-       .uleb128 0x3
-
-       .align 4
-L$EFDE3:
index 602690432c046214fa003a40bbc034a20952d8d6..33ef0b137a4118bcfce9bc1e4b1dc4335cb4f027 100644 (file)
@@ -1,7 +1,6 @@
 /* -----------------------------------------------------------------------
    linux.S - (c) 2003-2004 Randolph Chung <tausq@debian.org>
             (c) 2008 Red Hat, Inc.
-            (c) 2016 John David Anglin
 
    HPPA Foreign Function Interface
 
                               unsigned bytes,
                               unsigned flags,
                               unsigned *rvalue,
-                              void (*fn)(void),
-                              ffi_go_closure *closure);
+                              void (*fn)(void));
         */
 
        .export ffi_call_pa32,code
        .import ffi_prep_args_pa32,code
 
        .type ffi_call_pa32, @function
-       .cfi_startproc
+.LFB1:
 ffi_call_pa32:
        .proc
        .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4
        .entry
        stw %rp, -20(%sp)
        copy %r3, %r1
-        .cfi_offset 2, -20
-        .cfi_register 3, 1
+.LCFI11:
 
        copy %sp, %r3
-       .cfi_def_cfa_register 3
+.LCFI12:
 
        /* Setup the stack for calling prep_args...
           We want the stack to look like this:
@@ -73,8 +70,8 @@ ffi_call_pa32:
         */
 
        stwm %r1, 64(%sp)
-       .cfi_offset 3, 0
        stw %r4, 12(%r3)
+.LCFI13:
        copy %sp, %r4
 
        addl %arg2, %r4, %arg0      /* arg stack */
@@ -101,7 +98,6 @@ ffi_call_pa32:
           we need to give it a place to put the result.  */
        ldw -52(%r3), %ret0                     /* %ret0 <- rvalue */
        ldw -56(%r3), %r22                      /* %r22 <- function to call */
-       ldw -60(%r3), %ret1                     /* %ret1 <- closure */
        bl $$dyncall, %r31                      /* Call the user function */
        copy %r31, %rp
 
@@ -253,27 +249,27 @@ ffi_call_pa32:
        nop
        .exit
        .procend
-       .cfi_endproc
+.LFE1:
 
        /* void ffi_closure_pa32(void);
-          Called with ffi_closure argument in %r21.  */
+          Called with closure argument in %r19 */
        .export ffi_closure_pa32,code
        .import ffi_closure_inner_pa32,code
+
        .type ffi_closure_pa32, @function
-       .cfi_startproc
+.LFB2:
 ffi_closure_pa32:
        .proc
        .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
        .entry
 
        stw %rp, -20(%sp)
+.LCFI20:
        copy %r3, %r1
-       .cfi_offset 2, -20
-       .cfi_register 3, 1
+.LCFI21:
        copy %sp, %r3
-       .cfi_def_cfa_register 3
+.LCFI22:
        stwm %r1, 64(%sp)
-       .cfi_offset 3, 0
 
        /* Put arguments onto the stack and call ffi_closure_inner.  */
        stw %arg0, -36(%r3)
@@ -281,9 +277,9 @@ ffi_closure_pa32:
        stw %arg2, -44(%r3)
        stw %arg3, -48(%r3)
 
-       /* Closure type 0.  */
-       copy %r21, %arg0
-       copy %r0, %arg2
+       /* Retrieve closure pointer and real gp.  */
+       copy    %r19, %arg0
+       ldw     8(%r19), %r19
        bl ffi_closure_inner_pa32, %r2
        copy %r3, %arg1
 
@@ -295,46 +291,90 @@ ffi_closure_pa32:
 
        .exit
        .procend
-       .cfi_endproc
-
-       /* void ffi_go_closure_pa32(void);
-          Called with ffi_go_closure argument in %ret1.  */
-       .export ffi_go_closure_pa32,code
-       .import ffi_closure_inner_pa32,code
-       .type ffi_go_closure_pa32, @function
-       .cfi_startproc
-ffi_go_closure_pa32:
-       .proc
-       .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
-       .entry
-
-       stw %rp, -20(%sp)
-       copy %r3, %r1
-       .cfi_offset 2, -20
-       .cfi_register 3, 1
-       copy %sp, %r3
-       .cfi_def_cfa_register 3
-       stwm %r1, 64(%sp)
-       .cfi_offset 3, 0
-
-       /* Put arguments onto the stack and call ffi_closure_inner.  */
-       stw %arg0, -36(%r3)
-       stw %arg1, -40(%r3)
-       stw %arg2, -44(%r3)
-       stw %arg3, -48(%r3)
-
-       /* Closure type 1.  */
-       copy %ret1, %arg0
-       ldi 1, %arg2
-       bl ffi_closure_inner_pa32, %r2
-       copy %r3, %arg1
+.LFE2:
+
+       .section        ".eh_frame",EH_FRAME_FLAGS,@progbits
+.Lframe1:
+       .word   .LECIE1-.LSCIE1 ;# Length of Common Information Entry
+.LSCIE1:
+       .word   0x0     ;# CIE Identifier Tag
+       .byte   0x1     ;# CIE Version
+#ifdef __PIC__
+       .ascii  "zR\0"  ;# CIE Augmentation: 'z' - data, 'R' - DW_EH_PE_... data
+#else
+       .ascii "\0"     ;# CIE Augmentation
+#endif
+       .uleb128 0x1    ;# CIE Code Alignment Factor
+       .sleb128 4      ;# CIE Data Alignment Factor
+       .byte   0x2     ;# CIE RA Column
+#ifdef __PIC__
+       .uleb128 0x1    ;# Augmentation size
+       .byte   0x1b    ;# FDE Encoding (DW_EH_PE_pcrel|DW_EH_PE_sdata4)
+#endif
+       .byte   0xc     ;# DW_CFA_def_cfa
+       .uleb128 0x1e
+       .uleb128 0x0
+       .align 4
+.LECIE1:
+.LSFDE1:
+       .word   .LEFDE1-.LASFDE1        ;# FDE Length
+.LASFDE1:
+       .word   .LASFDE1-.Lframe1       ;# FDE CIE offset
+#ifdef __PIC__
+       .word   .LFB1-. ;# FDE initial location
+#else
+       .word   .LFB1   ;# FDE initial location
+#endif
+       .word   .LFE1-.LFB1     ;# FDE address range
+#ifdef __PIC__
+       .uleb128 0x0    ;# Augmentation size: no data
+#endif
+       .byte   0x4     ;# DW_CFA_advance_loc4
+       .word   .LCFI11-.LFB1
+       .byte   0x83    ;# DW_CFA_offset, column 0x3
+       .uleb128 0x0
+       .byte   0x11    ;# DW_CFA_offset_extended_sf; save r2 at [r30-20]
+       .uleb128 0x2
+       .sleb128 -5
+
+       .byte   0x4     ;# DW_CFA_advance_loc4
+       .word   .LCFI12-.LCFI11
+       .byte   0xd     ;# DW_CFA_def_cfa_register = r3
+       .uleb128 0x3
+
+       .byte   0x4     ;# DW_CFA_advance_loc4
+       .word   .LCFI13-.LCFI12
+       .byte   0x84    ;# DW_CFA_offset, column 0x4
+       .uleb128 0x3
 
-       ldwm -64(%sp), %r3
-       ldw -20(%sp), %rp
-       ldw -36(%sp), %ret0
-       bv %r0(%r2)
-       ldw -40(%sp), %ret1
+       .align 4
+.LEFDE1:
+
+.LSFDE2:
+       .word   .LEFDE2-.LASFDE2        ;# FDE Length
+.LASFDE2:
+       .word   .LASFDE2-.Lframe1       ;# FDE CIE offset
+#ifdef __PIC__
+       .word   .LFB2-. ;# FDE initial location
+#else
+       .word   .LFB2   ;# FDE initial location
+#endif
+       .word   .LFE2-.LFB2     ;# FDE address range
+#ifdef __PIC__
+       .uleb128 0x0    ;# Augmentation size: no data
+#endif
+       .byte   0x4     ;# DW_CFA_advance_loc4
+       .word   .LCFI21-.LFB2
+       .byte   0x83    ;# DW_CFA_offset, column 0x3
+       .uleb128 0x0
+       .byte   0x11    ;# DW_CFA_offset_extended_sf
+       .uleb128 0x2
+       .sleb128 -5
+
+       .byte   0x4     ;# DW_CFA_advance_loc4
+       .word   .LCFI22-.LCFI21
+       .byte   0xd     ;# DW_CFA_def_cfa_register = r3
+       .uleb128 0x3
 
-       .exit
-       .procend
-       .cfi_endproc
+       .align 4
+.LEFDE2:
index 994f62d079d4742445c5165ac49f6aed7325fc39..27b22f670a232873bd721f4286aafbc3ccc27160 100644 (file)
@@ -93,7 +93,7 @@
 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
    past a 2^align boundary.  */
 #ifdef PROF
-#define EALIGN(name, alignt, words)                                          \
+#define EFFI_ALIGN(name, alignt, words)                                              \
   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);                                  \
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)                         \
   .align ALIGNARG(2);                                                        \
   EALIGN_W_##words;                                                          \
   0:
 #else /* PROF */
-#define EALIGN(name, alignt, words)                                          \
+#define EFFI_ALIGN(name, alignt, words)                                              \
   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);                                  \
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)                         \
   .align ALIGNARG(alignt);                                                   \
index c7734d419861064e39336c457d4046d32b2adf83..3121e6ac26d319ff123d5223278499670454c755 100644 (file)
@@ -353,7 +353,7 @@ Lret_type13:
        bgt     Lstructend              ; not a special small case
        b       Lsmallstruct            ; see if we need more.
 #else
-       cmp   0,r0,4
+       cmpwi   0,r0,4
        bgt     Lfinish         ; not by value
        lg      r3,0(r5)
        b       Lfinish
@@ -494,8 +494,8 @@ LSFDE1:
 LASFDE1:
        .long   LASFDE1-EH_frame1       ; FDE CIE offset
        .g_long Lstartcode-.    ; FDE initial location
-       .set    L$set$3,LFE1-Lstartcode
-       .g_long L$set$3 ; FDE address range
+       .set    L$set$2,LFE1-Lstartcode
+       .g_long L$set$2 ; FDE address range
        .byte   0x0     ; uleb128 0x0; Augmentation size
        .byte   0x4     ; DW_CFA_advance_loc4
        .set    L$set$3,LCFI1-LCFI0
index 7eb543e4b3b78976579d0dfa9c907944e2826ad8..a19bcbbfc52ffd1fda52820e8664745cba00e769 100644 (file)
@@ -85,8 +85,9 @@ ffi_call_int (ffi_cif *cif,
      can write r3 and r4 to memory without worrying about struct size.
    
      For ELFv2 ABI, use a bounce buffer for homogeneous structs too,
-     for similar reasons.  */
-  unsigned long smst_buffer[8];
+     for similar reasons. This bounce buffer must be aligned to 16
+     bytes for use with homogeneous structs of vectors (float128).  */
+  float128 smst_buffer[8];
   extended_cif ecif;
 
   ecif.cif = cif;
@@ -121,8 +122,9 @@ ffi_call_int (ffi_cif *cif,
 # endif
        /* The SYSV ABI returns a structure of up to 8 bytes in size
           left-padded in r3/r4, and the ELFv2 ABI similarly returns a
-          structure of up to 8 bytes in size left-padded in r3.  */
-       if (rsize <= 8)
+          structure of up to 8 bytes in size left-padded in r3. But
+          note that a structure of a single float is not paddded.  */
+       if (rsize <= 8 && (cif->flags & FLAG_RETURNS_FP) == 0)
          memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize);
        else
 #endif
index 6588e3cad0832e231b72eb70b23cc30fca11c7c0..64bb94dfae7e3d9a15aca95ce64282122bfcfa6a 100644 (file)
 #include <stdlib.h>
 
 extern void ffi_closure_ASM (void);
+
+#if defined (FFI_GO_CLOSURES)
 extern void ffi_go_closure_ASM (void);
+#endif
 
 enum {
   /* The assembly depends on these exact flags.  
@@ -256,7 +259,7 @@ ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
        case FFI_TYPE_STRUCT:
          size_al = (*ptr)->size;
 #if defined(POWERPC_DARWIN64)
-         next_arg = (unsigned long *)ALIGN((char *)next_arg, (*ptr)->alignment);
+         next_arg = (unsigned long *)FFI_ALIGN((char *)next_arg, (*ptr)->alignment);
          darwin64_pass_struct_by_value (*ptr, (char *) *p_argv, 
                                         (unsigned) size_al,
                                         (unsigned int *) &fparg_count,
@@ -267,7 +270,7 @@ ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
          /* If the first member of the struct is a double, then include enough
             padding in the struct size to align it to double-word.  */
          if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
-           size_al = ALIGN((*ptr)->size, 8);
+           size_al = FFI_ALIGN((*ptr)->size, 8);
 
 #  if defined(POWERPC64) 
          FFI_ASSERT (abi != FFI_DARWIN);
@@ -353,7 +356,7 @@ darwin64_struct_size_exceeds_gprs_p (ffi_type *s, char *src, unsigned *nfpr)
       ffi_type *p = s->elements[i];
       /* Find the start of this item (0 for the first one).  */
       if (i > 0)
-        struct_offset = ALIGN(struct_offset, p->alignment);
+        struct_offset = FFI_ALIGN(struct_offset, p->alignment);
 
       item_base = src + struct_offset;
 
@@ -437,7 +440,7 @@ darwin64_pass_struct_floats (ffi_type *s, char *src,
       ffi_type *p = s->elements[i];
       /* Find the start of this item (0 for the first one).  */
       if (i > 0)
-        struct_offset = ALIGN(struct_offset, p->alignment);
+        struct_offset = FFI_ALIGN(struct_offset, p->alignment);
       item_base = src + struct_offset;
 
       switch (p->type)
@@ -528,7 +531,7 @@ darwin64_struct_floats_to_mem (ffi_type *s, char *dest, double *fprs, unsigned *
       ffi_type *p = s->elements[i];
       /* Find the start of this item (0 for the first one).  */
       if (i > 0)
-        struct_offset = ALIGN(struct_offset, p->alignment);
+        struct_offset = FFI_ALIGN(struct_offset, p->alignment);
       item_base = dest + struct_offset;
 
       switch (p->type)
@@ -605,10 +608,10 @@ darwin_adjust_aggregate_sizes (ffi_type *s)
        align = 4;
 #endif
       /* Pad, if necessary, before adding the current item.  */
-      s->size = ALIGN(s->size, align) + p->size;
+      s->size = FFI_ALIGN(s->size, align) + p->size;
     }
   
-  s->size = ALIGN(s->size, s->alignment);
+  s->size = FFI_ALIGN(s->size, s->alignment);
   
   /* This should not be necessary on m64, but harmless.  */
   if (s->elements[0]->type == FFI_TYPE_UINT64
@@ -641,10 +644,10 @@ aix_adjust_aggregate_sizes (ffi_type *s)
       align = p->alignment;
       if (i != 0 && p->type == FFI_TYPE_DOUBLE)
        align = 4;
-      s->size = ALIGN(s->size, align) + p->size;
+      s->size = FFI_ALIGN(s->size, align) + p->size;
     }
   
-  s->size = ALIGN(s->size, s->alignment);
+  s->size = FFI_ALIGN(s->size, s->alignment);
   
   if (s->elements[0]->type == FFI_TYPE_UINT64
       || s->elements[0]->type == FFI_TYPE_SINT64
@@ -810,9 +813,9 @@ ffi_prep_cif_machdep (ffi_cif *cif)
             16-byte-aligned.  */
          if (fparg_count >= NUM_FPR_ARG_REGISTERS)
 #if defined (POWERPC64)
-           intarg_count = ALIGN(intarg_count, 2);
+           intarg_count = FFI_ALIGN(intarg_count, 2);
 #else
-           intarg_count = ALIGN(intarg_count, 4);
+           intarg_count = FFI_ALIGN(intarg_count, 4);
 #endif
          break;
 #endif
@@ -839,7 +842,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
 #if defined(POWERPC_DARWIN64)
          align_words = (*ptr)->alignment >> 3;
          if (align_words)
-           intarg_count = ALIGN(intarg_count, align_words);
+           intarg_count = FFI_ALIGN(intarg_count, align_words);
          /* Base size of the struct.  */
          intarg_count += (size_al + 7) / 8;
          /* If 16 bytes then don't worry about floats.  */
@@ -849,11 +852,11 @@ ffi_prep_cif_machdep (ffi_cif *cif)
 #else
          align_words = (*ptr)->alignment >> 2;
          if (align_words)
-           intarg_count = ALIGN(intarg_count, align_words);
+           intarg_count = FFI_ALIGN(intarg_count, align_words);
          /* If the first member of the struct is a double, then align
             the struct to double-word. 
          if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
-           size_al = ALIGN((*ptr)->size, 8); */
+           size_al = FFI_ALIGN((*ptr)->size, 8); */
 #  ifdef POWERPC64
          intarg_count += (size_al + 7) / 8;
 #  else
@@ -898,7 +901,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
     bytes += NUM_GPR_ARG_REGISTERS * sizeof(long);
 
   /* The stack space allocated needs to be a multiple of 16 bytes.  */
-  bytes = ALIGN(bytes, 16) ;
+  bytes = FFI_ALIGN(bytes, 16) ;
 
   cif->flags = flags;
   cif->bytes = bytes;
@@ -909,8 +912,10 @@ ffi_prep_cif_machdep (ffi_cif *cif)
 extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *,
                         void (*fn)(void), void (*fn2)(void));
 
+#if defined (FFI_GO_CLOSURES)
 extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *,
                            void (*fn)(void), void (*fn2)(void), void *closure);
+#endif
 
 extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *,
                            void (*fn)(void), void (*fn2)(void), ffi_type*);
@@ -950,6 +955,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
     }
 }
 
+#if defined (FFI_GO_CLOSURES)
 void
 ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
             void *closure)
@@ -981,6 +987,7 @@ ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
       break;
     }
 }
+#endif
 
 static void flush_icache(char *);
 static void flush_range(char *, int);
@@ -1110,6 +1117,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
   return FFI_OK;
 }
 
+#if defined (FFI_GO_CLOSURES)
 ffi_status
 ffi_prep_go_closure (ffi_go_closure* closure,
                     ffi_cif* cif,
@@ -1133,6 +1141,7 @@ ffi_prep_go_closure (ffi_go_closure* closure,
     }
   return FFI_OK;
 }
+#endif
 
 static void
 flush_icache(char *addr)
@@ -1168,9 +1177,11 @@ ffi_type *
 ffi_closure_helper_DARWIN (ffi_closure *, void *,
                           unsigned long *, ffi_dblfl *);
 
+#if defined (FFI_GO_CLOSURES)
 ffi_type *
 ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *,
                              unsigned long *, ffi_dblfl *);
+#endif
 
 /* Basically the trampoline invokes ffi_closure_ASM, and on
    entry, r11 holds the address of the closure.
@@ -1272,7 +1283,7 @@ ffi_closure_helper_common (ffi_cif* cif,
        case FFI_TYPE_STRUCT:
          size_al = arg_types[i]->size;
 #if defined(POWERPC_DARWIN64)
-         pgr = (unsigned long *)ALIGN((char *)pgr, arg_types[i]->alignment);
+         pgr = (unsigned long *)FFI_ALIGN((char *)pgr, arg_types[i]->alignment);
          if (size_al < 3 || size_al == 4)
            {
              avalue[i] = ((char *)pgr)+8-size_al;
@@ -1297,7 +1308,7 @@ ffi_closure_helper_common (ffi_cif* cif,
          /* If the first member of the struct is a double, then align
             the struct to double-word.  */
          if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE)
-           size_al = ALIGN(arg_types[i]->size, 8);
+           size_al = FFI_ALIGN(arg_types[i]->size, 8);
 #  if defined(POWERPC64)
          FFI_ASSERT (cif->abi != FFI_DARWIN);
          avalue[i] = pgr;
@@ -1430,6 +1441,7 @@ ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue,
                                    closure->user_data, rvalue, pgr, pfr);
 }
 
+#if defined (FFI_GO_CLOSURES)
 ffi_type *
 ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue,
                              unsigned long *pgr, ffi_dblfl *pfr)
@@ -1437,4 +1449,4 @@ ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue,
   return ffi_closure_helper_common (closure->cif, closure->fun,
                                    closure, rvalue, pgr, pfr);
 }
-
+#endif
index ef0361b24ee3a2e93bba909dae75a561dd815d02..4d50878e402a2a6a2f842e7d2a0c6d8d1e1ebe02 100644 (file)
@@ -38,7 +38,8 @@
 /* About the LINUX64 ABI.  */
 enum {
   NUM_GPR_ARG_REGISTERS64 = 8,
-  NUM_FPR_ARG_REGISTERS64 = 13
+  NUM_FPR_ARG_REGISTERS64 = 13,
+  NUM_VEC_ARG_REGISTERS64 = 12,
 };
 enum { ASM_NEEDS_REGISTERS64 = 4 };
 
@@ -63,10 +64,31 @@ ffi_prep_types_linux64 (ffi_abi abi)
 
 
 static unsigned int
-discover_homogeneous_aggregate (const ffi_type *t, unsigned int *elnum)
+discover_homogeneous_aggregate (ffi_abi abi,
+                                const ffi_type *t,
+                                unsigned int *elnum)
 {
   switch (t->type)
     {
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+    case FFI_TYPE_LONGDOUBLE:
+      /* 64-bit long doubles are equivalent to doubles. */
+      if ((abi & FFI_LINUX_LONG_DOUBLE_128) == 0)
+        {
+          *elnum = 1;
+          return FFI_TYPE_DOUBLE;
+        }
+      /* IBM extended precision values use unaligned pairs
+         of FPRs, but according to the ABI must be considered
+         distinct from doubles. They are also limited to a
+         maximum of four members in a homogeneous aggregate. */
+      else if ((abi & FFI_LINUX_LONG_DOUBLE_IEEE128) == 0)
+        {
+          *elnum = 2;
+          return FFI_TYPE_LONGDOUBLE;
+        }
+      /* Fall through. */
+#endif
     case FFI_TYPE_FLOAT:
     case FFI_TYPE_DOUBLE:
       *elnum = 1;
@@ -79,7 +101,7 @@ discover_homogeneous_aggregate (const ffi_type *t, unsigned int *elnum)
        while (*el)
          {
            unsigned int el_elt, el_elnum = 0;
-           el_elt = discover_homogeneous_aggregate (*el, &el_elnum);
+           el_elt = discover_homogeneous_aggregate (abi, *el, &el_elnum);
            if (el_elt == 0
                || (base_elt && base_elt != el_elt))
              return 0;
@@ -110,13 +132,23 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
 {
   ffi_type **ptr;
   unsigned bytes;
-  unsigned i, fparg_count = 0, intarg_count = 0;
+  unsigned i, fparg_count = 0, intarg_count = 0, vecarg_count = 0;
   unsigned flags = cif->flags;
-  unsigned int elt, elnum;
+  unsigned elt, elnum, rtype;
 
 #if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE
-  /* If compiled without long double support..  */
-  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+  /* If compiled without long double support... */
+  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0 ||
+      (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+    return FFI_BAD_ABI;
+#elif !defined(__VEC__)
+  /* If compiled without vector register support (used by assembly)... */
+  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+    return FFI_BAD_ABI;
+#else
+  /* If the IEEE128 flag is set, but long double is only 64 bits wide... */
+  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) == 0 &&
+      (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
     return FFI_BAD_ABI;
 #endif
 
@@ -138,10 +170,19 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
 #endif
 
   /* Return value handling.  */
-  switch (cif->rtype->type)
+  rtype = cif->rtype->type;
+#if _CALL_ELF == 2
+homogeneous:
+#endif
+  switch (rtype)
     {
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
     case FFI_TYPE_LONGDOUBLE:
+      if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+        {
+          flags |= FLAG_RETURNS_VEC;
+          break;
+        }
       if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
        flags |= FLAG_RETURNS_128BITS;
       /* Fall through.  */
@@ -164,19 +205,18 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
 
     case FFI_TYPE_STRUCT:
 #if _CALL_ELF == 2
-      elt = discover_homogeneous_aggregate (cif->rtype, &elnum);
+      elt = discover_homogeneous_aggregate (cif->abi, cif->rtype, &elnum);
       if (elt)
-       {
-         if (elt == FFI_TYPE_DOUBLE)
-           flags |= FLAG_RETURNS_64BITS;
-         flags |= FLAG_RETURNS_FP | FLAG_RETURNS_SMST;
-         break;
-       }
+        {
+          flags |= FLAG_RETURNS_SMST;
+          rtype = elt;
+          goto homogeneous;
+        }
       if (cif->rtype->size <= 16)
-       {
-         flags |= FLAG_RETURNS_SMST;
-         break;
-       }
+        {
+          flags |= FLAG_RETURNS_SMST;
+          break;
+        }
 #endif
       intarg_count++;
       flags |= FLAG_RETVAL_REFERENCE;
@@ -198,6 +238,15 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
        {
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
        case FFI_TYPE_LONGDOUBLE:
+          if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+            {
+              vecarg_count++;
+              /* Align to 16 bytes, plus the 16-byte argument. */
+              intarg_count = (intarg_count + 3) & ~0x1;
+              if (vecarg_count > NUM_VEC_ARG_REGISTERS64)
+                flags |= FLAG_ARG_NEEDS_PSAVE;
+              break;
+            }
          if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
            {
              fparg_count++;
@@ -221,10 +270,21 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
                align = 16;
              align = align / 8;
              if (align > 1)
-               intarg_count = ALIGN (intarg_count, align);
+               intarg_count = FFI_ALIGN (intarg_count, align);
            }
          intarg_count += ((*ptr)->size + 7) / 8;
-         elt = discover_homogeneous_aggregate (*ptr, &elnum);
+         elt = discover_homogeneous_aggregate (cif->abi, *ptr, &elnum);
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+          if (elt == FFI_TYPE_LONGDOUBLE &&
+              (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+            {
+              vecarg_count += elnum;
+              if (vecarg_count > NUM_VEC_ARG_REGISTERS64)
+                flags |= FLAG_ARG_NEEDS_PSAVE;
+              break;
+            }
+         else
+#endif
          if (elt)
            {
              fparg_count += elnum;
@@ -263,10 +323,17 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
     flags |= FLAG_FP_ARGUMENTS;
   if (intarg_count > 4)
     flags |= FLAG_4_GPR_ARGUMENTS;
+  if (vecarg_count != 0)
+    flags |= FLAG_VEC_ARGUMENTS;
 
   /* Space for the FPR registers, if needed.  */
   if (fparg_count != 0)
     bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double);
+  /* Space for the vector registers, if needed, aligned to 16 bytes. */
+  if (vecarg_count != 0) {
+    bytes = (bytes + 15) & ~0xF;
+    bytes += NUM_VEC_ARG_REGISTERS64 * sizeof (float128);
+  }
 
   /* Stack space.  */
 #if _CALL_ELF == 2
@@ -349,6 +416,8 @@ ffi_prep_cif_linux64_var (ffi_cif *cif,
    |--------------------------------------------| |
    |   FPR registers f1-f13 (optional) 13*8    | |
    |--------------------------------------------| |
+   |   VEC registers v2-v13 (optional)  12*16   | |
+   |--------------------------------------------| |
    |   Parameter save area                     | |
    |--------------------------------------------| |
    |   TOC save area                   8       | |
@@ -378,6 +447,7 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
     unsigned long *ul;
     float *f;
     double *d;
+    float128 *f128;
     size_t p;
   } valp;
 
@@ -391,11 +461,16 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
   valp rest;
   valp next_arg;
 
-  /* 'fpr_base' points at the space for fpr3, and grows upwards as
+  /* 'fpr_base' points at the space for f1, and grows upwards as
      we use FPR registers.  */
   valp fpr_base;
   unsigned int fparg_count;
 
+  /* 'vec_base' points at the space for v2, and grows upwards as
+     we use vector registers.  */
+  valp vec_base;
+  unsigned int vecarg_count;
+
   unsigned int i, words, nargs, nfixedargs;
   ffi_type **ptr;
   double double_tmp;
@@ -412,6 +487,7 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
     unsigned long **ul;
     float **f;
     double **d;
+    float128 **f128;
   } p_argv;
   unsigned long gprvalue;
   unsigned long align;
@@ -426,11 +502,21 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
 #endif
   fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64;
   fparg_count = 0;
+  /* Place the vector args below the FPRs, if used, else the GPRs. */
+  if (ecif->cif->flags & FLAG_FP_ARGUMENTS)
+    vec_base.p = fpr_base.p & ~0xF;
+  else
+    vec_base.p = gpr_base.p;
+  vec_base.f128 -= NUM_VEC_ARG_REGISTERS64;
+  vecarg_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 (((unsigned long) gpr_base.c & 0xF) == 0);
+  FFI_ASSERT (((unsigned long) gpr_end.c  & 0xF) == 0);
+  FFI_ASSERT (((unsigned long) vec_base.c & 0xF) == 0);
   FFI_ASSERT ((bytes & 0xF) == 0);
 
   /* Deal with return values that are actually pass-by-reference.  */
@@ -455,6 +541,22 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
        {
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
        case FFI_TYPE_LONGDOUBLE:
+          if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+            {
+              next_arg.p = FFI_ALIGN (next_arg.p, 16);
+              if (next_arg.ul == gpr_end.ul)
+                next_arg.ul = rest.ul;
+              if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs)
+               memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128));
+              else
+               memcpy (next_arg.f128, *p_argv.f128, sizeof (float128));
+              if (++next_arg.f128 == gpr_end.f128)
+                next_arg.f128 = rest.f128;
+              vecarg_count++;
+              FFI_ASSERT (__LDBL_MANT_DIG__ == 113);
+              FFI_ASSERT (flags & FLAG_VEC_ARGUMENTS);
+              break;
+            }
          if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
            {
              double_tmp = (*p_argv.d)[0];
@@ -492,7 +594,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
          /* Fall through.  */
 #endif
        case FFI_TYPE_DOUBLE:
+#if _CALL_ELF != 2
        do_double:
+#endif
          double_tmp = **p_argv.d;
          if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
            {
@@ -511,7 +615,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
          break;
 
        case FFI_TYPE_FLOAT:
+#if _CALL_ELF != 2
        do_float:
+#endif
          double_tmp = **p_argv.f;
          if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
            {
@@ -548,9 +654,13 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
              if (align > 16)
                align = 16;
              if (align > 1)
-               next_arg.p = ALIGN (next_arg.p, align);
+                {
+                  next_arg.p = FFI_ALIGN (next_arg.p, align);
+                  if (next_arg.ul == gpr_end.ul)
+                    next_arg.ul = rest.ul;
+                }
            }
-         elt = discover_homogeneous_aggregate (*ptr, &elnum);
+         elt = discover_homogeneous_aggregate (ecif->cif->abi, *ptr, &elnum);
          if (elt)
            {
 #if _CALL_ELF == 2
@@ -558,9 +668,29 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
                void *v;
                float *f;
                double *d;
+               float128 *f128;
              } arg;
 
              arg.v = *p_argv.v;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+              if (elt == FFI_TYPE_LONGDOUBLE &&
+                  (ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+                {
+                  do
+                    {
+                      if (vecarg_count < NUM_VEC_ARG_REGISTERS64
+                          && i < nfixedargs)
+                       memcpy (vec_base.f128++, arg.f128, sizeof (float128));
+                      else
+                       memcpy (next_arg.f128, arg.f128++, sizeof (float128));
+                      if (++next_arg.f128 == gpr_end.f128)
+                        next_arg.f128 = rest.f128;
+                      vecarg_count++;
+                    }
+                  while (--elnum != 0);
+                }
+              else
+#endif
              if (elt == FFI_TYPE_FLOAT)
                {
                  do
@@ -576,11 +706,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
                      fparg_count++;
                    }
                  while (--elnum != 0);
-                 if ((next_arg.p & 3) != 0)
-                   {
-                     if (++next_arg.f == gpr_end.f)
-                       next_arg.f = rest.f;
-                   }
+                 if ((next_arg.p & 7) != 0)
+                    if (++next_arg.f == gpr_end.f)
+                      next_arg.f = rest.f;
                }
              else
                do
@@ -733,17 +861,20 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
                            void *user_data,
                            void *rvalue,
                            unsigned long *pst,
-                           ffi_dblfl *pfr)
+                            ffi_dblfl *pfr,
+                            float128 *pvec)
 {
   /* 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 */
+  /* pvec is the pointer to where v2-v13 are stored in ffi_closure_LINUX64 */
 
   void **avalue;
   ffi_type **arg_types;
   unsigned long i, avn, nfixedargs;
   ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64;
+  float128 *end_pvec = pvec + NUM_VEC_ARG_REGISTERS64;
   unsigned long align;
 
   avalue = alloca (cif->nargs * sizeof (void *));
@@ -811,9 +942,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
              if (align > 16)
                align = 16;
              if (align > 1)
-               pst = (unsigned long *) ALIGN ((size_t) pst, align);
+               pst = (unsigned long *) FFI_ALIGN ((size_t) pst, align);
            }
-         elt = discover_homogeneous_aggregate (arg_types[i], &elnum);
+         elt = discover_homogeneous_aggregate (cif->abi, arg_types[i], &elnum);
          if (elt)
            {
 #if _CALL_ELF == 2
@@ -822,6 +953,7 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
                unsigned long *ul;
                float *f;
                double *d;
+               float128 *f128;
                size_t p;
              } to, from;
 
@@ -829,6 +961,17 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
                 aggregate size is not greater than the space taken by
                 the registers so store back to the register/parameter
                 save arrays.  */
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+              if (elt == FFI_TYPE_LONGDOUBLE &&
+                  (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+                {
+                  if (pvec + elnum <= end_pvec)
+                    to.v = pvec;
+                  else
+                    to.v = pst;
+                }
+              else
+#endif
              if (pfr + elnum <= end_pfr)
                to.v = pfr;
              else
@@ -836,6 +979,23 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
 
              avalue[i] = to.v;
              from.ul = pst;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+              if (elt == FFI_TYPE_LONGDOUBLE &&
+                  (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+                {
+                  do
+                    {
+                      if (pvec < end_pvec && i < nfixedargs)
+                       memcpy (to.f128, pvec++, sizeof (float128));
+                      else
+                       memcpy (to.f128, from.f128, sizeof (float128));
+                      to.f128++;
+                      from.f128++;
+                    }
+                  while (--elnum != 0);
+                }
+              else
+#endif
              if (elt == FFI_TYPE_FLOAT)
                {
                  do
@@ -891,7 +1051,18 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
 
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
        case FFI_TYPE_LONGDOUBLE:
-         if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+          if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0)
+            {
+              if (((unsigned long) pst & 0xF) != 0)
+                ++pst;
+              if (pvec < end_pvec && i < nfixedargs)
+                avalue[i] = pvec++;
+              else
+                avalue[i] = pst;
+              pst += 2;
+              break;
+            }
+          else if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
            {
              if (pfr + 1 < end_pfr && i + 1 < nfixedargs)
                {
@@ -915,7 +1086,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
          /* Fall through.  */
 #endif
        case FFI_TYPE_DOUBLE:
+#if _CALL_ELF != 2
        do_double:
+#endif
          /* On the outgoing stack all values are aligned to 8 */
          /* there are 13 64bit floating point registers */
 
@@ -930,7 +1103,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
          break;
 
        case FFI_TYPE_FLOAT:
+#if _CALL_ELF != 2
        do_float:
+#endif
          if (pfr < end_pfr && i < nfixedargs)
            {
              /* Float values are stored as doubles in the
@@ -962,13 +1137,17 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
   /* Tell ffi_closure_LINUX64 how to perform return type promotions.  */
   if ((cif->flags & FLAG_RETURNS_SMST) != 0)
     {
-      if ((cif->flags & FLAG_RETURNS_FP) == 0)
+      if ((cif->flags & (FLAG_RETURNS_FP | FLAG_RETURNS_VEC)) == 0)
        return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1;
+      else if ((cif->flags & FLAG_RETURNS_VEC) != 0)
+        return FFI_V2_TYPE_VECTOR_HOMOG;
       else if ((cif->flags & FLAG_RETURNS_64BITS) != 0)
        return FFI_V2_TYPE_DOUBLE_HOMOG;
       else
        return FFI_V2_TYPE_FLOAT_HOMOG;
     }
+  if ((cif->flags & FLAG_RETURNS_VEC) != 0)
+    return FFI_V2_TYPE_VECTOR;
   return cif->rtype->type;
 }
 #endif
index 3dcd6b57175dd36af3047c220e193362d6001658..960a5c42213a0d5ff624a8d30fc58f31e293608e 100644 (file)
 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_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),
+  FLAG_RETURNS_VEC      = 1 << (31-28),
 
-  /* This goes in cr6 */
-  FLAG_RETURNS_128BITS  = 1 << (31-27),
+  /* These go in cr6 */
+  FLAG_RETURNS_64BITS   = 1 << (31-27),
+  FLAG_RETURNS_128BITS  = 1 << (31-26),
 
-  FLAG_COMPAT          = 1 << (31- 8), /* Not used by assembly */
+  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)
+  FLAG_RETVAL_REFERENCE = 1 << (31- 4),
+  FLAG_VEC_ARGUMENTS    = 1 << (31- 3),
 };
 
 typedef union
@@ -55,6 +57,14 @@ typedef union
   double d;
 } ffi_dblfl;
 
+#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128)
+typedef _Float128 float128;
+#elif defined(__FLOAT128__)
+typedef __float128 float128;
+#else
+typedef char float128[16] __attribute__((aligned(16)));
+#endif
+
 void FFI_HIDDEN ffi_closure_SYSV (void);
 void FFI_HIDDEN ffi_go_closure_sysv (void);
 void FFI_HIDDEN ffi_call_SYSV(extended_cif *, void (*)(void), void *,
@@ -91,4 +101,5 @@ int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_cif *,
                                           void (*) (ffi_cif *, void *,
                                                     void **, void *),
                                           void *, void *,
-                                          unsigned long *, ffi_dblfl *);
+                                          unsigned long *, ffi_dblfl *,
+                                          float128 *);
index 90aa36b0fce48ec827c2eafae94ee68f7dcf2afd..7fb9a93908271086f0d8e3d4a8f9882827f80268 100644 (file)
@@ -91,15 +91,19 @@ typedef enum ffi_abi {
   /* This and following bits can reuse FFI_COMPAT values.  */
   FFI_LINUX_STRUCT_ALIGN = 1,
   FFI_LINUX_LONG_DOUBLE_128 = 2,
+  FFI_LINUX_LONG_DOUBLE_IEEE128 = 4,
   FFI_DEFAULT_ABI = (FFI_LINUX
 #  ifdef __STRUCT_PARM_ALIGN__
                     | FFI_LINUX_STRUCT_ALIGN
 #  endif
 #  ifdef __LONG_DOUBLE_128__
                     | FFI_LINUX_LONG_DOUBLE_128
+#   ifdef __LONG_DOUBLE_IEEE128__
+                    | FFI_LINUX_LONG_DOUBLE_IEEE128
+#   endif
 #  endif
                     ),
-  FFI_LAST_ABI = 12
+  FFI_LAST_ABI = 16
 
 # else
   /* This bit, always set in new code, must not be set in any of the
@@ -167,9 +171,11 @@ typedef enum ffi_abi {
 #define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 2)
 
 /* Used by ELFv2 for homogenous structure returns.  */
-#define FFI_V2_TYPE_FLOAT_HOMOG                (FFI_PPC_TYPE_LAST + 1)
-#define FFI_V2_TYPE_DOUBLE_HOMOG       (FFI_PPC_TYPE_LAST + 2)
-#define FFI_V2_TYPE_SMALL_STRUCT       (FFI_PPC_TYPE_LAST + 3)
+#define FFI_V2_TYPE_VECTOR             (FFI_PPC_TYPE_LAST + 1)
+#define FFI_V2_TYPE_VECTOR_HOMOG       (FFI_PPC_TYPE_LAST + 2)
+#define FFI_V2_TYPE_FLOAT_HOMOG                (FFI_PPC_TYPE_LAST + 3)
+#define FFI_V2_TYPE_DOUBLE_HOMOG       (FFI_PPC_TYPE_LAST + 4)
+#define FFI_V2_TYPE_SMALL_STRUCT       (FFI_PPC_TYPE_LAST + 5)
 
 #if _CALL_ELF == 2
 # define FFI_TRAMPOLINE_SIZE 32
index f0006fe90c5f2a0cfca232d44b980697d5d313a1..e92d64af34fdd15a1c9b0bbd4de2c24bf52b0a48 100644 (file)
@@ -109,40 +109,70 @@ ffi_call_LINUX64:
        ld      %r2, 8(%r29)
 # endif
        /* Now do the call.  */
-       /* Set up cr1 with bits 4-7 of the flags.  */
-       mtcrf   0x40, %r31
+       /* Set up cr1 with bits 3-7 of the flags.  */
+       mtcrf   0xc0, %r31
 
        /* Get the address to call into CTR.  */
        mtctr   %r12
        /* Load all those argument registers.  */
-       ld      %r3, -32-(8*8)(%r28)
-       ld      %r4, -32-(7*8)(%r28)
-       ld      %r5, -32-(6*8)(%r28)
-       ld      %r6, -32-(5*8)(%r28)
+       addi    %r29, %r28, -32-(8*8)
+       ld      %r3,  (0*8)(%r29)
+       ld      %r4,  (1*8)(%r29)
+       ld      %r5,  (2*8)(%r29)
+       ld      %r6,  (3*8)(%r29)
        bf-     5, 1f
-       ld      %r7, -32-(4*8)(%r28)
-       ld      %r8, -32-(3*8)(%r28)
-       ld      %r9, -32-(2*8)(%r28)
-       ld      %r10, -32-(1*8)(%r28)
+       ld      %r7,  (4*8)(%r29)
+       ld      %r8,  (5*8)(%r29)
+       ld      %r9,  (6*8)(%r29)
+       ld      %r10, (7*8)(%r29)
 1:
 
        /* Load all the FP registers.  */
        bf-     6, 2f
-       lfd     %f1, -32-(21*8)(%r28)
-       lfd     %f2, -32-(20*8)(%r28)
-       lfd     %f3, -32-(19*8)(%r28)
-       lfd     %f4, -32-(18*8)(%r28)
-       lfd     %f5, -32-(17*8)(%r28)
-       lfd     %f6, -32-(16*8)(%r28)
-       lfd     %f7, -32-(15*8)(%r28)
-       lfd     %f8, -32-(14*8)(%r28)
-       lfd     %f9, -32-(13*8)(%r28)
-       lfd     %f10, -32-(12*8)(%r28)
-       lfd     %f11, -32-(11*8)(%r28)
-       lfd     %f12, -32-(10*8)(%r28)
-       lfd     %f13, -32-(9*8)(%r28)
+       addi    %r29, %r29, -(14*8)
+       lfd     %f1,  ( 1*8)(%r29)
+       lfd     %f2,  ( 2*8)(%r29)
+       lfd     %f3,  ( 3*8)(%r29)
+       lfd     %f4,  ( 4*8)(%r29)
+       lfd     %f5,  ( 5*8)(%r29)
+       lfd     %f6,  ( 6*8)(%r29)
+       lfd     %f7,  ( 7*8)(%r29)
+       lfd     %f8,  ( 8*8)(%r29)
+       lfd     %f9,  ( 9*8)(%r29)
+       lfd     %f10, (10*8)(%r29)
+       lfd     %f11, (11*8)(%r29)
+       lfd     %f12, (12*8)(%r29)
+       lfd     %f13, (13*8)(%r29)
 2:
 
+       /* Load all the vector registers.  */
+       bf-     3, 3f
+       addi    %r29, %r29, -16
+       lvx     %v13, 0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v12, 0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v11, 0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v10, 0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v9,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v8,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v7,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v6,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v5,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v4,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v3,  0, %r29
+       addi    %r29, %r29, -16
+       lvx     %v2,  0, %r29
+3:
+
        /* Make the call.  */
        ld      %r11, 8(%r28)
        bctrl
@@ -160,6 +190,7 @@ ffi_call_LINUX64:
        bt      31, .Lstruct_return_value
        bt      30, .Ldone_return_value
        bt      29, .Lfp_return_value
+       bt      28, .Lvec_return_value
        std     %r3, 0(%r30)
        /* Fall through...  */
 
@@ -175,12 +206,16 @@ ffi_call_LINUX64:
        ld      %r31, -8(%r1)
        blr
 
+.Lvec_return_value:
+       stvx    %v2, 0, %r30
+       b       .Ldone_return_value
+
 .Lfp_return_value:
        .cfi_def_cfa_register 28
-       bf      28, .Lfloat_return_value
-       stfd    %f1, 0(%r30)
        mtcrf   0x02, %r31 /* cr6  */
-       bf      27, .Ldone_return_value
+       bf      27, .Lfloat_return_value
+       stfd    %f1, 0(%r30)
+       bf      26, .Ldone_return_value
        stfd    %f2, 8(%r30)
        b       .Ldone_return_value
 .Lfloat_return_value:
@@ -188,8 +223,9 @@ ffi_call_LINUX64:
        b       .Ldone_return_value
 
 .Lstruct_return_value:
-       bf      29, .Lsmall_struct
-       bf      28, .Lfloat_homog_return_value
+       bf      29, .Lvec_homog_or_small_struct
+       mtcrf   0x02, %r31 /* cr6  */
+       bf      27, .Lfloat_homog_return_value
        stfd    %f1, 0(%r30)
        stfd    %f2, 8(%r30)
        stfd    %f3, 16(%r30)
@@ -211,6 +247,25 @@ ffi_call_LINUX64:
        stfs    %f8, 28(%r30)
        b       .Ldone_return_value
 
+.Lvec_homog_or_small_struct:
+       bf      28, .Lsmall_struct
+       stvx    %v2, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v3, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v4, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v5, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v6, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v7, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v8, 0, %r30
+       addi    %r30, %r30, 16
+       stvx    %v9, 0, %r30
+       b       .Ldone_return_value
+
 .Lsmall_struct:
        std     %r3, 0(%r30)
        std     %r4, 8(%r30)
index 5663bb4022361a4d10749e4efb5623c1ca2cf107..3469a2cbb01ee38188a348992517ae4fa19bcaa2 100644 (file)
@@ -63,9 +63,15 @@ ffi_closure_LINUX64:
 # 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
+#  ifdef __VEC__
+#   32 byte special reg save area + 64 byte parm save area
+#   + 128 byte retval area + 13*8 fpr save area + 12*16 vec save area + round to 16
+#   define STACKFRAME 528
+#  else
+#   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
+#  endif
 #  define PARMSAVE 32
 #  define RETVAL PARMSAVE+64
 # else
@@ -148,6 +154,35 @@ ffi_closure_LINUX64:
        # load up the pointer to the saved fpr registers
        addi    %r8, %r1, -104
 
+# ifdef __VEC__
+       # load up the pointer to the saved vector registers
+       # 8 bytes padding for 16-byte alignment at -112(%r1)
+       addi    %r9, %r8, -24
+       stvx    %v13, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v12, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v11, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v10, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v9, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v8, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v7, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v6, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v5, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v4, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v3, 0, %r9
+       addi    %r9, %r9, -16
+       stvx    %v2, 0, %r9
+# endif
+
        # load up the pointer to the result storage
        addi    %r6, %r1, -STACKFRAME+RETVAL
 
@@ -323,6 +358,16 @@ ffi_closure_LINUX64:
        .cfi_def_cfa_offset 0
        blr
        .cfi_def_cfa_offset STACKFRAME
+# case FFI_V2_TYPE_VECTOR
+       addi %r3, %r1, RETVAL
+       lvx %v2, 0, %r3
+       mtlr %r0
+       b .Lfinish
+# case FFI_V2_TYPE_VECTOR_HOMOG
+       addi %r3, %r1, RETVAL
+       lvx %v2, 0, %r3
+       addi %r3, %r3, 16
+       b .Lmorevector
 # case FFI_V2_TYPE_FLOAT_HOMOG
        lfs %f1, RETVAL+0(%r1)
        lfs %f2, RETVAL+4(%r1)
@@ -342,6 +387,25 @@ ffi_closure_LINUX64:
        .cfi_def_cfa_offset 0
        blr
        .cfi_def_cfa_offset STACKFRAME
+.Lmorevector:
+       lvx %v3, 0, %r3
+       addi %r3, %r3, 16
+       lvx %v4, 0, %r3
+       addi %r3, %r3, 16
+       lvx %v5, 0, %r3
+       mtlr %r0
+       addi %r3, %r3, 16
+       lvx %v6, 0, %r3
+       addi %r3, %r3, 16
+       lvx %v7, 0, %r3
+       addi %r3, %r3, 16
+       lvx %v8, 0, %r3
+       addi %r3, %r3, 16
+       lvx %v9, 0, %r3
+       addi %r1, %r1, STACKFRAME
+       .cfi_def_cfa_offset 0
+       blr
+       .cfi_def_cfa_offset STACKFRAME
 .Lmorefloat:
        lfs %f4, RETVAL+12(%r1)
        mtlr %r0
index 1474ce702b388e19f67890111a0a6ede27330669..df9773427cba5c78e7727973f7ca259124048849 100644 (file)
@@ -104,17 +104,16 @@ ENTRY(ffi_call_SYSV)
        bctrl
 
        /* Now, deal with the return value.  */
-       mtcrf   0x01,%r31 /* cr7  */
+       mtcrf   0x03,%r31 /* cr6-cr7  */
        bt-     31,L(small_struct_return_value)
        bt-     30,L(done_return_value)
 #ifndef __NO_FPRS__
        bt-     29,L(fp_return_value)
 #endif
        stw     %r3,0(%r30)
-       bf+     28,L(done_return_value)
+       bf+     27,L(done_return_value)
        stw     %r4,4(%r30)
-       mtcrf   0x02,%r31 /* cr6  */
-       bf      27,L(done_return_value)
+       bf      26,L(done_return_value)
        stw     %r5,8(%r30)
        stw     %r6,12(%r30)
        /* Fall through...  */
@@ -145,10 +144,9 @@ L(done_return_value):
 #ifndef __NO_FPRS__
 L(fp_return_value):
        .cfi_restore_state
-       bf      28,L(float_return_value)
+       bf      27,L(float_return_value)
        stfd    %f1,0(%r30)
-       mtcrf   0x02,%r31 /* cr6  */
-       bf      27,L(done_return_value)
+       bf      26,L(done_return_value)
        stfd    %f2,8(%r30)
        b       L(done_return_value)
 L(float_return_value):
index 5881cebd784c2bcf4c59a6ed822d84e1733b5610..c1832b10302fa355ecf9d5d2b749946492b88246 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
-   prep_cif.c - Copyright (c) 2011, 2012  Anthony Green
+   prep_cif.c - Copyright (c) 2011, 2012, 2021  Anthony Green
                 Copyright (c) 1996, 1998, 2007  Red Hat, Inc.
 
    Permission is hereby granted, free of charge, to any person obtaining
 
 /* Round up to FFI_SIZEOF_ARG. */
 
-#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
+#define STACK_ARG_SIZE(x) FFI_ALIGN(x, FFI_SIZEOF_ARG)
 
 /* Perform machine independent initialization of aggregate type
    specifications. */
 
-static ffi_status initialize_aggregate(ffi_type *arg)
+static ffi_status initialize_aggregate(ffi_type *arg, size_t *offsets)
 {
   ffi_type **ptr;
 
@@ -52,13 +52,15 @@ static ffi_status initialize_aggregate(ffi_type *arg)
   while ((*ptr) != NULL)
     {
       if (UNLIKELY(((*ptr)->size == 0)
-                   && (initialize_aggregate((*ptr)) != FFI_OK)))
+                   && (initialize_aggregate((*ptr), NULL) != FFI_OK)))
        return FFI_BAD_TYPEDEF;
 
       /* Perform a sanity check on the argument type */
       FFI_ASSERT_VALID_TYPE(*ptr);
 
-      arg->size = ALIGN(arg->size, (*ptr)->alignment);
+      arg->size = FFI_ALIGN(arg->size, (*ptr)->alignment);
+      if (offsets)
+       *offsets++ = arg->size;
       arg->size += (*ptr)->size;
 
       arg->alignment = (arg->alignment > (*ptr)->alignment) ?
@@ -74,7 +76,7 @@ static ffi_status initialize_aggregate(ffi_type *arg)
      struct A { long a; char b; }; struct B { struct A x; char y; };
      should find y at an offset of 2*sizeof(long) and result in a
      total size of 3*sizeof(long).  */
-  arg->size = ALIGN (arg->size, arg->alignment);
+  arg->size = FFI_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.  */
@@ -127,13 +129,16 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
   cif->rtype = rtype;
 
   cif->flags = 0;
-
+#if (defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32)
+  cif->is_variadic = isvariadic;
+#endif
 #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))
+  if ((cif->rtype->size == 0)
+      && (initialize_aggregate(cif->rtype, NULL) != FFI_OK))
     return FFI_BAD_TYPEDEF;
 
 #ifndef FFI_TARGET_HAS_COMPLEX_TYPE
@@ -164,7 +169,8 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
     {
 
       /* Initialize any uninitialized aggregate type definitions */
-      if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
+      if (((*ptr)->size == 0)
+         && (initialize_aggregate((*ptr), NULL) != FFI_OK))
        return FFI_BAD_TYPEDEF;
 
 #ifndef FFI_TARGET_HAS_COMPLEX_TYPE
@@ -179,7 +185,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 = (unsigned)ALIGN(bytes, (*ptr)->alignment);
+           bytes = (unsigned)FFI_ALIGN(bytes, (*ptr)->alignment);
 
 #ifdef TILE
          if (bytes < 10 * FFI_SIZEOF_ARG &&
@@ -195,7 +201,7 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
            bytes = 6*4;
 #endif
 
-         bytes += STACK_ARG_SIZE((*ptr)->size);
+         bytes += (unsigned int)STACK_ARG_SIZE((*ptr)->size);
        }
 #endif
     }
@@ -225,7 +231,26 @@ ffi_status ffi_prep_cif_var(ffi_cif *cif,
                             ffi_type *rtype,
                             ffi_type **atypes)
 {
-  return ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes);
+  ffi_status rc;
+  size_t int_size = ffi_type_sint.size;
+  int i;
+
+  rc = ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes);
+
+  if (rc != FFI_OK)
+    return rc;
+
+  for (i = 1; i < ntotalargs; i++)
+    {
+      ffi_type *arg_type = atypes[i];
+      if (arg_type == &ffi_type_float
+          || ((arg_type->type != FFI_TYPE_STRUCT
+               && arg_type->type != FFI_TYPE_COMPLEX)
+              && arg_type->size < int_size))
+        return FFI_BAD_ARGTYPE;
+    }
+
+  return FFI_OK;
 }
 
 #if FFI_CLOSURES
@@ -240,3 +265,18 @@ ffi_prep_closure (ffi_closure* closure,
 }
 
 #endif
+
+ffi_status
+ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets)
+{
+  if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI))
+    return FFI_BAD_ABI;
+  if (struct_type->type != FFI_TYPE_STRUCT)
+    return FFI_BAD_TYPEDEF;
+
+#if HAVE_LONG_DOUBLE_VARIANT
+  ffi_prep_types (abi);
+#endif
+
+  return initialize_aggregate(struct_type, offsets);
+}
index 276cb22807a5965d8d9fb0eca7bfaa204daf6390..be156116cb0d99fe1e635823e9fec93b782cd7ad 100644 (file)
@@ -43,10 +43,10 @@ ffi_raw_size (ffi_cif *cif)
     {
 #if !FFI_NO_STRUCTS
       if ((*at)->type == FFI_TYPE_STRUCT)
-       result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG);
+       result += FFI_ALIGN (sizeof (void*), FFI_SIZEOF_ARG);
       else
 #endif
-       result += ALIGN ((*at)->size, FFI_SIZEOF_ARG);
+       result += FFI_ALIGN ((*at)->size, FFI_SIZEOF_ARG);
     }
 
   return result;
@@ -98,7 +98,7 @@ ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
          
        default:
          *args = raw;
-         raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+         raw += FFI_ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
        }
     }
 
@@ -123,7 +123,7 @@ ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
       else
        {
          *args = (void*) raw;
-         raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
+         raw += FFI_ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
        }
     }
 
@@ -186,7 +186,7 @@ ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
 
        default:
          memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
-         raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+         raw += FFI_ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
        }
     }
 }
index 8c5a86050607194b5a29bc237d77cd488547efec..c910858896ae60d38da2b992c4790932767a5e20 100644 (file)
@@ -120,7 +120,7 @@ static float_struct_info struct_passed_as_elements(call_builder *cb, ffi_type *t
 
         ret.type1 = fields[0]->type;
         ret.type2 = fields[1]->type;
-        ret.offset2 = ALIGN(fields[0]->size, fields[1]->alignment);
+        ret.offset2 = FFI_ALIGN(fields[0]->size, fields[1]->alignment);
         ret.as_elements = 1;
     }
 
@@ -238,8 +238,8 @@ static void marshal(call_builder *cb, ffi_type *type, int var, void *data) {
         /* variadics are aligned even in registers */
         if (type->alignment > __SIZEOF_POINTER__) {
             if (var)
-                cb->used_integer = ALIGN(cb->used_integer, 2);
-            cb->used_stack = (size_t *)ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__);
+                cb->used_integer = FFI_ALIGN(cb->used_integer, 2);
+            cb->used_stack = (size_t *)FFI_ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__);
         }
 
         memcpy(realign, data, type->size);
@@ -286,8 +286,8 @@ static void *unmarshal(call_builder *cb, ffi_type *type, int var, void *data) {
         /* variadics are aligned even in registers */
         if (type->alignment > __SIZEOF_POINTER__) {
             if (var)
-                cb->used_integer = ALIGN(cb->used_integer, 2);
-            cb->used_stack = (size_t *)ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__);
+                cb->used_integer = FFI_ALIGN(cb->used_integer, 2);
+            cb->used_stack = (size_t *)FFI_ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__);
         }
 
         if (type->size > 0)
@@ -334,10 +334,10 @@ ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
     /* this is a conservative estimate, assuming a complex return value and
        that all remaining arguments are long long / __int128 */
     size_t arg_bytes = cif->nargs <= 3 ? 0 :
-        ALIGN(2 * sizeof(size_t) * (cif->nargs - 3), STKALIGN);
+        FFI_ALIGN(2 * sizeof(size_t) * (cif->nargs - 3), STKALIGN);
     size_t rval_bytes = 0;
     if (rvalue == NULL && cif->rtype->size > 2*__SIZEOF_POINTER__)
-        rval_bytes = ALIGN(cif->rtype->size, STKALIGN);
+        rval_bytes = FFI_ALIGN(cif->rtype->size, STKALIGN);
     size_t alloc_size = arg_bytes + rval_bytes + sizeof(call_context);
 
     /* the assembly code will deallocate all stack data at lower addresses
@@ -350,7 +350,7 @@ ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
            guarantee alloca alignment to at least that much */
         alloc_base = (size_t)alloca(alloc_size);
     } else {
-        alloc_base = ALIGN(alloca(alloc_size + STKALIGN - 1), STKALIGN);
+        alloc_base = FFI_ALIGN(alloca(alloc_size + STKALIGN - 1), STKALIGN);
     }
 
     if (rval_bytes)
index d5212d86e419f4b961d13c808ab48e4cf2934342..9e406d0af678b8722538d09514f1008436904453 100644 (file)
@@ -153,7 +153,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
          /* FALLTHRU */
 
        default:
-         z = ALIGN(z, 4);
+         z = FFI_ALIGN(z, 4);
        }
       bytes += z;
     }
@@ -167,7 +167,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
   bytes += 4;
 
   /* The stack must be 2 word aligned, so round bytes up appropriately. */
-  bytes = ALIGN(bytes, 2 * 4);
+  bytes = FFI_ALIGN(bytes, 2 * 4);
 
   /* Include the call frame to prep_args.  */
   bytes += 4*16 + 4*8;
@@ -293,7 +293,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
      got to pass the return value to the callee.  Otherwise ignore it.  */
   if (rvalue == NULL
       && (cif->flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT)
-    bytes += ALIGN (cif->rtype->size, 8);
+    bytes += FFI_ALIGN (cif->rtype->size, 8);
 
   ffi_call_v8(cif, fn, rvalue, avalue, -bytes, closure);
 }
index 340b19823211d973d9ecf5a76dc8d273e2f92cc5..9e04061a4283c997a74c87d54c2bd2c0b5acd1ec 100644 (file)
@@ -75,7 +75,7 @@ ffi_struct_float_mask (ffi_type *outer_type, int size_mask)
       size_t z = t->size;
       int o, m, tt;
 
-      size_mask = ALIGN(size_mask, t->alignment);
+      size_mask = FFI_ALIGN(size_mask, t->alignment);
       switch (t->type)
        {
        case FFI_TYPE_STRUCT:
@@ -99,7 +99,7 @@ ffi_struct_float_mask (ffi_type *outer_type, int size_mask)
       size_mask += z;
     }
 
-  size_mask = ALIGN(size_mask, outer_type->alignment);
+  size_mask = FFI_ALIGN(size_mask, outer_type->alignment);
   FFI_ASSERT ((size_mask & 0xff) == outer_type->size);
 
   return size_mask;
@@ -284,8 +284,8 @@ ffi_prep_cif_machdep_core(ffi_cif *cif)
          flags |= SPARC_FLAG_FP_ARGS;
          break;
        }
-      bytes = ALIGN(bytes, a);
-      bytes += ALIGN(z, 8);
+      bytes = FFI_ALIGN(bytes, a);
+      bytes += FFI_ALIGN(z, 8);
     }
 
   /* Sparc call frames require that space is allocated for 6 args,
@@ -294,7 +294,7 @@ ffi_prep_cif_machdep_core(ffi_cif *cif)
     bytes = 6 * 8;
 
   /* The stack must be 2 word aligned, so round bytes up appropriately. */
-  bytes = ALIGN(bytes, 16);
+  bytes = FFI_ALIGN(bytes, 16);
 
   /* Include the call frame to prep_args.  */
   bytes += 8*16 + 8*8;
@@ -405,7 +405,7 @@ ffi_prep_args_v9(ffi_cif *cif, unsigned long *argp, void *rvalue, void **avalue)
          if (((unsigned long)argp & 15) && ty->alignment > 8)
            argp++;
          memcpy(argp, a, z);
-         argp += ALIGN(z, 8) / 8;
+         argp += FFI_ALIGN(z, 8) / 8;
          break;
 
        default:
@@ -425,7 +425,7 @@ ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue,
   FFI_ASSERT (cif->abi == FFI_V9);
 
   if (rvalue == NULL && (cif->flags & SPARC_FLAG_RET_IN_MEM))
-    bytes += ALIGN (cif->rtype->size, 16);
+    bytes += FFI_ALIGN (cif->rtype->size, 16);
 
   ffi_call_v9(cif, fn, rvalue, avalue, -bytes, closure);
 }
@@ -547,7 +547,7 @@ ffi_closure_sparc_inner_v9(ffi_cif *cif,
            a = *(void **)a;
          else
            {
-             argx = argn + ALIGN (z, 8) / 8;
+             argx = argn + FFI_ALIGN (z, 8) / 8;
              if (named && argn < 16)
                {
                  int size_mask = ffi_struct_float_mask (ty, 0);
@@ -561,7 +561,7 @@ ffi_closure_sparc_inner_v9(ffi_cif *cif,
          break;
 
        case FFI_TYPE_LONGDOUBLE:
-         argn = ALIGN (argn, 2);
+         argn = FFI_ALIGN (argn, 2);
          a = (named && argn < 16 ? fpr : gpr) + argn;
          argx = argn + 2;
          break;
diff --git a/libffi/src/tramp.c b/libffi/src/tramp.c
new file mode 100644 (file)
index 0000000..265aeaa
--- /dev/null
@@ -0,0 +1,729 @@
+/* -----------------------------------------------------------------------
+   tramp.c - Copyright (c) 2020 Madhavan T. Venkataraman
+
+   API and support functions for managing statically defined closure
+   trampolines.
+
+   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 <fficonfig.h>
+
+#ifdef FFI_EXEC_STATIC_TRAMP
+
+/* -------------------------- Headers and Definitions ---------------------*/
+/*
+ * Add support for other OSes later. For now, it is just Linux.
+ */
+
+#if defined __linux__
+#ifdef __linux__
+#define _GNU_SOURCE 1
+#endif
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <sys/mman.h>
+#include <tramp.h>
+#ifdef __linux__
+#include <linux/limits.h>
+#include <linux/types.h>
+#endif
+#endif /* __linux__ */
+
+/*
+ * Each architecture defines static code for a trampoline code table. The
+ * trampoline code table is mapped into the address space of a process.
+ *
+ * The following architecture specific function returns:
+ *
+ *     - the address of the trampoline code table in the text segment
+ *     - the size of each trampoline in the trampoline code table
+ *     - the size of the mapping for the whole trampoline code table
+ */
+void __attribute__((weak)) *ffi_tramp_arch (size_t *tramp_size,
+  size_t *map_size);
+
+/* ------------------------- Trampoline Data Structures --------------------*/
+
+struct tramp;
+
+/*
+ * Trampoline table. Manages one trampoline code table and one trampoline
+ * parameter table.
+ *
+ * prev, next  Links in the global trampoline table list.
+ * code_table  Trampoline code table mapping.
+ * parm_table  Trampoline parameter table mapping.
+ * array       Array of trampolines malloced.
+ * free                List of free trampolines.
+ * nfree       Number of free trampolines.
+ */
+struct tramp_table
+{
+  struct tramp_table *prev;
+  struct tramp_table *next;
+  void *code_table;
+  void *parm_table;
+  struct tramp *array;
+  struct tramp *free;
+  int nfree;
+};
+
+/*
+ * Parameters for each trampoline.
+ *
+ * data
+ *     Data for the target code that the trampoline jumps to.
+ * target
+ *     Target code that the trampoline jumps to.
+ */
+struct tramp_parm
+{
+  void *data;
+  void *target;
+};
+
+/*
+ * Trampoline structure for each trampoline.
+ *
+ * prev, next  Links in the trampoline free list of a trampoline table.
+ * table       Trampoline table to which this trampoline belongs.
+ * code                Address of this trampoline in the code table mapping.
+ * parm                Address of this trampoline's parameters in the parameter
+ *             table mapping.
+ */
+struct tramp
+{
+  struct tramp *prev;
+  struct tramp *next;
+  struct tramp_table *table;
+  void *code;
+  struct tramp_parm *parm;
+};
+
+enum tramp_globals_status {
+       TRAMP_GLOBALS_UNINITIALIZED = 0,
+       TRAMP_GLOBALS_PASSED,
+       TRAMP_GLOBALS_FAILED,
+};
+
+/*
+ * Trampoline globals.
+ *
+ * fd
+ *     File descriptor of binary file that contains the trampoline code table.
+ * offset
+ *     Offset of the trampoline code table in that file.
+ * text
+ *     Address of the trampoline code table in the text segment.
+ * map_size
+ *     Size of the trampoline code table mapping.
+ * size
+ *     Size of one trampoline in the trampoline code table.
+ * ntramp
+ *     Total number of trampolines in the trampoline code table.
+ * free_tables
+ *     List of trampoline tables that contain free trampolines.
+ * nfree_tables
+ *     Number of trampoline tables that contain free trampolines.
+ * status
+ *     Initialization status.
+ */
+struct tramp_globals
+{
+  int fd;
+  off_t offset;
+  void *text;
+  size_t map_size;
+  size_t size;
+  int ntramp;
+  struct tramp_table *free_tables;
+  int nfree_tables;
+  enum tramp_globals_status status;
+};
+
+static struct tramp_globals tramp_globals;
+
+/* --------------------- Trampoline File Initialization --------------------*/
+
+/*
+ * The trampoline file is the file used to map the trampoline code table into
+ * the address space of a process. There are two ways to get this file:
+ *
+ * - From the OS. E.g., on Linux, /proc/<pid>/maps lists all the memory
+ *   mappings for <pid>. For file-backed mappings, maps supplies the file name
+ *   and the file offset. Using this, we can locate the mapping that maps
+ *   libffi and get the path to the libffi binary. And, we can compute the
+ *   offset of the trampoline code table within that binary.
+ *
+ * - Else, if we can create a temporary file, we can write the trampoline code
+ *   table from the text segment into the temporary file.
+ *
+ * The first method is the preferred one. If the OS security subsystem
+ * disallows mapping unsigned files with PROT_EXEC, then the second method
+ * will fail.
+ *
+ * If an OS allows the trampoline code table in the text segment to be
+ * directly remapped (e.g., MACH vm_remap ()), then we don't need the
+ * trampoline file.
+ */
+static int tramp_table_alloc (void);
+
+#if defined __linux__
+
+static int
+ffi_tramp_get_libffi (void)
+{
+  FILE *fp;
+  char file[PATH_MAX], line[PATH_MAX+100], perm[10], dev[10];
+  unsigned long start, end, offset, inode;
+  uintptr_t addr = (uintptr_t) tramp_globals.text;
+  int nfields, found;
+
+  snprintf (file, PATH_MAX, "/proc/%d/maps", getpid());
+  fp = fopen (file, "r");
+  if (fp == NULL)
+    return 0;
+
+  found = 0;
+  while (feof (fp) == 0) {
+    if (fgets (line, sizeof (line), fp) == 0)
+      break;
+
+    nfields = sscanf (line, "%lx-%lx %9s %lx %9s %ld %s",
+      &start, &end, perm, &offset, dev, &inode, file);
+    if (nfields != 7)
+      continue;
+
+    if (addr >= start && addr < end) {
+      tramp_globals.offset = offset + (addr - start);
+      found = 1;
+      break;
+    }
+  }
+  fclose (fp);
+
+  if (!found)
+    return 0;
+
+  tramp_globals.fd = open (file, O_RDONLY);
+  if (tramp_globals.fd == -1)
+    return 0;
+
+  /*
+   * Allocate a trampoline table just to make sure that the trampoline code
+   * table can be mapped.
+   */
+  if (!tramp_table_alloc ())
+    {
+      close (tramp_globals.fd);
+      tramp_globals.fd = -1;
+      return 0;
+    }
+  return 1;
+}
+
+#endif /* __linux__ */
+
+#if defined __linux__
+
+#if defined HAVE_MKSTEMP
+
+static int
+ffi_tramp_get_temp_file (void)
+{
+  char template[12] = "/tmp/XXXXXX";
+  ssize_t count;
+
+  tramp_globals.offset = 0;
+  tramp_globals.fd = mkstemp (template);
+  if (tramp_globals.fd == -1)
+    return 0;
+
+  unlink (template);
+  /*
+   * Write the trampoline code table into the temporary file and allocate a
+   * trampoline table to make sure that the temporary file can be mapped.
+   */
+  count = write(tramp_globals.fd, tramp_globals.text, tramp_globals.map_size);
+  if (count == tramp_globals.map_size && tramp_table_alloc ())
+    return 1;
+
+  close (tramp_globals.fd);
+  tramp_globals.fd = -1;
+  return 0;
+}
+
+#else /* !defined HAVE_MKSTEMP */
+
+/*
+ * TODO:
+ * src/closures.c contains code for finding temp file that has EXEC
+ * permissions. May be, some of that code can be shared with static
+ * trampolines.
+ */
+static int
+ffi_tramp_get_temp_file (void)
+{
+  tramp_globals.offset = 0;
+  tramp_globals.fd = -1;
+  return 0;
+}
+
+#endif /* defined HAVE_MKSTEMP */
+
+#endif /* __linux__ */
+
+/* ------------------------ OS-specific Initialization ----------------------*/
+
+#if defined __linux__
+
+static int
+ffi_tramp_init_os (void)
+{
+  if (ffi_tramp_get_libffi ())
+    return 1;
+  return ffi_tramp_get_temp_file ();
+}
+
+#endif /* __linux__ */
+
+/* --------------------------- OS-specific Locking -------------------------*/
+
+#if defined __linux__
+
+static pthread_mutex_t tramp_globals_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static void
+ffi_tramp_lock(void)
+{
+  pthread_mutex_lock (&tramp_globals_mutex);
+}
+
+static void
+ffi_tramp_unlock()
+{
+  pthread_mutex_unlock (&tramp_globals_mutex);
+}
+
+#endif /* __linux__ */
+
+/* ------------------------ OS-specific Memory Mapping ----------------------*/
+
+/*
+ * Create a trampoline code table mapping and a trampoline parameter table
+ * mapping. The two mappings must be adjacent to each other for PC-relative
+ * access.
+ *
+ * For each trampoline in the code table, there is a corresponding parameter
+ * block in the parameter table. The size of the parameter block is the same
+ * as the size of the trampoline. This means that the parameter block is at
+ * a fixed offset from its trampoline making it easy for a trampoline to find
+ * its parameters using PC-relative access.
+ *
+ * The parameter block will contain a struct tramp_parm. This means that
+ * sizeof (struct tramp_parm) cannot exceed the size of a parameter block.
+ */
+
+#if defined __linux__
+
+static int
+tramp_table_map (struct tramp_table *table)
+{
+  char *addr;
+
+  /*
+   * Create an anonymous mapping twice the map size. The top half will be used
+   * for the code table. The bottom half will be used for the parameter table.
+   */
+  addr = mmap (NULL, tramp_globals.map_size * 2, PROT_READ | PROT_WRITE,
+    MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  if (addr == MAP_FAILED)
+    return 0;
+
+  /*
+   * Replace the top half of the anonymous mapping with the code table mapping.
+   */
+  table->code_table = mmap (addr, tramp_globals.map_size, PROT_READ | PROT_EXEC,
+    MAP_PRIVATE | MAP_FIXED, tramp_globals.fd, tramp_globals.offset);
+  if (table->code_table == MAP_FAILED)
+    {
+      (void) munmap (addr, tramp_globals.map_size * 2);
+      return 0;
+    }
+  table->parm_table = table->code_table + tramp_globals.map_size;
+  return 1;
+}
+
+static void
+tramp_table_unmap (struct tramp_table *table)
+{
+  (void) munmap (table->code_table, tramp_globals.map_size);
+  (void) munmap (table->parm_table, tramp_globals.map_size);
+}
+
+#endif /* __linux__ */
+
+/* ------------------------ Trampoline Initialization ----------------------*/
+
+/*
+ * Initialize the static trampoline feature.
+ */
+static int
+ffi_tramp_init (void)
+{
+  if (tramp_globals.status == TRAMP_GLOBALS_PASSED)
+    return 1;
+
+  if (tramp_globals.status == TRAMP_GLOBALS_FAILED)
+    return 0;
+
+  if (ffi_tramp_arch == NULL)
+    {
+      tramp_globals.status = TRAMP_GLOBALS_FAILED;
+      return 0;
+    }
+
+  tramp_globals.free_tables = NULL;
+  tramp_globals.nfree_tables = 0;
+
+  /*
+   * Get trampoline code table information from the architecture.
+   */
+  tramp_globals.text = ffi_tramp_arch (&tramp_globals.size,
+    &tramp_globals.map_size);
+  tramp_globals.ntramp = tramp_globals.map_size / tramp_globals.size;
+
+  if (sysconf (_SC_PAGESIZE) > tramp_globals.map_size)
+    return 0;
+
+  if (ffi_tramp_init_os ())
+    {
+      tramp_globals.status = TRAMP_GLOBALS_PASSED;
+      return 1;
+    }
+
+  tramp_globals.status = TRAMP_GLOBALS_FAILED;
+  return 0;
+}
+
+/* ---------------------- Trampoline Table functions ---------------------- */
+
+/* This code assumes that malloc () is available on all OSes. */
+
+static void tramp_add (struct tramp *tramp);
+
+/*
+ * Allocate and initialize a trampoline table.
+ */
+static int
+tramp_table_alloc (void)
+{
+  struct tramp_table *table;
+  struct tramp *tramp_array, *tramp;
+  size_t size;
+  char *code, *parm;
+  int i;
+
+  /*
+   * If we already have tables with free trampolines, there is no need to
+   * allocate a new table.
+   */
+  if (tramp_globals.nfree_tables > 0)
+    return 1;
+
+  /*
+   * Allocate a new trampoline table structure.
+   */
+  table = malloc (sizeof (*table));
+  if (table == NULL)
+    return 0;
+
+  /*
+   * Allocate new trampoline structures.
+   */
+  tramp_array = malloc (sizeof (*tramp) * tramp_globals.ntramp);
+  if (tramp_array == NULL)
+    goto free_table;
+
+  /*
+   * Map a code table and a parameter table into the caller's address space.
+   */
+  if (!tramp_table_map (table))
+    {
+      /*
+       * Failed to map the code and parameter tables.
+       */
+      goto free_tramp_array;
+    }
+
+  /*
+   * Initialize the trampoline table.
+   */
+  table->array = tramp_array;
+  table->free = NULL;
+  table->nfree = 0;
+
+  /*
+   * Populate the trampoline table free list. This will also add the trampoline
+   * table to the global list of trampoline tables.
+   */
+  size = tramp_globals.size;
+  code = table->code_table;
+  parm = table->parm_table;
+  for (i = 0; i < tramp_globals.ntramp; i++)
+    {
+      tramp = &tramp_array[i];
+      tramp->table = table;
+      tramp->code = code;
+      tramp->parm = (struct tramp_parm *) parm;
+      tramp_add (tramp);
+
+      code += size;
+      parm += size;
+    }
+  /* Success */
+  return 1;
+
+/* Failure */
+free_tramp_array:
+  free (tramp_array);
+free_table:
+  free (table);
+  return 0;
+}
+
+/*
+ * Free a trampoline table.
+ */
+static void
+tramp_table_free (struct tramp_table *table)
+{
+  tramp_table_unmap (table);
+  free (table->array);
+  free (table);
+}
+
+/*
+ * Add a new trampoline table to the global table list.
+ */
+static void
+tramp_table_add (struct tramp_table *table)
+{
+  table->next = tramp_globals.free_tables;
+  table->prev = NULL;
+  if (tramp_globals.free_tables != NULL)
+    tramp_globals.free_tables->prev = table;
+  tramp_globals.free_tables = table;
+  tramp_globals.nfree_tables++;
+}
+
+/*
+ * Delete a trampoline table from the global table list.
+ */
+static void
+tramp_table_del (struct tramp_table *table)
+{
+  tramp_globals.nfree_tables--;
+  if (table->prev != NULL)
+    table->prev->next = table->next;
+  if (table->next != NULL)
+    table->next->prev = table->prev;
+  if (tramp_globals.free_tables == table)
+    tramp_globals.free_tables = table->next;
+}
+
+/* ------------------------- Trampoline functions ------------------------- */
+
+/*
+ * Add a trampoline to its trampoline table.
+ */
+static void
+tramp_add (struct tramp *tramp)
+{
+  struct tramp_table *table = tramp->table;
+
+  tramp->next = table->free;
+  tramp->prev = NULL;
+  if (table->free != NULL)
+    table->free->prev = tramp;
+  table->free = tramp;
+  table->nfree++;
+
+  if (table->nfree == 1)
+    tramp_table_add (table);
+
+  /*
+   * We don't want to keep too many free trampoline tables lying around.
+   */
+  if (table->nfree == tramp_globals.ntramp &&
+    tramp_globals.nfree_tables > 1)
+    {
+      tramp_table_del (table);
+      tramp_table_free (table);
+    }
+}
+
+/*
+ * Remove a trampoline from its trampoline table.
+ */
+static void
+tramp_del (struct tramp *tramp)
+{
+  struct tramp_table *table = tramp->table;
+
+  table->nfree--;
+  if (tramp->prev != NULL)
+    tramp->prev->next = tramp->next;
+  if (tramp->next != NULL)
+    tramp->next->prev = tramp->prev;
+  if (table->free == tramp)
+    table->free = tramp->next;
+
+  if (table->nfree == 0)
+    tramp_table_del (table);
+}
+
+/* ------------------------ Trampoline API functions ------------------------ */
+
+int
+ffi_tramp_is_supported(void)
+{
+  int ret;
+
+  ffi_tramp_lock();
+  ret = ffi_tramp_init ();
+  ffi_tramp_unlock();
+  return ret;
+}
+
+/*
+ * Allocate a trampoline and return its opaque address.
+ */
+void *
+ffi_tramp_alloc (int flags)
+{
+  struct tramp *tramp;
+
+  ffi_tramp_lock();
+
+  if (!ffi_tramp_init () || flags != 0)
+    {
+      ffi_tramp_unlock();
+      return NULL;
+    }
+
+  if (!tramp_table_alloc ())
+    {
+      ffi_tramp_unlock();
+      return NULL;
+    }
+
+  tramp = tramp_globals.free_tables->free;
+  tramp_del (tramp);
+
+  ffi_tramp_unlock();
+
+  return tramp;
+}
+
+/*
+ * Set the parameters for a trampoline.
+ */
+void
+ffi_tramp_set_parms (void *arg, void *target, void *data)
+{
+  struct tramp *tramp = arg;
+
+  ffi_tramp_lock();
+  tramp->parm->target = target;
+  tramp->parm->data = data;
+  ffi_tramp_unlock();
+}
+
+/*
+ * Get the invocation address of a trampoline.
+ */
+void *
+ffi_tramp_get_addr (void *arg)
+{
+  struct tramp *tramp = arg;
+  void *addr;
+
+  ffi_tramp_lock();
+  addr = tramp->code;
+  ffi_tramp_unlock();
+
+  return addr;
+}
+
+/*
+ * Free a trampoline.
+ */
+void
+ffi_tramp_free (void *arg)
+{
+  struct tramp *tramp = arg;
+
+  ffi_tramp_lock();
+  tramp_add (tramp);
+  ffi_tramp_unlock();
+}
+
+/* ------------------------------------------------------------------------- */
+
+#else /* !FFI_EXEC_STATIC_TRAMP */
+
+#include <stddef.h>
+
+int
+ffi_tramp_is_supported(void)
+{
+  return 0;
+}
+
+void *
+ffi_tramp_alloc (int flags)
+{
+  return NULL;
+}
+
+void
+ffi_tramp_set_parms (void *arg, void *target, void *data)
+{
+}
+
+void *
+ffi_tramp_get_addr (void *arg)
+{
+  return NULL;
+}
+
+void
+ffi_tramp_free (void *arg)
+{
+}
+
+#endif /* FFI_EXEC_STATIC_TRAMP */
index 7e80aec6eb4b66da2a583cbb159da450dff6cd50..9ec27f6cf37676d83bfb489bbe1bb7c7c7363378 100644 (file)
@@ -38,6 +38,7 @@ struct struct_align_##name {                  \
   char c;                                      \
   type x;                                      \
 };                                             \
+FFI_EXTERN                                     \
 maybe_const ffi_type ffi_type_##name = {       \
   sizeof(type),                                        \
   offsetof(struct struct_align_##name, x),     \
@@ -52,6 +53,7 @@ struct struct_align_complex_##name {                  \
   char c;                                              \
   _Complex type x;                                     \
 };                                                     \
+FFI_EXTERN                                             \
 maybe_const ffi_type ffi_type_complex_##name = {       \
   sizeof(_Complex type),                               \
   offsetof(struct struct_align_complex_##name, x),     \
@@ -60,7 +62,7 @@ maybe_const ffi_type ffi_type_complex_##name = {      \
 }
 
 /* Size and alignment are fake here. They must not be 0. */
-const ffi_type ffi_type_void = {
+FFI_EXTERN const ffi_type ffi_type_void = {
   1, 1, FFI_TYPE_VOID, NULL
 };
 
index f4d6bbb4f404667a0defe88c9b2e4765e008aa37..e52caec86da2e8ebec5fdd173ff4b247f8a98489 100644 (file)
@@ -108,7 +108,7 @@ ffi_prep_args (extended_cif *ecif, void *stack)
 
          /* Align if necessary.  */
          if ((sizeof(int) - 1) & z)
-           z = ALIGN(z, sizeof(int));
+           z = FFI_ALIGN(z, sizeof(int));
        }
 
       p_argv++;
@@ -215,7 +215,7 @@ ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp)
 
       /* Align if necessary */
       if ((sizeof (int) - 1) & z)
-       z = ALIGN(z, sizeof (int));
+       z = FFI_ALIGN(z, sizeof (int));
 
       p_argv++;
       stackp += z;
diff --git a/libffi/src/x86/asmnames.h b/libffi/src/x86/asmnames.h
new file mode 100644 (file)
index 0000000..7551021
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef ASMNAMES_H
+#define ASMNAMES_H
+
+#define C2(X, Y)  X ## Y
+#define C1(X, Y)  C2(X, Y)
+#ifdef __USER_LABEL_PREFIX__
+# define C(X)     C1(__USER_LABEL_PREFIX__, X)
+#else
+# define C(X)     X
+#endif
+
+#ifdef __APPLE__
+# define L(X)     C1(L, X)
+#else
+# define L(X)     C1(.L, X)
+#endif
+
+#if defined(__ELF__) && defined(__PIC__)
+# define PLT(X)          X@PLT
+#else
+# define PLT(X)          X
+#endif
+
+#ifdef __ELF__
+# define ENDF(X)  .type        X,@function; .size X, . - X
+#else
+# define ENDF(X)
+#endif
+
+#endif /* ASMNAMES_H */
diff --git a/libffi/src/x86/darwin.S b/libffi/src/x86/darwin.S
deleted file mode 100644 (file)
index 8f0f070..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-/* -----------------------------------------------------------------------
-   darwin.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005  Red Hat, Inc.
-       Copyright (C) 2008  Free Software Foundation, Inc.
-
-   X86 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 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 __x86_64__
-
-#define LIBFFI_ASM     
-#include <fficonfig.h>
-#include <ffi.h>
-
-.text
-
-.globl _ffi_prep_args
-
-       .align 4
-.globl _ffi_call_SYSV
-
-_ffi_call_SYSV:
-.LFB1:
-        pushl %ebp
-.LCFI0:
-        movl  %esp,%ebp
-.LCFI1:
-        subl $8,%esp
-       /* Make room for all of the new args.  */
-       movl  16(%ebp),%ecx
-       subl  %ecx,%esp
-
-       movl  %esp,%eax
-
-       /* Place all of the ffi_prep_args in position  */
-       subl  $8,%esp
-       pushl 12(%ebp)
-       pushl %eax
-       call  *8(%ebp)
-
-       /* Return stack to previous state and call the function  */
-       addl  $16,%esp  
-
-       call  *28(%ebp)
-
-       /* Load %ecx with the return type code  */
-       movl  20(%ebp),%ecx     
-
-       /* Protect %esi.  We're going to pop it in the epilogue.  */
-       pushl %esi
-
-       /* If the return value pointer is NULL, assume no return value.  */
-       cmpl  $0,24(%ebp)
-       jne  0f
-
-       /* Even if there is no space for the return value, we are 
-          obliged to handle floating-point values.  */
-       cmpl  $FFI_TYPE_FLOAT,%ecx
-       jne   noretval
-       fstp  %st(0)
-
-       jmp   epilogue
-0:
-       .align 4
-       call 1f
-.Lstore_table:
-       .long   noretval-.Lstore_table          /* FFI_TYPE_VOID */
-       .long   retint-.Lstore_table            /* FFI_TYPE_INT */
-       .long   retfloat-.Lstore_table          /* FFI_TYPE_FLOAT */
-       .long   retdouble-.Lstore_table         /* FFI_TYPE_DOUBLE */
-       .long   retlongdouble-.Lstore_table     /* FFI_TYPE_LONGDOUBLE */
-       .long   retuint8-.Lstore_table          /* FFI_TYPE_UINT8 */
-       .long   retsint8-.Lstore_table          /* FFI_TYPE_SINT8 */
-       .long   retuint16-.Lstore_table         /* FFI_TYPE_UINT16 */
-       .long   retsint16-.Lstore_table         /* FFI_TYPE_SINT16 */
-       .long   retint-.Lstore_table            /* FFI_TYPE_UINT32 */
-       .long   retint-.Lstore_table            /* FFI_TYPE_SINT32 */
-       .long   retint64-.Lstore_table          /* FFI_TYPE_UINT64 */
-       .long   retint64-.Lstore_table          /* FFI_TYPE_SINT64 */
-       .long   retstruct-.Lstore_table         /* FFI_TYPE_STRUCT */
-       .long   retint-.Lstore_table            /* FFI_TYPE_POINTER */
-       .long   retstruct1b-.Lstore_table       /* FFI_TYPE_SMALL_STRUCT_1B */
-       .long   retstruct2b-.Lstore_table       /* FFI_TYPE_SMALL_STRUCT_2B */
-1:
-       pop  %esi
-       add  (%esi, %ecx, 4), %esi
-       jmp  *%esi
-
-       /* Sign/zero extend as appropriate.  */
-retsint8:
-       movsbl  %al, %eax
-       jmp  retint
-
-retsint16:
-       movswl  %ax, %eax
-       jmp  retint
-
-retuint8:
-       movzbl  %al, %eax
-       jmp  retint
-
-retuint16:
-       movzwl  %ax, %eax
-       jmp  retint
-
-retfloat:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       fstps (%ecx)
-       jmp   epilogue
-
-retdouble:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       fstpl (%ecx)
-       jmp   epilogue
-
-retlongdouble:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       fstpt (%ecx)
-       jmp   epilogue
-
-retint64:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       movl  %eax,0(%ecx)
-       movl  %edx,4(%ecx)
-       jmp   epilogue
-
-retstruct1b:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       movb  %al,0(%ecx)
-       jmp   epilogue
-
-retstruct2b:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       movw  %ax,0(%ecx)
-       jmp   epilogue
-
-retint:
-       /* Load %ecx with the pointer to storage for the return value  */
-       movl  24(%ebp),%ecx
-       movl  %eax,0(%ecx)
-
-retstruct:
-       /* Nothing to do!  */
-
-noretval:
-epilogue:
-       popl %esi
-       movl %ebp,%esp
-       popl %ebp
-       ret
-
-.LFE1:
-.ffi_call_SYSV_end:
-
-       .align  4
-FFI_HIDDEN (ffi_closure_SYSV)
-.globl _ffi_closure_SYSV
-
-_ffi_closure_SYSV:
-.LFB2:
-       pushl   %ebp
-.LCFI2:
-       movl    %esp, %ebp
-.LCFI3:
-       subl    $40, %esp
-       leal    -24(%ebp), %edx
-       movl    %edx, -12(%ebp) /* resp */
-       leal    8(%ebp), %edx
-       movl    %edx, 4(%esp)   /* args = __builtin_dwarf_cfa () */
-       leal    -12(%ebp), %edx
-       movl    %edx, (%esp)    /* &resp */
-       movl    %ebx, 8(%esp)
-.LCFI7:
-       call    L_ffi_closure_SYSV_inner$stub
-       movl    8(%esp), %ebx
-       movl    -12(%ebp), %ecx
-       cmpl    $FFI_TYPE_INT, %eax
-       je      .Lcls_retint
-
-       /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
-          FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32.  */
-       cmpl    $FFI_TYPE_UINT64, %eax
-       jge     0f
-       cmpl    $FFI_TYPE_UINT8, %eax
-       jge     .Lcls_retint
-
-0:     cmpl    $FFI_TYPE_FLOAT, %eax
-       je      .Lcls_retfloat
-       cmpl    $FFI_TYPE_DOUBLE, %eax
-       je      .Lcls_retdouble
-       cmpl    $FFI_TYPE_LONGDOUBLE, %eax
-       je      .Lcls_retldouble
-       cmpl    $FFI_TYPE_SINT64, %eax
-       je      .Lcls_retllong
-       cmpl    $FFI_TYPE_SMALL_STRUCT_1B, %eax
-       je      .Lcls_retstruct1b
-       cmpl    $FFI_TYPE_SMALL_STRUCT_2B, %eax
-       je      .Lcls_retstruct2b
-       cmpl    $FFI_TYPE_STRUCT, %eax
-       je      .Lcls_retstruct
-.Lcls_epilogue:
-       movl    %ebp, %esp
-       popl    %ebp
-       ret
-.Lcls_retint:
-       movl    (%ecx), %eax
-       jmp     .Lcls_epilogue
-.Lcls_retfloat:
-       flds    (%ecx)
-       jmp     .Lcls_epilogue
-.Lcls_retdouble:
-       fldl    (%ecx)
-       jmp     .Lcls_epilogue
-.Lcls_retldouble:
-       fldt    (%ecx)
-       jmp     .Lcls_epilogue
-.Lcls_retllong:
-       movl    (%ecx), %eax
-       movl    4(%ecx), %edx
-       jmp     .Lcls_epilogue
-.Lcls_retstruct1b:
-       movsbl  (%ecx), %eax
-       jmp     .Lcls_epilogue
-.Lcls_retstruct2b:
-       movswl  (%ecx), %eax
-       jmp     .Lcls_epilogue
-.Lcls_retstruct:
-       lea -8(%ebp),%esp
-       movl    %ebp, %esp
-       popl    %ebp
-       ret $4
-.LFE2:
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-#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
-
-       .align  4
-FFI_HIDDEN (ffi_closure_raw_SYSV)
-.globl _ffi_closure_raw_SYSV
-
-_ffi_closure_raw_SYSV:
-.LFB3:
-       pushl   %ebp
-.LCFI4:
-       movl    %esp, %ebp
-.LCFI5:
-       pushl   %esi
-.LCFI6:
-       subl    $36, %esp
-       movl    RAW_CLOSURE_CIF_OFFSET(%eax), %esi       /* closure->cif */
-       movl    RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
-       movl    %edx, 12(%esp)  /* user_data */
-       leal    8(%ebp), %edx   /* __builtin_dwarf_cfa () */
-       movl    %edx, 8(%esp)   /* raw_args */
-       leal    -24(%ebp), %edx
-       movl    %edx, 4(%esp)   /* &res */
-       movl    %esi, (%esp)    /* cif */
-       call    *RAW_CLOSURE_FUN_OFFSET(%eax)            /* closure->fun */
-       movl    CIF_FLAGS_OFFSET(%esi), %eax             /* rtype */
-       cmpl    $FFI_TYPE_INT, %eax
-       je      .Lrcls_retint
-
-       /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
-          FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32.  */
-       cmpl    $FFI_TYPE_UINT64, %eax
-       jge     0f
-       cmpl    $FFI_TYPE_UINT8, %eax
-       jge     .Lrcls_retint
-0:
-       cmpl    $FFI_TYPE_FLOAT, %eax
-       je      .Lrcls_retfloat
-       cmpl    $FFI_TYPE_DOUBLE, %eax
-       je      .Lrcls_retdouble
-       cmpl    $FFI_TYPE_LONGDOUBLE, %eax
-       je      .Lrcls_retldouble
-       cmpl    $FFI_TYPE_SINT64, %eax
-       je      .Lrcls_retllong
-.Lrcls_epilogue:
-       addl    $36, %esp
-       popl    %esi
-       popl    %ebp
-       ret
-.Lrcls_retint:
-       movl    -24(%ebp), %eax
-       jmp     .Lrcls_epilogue
-.Lrcls_retfloat:
-       flds    -24(%ebp)
-       jmp     .Lrcls_epilogue
-.Lrcls_retdouble:
-       fldl    -24(%ebp)
-       jmp     .Lrcls_epilogue
-.Lrcls_retldouble:
-       fldt    -24(%ebp)
-       jmp     .Lrcls_epilogue
-.Lrcls_retllong:
-       movl    -24(%ebp), %eax
-       movl    -20(%ebp), %edx
-       jmp     .Lrcls_epilogue
-.LFE3:
-#endif
-
-.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
-
-
-.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
-       .set    L$set$0,LECIE1-LSCIE1
-       .long   L$set$0
-LSCIE1:
-       .long   0x0
-       .byte   0x1
-       .ascii "zR\0"
-       .byte   0x1
-       .byte   0x7c
-       .byte   0x8
-       .byte   0x1
-       .byte   0x10
-       .byte   0xc
-       .byte   0x5
-       .byte   0x4
-       .byte   0x88
-       .byte   0x1
-       .align 2
-LECIE1:
-.globl _ffi_call_SYSV.eh
-_ffi_call_SYSV.eh:
-LSFDE1:
-       .set    L$set$1,LEFDE1-LASFDE1
-       .long   L$set$1
-LASFDE1:
-       .long   LASFDE1-EH_frame1
-       .long   .LFB1-.
-       .set L$set$2,.LFE1-.LFB1
-       .long L$set$2
-       .byte   0x0
-       .byte   0x4
-       .set L$set$3,.LCFI0-.LFB1
-       .long L$set$3
-       .byte   0xe
-       .byte   0x8
-       .byte   0x84
-       .byte   0x2
-       .byte   0x4
-       .set L$set$4,.LCFI1-.LCFI0
-       .long L$set$4
-       .byte   0xd
-       .byte   0x4
-       .align 2
-LEFDE1:
-.globl _ffi_closure_SYSV.eh
-_ffi_closure_SYSV.eh:
-LSFDE2:
-       .set    L$set$5,LEFDE2-LASFDE2
-       .long   L$set$5
-LASFDE2:
-       .long   LASFDE2-EH_frame1
-       .long   .LFB2-.
-       .set L$set$6,.LFE2-.LFB2
-       .long L$set$6
-       .byte   0x0
-       .byte   0x4
-       .set L$set$7,.LCFI2-.LFB2
-       .long L$set$7
-       .byte   0xe
-       .byte   0x8
-       .byte   0x84
-       .byte   0x2
-       .byte   0x4
-       .set L$set$8,.LCFI3-.LCFI2
-       .long L$set$8
-       .byte   0xd
-       .byte   0x4
-       .align 2
-LEFDE2:
-
-#if !FFI_NO_RAW_API
-
-.globl _ffi_closure_raw_SYSV.eh
-_ffi_closure_raw_SYSV.eh:
-LSFDE3:
-       .set    L$set$10,LEFDE3-LASFDE3
-       .long   L$set$10
-LASFDE3:
-       .long   LASFDE3-EH_frame1
-       .long   .LFB3-.
-       .set L$set$11,.LFE3-.LFB3
-       .long L$set$11
-       .byte   0x0
-       .byte   0x4
-       .set L$set$12,.LCFI4-.LFB3
-       .long L$set$12
-       .byte   0xe
-       .byte   0x8
-       .byte   0x84
-       .byte   0x2
-       .byte   0x4
-       .set L$set$13,.LCFI5-.LCFI4
-       .long L$set$13
-       .byte   0xd
-       .byte   0x4
-       .byte   0x4
-       .set L$set$14,.LCFI6-.LCFI5
-       .long L$set$14
-       .byte   0x85
-       .byte   0x3
-       .align 2
-LEFDE3:
-
-#endif
-
-#endif /* ifndef __x86_64__ */
diff --git a/libffi/src/x86/darwin64.S b/libffi/src/x86/darwin64.S
deleted file mode 100644 (file)
index 2f7394e..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-/* -----------------------------------------------------------------------
-   darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc.
-               Copyright (c) 2008 Red Hat, Inc.
-   derived from unix64.S
-
-   x86-64 Foreign Function Interface for Darwin.
-
-   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.
-   ----------------------------------------------------------------------- */
-
-#ifdef __x86_64__
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-       .file "darwin64.S"
-.text
-
-/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
-                   void *raddr, void (*fnaddr)(void));
-
-   Bit o trickiness here -- ARGS+BYTES is the base of the stack frame
-   for this function.  This has been allocated by ffi_call.  We also
-   deallocate some of the stack that has been alloca'd.  */
-
-       .align  3
-       .globl  _ffi_call_unix64
-
-_ffi_call_unix64:
-LUW0:
-       movq    (%rsp), %r10            /* Load return address.  */
-       leaq    (%rdi, %rsi), %rax      /* Find local stack base.  */
-       movq    %rdx, (%rax)            /* Save flags.  */
-       movq    %rcx, 8(%rax)           /* Save raddr.  */
-       movq    %rbp, 16(%rax)          /* Save old frame pointer.  */
-       movq    %r10, 24(%rax)          /* Relocate return address.  */
-       movq    %rax, %rbp              /* Finalize local stack frame.  */
-LUW1:
-       movq    %rdi, %r10              /* Save a copy of the register area. */
-       movq    %r8, %r11               /* Save a copy of the target fn.  */
-       movl    %r9d, %eax              /* Set number of SSE registers.  */
-
-       /* Load up all argument registers.  */
-       movq    (%r10), %rdi
-       movq    8(%r10), %rsi
-       movq    16(%r10), %rdx
-       movq    24(%r10), %rcx
-       movq    32(%r10), %r8
-       movq    40(%r10), %r9
-       testl   %eax, %eax
-       jnz     Lload_sse
-Lret_from_load_sse:
-
-       /* Deallocate the reg arg area.  */
-       leaq    176(%r10), %rsp
-
-       /* Call the user function.  */
-       call    *%r11
-
-       /* Deallocate stack arg area; local stack frame in redzone.  */
-       leaq    24(%rbp), %rsp
-
-       movq    0(%rbp), %rcx           /* Reload flags.  */
-       movq    8(%rbp), %rdi           /* Reload raddr.  */
-       movq    16(%rbp), %rbp          /* Reload old frame pointer.  */
-LUW2:
-
-       /* The first byte of the flags contains the FFI_TYPE.  */
-       movzbl  %cl, %r10d
-       leaq    Lstore_table(%rip), %r11
-       movslq  (%r11, %r10, 4), %r10
-       addq    %r11, %r10
-       jmp     *%r10
-
-Lstore_table:
-       .long   Lst_void-Lstore_table           /* FFI_TYPE_VOID */
-       .long   Lst_sint32-Lstore_table         /* FFI_TYPE_INT */
-       .long   Lst_float-Lstore_table          /* FFI_TYPE_FLOAT */
-       .long   Lst_double-Lstore_table         /* FFI_TYPE_DOUBLE */
-       .long   Lst_ldouble-Lstore_table        /* FFI_TYPE_LONGDOUBLE */
-       .long   Lst_uint8-Lstore_table          /* FFI_TYPE_UINT8 */
-       .long   Lst_sint8-Lstore_table          /* FFI_TYPE_SINT8 */
-       .long   Lst_uint16-Lstore_table         /* FFI_TYPE_UINT16 */
-       .long   Lst_sint16-Lstore_table         /* FFI_TYPE_SINT16 */
-       .long   Lst_uint32-Lstore_table         /* FFI_TYPE_UINT32 */
-       .long   Lst_sint32-Lstore_table         /* FFI_TYPE_SINT32 */
-       .long   Lst_int64-Lstore_table          /* FFI_TYPE_UINT64 */
-       .long   Lst_int64-Lstore_table          /* FFI_TYPE_SINT64 */
-       .long   Lst_struct-Lstore_table         /* FFI_TYPE_STRUCT */
-       .long   Lst_int64-Lstore_table          /* FFI_TYPE_POINTER */
-
-       .text
-       .align  3
-Lst_void:
-       ret
-       .align  3
-Lst_uint8:
-       movzbq  %al, %rax
-       movq    %rax, (%rdi)
-       ret
-       .align  3
-Lst_sint8:
-       movsbq  %al, %rax
-       movq    %rax, (%rdi)
-       ret
-       .align  3
-Lst_uint16:
-       movzwq  %ax, %rax
-       movq    %rax, (%rdi)
-       .align  3
-Lst_sint16:
-       movswq  %ax, %rax
-       movq    %rax, (%rdi)
-       ret
-       .align  3
-Lst_uint32:
-       movl    %eax, %eax
-       movq    %rax, (%rdi)
-       .align  3
-Lst_sint32:
-       cltq
-       movq    %rax, (%rdi)
-       ret
-       .align  3
-Lst_int64:
-       movq    %rax, (%rdi)
-       ret
-       .align  3
-Lst_float:
-       movss   %xmm0, (%rdi)
-       ret
-       .align  3
-Lst_double:
-       movsd   %xmm0, (%rdi)
-       ret
-Lst_ldouble:
-       fstpt   (%rdi)
-       ret
-       .align  3
-Lst_struct:
-       leaq    -20(%rsp), %rsi         /* Scratch area in redzone.  */
-
-       /* We have to locate the values now, and since we don't want to
-          write too much data into the user's return value, we spill the
-          value to a 16 byte scratch area first.  Bits 8, 9, and 10
-          control where the values are located.  Only one of the three
-          bits will be set; see ffi_prep_cif_machdep for the pattern.  */
-       movd    %xmm0, %r10
-       movd    %xmm1, %r11
-       testl   $0x100, %ecx
-       cmovnz  %rax, %rdx
-       cmovnz  %r10, %rax
-       testl   $0x200, %ecx
-       cmovnz  %r10, %rdx
-       testl   $0x400, %ecx
-       cmovnz  %r10, %rax
-       cmovnz  %r11, %rdx
-       movq    %rax, (%rsi)
-       movq    %rdx, 8(%rsi)
-
-       /* Bits 12-31 contain the true size of the structure.  Copy from
-          the scratch area to the true destination.  */
-       shrl    $12, %ecx
-       rep movsb
-       ret
-
-       /* Many times we can avoid loading any SSE registers at all.
-          It's not worth an indirect jump to load the exact set of
-          SSE registers needed; zero or all is a good compromise.  */
-       .align  3
-LUW3:
-Lload_sse:
-       movdqa  48(%r10), %xmm0
-       movdqa  64(%r10), %xmm1
-       movdqa  80(%r10), %xmm2
-       movdqa  96(%r10), %xmm3
-       movdqa  112(%r10), %xmm4
-       movdqa  128(%r10), %xmm5
-       movdqa  144(%r10), %xmm6
-       movdqa  160(%r10), %xmm7
-       jmp     Lret_from_load_sse
-
-LUW4:
-       .align  3
-       .globl  _ffi_closure_unix64
-
-_ffi_closure_unix64:
-LUW5:
-       /* The carry flag is set by the trampoline iff SSE registers
-          are used.  Don't clobber it before the branch instruction.  */
-       leaq    -200(%rsp), %rsp
-LUW6:
-       movq    %rdi, (%rsp)
-       movq    %rsi, 8(%rsp)
-       movq    %rdx, 16(%rsp)
-       movq    %rcx, 24(%rsp)
-       movq    %r8, 32(%rsp)
-       movq    %r9, 40(%rsp)
-       jc      Lsave_sse
-Lret_from_save_sse:
-
-       movq    %r10, %rdi
-       leaq    176(%rsp), %rsi
-       movq    %rsp, %rdx
-       leaq    208(%rsp), %rcx
-       call    _ffi_closure_unix64_inner
-
-       /* Deallocate stack frame early; return value is now in redzone.  */
-       addq    $200, %rsp
-LUW7:
-
-       /* The first byte of the return value contains the FFI_TYPE.  */
-       movzbl  %al, %r10d
-       leaq    Lload_table(%rip), %r11
-       movslq  (%r11, %r10, 4), %r10
-       addq    %r11, %r10
-       jmp     *%r10
-
-Lload_table:
-       .long   Lld_void-Lload_table            /* FFI_TYPE_VOID */
-       .long   Lld_int32-Lload_table           /* FFI_TYPE_INT */
-       .long   Lld_float-Lload_table           /* FFI_TYPE_FLOAT */
-       .long   Lld_double-Lload_table          /* FFI_TYPE_DOUBLE */
-       .long   Lld_ldouble-Lload_table         /* FFI_TYPE_LONGDOUBLE */
-       .long   Lld_int8-Lload_table            /* FFI_TYPE_UINT8 */
-       .long   Lld_int8-Lload_table            /* FFI_TYPE_SINT8 */
-       .long   Lld_int16-Lload_table           /* FFI_TYPE_UINT16 */
-       .long   Lld_int16-Lload_table           /* FFI_TYPE_SINT16 */
-       .long   Lld_int32-Lload_table           /* FFI_TYPE_UINT32 */
-       .long   Lld_int32-Lload_table           /* FFI_TYPE_SINT32 */
-       .long   Lld_int64-Lload_table           /* FFI_TYPE_UINT64 */
-       .long   Lld_int64-Lload_table           /* FFI_TYPE_SINT64 */
-       .long   Lld_struct-Lload_table          /* FFI_TYPE_STRUCT */
-       .long   Lld_int64-Lload_table           /* FFI_TYPE_POINTER */
-
-       .text
-       .align  3
-Lld_void:
-       ret
-       .align  3
-Lld_int8:
-       movzbl  -24(%rsp), %eax
-       ret
-       .align  3
-Lld_int16:
-       movzwl  -24(%rsp), %eax
-       ret
-       .align  3
-Lld_int32:
-       movl    -24(%rsp), %eax
-       ret
-       .align  3
-Lld_int64:
-       movq    -24(%rsp), %rax
-       ret
-       .align  3
-Lld_float:
-       movss   -24(%rsp), %xmm0
-       ret
-       .align  3
-Lld_double:
-       movsd   -24(%rsp), %xmm0
-       ret
-       .align  3
-Lld_ldouble:
-       fldt    -24(%rsp)
-       ret
-       .align  3
-Lld_struct:
-       /* There are four possibilities here, %rax/%rdx, %xmm0/%rax,
-          %rax/%xmm0, %xmm0/%xmm1.  We collapse two by always loading
-          both rdx and xmm1 with the second word.  For the remaining,
-          bit 8 set means xmm0 gets the second word, and bit 9 means
-          that rax gets the second word.  */
-       movq    -24(%rsp), %rcx
-       movq    -16(%rsp), %rdx
-       movq    -16(%rsp), %xmm1
-       testl   $0x100, %eax
-       cmovnz  %rdx, %rcx
-       movd    %rcx, %xmm0
-       testl   $0x200, %eax
-       movq    -24(%rsp), %rax
-       cmovnz  %rdx, %rax
-       ret
-
-       /* See the comment above Lload_sse; the same logic applies here.  */
-       .align  3
-LUW8:
-Lsave_sse:
-       movdqa  %xmm0, 48(%rsp)
-       movdqa  %xmm1, 64(%rsp)
-       movdqa  %xmm2, 80(%rsp)
-       movdqa  %xmm3, 96(%rsp)
-       movdqa  %xmm4, 112(%rsp)
-       movdqa  %xmm5, 128(%rsp)
-       movdqa  %xmm6, 144(%rsp)
-       movdqa  %xmm7, 160(%rsp)
-       jmp     Lret_from_save_sse
-
-LUW9:
-.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
-       .set    L$set$0,LECIE1-LSCIE1           /* CIE Length */
-       .long   L$set$0
-LSCIE1:
-       .long   0x0             /* CIE Identifier Tag */
-       .byte   0x1             /* CIE Version */
-       .ascii  "zR\0"          /* CIE Augmentation */
-       .byte   0x1             /* uleb128 0x1; CIE Code Alignment Factor */
-       .byte   0x78            /* sleb128 -8; CIE Data Alignment Factor */
-       .byte   0x10            /* CIE RA Column */
-       .byte   0x1             /* uleb128 0x1; Augmentation size */
-       .byte   0x10            /* FDE Encoding (pcrel sdata4) */
-       .byte   0xc             /* DW_CFA_def_cfa, %rsp offset 8 */
-       .byte   0x7             /* uleb128 0x7 */
-       .byte   0x8             /* uleb128 0x8 */
-       .byte   0x90            /* DW_CFA_offset, column 0x10 */
-       .byte   0x1
-       .align  3
-LECIE1:
-       .globl _ffi_call_unix64.eh
-_ffi_call_unix64.eh:
-LSFDE1:
-       .set    L$set$1,LEFDE1-LASFDE1  /* FDE Length */
-       .long   L$set$1
-LASFDE1:
-       .long   LASFDE1-EH_frame1       /* FDE CIE offset */
-       .quad   LUW0-.                  /* FDE initial location */
-       .set    L$set$2,LUW4-LUW0       /* FDE address range */
-       .quad   L$set$2
-       .byte   0x0                     /* Augmentation size */
-       .byte   0x4                     /* DW_CFA_advance_loc4 */
-       .set    L$set$3,LUW1-LUW0
-       .long   L$set$3
-
-       /* New stack frame based off rbp.  This is a itty bit of unwind
-          trickery in that the CFA *has* changed.  There is no easy way
-          to describe it correctly on entry to the function.  Fortunately,
-          it doesn't matter too much since at all points we can correctly
-          unwind back to ffi_call.  Note that the location to which we
-          moved the return address is (the new) CFA-8, so from the
-          perspective of the unwind info, it hasn't moved.  */
-       .byte   0xc                     /* DW_CFA_def_cfa, %rbp offset 32 */
-       .byte   0x6
-       .byte   0x20
-       .byte   0x80+6                  /* DW_CFA_offset, %rbp offset 2*-8 */
-       .byte   0x2
-       .byte   0xa                     /* DW_CFA_remember_state */
-
-       .byte   0x4                     /* DW_CFA_advance_loc4 */
-       .set    L$set$4,LUW2-LUW1
-       .long   L$set$4
-       .byte   0xc                     /* DW_CFA_def_cfa, %rsp offset 8 */
-       .byte   0x7
-       .byte   0x8
-       .byte   0xc0+6                  /* DW_CFA_restore, %rbp */
-
-       .byte   0x4                     /* DW_CFA_advance_loc4 */
-       .set    L$set$5,LUW3-LUW2
-       .long   L$set$5
-       .byte   0xb                     /* DW_CFA_restore_state */
-
-       .align  3
-LEFDE1:
-       .globl _ffi_closure_unix64.eh
-_ffi_closure_unix64.eh:
-LSFDE3:
-       .set    L$set$6,LEFDE3-LASFDE3  /* FDE Length */
-       .long   L$set$6
-LASFDE3:
-       .long   LASFDE3-EH_frame1       /* FDE CIE offset */
-       .quad   LUW5-.                  /* FDE initial location */
-       .set    L$set$7,LUW9-LUW5       /* FDE address range */
-       .quad   L$set$7
-       .byte   0x0                     /* Augmentation size */
-
-       .byte   0x4                     /* DW_CFA_advance_loc4 */
-       .set    L$set$8,LUW6-LUW5
-       .long   L$set$8
-       .byte   0xe                     /* DW_CFA_def_cfa_offset */
-       .byte   208,1                   /* uleb128 208 */
-       .byte   0xa                     /* DW_CFA_remember_state */
-
-       .byte   0x4                     /* DW_CFA_advance_loc4 */
-       .set    L$set$9,LUW7-LUW6
-       .long   L$set$9
-       .byte   0xe                     /* DW_CFA_def_cfa_offset */
-       .byte   0x8
-
-       .byte   0x4                     /* DW_CFA_advance_loc4 */
-       .set    L$set$10,LUW8-LUW7
-       .long   L$set$10
-       .byte   0xb                     /* DW_CFA_restore_state */
-
-       .align  3
-LEFDE3:
-       .subsections_via_symbols
-
-#endif /* __x86_64__ */
diff --git a/libffi/src/x86/darwin64_c.c b/libffi/src/x86/darwin64_c.c
deleted file mode 100644 (file)
index 1daa1c0..0000000
+++ /dev/null
@@ -1,643 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi64.c - Copyright (c) 20011  Anthony Green
-             Copyright (c) 2008, 2010  Red Hat, Inc.
-             Copyright (c) 2002, 2007  Bo Thorsen <bo@suse.de>
-             
-   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
-   ``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>
-#include <stdarg.h>
-
-#ifdef __x86_64__
-
-#define MAX_GPR_REGS 6
-#define MAX_SSE_REGS 8
-
-#ifdef __INTEL_COMPILER
-#define UINT128 __m128
-#else
-#define UINT128 __int128_t
-#endif
-
-struct register_args
-{
-  /* Registers for argument passing.  */
-  UINT64 gpr[MAX_GPR_REGS];
-  UINT128 sse[MAX_SSE_REGS];
-};
-
-extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
-                            void *raddr, void (*fnaddr)(void), unsigned ssecount);
-
-/* All reference to register classes here is identical to the code in
-   gcc/config/i386/i386.c. Do *not* change one without the other.  */
-
-/* Register class used for passing given 64bit part of the argument.
-   These represent classes as documented by the PS ABI, with the
-   exception of SSESF, SSEDF classes, that are basically SSE class,
-   just gcc will use SF or DFmode move instead of DImode to avoid
-   reformatting penalties.
-
-   Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
-   whenever possible (upper half does contain padding).  */
-enum x86_64_reg_class
-  {
-    X86_64_NO_CLASS,
-    X86_64_INTEGER_CLASS,
-    X86_64_INTEGERSI_CLASS,
-    X86_64_SSE_CLASS,
-    X86_64_SSESF_CLASS,
-    X86_64_SSEDF_CLASS,
-    X86_64_SSEUP_CLASS,
-    X86_64_X87_CLASS,
-    X86_64_X87UP_CLASS,
-    X86_64_COMPLEX_X87_CLASS,
-    X86_64_MEMORY_CLASS
-  };
-
-#define MAX_CLASSES 4
-
-#define SSE_CLASS_P(X) ((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS)
-
-/* x86-64 register passing implementation.  See x86-64 ABI for details.  Goal
-   of this code is to classify each 8bytes of incoming argument by the register
-   class and assign registers accordingly.  */
-
-/* Return the union class of CLASS1 and CLASS2.
-   See the x86-64 PS ABI for details.  */
-
-static enum x86_64_reg_class
-merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
-{
-  /* Rule #1: If both classes are equal, this is the resulting class.  */
-  if (class1 == class2)
-    return class1;
-
-  /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
-     the other class.  */
-  if (class1 == X86_64_NO_CLASS)
-    return class2;
-  if (class2 == X86_64_NO_CLASS)
-    return class1;
-
-  /* Rule #3: If one of the classes is MEMORY, the result is MEMORY.  */
-  if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS)
-    return X86_64_MEMORY_CLASS;
-
-  /* Rule #4: If one of the classes is INTEGER, the result is INTEGER.  */
-  if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS)
-      || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS))
-    return X86_64_INTEGERSI_CLASS;
-  if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS
-      || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS)
-    return X86_64_INTEGER_CLASS;
-
-  /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class,
-     MEMORY is used.  */
-  if (class1 == X86_64_X87_CLASS
-      || class1 == X86_64_X87UP_CLASS
-      || class1 == X86_64_COMPLEX_X87_CLASS
-      || class2 == X86_64_X87_CLASS
-      || class2 == X86_64_X87UP_CLASS
-      || class2 == X86_64_COMPLEX_X87_CLASS)
-    return X86_64_MEMORY_CLASS;
-
-  /* Rule #6: Otherwise class SSE is used.  */
-  return X86_64_SSE_CLASS;
-}
-
-/* Classify the argument of type TYPE and mode MODE.
-   CLASSES will be filled by the register class used to pass each word
-   of the operand.  The number of words is returned.  In case the parameter
-   should be passed in memory, 0 is returned. As a special case for zero
-   sized containers, classes[0] will be NO_CLASS and 1 is returned.
-
-   See the x86-64 PS ABI for details.
-*/
-static int
-classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
-                  size_t byte_offset)
-{
-  switch (type->type)
-    {
-    case FFI_TYPE_UINT8:
-    case FFI_TYPE_SINT8:
-    case FFI_TYPE_UINT16:
-    case FFI_TYPE_SINT16:
-    case FFI_TYPE_UINT32:
-    case FFI_TYPE_SINT32:
-    case FFI_TYPE_UINT64:
-    case FFI_TYPE_SINT64:
-    case FFI_TYPE_POINTER:
-      {
-       int size = byte_offset + type->size;
-
-       if (size <= 4)
-         {
-           classes[0] = X86_64_INTEGERSI_CLASS;
-           return 1;
-         }
-       else if (size <= 8)
-         {
-           classes[0] = X86_64_INTEGER_CLASS;
-           return 1;
-         }
-       else if (size <= 12)
-         {
-           classes[0] = X86_64_INTEGER_CLASS;
-           classes[1] = X86_64_INTEGERSI_CLASS;
-           return 2;
-         }
-       else if (size <= 16)
-         {
-           classes[0] = classes[1] = X86_64_INTEGERSI_CLASS;
-           return 2;
-         }
-       else
-         FFI_ASSERT (0);
-      }
-    case FFI_TYPE_FLOAT:
-      if (!(byte_offset % 8))
-       classes[0] = X86_64_SSESF_CLASS;
-      else
-       classes[0] = X86_64_SSE_CLASS;
-      return 1;
-    case FFI_TYPE_DOUBLE:
-      classes[0] = X86_64_SSEDF_CLASS;
-      return 1;
-    case FFI_TYPE_LONGDOUBLE:
-      classes[0] = X86_64_X87_CLASS;
-      classes[1] = X86_64_X87UP_CLASS;
-      return 2;
-    case FFI_TYPE_STRUCT:
-      {
-       const int UNITS_PER_WORD = 8;
-       int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
-       ffi_type **ptr; 
-       int i;
-       enum x86_64_reg_class subclasses[MAX_CLASSES];
-
-       /* If the struct is larger than 32 bytes, pass it on the stack.  */
-       if (type->size > 32)
-         return 0;
-
-       for (i = 0; i < words; i++)
-         classes[i] = X86_64_NO_CLASS;
-
-       /* Zero sized arrays or structures are NO_CLASS.  We return 0 to
-          signalize memory class, so handle it as special case.  */
-       if (!words)
-         {
-           classes[0] = X86_64_NO_CLASS;
-           return 1;
-         }
-
-       /* Merge the fields of structure.  */
-       for (ptr = type->elements; *ptr != NULL; ptr++)
-         {
-           int num;
-
-           byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
-
-           num = classify_argument (*ptr, subclasses, byte_offset % 8);
-           if (num == 0)
-             return 0;
-           for (i = 0; i < num; i++)
-             {
-               int pos = byte_offset / 8;
-               classes[i + pos] =
-                 merge_classes (subclasses[i], classes[i + pos]);
-             }
-
-           byte_offset += (*ptr)->size;
-         }
-
-       if (words > 2)
-         {
-           /* When size > 16 bytes, if the first one isn't
-              X86_64_SSE_CLASS or any other ones aren't
-              X86_64_SSEUP_CLASS, everything should be passed in
-              memory.  */
-           if (classes[0] != X86_64_SSE_CLASS)
-             return 0;
-
-           for (i = 1; i < words; i++)
-             if (classes[i] != X86_64_SSEUP_CLASS)
-               return 0;
-         }
-
-       /* Final merger cleanup.  */
-       for (i = 0; i < words; i++)
-         {
-           /* If one class is MEMORY, everything should be passed in
-              memory.  */
-           if (classes[i] == X86_64_MEMORY_CLASS)
-             return 0;
-
-           /* The X86_64_SSEUP_CLASS should be always preceded by
-              X86_64_SSE_CLASS or X86_64_SSEUP_CLASS.  */
-           if (classes[i] == X86_64_SSEUP_CLASS
-               && classes[i - 1] != X86_64_SSE_CLASS
-               && classes[i - 1] != X86_64_SSEUP_CLASS)
-             {
-               /* The first one should never be X86_64_SSEUP_CLASS.  */
-               FFI_ASSERT (i != 0);
-               classes[i] = X86_64_SSE_CLASS;
-             }
-
-           /*  If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS,
-               everything should be passed in memory.  */
-           if (classes[i] == X86_64_X87UP_CLASS
-               && (classes[i - 1] != X86_64_X87_CLASS))
-             {
-               /* The first one should never be X86_64_X87UP_CLASS.  */
-               FFI_ASSERT (i != 0);
-               return 0;
-             }
-         }
-       return words;
-      }
-
-    default:
-      FFI_ASSERT(0);
-    }
-  return 0; /* Never reached.  */
-}
-
-/* Examine the argument and return set number of register required in each
-   class.  Return zero iff parameter should be passed in memory, otherwise
-   the number of registers.  */
-
-static int
-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;
-
-  n = classify_argument (type, classes, 0);
-  if (n == 0)
-    return 0;
-
-  ngpr = nsse = 0;
-  for (i = 0; i < n; ++i)
-    switch (classes[i])
-      {
-      case X86_64_INTEGER_CLASS:
-      case X86_64_INTEGERSI_CLASS:
-       ngpr++;
-       break;
-      case X86_64_SSE_CLASS:
-      case X86_64_SSESF_CLASS:
-      case X86_64_SSEDF_CLASS:
-       nsse++;
-       break;
-      case X86_64_NO_CLASS:
-      case X86_64_SSEUP_CLASS:
-       break;
-      case X86_64_X87_CLASS:
-      case X86_64_X87UP_CLASS:
-      case X86_64_COMPLEX_X87_CLASS:
-       return in_return != 0;
-      default:
-       abort ();
-      }
-
-  *pngpr = ngpr;
-  *pnsse = nsse;
-
-  return n;
-}
-
-/* Perform machine dependent cif processing.  */
-
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
-  int gprcount, ssecount, i, avn, n, ngpr, nsse, flags;
-  enum x86_64_reg_class classes[MAX_CLASSES];
-  size_t bytes;
-
-  gprcount = ssecount = 0;
-
-  flags = cif->rtype->type;
-  if (flags != FFI_TYPE_VOID)
-    {
-      n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
-      if (n == 0)
-       {
-         /* The return value is passed in memory.  A pointer to that
-            memory is the first argument.  Allocate a register for it.  */
-         gprcount++;
-         /* We don't have to do anything in asm for the return.  */
-         flags = FFI_TYPE_VOID;
-       }
-      else if (flags == FFI_TYPE_STRUCT)
-       {
-         /* Mark which registers the result appears in.  */
-         _Bool sse0 = SSE_CLASS_P (classes[0]);
-         _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]);
-         if (sse0 && !sse1)
-           flags |= 1 << 8;
-         else if (!sse0 && sse1)
-           flags |= 1 << 9;
-         else if (sse0 && sse1)
-           flags |= 1 << 10;
-         /* Mark the true size of the structure.  */
-         flags |= cif->rtype->size << 12;
-       }
-    }
-
-  /* Go over all arguments and determine the way they should be passed.
-     If it's in a register and there is space for it, let that be so. If
-     not, add it's size to the stack byte count.  */
-  for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++)
-    {
-      if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0
-         || gprcount + ngpr > MAX_GPR_REGS
-         || ssecount + nsse > MAX_SSE_REGS)
-       {
-         long align = cif->arg_types[i]->alignment;
-
-         if (align < 8)
-           align = 8;
-
-         bytes = ALIGN (bytes, align);
-         bytes += cif->arg_types[i]->size;
-       }
-      else
-       {
-         gprcount += ngpr;
-         ssecount += nsse;
-       }
-    }
-  if (ssecount)
-    flags |= 1 << 11;
-  cif->flags = flags;
-  cif->bytes = ALIGN (bytes, 8);
-
-  return FFI_OK;
-}
-
-void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
-  enum x86_64_reg_class classes[MAX_CLASSES];
-  char *stack, *argp;
-  ffi_type **arg_types;
-  int gprcount, ssecount, ngpr, nsse, i, avn;
-  _Bool ret_in_memory;
-  struct register_args *reg_args;
-
-  /* Can't call 32-bit mode from 64-bit mode.  */
-  FFI_ASSERT (cif->abi == FFI_UNIX64);
-
-  /* If the return value is a struct and we don't have a return value
-     address then we need to make one.  Note the setting of flags to
-     VOID above in ffi_prep_cif_machdep.  */
-  ret_in_memory = (cif->rtype->type == FFI_TYPE_STRUCT
-                  && (cif->flags & 0xff) == FFI_TYPE_VOID);
-  if (rvalue == NULL && ret_in_memory)
-    rvalue = alloca (cif->rtype->size);
-
-  /* Allocate the space for the arguments, plus 4 words of temp space.  */
-  stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8);
-  reg_args = (struct register_args *) stack;
-  argp = stack + sizeof (struct register_args);
-
-  gprcount = ssecount = 0;
-
-  /* If the return value is passed in memory, add the pointer as the
-     first integer argument.  */
-  if (ret_in_memory)
-    reg_args->gpr[gprcount++] = (unsigned long) rvalue;
-
-  avn = cif->nargs;
-  arg_types = cif->arg_types;
-
-  for (i = 0; i < avn; ++i)
-    {
-      size_t size = arg_types[i]->size;
-      int n;
-
-      n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
-      if (n == 0
-         || gprcount + ngpr > MAX_GPR_REGS
-         || ssecount + nsse > MAX_SSE_REGS)
-       {
-         long align = arg_types[i]->alignment;
-
-         /* Stack arguments are *always* at least 8 byte aligned.  */
-         if (align < 8)
-           align = 8;
-
-         /* Pass this argument in memory.  */
-         argp = (void *) ALIGN (argp, align);
-         memcpy (argp, avalue[i], size);
-         argp += size;
-       }
-      else
-       {
-         /* The argument is passed entirely in registers.  */
-         char *a = (char *) avalue[i];
-         int j;
-
-         for (j = 0; j < n; j++, a += 8, size -= 8)
-           {
-             switch (classes[j])
-               {
-               case X86_64_INTEGER_CLASS:
-               case X86_64_INTEGERSI_CLASS:
-                 reg_args->gpr[gprcount] = 0;
-                 memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
-                 gprcount++;
-                 break;
-               case X86_64_SSE_CLASS:
-               case X86_64_SSEDF_CLASS:
-                 reg_args->sse[ssecount++] = *(UINT64 *) a;
-                 break;
-               case X86_64_SSESF_CLASS:
-                 reg_args->sse[ssecount++] = *(UINT32 *) a;
-                 break;
-               default:
-                 abort();
-               }
-           }
-       }
-    }
-
-  ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args),
-                  cif->flags, rvalue, fn, ssecount);
-}
-
-
-extern void ffi_closure_unix64(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)
-{
-  volatile unsigned short *tramp;
-
-  /* Sanity check on the cif ABI.  */
-  {
-    int abi = cif->abi;
-    if (UNLIKELY (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)))
-      return FFI_BAD_ABI;
-  }
-
-  tramp = (volatile unsigned short *) &closure->tramp[0];
-
-  tramp[0] = 0xbb49;           /* mov <code>, %r11     */
-  *((unsigned long long * volatile) &tramp[1])
-    = (unsigned long) ffi_closure_unix64;
-  tramp[5] = 0xba49;           /* mov <data>, %r10     */
-  *((unsigned long long * volatile) &tramp[6])
-    = (unsigned long) codeloc;
-
-  /* Set the carry bit iff the function uses any sse registers.
-     This is clc or stc, together with the first byte of the jmp.  */
-  tramp[10] = cif->flags & (1 << 11) ? 0x49f9 : 0x49f8;
-
-  tramp[11] = 0xe3ff;                  /* jmp *%r11    */
-
-  closure->cif = cif;
-  closure->fun = fun;
-  closure->user_data = user_data;
-
-  return FFI_OK;
-}
-
-int
-ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue,
-                        struct register_args *reg_args, char *argp)
-{
-  ffi_cif *cif;
-  void **avalue;
-  ffi_type **arg_types;
-  long i, avn;
-  int gprcount, ssecount, ngpr, nsse;
-  int ret;
-
-  cif = closure->cif;
-  avalue = alloca(cif->nargs * sizeof(void *));
-  gprcount = ssecount = 0;
-
-  ret = cif->rtype->type;
-  if (ret != FFI_TYPE_VOID)
-    {
-      enum x86_64_reg_class classes[MAX_CLASSES];
-      int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
-      if (n == 0)
-       {
-         /* The return value goes in memory.  Arrange for the closure
-            return value to go directly back to the original caller.  */
-         rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++];
-         /* We don't have to do anything in asm for the return.  */
-         ret = FFI_TYPE_VOID;
-       }
-      else if (ret == FFI_TYPE_STRUCT && n == 2)
-       {
-         /* Mark which register the second word of the structure goes in.  */
-         _Bool sse0 = SSE_CLASS_P (classes[0]);
-         _Bool sse1 = SSE_CLASS_P (classes[1]);
-         if (!sse0 && sse1)
-           ret |= 1 << 8;
-         else if (sse0 && !sse1)
-           ret |= 1 << 9;
-       }
-    }
-
-  avn = cif->nargs;
-  arg_types = cif->arg_types;
-  
-  for (i = 0; i < avn; ++i)
-    {
-      enum x86_64_reg_class classes[MAX_CLASSES];
-      int n;
-
-      n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
-      if (n == 0
-         || gprcount + ngpr > MAX_GPR_REGS
-         || ssecount + nsse > MAX_SSE_REGS)
-       {
-         long align = arg_types[i]->alignment;
-
-         /* Stack arguments are *always* at least 8 byte aligned.  */
-         if (align < 8)
-           align = 8;
-
-         /* Pass this argument in memory.  */
-         argp = (void *) ALIGN (argp, align);
-         avalue[i] = argp;
-         argp += arg_types[i]->size;
-       }
-      /* If the argument is in a single register, or two consecutive
-        integer registers, then we can use that address directly.  */
-      else if (n == 1
-              || (n == 2 && !(SSE_CLASS_P (classes[0])
-                              || SSE_CLASS_P (classes[1]))))
-       {
-         /* The argument is in a single register.  */
-         if (SSE_CLASS_P (classes[0]))
-           {
-             avalue[i] = &reg_args->sse[ssecount];
-             ssecount += n;
-           }
-         else
-           {
-             avalue[i] = &reg_args->gpr[gprcount];
-             gprcount += n;
-           }
-       }
-      /* Otherwise, allocate space to make them consecutive.  */
-      else
-       {
-         char *a = alloca (16);
-         int j;
-
-         avalue[i] = a;
-         for (j = 0; j < n; j++, a += 8)
-           {
-             if (SSE_CLASS_P (classes[j]))
-               memcpy (a, &reg_args->sse[ssecount++], 8);
-             else
-               memcpy (a, &reg_args->gpr[gprcount++], 8);
-           }
-       }
-    }
-
-  /* Invoke the closure.  */
-  closure->fun (cif, rvalue, avalue, closure->user_data);
-
-  /* Tell assembly how to perform return type promotions.  */
-  return ret;
-}
-
-#endif /* __x86_64__ */
diff --git a/libffi/src/x86/darwin_c.c b/libffi/src/x86/darwin_c.c
deleted file mode 100644 (file)
index 6338de2..0000000
+++ /dev/null
@@ -1,843 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008  Red Hat, Inc.
-           Copyright (c) 2002  Ranjit Mathew
-           Copyright (c) 2002  Bo Thorsen
-           Copyright (c) 2002  Roger Sayle
-           Copyright (C) 2008, 2010  Free Software Foundation, Inc.
-
-   x86 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 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.
-   ----------------------------------------------------------------------- */
-
-#if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__)
-
-#ifdef _WIN64
-#include <windows.h>
-#endif
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#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)
-{
-  register unsigned int i;
-  register void **p_argv;
-  register char *argp;
-  register ffi_type **p_arg;
-#ifdef X86_WIN32
-  size_t p_stack_args[2];
-  void *p_stack_data[2];
-  char *argp2 = stack;
-  int stack_args_count = 0;
-  int cabi = ecif->cif->abi;
-#endif
-
-  argp = stack;
-
-  if ((ecif->cif->flags == FFI_TYPE_STRUCT
-       || ecif->cif->flags == FFI_TYPE_MS_STRUCT)
-#ifdef X86_WIN64
-      && (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2
-          && ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8)
-#endif
-      )
-    {
-      *(void **) argp = ecif->rvalue;
-#ifdef X86_WIN32
-      /* For fastcall/thiscall this is first register-passed
-         argument.  */
-      if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
-       {
-         p_stack_args[stack_args_count] = sizeof (void*);
-         p_stack_data[stack_args_count] = argp;
-         ++stack_args_count;
-       }
-#endif
-      argp += sizeof(void*);
-    }
-
-  p_argv = ecif->avalue;
-
-  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
-       i != 0;
-       i--, p_arg++)
-    {
-      size_t z;
-
-      /* Align if necessary */
-      if ((sizeof(void*) - 1) & (size_t) argp)
-        argp = (char *) ALIGN(argp, sizeof(void*));
-
-      z = (*p_arg)->size;
-#ifdef X86_WIN64
-      if (z > sizeof(ffi_arg)
-          || ((*p_arg)->type == FFI_TYPE_STRUCT
-              && (z != 1 && z != 2 && z != 4 && z != 8))
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
-          || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
-#endif
-          )
-        {
-          z = sizeof(ffi_arg);
-          *(void **)argp = *p_argv;
-        }
-      else if ((*p_arg)->type == FFI_TYPE_FLOAT)
-        {
-          memcpy(argp, *p_argv, z);
-        }
-      else
-#endif
-      if (z < sizeof(ffi_arg))
-        {
-          z = sizeof(ffi_arg);
-          switch ((*p_arg)->type)
-            {
-            case FFI_TYPE_SINT8:
-              *(ffi_sarg *) argp = (ffi_sarg)*(SINT8 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_UINT8:
-              *(ffi_arg *) argp = (ffi_arg)*(UINT8 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_SINT16:
-              *(ffi_sarg *) argp = (ffi_sarg)*(SINT16 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_UINT16:
-              *(ffi_arg *) argp = (ffi_arg)*(UINT16 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_SINT32:
-              *(ffi_sarg *) argp = (ffi_sarg)*(SINT32 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_UINT32:
-              *(ffi_arg *) argp = (ffi_arg)*(UINT32 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_STRUCT:
-              *(ffi_arg *) argp = *(ffi_arg *)(* p_argv);
-              break;
-
-            default:
-              FFI_ASSERT(0);
-            }
-        }
-      else
-        {
-          memcpy(argp, *p_argv, z);
-        }
-
-#ifdef X86_WIN32
-    /* For thiscall/fastcall convention register-passed arguments
-       are the first two none-floating-point arguments with a size
-       smaller or equal to sizeof (void*).  */
-    if ((cabi == FFI_THISCALL && stack_args_count < 1)
-        || (cabi == FFI_FASTCALL && stack_args_count < 2))
-      {
-       if (z <= 4
-           && ((*p_arg)->type != FFI_TYPE_FLOAT
-               && (*p_arg)->type != FFI_TYPE_STRUCT))
-         {
-           p_stack_args[stack_args_count] = z;
-           p_stack_data[stack_args_count] = argp;
-           ++stack_args_count;
-         }
-      }
-#endif
-      p_argv++;
-#ifdef X86_WIN64
-      argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
-#else
-      argp += z;
-#endif
-    }
-
-#ifdef X86_WIN32
-  /* 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.  */
-  if (stack_args_count > 0)
-    {
-      size_t zz = (p_stack_args[0] + 3) & ~3;
-      char *h;
-
-      /* Move first argument to top-stack position.  */
-      if (p_stack_data[0] != argp2)
-       {
-         h = alloca (zz + 1);
-         memcpy (h, p_stack_data[0], zz);
-         memmove (argp2 + zz, argp2,
-                  (size_t) ((char *) p_stack_data[0] - (char*)argp2));
-         memcpy (argp2, h, zz);
-       }
-
-      argp2 += zz;
-      --stack_args_count;
-      if (zz > 4)
-       stack_args_count = 0;
-
-      /* If we have a second argument, then move it on top
-         after the first one.  */
-      if (stack_args_count > 0 && p_stack_data[1] != argp2)
-       {
-         zz = p_stack_args[1];
-         zz = (zz + 3) & ~3;
-         h = alloca (zz + 1);
-         h = alloca (zz + 1);
-         memcpy (h, p_stack_data[1], zz);
-         memmove (argp2 + zz, argp2, (size_t) ((char*) p_stack_data[1] - (char*)argp2));
-         memcpy (argp2, h, zz);
-       }
-    }
-#endif
-  return;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
-  unsigned int i;
-  ffi_type **ptr;
-
-  /* Set the return type flag */
-  switch (cif->rtype->type)
-    {
-    case FFI_TYPE_VOID:
-    case FFI_TYPE_UINT8:
-    case FFI_TYPE_UINT16:
-    case FFI_TYPE_SINT8:
-    case FFI_TYPE_SINT16:
-#ifdef X86_WIN64
-    case FFI_TYPE_UINT32:
-    case FFI_TYPE_SINT32:
-#endif
-    case FFI_TYPE_SINT64:
-    case FFI_TYPE_FLOAT:
-    case FFI_TYPE_DOUBLE:
-#ifndef X86_WIN64
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
-    case FFI_TYPE_LONGDOUBLE:
-#endif
-#endif
-      cif->flags = (unsigned) cif->rtype->type;
-      break;
-
-    case FFI_TYPE_UINT64:
-#ifdef X86_WIN64
-    case FFI_TYPE_POINTER:
-#endif
-      cif->flags = FFI_TYPE_SINT64;
-      break;
-
-    case FFI_TYPE_STRUCT:
-#ifndef X86
-      if (cif->rtype->size == 1)
-        {
-          cif->flags = FFI_TYPE_SMALL_STRUCT_1B; /* same as char size */
-        }
-      else if (cif->rtype->size == 2)
-        {
-          cif->flags = FFI_TYPE_SMALL_STRUCT_2B; /* same as short size */
-        }
-      else if (cif->rtype->size == 4)
-        {
-#ifdef X86_WIN64
-          cif->flags = FFI_TYPE_SMALL_STRUCT_4B;
-#else
-          cif->flags = FFI_TYPE_INT; /* same as int type */
-#endif
-        }
-      else if (cif->rtype->size == 8)
-        {
-          cif->flags = FFI_TYPE_SINT64; /* same as int64 type */
-        }
-      else
-#endif
-        {
-#ifdef X86_WIN32
-          if (cif->abi == FFI_MS_CDECL)
-            cif->flags = FFI_TYPE_MS_STRUCT;
-          else
-#endif
-            cif->flags = FFI_TYPE_STRUCT;
-          /* allocate space for return value pointer */
-          cif->bytes += ALIGN(sizeof(void*), FFI_SIZEOF_ARG);
-        }
-      break;
-
-    default:
-#ifdef X86_WIN64
-      cif->flags = FFI_TYPE_SINT64;
-      break;
-    case FFI_TYPE_INT:
-      cif->flags = FFI_TYPE_SINT32;
-#else
-      cif->flags = FFI_TYPE_INT;
-#endif
-      break;
-    }
-
-  for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
-    {
-      if (((*ptr)->alignment - 1) & cif->bytes)
-        cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
-      cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
-    }
-
-#ifdef X86_WIN64
-  /* ensure space for storing four registers */
-  cif->bytes += 4 * sizeof(ffi_arg);
-#endif
-
-#ifdef X86_DARWIN
-  cif->bytes = (cif->bytes + 15) & ~0xF;
-#endif
-
-  return FFI_OK;
-}
-
-#ifdef X86_WIN64
-extern int
-ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
-               unsigned, unsigned, unsigned *, void (*fn)(void));
-#elif defined(X86_WIN32)
-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
-
-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                     */
-
-#ifdef X86_WIN64
-  if (rvalue == NULL
-      && cif->flags == FFI_TYPE_STRUCT
-      && cif->rtype->size != 1 && cif->rtype->size != 2
-      && cif->rtype->size != 4 && cif->rtype->size != 8)
-    {
-      ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
-    }
-#else
-  if (rvalue == NULL
-      && (cif->flags == FFI_TYPE_STRUCT
-          || cif->flags == FFI_TYPE_MS_STRUCT))
-    {
-      ecif.rvalue = alloca(cif->rtype->size);
-    }
-#endif
-  else
-    ecif.rvalue = rvalue;
-    
-  
-  switch (cif->abi) 
-    {
-#ifdef X86_WIN64
-    case FFI_WIN64:
-      ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
-                     cif->flags, ecif.rvalue, fn);
-      break;
-#elif defined(X86_WIN32)
-    case FFI_SYSV:
-    case FFI_STDCALL:
-    case FFI_MS_CDECL:
-      ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
-                    ecif.rvalue, fn);
-      break;
-    case FFI_THISCALL:
-    case FFI_FASTCALL:
-      {
-       unsigned int abi = cif->abi;
-       unsigned int i, passed_regs = 0;
-
-       if (cif->flags == FFI_TYPE_STRUCT)
-         ++passed_regs;
-
-       for (i=0; i < cif->nargs && passed_regs < 2;i++)
-         {
-           size_t sz;
-
-           if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
-               || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
-             continue;
-           sz = (cif->arg_types[i]->size + 3) & ~3;
-           if (sz == 0 || sz > 4)
-             continue;
-           ++passed_regs;
-         }
-       if (passed_regs < 2 && abi == FFI_FASTCALL)
-         abi = FFI_THISCALL;
-       if (passed_regs < 1 && abi == FFI_THISCALL)
-         abi = FFI_STDCALL;
-        ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags,
-                       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);
-      break;
-    }
-}
-
-
-/** private members **/
-
-/* The following __attribute__((regparm(1))) decorations will have no effect
-   on MSVC - standard cdecl convention applies. */
-static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
-                                         void** args, ffi_cif* cif);
-void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *)
-     __attribute__ ((regparm(1)));
-unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *)
-     __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *)
-     __attribute__ ((regparm(1)));
-#ifdef X86_WIN32
-void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *)
-     __attribute__ ((regparm(1)));
-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_win64 (ffi_closure *);
-#endif
-
-/* This function is jumped to by the trampoline */
-
-#ifdef X86_WIN64
-void * FFI_HIDDEN
-ffi_closure_win64_inner (ffi_closure *closure, void *args) {
-  ffi_cif       *cif;
-  void         **arg_area;
-  void          *result;
-  void          *resp = &result;
-
-  cif         = closure->cif;
-  arg_area    = (void**) alloca (cif->nargs * sizeof (void*));  
-
-  /* this call will initialize ARG_AREA, such that each
-   * element in that array points to the corresponding 
-   * value on the stack; and if the function returns
-   * a structure, it will change RESP to point to the
-   * structure return address.  */
-
-  ffi_prep_incoming_args_SYSV(args, &resp, arg_area, cif);
-  
-  (closure->fun) (cif, resp, arg_area, closure->user_data);
-
-  /* The result is returned in rax.  This does the right thing for
-     result types except for floats; we have to 'mov xmm0, rax' in the
-     caller to correct this.
-     TODO: structure sizes of 3 5 6 7 are returned by reference, too!!!
-  */
-  return cif->rtype->size > sizeof(void *) ? resp : *(void **)resp;
-}
-
-#else
-unsigned int FFI_HIDDEN __attribute__ ((regparm(1)))
-ffi_closure_SYSV_inner (ffi_closure *closure, void **respp, void *args)
-{
-  /* our various things...  */
-  ffi_cif       *cif;
-  void         **arg_area;
-
-  cif         = closure->cif;
-  arg_area    = (void**) alloca (cif->nargs * sizeof (void*));  
-
-  /* this call will initialize ARG_AREA, such that each
-   * element in that array points to the corresponding 
-   * value on the stack; and if the function returns
-   * a structure, it will change RESP to point to the
-   * structure return address.  */
-
-  ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
-
-  (closure->fun) (cif, *respp, arg_area, closure->user_data);
-
-  return cif->flags;
-}
-#endif /* !X86_WIN64 */
-
-static void
-ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
-                            ffi_cif *cif)
-{
-  register unsigned int i;
-  register void **p_argv;
-  register char *argp;
-  register ffi_type **p_arg;
-
-  argp = stack;
-
-#ifdef X86_WIN64
-  if (cif->rtype->size > sizeof(ffi_arg)
-      || (cif->flags == FFI_TYPE_STRUCT
-          && (cif->rtype->size != 1 && cif->rtype->size != 2
-              && cif->rtype->size != 4 && cif->rtype->size != 8))) {
-    *rvalue = *(void **) argp;
-    argp += sizeof(void *);
-  }
-#else
-  if ( cif->flags == FFI_TYPE_STRUCT
-       || cif->flags == FFI_TYPE_MS_STRUCT ) {
-    *rvalue = *(void **) argp;
-    argp += sizeof(void *);
-  }
-#endif
-
-  p_argv = avalue;
-
-  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
-    {
-      size_t z;
-
-      /* Align if necessary */
-      if ((sizeof(void*) - 1) & (size_t) argp) {
-        argp = (char *) ALIGN(argp, sizeof(void*));
-      }
-
-#ifdef X86_WIN64
-      if ((*p_arg)->size > sizeof(ffi_arg)
-          || ((*p_arg)->type == FFI_TYPE_STRUCT
-              && ((*p_arg)->size != 1 && (*p_arg)->size != 2
-                  && (*p_arg)->size != 4 && (*p_arg)->size != 8)))
-        {
-          z = sizeof(void *);
-          *p_argv = *(void **)argp;
-        }
-      else
-#endif
-        {
-          z = (*p_arg)->size;
-          
-          /* because we're little endian, this is what it turns into.   */
-          
-          *p_argv = (void*) argp;
-        }
-          
-      p_argv++;
-#ifdef X86_WIN64
-      argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
-#else
-      argp += z;
-#endif
-    }
-  
-  return;
-}
-
-#define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   void*  __fun = (void*)(FUN); \
-   void*  __ctx = (void*)(CTX); \
-   *(unsigned char*) &__tramp[0] = 0x41; \
-   *(unsigned char*) &__tramp[1] = 0xbb; \
-   *(unsigned int*) &__tramp[2] = MASK; /* mov $mask, %r11 */ \
-   *(unsigned char*) &__tramp[6] = 0x48; \
-   *(unsigned char*) &__tramp[7] = 0xb8; \
-   *(void**) &__tramp[8] = __ctx; /* mov __ctx, %rax */ \
-   *(unsigned char *)  &__tramp[16] = 0x49; \
-   *(unsigned char *)  &__tramp[17] = 0xba; \
-   *(void**) &__tramp[18] = __fun; /* mov __fun, %r10 */ \
-   *(unsigned char *)  &__tramp[26] = 0x41; \
-   *(unsigned char *)  &__tramp[27] = 0xff; \
-   *(unsigned char *)  &__tramp[28] = 0xe2; /* jmp %r10 */ \
- }
-
-/* How to make a trampoline.  Derived from gcc/config/i386/i386.c. */
-
-#define FFI_INIT_TRAMPOLINE(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 char*) &__tramp[0] = 0xb8; \
-   *(unsigned int*)  &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
-   *(unsigned char *)  &__tramp[5] = 0xe9; \
-   *(unsigned int*)  &__tramp[6] = __dis; /* jmp __fun  */ \
- }
-
-#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   unsigned int  __fun = (unsigned int)(FUN); \
-   unsigned int  __ctx = (unsigned int)(CTX); \
-   unsigned int  __dis = __fun - (__ctx + 49);  \
-   unsigned short __size = (unsigned short)(SIZE); \
-   *(unsigned int *) &__tramp[0] = 0x8324048b; /* mov (%esp), %eax */ \
-   *(unsigned int *) &__tramp[4] = 0x4c890cec; /* sub $12, %esp */ \
-   *(unsigned int *) &__tramp[8] = 0x04890424; /* mov %ecx, 4(%esp) */ \
-   *(unsigned char*) &__tramp[12] = 0x24;      /* mov %eax, (%esp) */ \
-   *(unsigned char*) &__tramp[13] = 0xb8; \
-   *(unsigned int *) &__tramp[14] = __size;    /* mov __size, %eax */ \
-   *(unsigned int *) &__tramp[18] = 0x08244c8d;        /* lea 8(%esp), %ecx */ \
-   *(unsigned int *) &__tramp[22] = 0x4802e8c1; /* shr $2, %eax ; dec %eax */ \
-   *(unsigned short*) &__tramp[26] = 0x0b74;   /* jz 1f */ \
-   *(unsigned int *) &__tramp[28] = 0x8908518b;        /* 2b: mov 8(%ecx), %edx */ \
-   *(unsigned int *) &__tramp[32] = 0x04c18311; /* mov %edx, (%ecx) ; add $4, %ecx */ \
-   *(unsigned char*) &__tramp[36] = 0x48;      /* dec %eax */ \
-   *(unsigned short*) &__tramp[37] = 0xf575;   /* jnz 2b ; 1f: */ \
-   *(unsigned char*) &__tramp[39] = 0xb8; \
-   *(unsigned int*)  &__tramp[40] = __ctx; /* movl __ctx, %eax */ \
-   *(unsigned char *)  &__tramp[44] = 0xe8; \
-   *(unsigned int*)  &__tramp[45] = __dis; /* call __fun  */ \
-   *(unsigned char*)  &__tramp[49] = 0xc2; /* ret  */ \
-   *(unsigned short*)  &__tramp[50] = (__size + 8); /* ret (__size + 8)  */ \
- }
-
-#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE)  \
-{ 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 */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
-                      ffi_cif* cif,
-                      void (*fun)(ffi_cif*,void*,void**,void*),
-                      void *user_data,
-                      void *codeloc)
-{
-#ifdef X86_WIN64
-#define ISFLOAT(IDX) (cif->arg_types[IDX]->type == FFI_TYPE_FLOAT || cif->arg_types[IDX]->type == FFI_TYPE_DOUBLE)
-#define FLAG(IDX) (cif->nargs>(IDX)&&ISFLOAT(IDX)?(1<<(IDX)):0)
-  if (cif->abi == FFI_WIN64) 
-    {
-      int mask = FLAG(0)|FLAG(1)|FLAG(2)|FLAG(3);
-      FFI_INIT_TRAMPOLINE_WIN64 (&closure->tramp[0],
-                                 &ffi_closure_win64,
-                                 codeloc, mask);
-      /* make sure we can execute here */
-    }
-#else
-  if (cif->abi == FFI_SYSV)
-    {
-      FFI_INIT_TRAMPOLINE (&closure->tramp[0],
-                           &ffi_closure_SYSV,
-                           (void*)codeloc);
-    }
-#ifdef X86_WIN32
-  else if (cif->abi == FFI_THISCALL)
-    {
-      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0],
-                                   &ffi_closure_THISCALL,
-                                   (void*)codeloc,
-                                   cif->bytes);
-    }
-  else if (cif->abi == FFI_STDCALL)
-    {
-      FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
-                                   &ffi_closure_STDCALL,
-                                   (void*)codeloc, cif->bytes);
-    }
-  else if (cif->abi == FFI_MS_CDECL)
-    {
-      FFI_INIT_TRAMPOLINE (&closure->tramp[0],
-                           &ffi_closure_SYSV,
-                           (void*)codeloc);
-    }
-#endif /* X86_WIN32 */
-#endif /* !X86_WIN64 */
-  else
-    {
-      return FFI_BAD_ABI;
-    }
-    
-  closure->cif  = cif;
-  closure->user_data = user_data;
-  closure->fun  = fun;
-
-  return FFI_OK;
-}
-
-/* ------- Native raw API support -------------------------------- */
-
-#if !FFI_NO_RAW_API
-
-ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
-                          ffi_cif* cif,
-                          void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-                          void *user_data,
-                          void *codeloc)
-{
-  int i;
-
-  if (cif->abi != FFI_SYSV) {
-#ifdef X86_WIN32
-    if (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
-     language routine, since it would require argument processing,
-     something we don't do now for performance.  */
-
-  for (i = cif->nargs-1; i >= 0; i--)
-    {
-      FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT);
-      FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE);
-    }
-  
-#ifdef X86_WIN32
-  if (cif->abi == FFI_SYSV)
-    {
-#endif
-  FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV,
-                       codeloc);
-#ifdef X86_WIN32
-    }
-  else if (cif->abi == FFI_THISCALL)
-    {
-      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL,
-                                   codeloc, cif->bytes);
-    }
-#endif
-  closure->cif  = cif;
-  closure->user_data = user_data;
-  closure->fun  = fun;
-
-  return FFI_OK;
-}
-
-static void 
-ffi_prep_args_raw(char *stack, extended_cif *ecif)
-{
-  memcpy (stack, ecif->avalue, ecif->cif->bytes);
-}
-
-/* we borrow this routine from libffi (it must be changed, though, to
- * actually call the function passed in the first argument.  as of
- * libffi-1.20, this is not the case.)
- */
-
-void
-ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
-{
-  extended_cif ecif;
-  void **avalue = (void **)fake_avalue;
-
-  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->flags == FFI_TYPE_STRUCT
-          || cif->flags == FFI_TYPE_MS_STRUCT))
-    {
-      ecif.rvalue = alloca(cif->rtype->size);
-    }
-  else
-    ecif.rvalue = rvalue;
-    
-  
-  switch (cif->abi) 
-    {
-#ifdef X86_WIN32
-    case FFI_SYSV:
-    case FFI_STDCALL:
-    case FFI_MS_CDECL:
-      ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
-                    ecif.rvalue, fn);
-      break;
-    case FFI_THISCALL:
-    case FFI_FASTCALL:
-      {
-       unsigned int abi = cif->abi;
-       unsigned int i, passed_regs = 0;
-
-       if (cif->flags == FFI_TYPE_STRUCT)
-         ++passed_regs;
-
-       for (i=0; i < cif->nargs && passed_regs < 2;i++)
-         {
-           size_t sz;
-
-           if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
-               || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
-             continue;
-           sz = (cif->arg_types[i]->size + 3) & ~3;
-           if (sz == 0 || sz > 4)
-             continue;
-           ++passed_regs;
-         }
-       if (passed_regs < 2 && abi == FFI_FASTCALL)
-         cif->abi = abi = FFI_THISCALL;
-       if (passed_regs < 1 && abi == FFI_THISCALL)
-         cif->abi = abi = FFI_STDCALL;
-        ffi_call_win32(ffi_prep_args_raw, &ecif, abi, cif->bytes, cif->flags,
-                       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);
-      break;
-    }
-}
-
-#endif
-
-#endif /* !__x86_64__  || X86_WIN64 */
-
index feb5cbbb4ac1371c7eb68668eea6a2238a6ad40d..24431c170ba539c7af5d7eff03a92614ca87286e 100644 (file)
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008  Red Hat, Inc.
+   ffi.c - Copyright (c) 2017  Anthony Green
+           Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008  Red Hat, Inc.
            Copyright (c) 2002  Ranjit Mathew
            Copyright (c) 2002  Bo Thorsen
            Copyright (c) 2002  Roger Sayle
    DEALINGS IN THE SOFTWARE.
    ----------------------------------------------------------------------- */
 
-#ifndef __x86_64__
+#if defined(__i386__) || defined(_M_IX86)
 #include <ffi.h>
 #include <ffi_common.h>
+#include <stdint.h>
 #include <stdlib.h>
+#include <tramp.h>
 #include "internal.h"
 
 /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
 # define __declspec(x)  __attribute__((x))
 #endif
 
+#if defined(_MSC_VER) && defined(_M_IX86)
+/* Stack is not 16-byte aligned on Windows.  */
+#define STACK_ALIGN(bytes) (bytes)
+#else
+#define STACK_ALIGN(bytes) FFI_ALIGN (bytes, 16)
+#endif
+
 /* Perform machine dependent cif processing.  */
 ffi_status FFI_HIDDEN
 ffi_prep_cif_machdep(ffi_cif *cif)
@@ -134,7 +144,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
              break;
            }
          /* Allocate space for return value pointer.  */
-         bytes += ALIGN (sizeof(void*), FFI_SIZEOF_ARG);
+         bytes += FFI_ALIGN (sizeof(void*), FFI_SIZEOF_ARG);
        }
       break;
     case FFI_TYPE_COMPLEX:
@@ -172,10 +182,10 @@ ffi_prep_cif_machdep(ffi_cif *cif)
     {
       ffi_type *t = cif->arg_types[i];
 
-      bytes = ALIGN (bytes, t->alignment);
-      bytes += ALIGN (t->size, FFI_SIZEOF_ARG);
+      bytes = FFI_ALIGN (bytes, t->alignment);
+      bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG);
     }
-  cif->bytes = ALIGN (bytes, 16);
+  cif->bytes = bytes;
 
   return FFI_OK;
 }
@@ -234,12 +244,25 @@ static const struct abi_params abi_params[FFI_LAST_ABI] = {
   [FFI_MS_CDECL] = { 1, R_ECX, 0 }
 };
 
-extern void ffi_call_i386(struct call_frame *, char *)
-#if HAVE_FASTCALL
-       __declspec(fastcall)
+#ifdef HAVE_FASTCALL
+  #ifdef _MSC_VER
+    #define FFI_DECLARE_FASTCALL __fastcall
+  #else
+    #define FFI_DECLARE_FASTCALL __declspec(fastcall)
+  #endif
+#else
+  #define FFI_DECLARE_FASTCALL
 #endif
-       FFI_HIDDEN;
 
+extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN;
+
+/* We perform some black magic here to use some of the parent's stack frame in
+ * ffi_call_i386() that breaks with the MSVC compiler with the /RTCs or /GZ
+ * flags.  Disable the 'Stack frame run time error checking' for this function
+ * so we don't hit weird exceptions in debug builds. */
+#if defined(_MSC_VER)
+#pragma runtime_checks("s", off)
+#endif
 static void
 ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
              void **avalue, void *closure)
@@ -277,7 +300,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
        }
     }
 
-  bytes = cif->bytes;
+  bytes = STACK_ALIGN (cif->bytes);
   stack = alloca(bytes + sizeof(*frame) + rsize);
   argp = (dir < 0 ? stack + bytes : stack);
   frame = (struct call_frame *)(stack + bytes);
@@ -334,9 +357,18 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
        }
       else
        {
-         size_t za = ALIGN (z, FFI_SIZEOF_ARG);
+         size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG);
          size_t align = FFI_SIZEOF_ARG;
 
+         /* Issue 434: For thiscall and fastcall, if the paramter passed
+            as 64-bit integer or struct, all following integer parameters
+            will be passed on stack.  */
+         if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
+             && (t == FFI_TYPE_SINT64
+                 || t == FFI_TYPE_UINT64
+                 || t == FFI_TYPE_STRUCT))
+           narg_reg = 2;
+
          /* Alignment rules for arguments are quite complex.  Vectors and
             structures with 16 byte alignment get it.  Note that long double
             on Darwin does have 16 byte alignment, and does not get this
@@ -356,7 +388,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
            }
          else
            {
-             argp = (char *)ALIGN (argp, align);
+             argp = (char *)FFI_ALIGN (argp, align);
              memcpy (argp, valp, z);
              argp += za;
            }
@@ -366,6 +398,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
 
   ffi_call_i386 (frame, stack);
 }
+#if defined(_MSC_VER)
+#pragma runtime_checks("s", restore)
+#endif
 
 void
 ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
@@ -373,18 +408,25 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
   ffi_call_int (cif, fn, rvalue, avalue, NULL);
 }
 
+#ifdef FFI_GO_CLOSURES
 void
 ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
             void **avalue, void *closure)
 {
   ffi_call_int (cif, fn, rvalue, avalue, closure);
 }
+#endif
 
 /** private members **/
 
 void FFI_HIDDEN ffi_closure_i386(void);
 void FFI_HIDDEN ffi_closure_STDCALL(void);
 void FFI_HIDDEN ffi_closure_REGISTER(void);
+#if defined(FFI_EXEC_STATIC_TRAMP)
+void FFI_HIDDEN ffi_closure_i386_alt(void);
+void FFI_HIDDEN ffi_closure_STDCALL_alt(void);
+void FFI_HIDDEN ffi_closure_REGISTER_alt(void);
+#endif
 
 struct closure_frame
 {
@@ -395,10 +437,7 @@ struct closure_frame
   void *user_data;                             /* 36 */
 };
 
-int FFI_HIDDEN
-#if HAVE_FASTCALL
-__declspec(fastcall)
-#endif
+int FFI_HIDDEN FFI_DECLARE_FASTCALL
 ffi_closure_inner (struct closure_frame *frame, char *stack)
 {
   ffi_cif *cif = frame->cif;
@@ -415,7 +454,7 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
   rvalue = frame->rettemp;
   pabi = &abi_params[cabi];
   dir = pabi->dir;
-  argp = (dir < 0 ? stack + cif->bytes : stack);
+  argp = (dir < 0 ? stack + STACK_ALIGN (cif->bytes) : stack);
 
   switch (flags)
     {
@@ -463,13 +502,22 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
        }
       else
        {
-         size_t za = ALIGN (z, FFI_SIZEOF_ARG);
+         size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG);
          size_t align = FFI_SIZEOF_ARG;
 
          /* See the comment in ffi_call_int.  */
          if (t == FFI_TYPE_STRUCT && ty->alignment >= 16)
            align = 16;
 
+         /* Issue 434: For thiscall and fastcall, if the paramter passed
+            as 64-bit integer or struct, all following integer parameters
+            will be passed on stack.  */
+         if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
+             && (t == FFI_TYPE_SINT64
+                 || t == FFI_TYPE_UINT64
+                 || t == FFI_TYPE_STRUCT))
+           narg_reg = 2;
+
          if (dir < 0)
            {
              /* ??? These reverse argument ABIs are probably too old
@@ -479,7 +527,7 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
            }
          else
            {
-             argp = (char *)ALIGN (argp, align);
+             argp = (char *)FFI_ALIGN (argp, align);
              valp = argp;
              argp += za;
            }
@@ -490,10 +538,17 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
 
   frame->fun (cif, rvalue, avalue, frame->user_data);
 
-  if (cabi == FFI_STDCALL)
-    return flags + (cif->bytes << X86_RET_POP_SHIFT);
-  else
-    return flags;
+  switch (cabi)
+    {
+    case FFI_STDCALL:
+      return flags | (cif->bytes << X86_RET_POP_SHIFT);
+    case FFI_THISCALL:
+    case FFI_FASTCALL:
+      return flags | ((cif->bytes - (narg_reg * FFI_SIZEOF_ARG))
+          << X86_RET_POP_SHIFT);
+    default:
+      return flags;
+    }
 }
 
 ffi_status
@@ -510,30 +565,51 @@ ffi_prep_closure_loc (ffi_closure* closure,
   switch (cif->abi)
     {
     case FFI_SYSV:
-    case FFI_THISCALL:
-    case FFI_FASTCALL:
     case FFI_MS_CDECL:
       dest = ffi_closure_i386;
       break;
     case FFI_STDCALL:
+    case FFI_THISCALL:
+    case FFI_FASTCALL:
     case FFI_PASCAL:
       dest = ffi_closure_STDCALL;
       break;
     case FFI_REGISTER:
       dest = ffi_closure_REGISTER;
       op = 0x68;  /* pushl imm */
+      break;
     default:
       return FFI_BAD_ABI;
     }
 
+#if defined(FFI_EXEC_STATIC_TRAMP)
+  if (ffi_tramp_is_present(closure))
+    {
+      /* Initialize the static trampoline's parameters. */
+      if (dest == ffi_closure_i386)
+        dest = ffi_closure_i386_alt;
+      else if (dest == ffi_closure_STDCALL)
+        dest = ffi_closure_STDCALL_alt;
+      else
+        dest = ffi_closure_REGISTER_alt;
+      ffi_tramp_set_parms (closure->ftramp, dest, closure);
+      goto out;
+    }
+#endif
+
+  /* Initialize the dynamic trampoline. */
+  /* endbr32.  */
+  *(UINT32 *) tramp = 0xfb1e0ff3;
+
   /* movl or pushl immediate.  */
-  tramp[0] = op;
-  *(void **)(tramp + 1) = codeloc;
+  tramp[4] = op;
+  *(void **)(tramp + 5) = codeloc;
 
   /* jmp dest */
-  tramp[5] = 0xe9;
-  *(unsigned *)(tramp + 6) = (unsigned)dest - ((unsigned)codeloc + 10);
+  tramp[9] = 0xe9;
+  *(unsigned *)(tramp + 10) = (unsigned)dest - ((unsigned)codeloc + 14);
 
+out:
   closure->cif = cif;
   closure->fun = fun;
   closure->user_data = user_data;
@@ -541,6 +617,8 @@ ffi_prep_closure_loc (ffi_closure* closure,
   return FFI_OK;
 }
 
+#ifdef FFI_GO_CLOSURES
+
 void FFI_HIDDEN ffi_go_closure_EAX(void);
 void FFI_HIDDEN ffi_go_closure_ECX(void);
 void FFI_HIDDEN ffi_go_closure_STDCALL(void);
@@ -577,6 +655,8 @@ ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
   return FFI_OK;
 }
 
+#endif /* FFI_GO_CLOSURES */
+
 /* ------- Native raw API support -------------------------------- */
 
 #if !FFI_NO_RAW_API
@@ -669,8 +749,9 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue)
        }
     }
 
-  bytes = cif->bytes;
-  argp = stack = alloca(bytes + sizeof(*frame) + rsize);
+  bytes = STACK_ALIGN (cif->bytes);
+  argp = stack =
+      (void *)((uintptr_t)alloca(bytes + sizeof(*frame) + rsize + 15) & ~16);
   frame = (struct call_frame *)(stack + bytes);
   if (rsize)
     rvalue = frame + 1;
@@ -714,7 +795,7 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue)
       else
        {
          memcpy (argp, avalue, z);
-         z = ALIGN (z, FFI_SIZEOF_ARG);
+         z = FFI_ALIGN (z, FFI_SIZEOF_ARG);
          argp += z;
        }
       avalue += z;
@@ -726,4 +807,17 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue)
   ffi_call_i386 (frame, stack);
 }
 #endif /* !FFI_NO_RAW_API */
-#endif /* !__x86_64__ */
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+void *
+ffi_tramp_arch (size_t *tramp_size, size_t *map_size)
+{
+  extern void *trampoline_code_table;
+
+  *map_size = X86_TRAMP_MAP_SIZE;
+  *tramp_size = X86_TRAMP_SIZE;
+  return &trampoline_code_table;
+}
+#endif
+
+#endif /* __i386__ */
index 243cbc7689a21a183f837522f2745788c940a6f3..438b374e2fbbf89bc97deefe7a2085f2a06c6661 100644 (file)
@@ -1,6 +1,6 @@
 /* -----------------------------------------------------------------------
-   ffi64.c - Copyright (c) 2013  The Written Word, Inc.
-             Copyright (c) 2011  Anthony Green
+   ffi64.c - Copyright (c) 2011, 2018  Anthony Green
+             Copyright (c) 2013  The Written Word, Inc.
              Copyright (c) 2008, 2010  Red Hat, Inc.
              Copyright (c) 2002, 2007  Bo Thorsen <bo@suse.de>
 
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdint.h>
+#include <tramp.h>
 #include "internal64.h"
 
 #ifdef __x86_64__
@@ -217,10 +218,10 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
     case FFI_TYPE_STRUCT:
       {
        const size_t UNITS_PER_WORD = 8;
-       size_t words = (type->size + byte_offset + UNITS_PER_WORD - 1)
-                      / UNITS_PER_WORD;
+        size_t words = (type->size + byte_offset + UNITS_PER_WORD - 1)
+                       / UNITS_PER_WORD;
        ffi_type **ptr;
-       int i;
+       unsigned int i;
        enum x86_64_reg_class subclasses[MAX_CLASSES];
 
        /* If the struct is larger than 32 bytes, pass it on the stack.  */
@@ -244,14 +245,15 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
          {
            size_t num, pos;
 
-           byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
+           byte_offset = FFI_ALIGN (byte_offset, (*ptr)->alignment);
 
            num = classify_argument (*ptr, subclasses, byte_offset % 8);
            if (num == 0)
              return 0;
-           pos = byte_offset / 8;
-           for (i = 0; i < num && (i + pos) < words; i++)
+            pos = byte_offset / 8;
+            for (i = 0; i < num && (i + pos) < words; i++)
              {
+               size_t pos = byte_offset / 8;
                classes[i + pos] =
                  merge_classes (subclasses[i], classes[i + pos]);
              }
@@ -283,7 +285,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
 
            /* The X86_64_SSEUP_CLASS should be always preceded by
               X86_64_SSE_CLASS or X86_64_SSEUP_CLASS.  */
-           if (classes[i] == X86_64_SSEUP_CLASS
+           if (i > 1 && classes[i] == X86_64_SSEUP_CLASS
                && classes[i - 1] != X86_64_SSE_CLASS
                && classes[i - 1] != X86_64_SSEUP_CLASS)
              {
@@ -294,7 +296,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
 
            /*  If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS,
                everything should be passed in memory.  */
-           if (classes[i] == X86_64_X87UP_CLASS
+           if (i > 1 && classes[i] == X86_64_X87UP_CLASS
                && (classes[i - 1] != X86_64_X87_CLASS))
              {
                /* The first one should never be X86_64_X87UP_CLASS.  */
@@ -351,7 +353,8 @@ examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
                  _Bool in_return, int *pngpr, int *pnsse)
 {
   size_t n;
-  int i, ngpr, nsse;
+  unsigned int i;
+  int ngpr, nsse;
 
   n = classify_argument (type, classes, 0);
   if (n == 0)
@@ -389,14 +392,24 @@ examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
 
 /* Perform machine dependent cif processing.  */
 
-ffi_status
+#ifndef __ILP32__
+extern ffi_status
+ffi_prep_cif_machdep_efi64(ffi_cif *cif);
+#endif
+
+ffi_status FFI_HIDDEN
 ffi_prep_cif_machdep (ffi_cif *cif)
 {
-  int gprcount, ssecount, i, avn, ngpr, nsse, flags;
+  int gprcount, ssecount, i, avn, ngpr, nsse;
+  unsigned flags;
   enum x86_64_reg_class classes[MAX_CLASSES];
   size_t bytes, n, rtype_size;
   ffi_type *rtype;
 
+#ifndef __ILP32__
+  if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
+    return ffi_prep_cif_machdep_efi64(cif);
+#endif
   if (cif->abi != FFI_UNIX64)
     return FFI_BAD_ABI;
 
@@ -441,9 +454,11 @@ ffi_prep_cif_machdep (ffi_cif *cif)
     case FFI_TYPE_DOUBLE:
       flags = UNIX64_RET_XMM64;
       break;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
     case FFI_TYPE_LONGDOUBLE:
       flags = UNIX64_RET_X87;
       break;
+#endif
     case FFI_TYPE_STRUCT:
       n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
       if (n == 0)
@@ -489,7 +504,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
        case FFI_TYPE_SINT32:
        case FFI_TYPE_UINT64:
        case FFI_TYPE_SINT64:
-         flags = UNIX64_RET_ST_RAX_RDX | (rtype_size << UNIX64_SIZE_SHIFT);
+         flags = UNIX64_RET_ST_RAX_RDX | ((unsigned) rtype_size << UNIX64_SIZE_SHIFT);
          break;
        case FFI_TYPE_FLOAT:
          flags = UNIX64_RET_XMM64;
@@ -524,7 +539,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
          if (align < 8)
            align = 8;
 
-         bytes = ALIGN (bytes, align);
+         bytes = FFI_ALIGN (bytes, align);
          bytes += cif->arg_types[i]->size;
        }
       else
@@ -537,7 +552,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
     flags |= UNIX64_FLAG_XMM_ARGS;
 
   cif->flags = flags;
-  cif->bytes = ALIGN (bytes, 8);
+  cif->bytes = (unsigned) FFI_ALIGN (bytes, 8);
 
   return FFI_OK;
 }
@@ -599,7 +614,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
            align = 8;
 
          /* Pass this argument in memory.  */
-         argp = (void *) ALIGN (argp, align);
+         argp = (void *) FFI_ALIGN (argp, align);
          memcpy (argp, avalue[i], size);
          argp += size;
        }
@@ -607,7 +622,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
        {
          /* The argument is passed entirely in registers.  */
          char *a = (char *) avalue[i];
-         int j;
+         unsigned int j;
 
          for (j = 0; j < n; j++, a += 8, size -= 8)
            {
@@ -641,10 +656,10 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
                  break;
                case X86_64_SSE_CLASS:
                case X86_64_SSEDF_CLASS:
-                 reg_args->sse[ssecount++].i64 = *(UINT64 *) a;
+                 memcpy (&reg_args->sse[ssecount++].i64, a, sizeof(UINT64));
                  break;
                case X86_64_SSESF_CLASS:
-                 reg_args->sse[ssecount++].i32 = *(UINT32 *) a;
+                 memcpy (&reg_args->sse[ssecount++].i32, a, sizeof(UINT32));
                  break;
                default:
                  abort();
@@ -658,21 +673,63 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
                   flags, rvalue, fn);
 }
 
+#ifndef __ILP32__
+extern void
+ffi_call_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue);
+#endif
+
 void
 ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 {
+#ifndef __ILP32__
+  if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
+    {
+      ffi_call_efi64(cif, fn, rvalue, avalue);
+      return;
+    }
+#endif
   ffi_call_int (cif, fn, rvalue, avalue, NULL);
 }
 
+#ifdef FFI_GO_CLOSURES
+
+#ifndef __ILP32__
+extern void
+ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue,
+                 void **avalue, void *closure);
+#endif
+
 void
 ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
             void **avalue, void *closure)
 {
+#ifndef __ILP32__
+  if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
+    {
+      ffi_call_go_efi64(cif, fn, rvalue, avalue, closure);
+      return;
+    }
+#endif
   ffi_call_int (cif, fn, rvalue, avalue, closure);
 }
 
+#endif /* FFI_GO_CLOSURES */
+
 extern void ffi_closure_unix64(void) FFI_HIDDEN;
 extern void ffi_closure_unix64_sse(void) FFI_HIDDEN;
+#if defined(FFI_EXEC_STATIC_TRAMP)
+extern void ffi_closure_unix64_alt(void) FFI_HIDDEN;
+extern void ffi_closure_unix64_sse_alt(void) FFI_HIDDEN;
+#endif
+
+#ifndef __ILP32__
+extern ffi_status
+ffi_prep_closure_loc_efi64(ffi_closure* closure,
+                          ffi_cif* cif,
+                          void (*fun)(ffi_cif*, void*, void**, void*),
+                          void *user_data,
+                          void *codeloc);
+#endif
 
 ffi_status
 ffi_prep_closure_loc (ffi_closure* closure,
@@ -681,17 +738,23 @@ ffi_prep_closure_loc (ffi_closure* closure,
                      void *user_data,
                      void *codeloc)
 {
-  static const unsigned char trampoline[16] = {
-    /* leaq  -0x7(%rip),%r10   # 0x0  */
-    0x4c, 0x8d, 0x15, 0xf9, 0xff, 0xff, 0xff,
-    /* jmpq  *0x3(%rip)        # 0x10 */
-    0xff, 0x25, 0x03, 0x00, 0x00, 0x00,
-    /* nopl  (%rax) */
-    0x0f, 0x1f, 0x00
+  static const unsigned char trampoline[24] = {
+    /* endbr64 */
+    0xf3, 0x0f, 0x1e, 0xfa,
+    /* leaq  -0xb(%rip),%r10   # 0x0  */
+    0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff,
+    /* jmpq  *0x7(%rip)        # 0x18 */
+    0xff, 0x25, 0x07, 0x00, 0x00, 0x00,
+    /* nopl  0(%rax) */
+    0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00
   };
   void (*dest)(void);
   char *tramp = closure->tramp;
 
+#ifndef __ILP32__
+  if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
+    return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc);
+#endif
   if (cif->abi != FFI_UNIX64)
     return FFI_BAD_ABI;
 
@@ -700,9 +763,24 @@ ffi_prep_closure_loc (ffi_closure* closure,
   else
     dest = ffi_closure_unix64;
 
+#if defined(FFI_EXEC_STATIC_TRAMP)
+  if (ffi_tramp_is_present(closure))
+    {
+      /* Initialize the static trampoline's parameters. */
+      if (dest == ffi_closure_unix64_sse)
+        dest = ffi_closure_unix64_sse_alt;
+      else
+        dest = ffi_closure_unix64_alt;
+      ffi_tramp_set_parms (closure->ftramp, dest, closure);
+      goto out;
+    }
+#endif
+
+  /* Initialize the dynamic trampoline. */
   memcpy (tramp, trampoline, sizeof(trampoline));
-  *(UINT64 *)(tramp + 16) = (uintptr_t)dest;
+  *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)dest;
 
+out:
   closure->cif = cif;
   closure->fun = fun;
   closure->user_data = user_data;
@@ -757,7 +835,7 @@ ffi_closure_unix64_inner(ffi_cif *cif,
            align = 8;
 
          /* Pass this argument in memory.  */
-         argp = (void *) ALIGN (argp, align);
+         argp = (void *) FFI_ALIGN (argp, align);
          avalue[i] = argp;
          argp += arg_types[i]->size;
        }
@@ -783,7 +861,7 @@ ffi_closure_unix64_inner(ffi_cif *cif,
       else
        {
          char *a = alloca (16);
-         int j;
+         unsigned int j;
 
          avalue[i] = a;
          for (j = 0; j < n; j++, a += 8)
@@ -803,13 +881,25 @@ ffi_closure_unix64_inner(ffi_cif *cif,
   return flags;
 }
 
+#ifdef FFI_GO_CLOSURES
+
 extern void ffi_go_closure_unix64(void) FFI_HIDDEN;
 extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN;
 
+#ifndef __ILP32__
+extern ffi_status
+ffi_prep_go_closure_efi64(ffi_go_closure* closure, ffi_cif* cif,
+                         void (*fun)(ffi_cif*, void*, void**, void*));
+#endif
+
 ffi_status
 ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
                     void (*fun)(ffi_cif*, void*, void**, void*))
 {
+#ifndef __ILP32__
+  if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
+    return ffi_prep_go_closure_efi64(closure, cif, fun);
+#endif
   if (cif->abi != FFI_UNIX64)
     return FFI_BAD_ABI;
 
@@ -822,4 +912,18 @@ ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
   return FFI_OK;
 }
 
+#endif /* FFI_GO_CLOSURES */
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+void *
+ffi_tramp_arch (size_t *tramp_size, size_t *map_size)
+{
+  extern void *trampoline_code_table;
+
+  *map_size = UNIX64_TRAMP_MAP_SIZE;
+  *tramp_size = UNIX64_TRAMP_SIZE;
+  return &trampoline_code_table;
+}
+#endif
+
 #endif /* __x86_64__ */
index a576961695202a02c9383a211a6d863aeea5ec4c..f454341a22d1ddab735aa07afcd82bf422195d4e 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------*-C-*-
-   ffitarget.h - Copyright (c) 2012, 2014  Anthony Green
+   ffitarget.h - Copyright (c) 2012, 2014, 2018  Anthony Green
                  Copyright (c) 1996-2003, 2010  Red Hat, Inc.
                  Copyright (C) 2008  Free Software Foundation, Inc.
 
@@ -50,8 +50,7 @@
 #endif
 
 #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
-
-#if !defined(_MSC_VER) && !defined(X86_DARWIN) && !defined(X86_64_DARWIN)
+#ifndef _MSC_VER
 #define FFI_TARGET_HAS_COMPLEX_TYPE
 #endif
 
@@ -81,13 +80,21 @@ typedef signed long            ffi_sarg;
 typedef enum ffi_abi {
 #if defined(X86_WIN64)
   FFI_FIRST_ABI = 0,
-  FFI_WIN64,
+  FFI_WIN64,            /* sizeof(long double) == 8  - microsoft compilers */
+  FFI_GNUW64,           /* sizeof(long double) == 16 - GNU compilers */
   FFI_LAST_ABI,
+#ifdef __GNUC__
+  FFI_DEFAULT_ABI = FFI_GNUW64
+#else  
   FFI_DEFAULT_ABI = FFI_WIN64
+#endif  
 
-#elif defined(X86_64) || defined(X86_64_DARWIN)
+#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
   FFI_FIRST_ABI = 1,
   FFI_UNIX64,
+  FFI_WIN64,
+  FFI_EFI64 = FFI_WIN64,
+  FFI_GNUW64,
   FFI_LAST_ABI,
   FFI_DEFAULT_ABI = FFI_UNIX64
 
@@ -120,23 +127,36 @@ typedef enum ffi_abi {
 /* ---- Definitions for closures ----------------------------------------- */
 
 #define FFI_CLOSURES 1
-
-#if !defined(X86_DARWIN) && !defined(X86_64_DARWIN)
 #define FFI_GO_CLOSURES 1
-#endif
 
 #define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
 #define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
 #define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
 #define FFI_TYPE_MS_STRUCT       (FFI_TYPE_LAST + 4)
 
-#if defined (X86_64) || defined(X86_WIN64) || defined(X86_64_DARWIN)
-# define FFI_TRAMPOLINE_SIZE 24
+#if defined (X86_64) || defined(X86_WIN64) \
+    || (defined (__x86_64__) && defined (X86_DARWIN))
+/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP
+   + 8 bytes of pointer.  */
+# define FFI_TRAMPOLINE_SIZE 32
 # define FFI_NATIVE_RAW_API 0
 #else
-# define FFI_TRAMPOLINE_SIZE 12
+/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused
+   bytes.  */
+# define FFI_TRAMPOLINE_SIZE 16
 # define FFI_NATIVE_RAW_API 1  /* x86 has native raw api support */
 #endif
 
+#if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__)
+# include <cet.h>
+# if (__CET__ & 1) != 0
+#   define ENDBR_PRESENT
+# endif
+# define _CET_NOTRACK notrack
+#else
+# define _CET_ENDBR
+# define _CET_NOTRACK
+#endif
+
 #endif
 
index 8a33a6c478568f99b6f109c2e21ba5424678982a..6870d07c92b787c26544ff5e69c8bd4febe3e71c 100644 (file)
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   ffiw64.c - Copyright (c) 2014 Red Hat, Inc.
+   ffiw64.c - Copyright (c) 2018 Anthony Green
+              Copyright (c) 2014 Red Hat, Inc.
 
    x86 win64 Foreign Function Interface
 
    DEALINGS IN THE SOFTWARE.
    ----------------------------------------------------------------------- */
 
+#if defined(__x86_64__) || defined(_M_AMD64)
 #include <ffi.h>
 #include <ffi_common.h>
 #include <stdlib.h>
 #include <stdint.h>
+#include <tramp.h>
 
 #ifdef X86_WIN64
+#define EFI64(name) name
+#else
+#define EFI64(name) FFI_HIDDEN name##_efi64
+#endif
 
 struct win64_call_frame
 {
@@ -43,13 +50,19 @@ struct win64_call_frame
 extern void ffi_call_win64 (void *stack, struct win64_call_frame *,
                            void *closure) FFI_HIDDEN;
 
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
+ffi_status FFI_HIDDEN
+EFI64(ffi_prep_cif_machdep)(ffi_cif *cif)
 {
   int flags, n;
 
-  if (cif->abi != FFI_WIN64)
-    return FFI_BAD_ABI;
+  switch (cif->abi)
+    {
+    case FFI_WIN64:
+    case FFI_GNUW64:
+      break;
+    default:
+      return FFI_BAD_ABI;
+    }
 
   flags = cif->rtype->type;
   switch (flags)
@@ -57,7 +70,9 @@ ffi_prep_cif_machdep (ffi_cif *cif)
     default:
       break;
     case FFI_TYPE_LONGDOUBLE:
-      flags = FFI_TYPE_STRUCT;
+      /* GCC returns long double values by reference, like a struct */
+      if (cif->abi == FFI_GNUW64)
+       flags = FFI_TYPE_STRUCT;
       break;
     case FFI_TYPE_COMPLEX:
       flags = FFI_TYPE_STRUCT;
@@ -93,6 +108,13 @@ ffi_prep_cif_machdep (ffi_cif *cif)
   return FFI_OK;
 }
 
+/* We perform some black magic here to use some of the parent's stack frame in
+ * ffi_call_win64() that breaks with the MSVC compiler with the /RTCs or /GZ
+ * flags.  Disable the 'Stack frame run time error checking' for this function
+ * so we don't hit weird exceptions in debug builds. */
+#if defined(_MSC_VER)
+#pragma runtime_checks("s", off)
+#endif
 static void
 ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
              void **avalue, void *closure)
@@ -102,7 +124,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
   size_t rsize;
   struct win64_call_frame *frame;
 
-  FFI_ASSERT(cif->abi == FFI_WIN64);
+  FFI_ASSERT(cif->abi == FFI_GNUW64 || cif->abi == FFI_WIN64);
 
   flags = cif->flags;
   rsize = 0;
@@ -157,15 +179,18 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
 
   ffi_call_win64 (stack, frame, closure);
 }
+#if defined(_MSC_VER)
+#pragma runtime_checks("s", restore)
+#endif
 
 void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 {
   ffi_call_int (cif, fn, rvalue, avalue, NULL);
 }
 
 void
-ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
+EFI64(ffi_call_go)(ffi_cif *cif, void (*fn)(void), void *rvalue,
             void **avalue, void *closure)
 {
   ffi_call_int (cif, fn, rvalue, avalue, closure);
@@ -173,31 +198,56 @@ ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
 
 
 extern void ffi_closure_win64(void) FFI_HIDDEN;
+#if defined(FFI_EXEC_STATIC_TRAMP)
+extern void ffi_closure_win64_alt(void) FFI_HIDDEN;
+#endif
+
+#ifdef FFI_GO_CLOSURES
 extern void ffi_go_closure_win64(void) FFI_HIDDEN;
+#endif
 
 ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
+EFI64(ffi_prep_closure_loc)(ffi_closure* closure,
                      ffi_cif* cif,
                      void (*fun)(ffi_cif*, void*, void**, void*),
                      void *user_data,
                      void *codeloc)
 {
-  static const unsigned char trampoline[16] = {
-    /* leaq  -0x7(%rip),%r10   # 0x0  */
-    0x4c, 0x8d, 0x15, 0xf9, 0xff, 0xff, 0xff,
-    /* jmpq  *0x3(%rip)        # 0x10 */
-    0xff, 0x25, 0x03, 0x00, 0x00, 0x00,
-    /* nopl  (%rax) */
-    0x0f, 0x1f, 0x00
+  static const unsigned char trampoline[FFI_TRAMPOLINE_SIZE - 8] = {
+    /* endbr64 */
+    0xf3, 0x0f, 0x1e, 0xfa,
+    /* leaq  -0xb(%rip),%r10   # 0x0  */
+    0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff,
+    /* jmpq  *0x7(%rip)        # 0x18 */
+    0xff, 0x25, 0x07, 0x00, 0x00, 0x00,
+    /* nopl  0(%rax) */
+    0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00
   };
-  unsigned char *tramp = closure->tramp;
+  char *tramp = closure->tramp;
+
+  switch (cif->abi)
+    {
+    case FFI_WIN64:
+    case FFI_GNUW64:
+      break;
+    default:
+      return FFI_BAD_ABI;
+    }
 
-  if (cif->abi != FFI_WIN64)
-    return FFI_BAD_ABI;
+#if defined(FFI_EXEC_STATIC_TRAMP)
+  if (ffi_tramp_is_present(closure))
+    {
+      /* Initialize the static trampoline's parameters. */
+      ffi_tramp_set_parms (closure->ftramp, ffi_closure_win64_alt, closure);
+      goto out;
+    }
+#endif
 
+  /* Initialize the dynamic trampoline. */
   memcpy (tramp, trampoline, sizeof(trampoline));
-  *(UINT64 *)(tramp + 16) = (uintptr_t)ffi_closure_win64;
+  *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)ffi_closure_win64;
 
+out:
   closure->cif = cif;
   closure->fun = fun;
   closure->user_data = user_data;
@@ -205,12 +255,19 @@ ffi_prep_closure_loc (ffi_closure* closure,
   return FFI_OK;
 }
 
+#ifdef FFI_GO_CLOSURES
 ffi_status
-ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
+EFI64(ffi_prep_go_closure)(ffi_go_closure* closure, ffi_cif* cif,
                     void (*fun)(ffi_cif*, void*, void**, void*))
 {
-  if (cif->abi != FFI_WIN64)
-    return FFI_BAD_ABI;
+  switch (cif->abi)
+    {
+    case FFI_WIN64:
+    case FFI_GNUW64:
+      break;
+    default:
+      return FFI_BAD_ABI;
+    }
 
   closure->tramp = ffi_go_closure_win64;
   closure->cif = cif;
@@ -218,6 +275,7 @@ ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
 
   return FFI_OK;
 }
+#endif
 
 struct win64_closure_frame
 {
@@ -227,7 +285,11 @@ struct win64_closure_frame
   UINT64 args[];
 };
 
-int FFI_HIDDEN
+/* Force the inner function to use the MS ABI.  When compiling on win64
+   this is a nop.  When compiling on unix, this simplifies the assembly,
+   and places the burden of saving the extra call-saved registers on
+   the compiler.  */
+int FFI_HIDDEN __attribute__((ms_abi))
 ffi_closure_win64_inner(ffi_cif *cif,
                        void (*fun)(ffi_cif*, void*, void**, void*),
                        void *user_data,
@@ -278,4 +340,4 @@ ffi_closure_win64_inner(ffi_cif *cif,
   return flags;
 }
 
-#endif /* X86_WIN64 */
+#endif /* __x86_64__ */
index 09771ba8cfb279e3f4b8bf60e7da89e5726f722e..23be7a2232692df72833440227f7ffc2401e407a 100644 (file)
 #else
 # define HAVE_FASTCALL 1
 #endif
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+/*
+ * For the trampoline code table mapping, a mapping size of 4K (base page size)
+ * is chosen.
+ */
+#define X86_TRAMP_MAP_SHIFT    12
+#define X86_TRAMP_MAP_SIZE     (1 << X86_TRAMP_MAP_SHIFT)
+#ifdef ENDBR_PRESENT
+#define X86_TRAMP_SIZE         44
+#else
+#define X86_TRAMP_SIZE         40
+#endif
+#endif
index 512e95523e92a7e8a3b75d7d328ad706ad5ee8bd..282b408027444e9abf3dda04257c17626ddb83b2 100644 (file)
 #define UNIX64_FLAG_RET_IN_MEM (1 << 10)
 #define UNIX64_FLAG_XMM_ARGS   (1 << 11)
 #define UNIX64_SIZE_SHIFT      12
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+/*
+ * For the trampoline code table mapping, a mapping size of 4K (base page size)
+ * is chosen.
+ */
+#define UNIX64_TRAMP_MAP_SHIFT 12
+#define UNIX64_TRAMP_MAP_SIZE  (1 << UNIX64_TRAMP_MAP_SHIFT)
+#ifdef ENDBR_PRESENT
+#define UNIX64_TRAMP_SIZE      40
+#else
+#define UNIX64_TRAMP_SIZE      32
+#endif
+#endif
index 78f245bda0762dee0f1074eaaad9e33ef918645b..7110f02f5f3ebb3bea92db8c2e26c4de40776945 100644 (file)
@@ -1,6 +1,7 @@
 /* -----------------------------------------------------------------------
-   sysv.S - Copyright (c) 2013  The Written Word, Inc.
-         - Copyright (c) 1996,1998,2001-2003,2005,2008,2010  Red Hat, Inc.
+   sysv.S - Copyright (c) 2017  Anthony Green
+          - Copyright (c) 2013  The Written Word, Inc.
+          - Copyright (c) 1996,1998,2001-2003,2005,2008,2010  Red Hat, Inc.
    
    X86 Foreign Function Interface 
 
@@ -25,7 +26,8 @@
    DEALINGS IN THE SOFTWARE.
    ----------------------------------------------------------------------- */
 
-#ifndef __x86_64__
+#ifdef __i386__
+#ifndef _MSC_VER
 
 #define LIBFFI_ASM     
 #include <fficonfig.h>
@@ -54,8 +56,8 @@
 
 /* Handle win32 fastcall name mangling.  */
 #ifdef X86_WIN32
-# define ffi_call_i386         @ffi_call_i386@8
-# define ffi_closure_inner     @ffi_closure_inner@8
+# define ffi_call_i386         "@ffi_call_i386@8"
+# define ffi_closure_inner     "@ffi_closure_inner@8"
 #else
 # define ffi_call_i386         C(ffi_call_i386)
 # define ffi_closure_inner     C(ffi_closure_inner)
@@ -90,6 +92,7 @@
 ffi_call_i386:
 L(UW0):
        # cfi_startproc
+       _CET_ENDBR
 #if !HAVE_FASTCALL
        movl    4(%esp), %ecx
        movl    8(%esp), %edx
@@ -131,7 +134,7 @@ L(pc1):
        leal    L(store_table)(,%ecx, 8), %ebx
 #endif
        movl    16(%ebp), %ecx          /* load result address */
-       jmp     *%ebx
+       _CET_NOTRACK jmp *%ebx
 
        .balign 8
 L(store_table):
@@ -254,7 +257,7 @@ ENDF(ffi_call_i386)
        andl    $X86_RET_TYPE_MASK, %eax;                               \
        leal    L(C1(load_table,N))(, %eax, 8), %edx;                   \
        movl    closure_CF(%esp), %eax;         /* optimiztic load */   \
-       jmp     *%edx
+       _CET_NOTRACK jmp *%edx
 
 #ifdef __PIC__
 # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
@@ -265,14 +268,14 @@ ENDF(ffi_call_i386)
 L(C1(pc,N)):                                                           \
        leal    L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx;   \
        movl    closure_CF(%esp), %eax;         /* optimiztic load */   \
-       jmp     *%edx
+       _CET_NOTRACK jmp *%edx
 # else
 #  define FFI_CLOSURE_CALL_INNER_SAVE_EBX
 #  undef FFI_CLOSURE_CALL_INNER
 #  define FFI_CLOSURE_CALL_INNER(UWN)                                  \
        movl    %ebx, 40(%esp);                 /* save ebx */          \
 L(C1(UW,UWN)):                                                         \
-       # cfi_rel_offset(%ebx, 40);                                     \
+       /* cfi_rel_offset(%ebx, 40); */                                 \
        call    C(__x86.get_pc_thunk.bx);       /* load got register */ \
        addl    $C(_GLOBAL_OFFSET_TABLE_), %ebx;                        \
        call    ffi_closure_inner@PLT
@@ -282,9 +285,9 @@ L(C1(UW,UWN)):                                                              \
        leal    L(C1(load_table,N))@GOTOFF(%ebx, %eax, 8), %edx;        \
        movl    40(%esp), %ebx;                 /* restore ebx */       \
 L(C1(UW,UWN)):                                                         \
-       # cfi_restore(%ebx);                                            \
+       /* cfi_restore(%ebx); */                                        \
        movl    closure_CF(%esp), %eax;         /* optimiztic load */   \
-       jmp     *%edx
+       _CET_NOTRACK jmp *%edx
 # endif /* DARWIN || HIDDEN */
 #endif /* __PIC__ */
 
@@ -294,6 +297,7 @@ L(C1(UW,UWN)):                                                              \
 C(ffi_go_closure_EAX):
 L(UW6):
        # cfi_startproc
+       _CET_ENDBR
        subl    $closure_FS, %esp
 L(UW7):
        # cfi_def_cfa_offset(closure_FS + 4)
@@ -314,6 +318,7 @@ ENDF(C(ffi_go_closure_EAX))
 C(ffi_go_closure_ECX):
 L(UW9):
        # cfi_startproc
+       _CET_ENDBR
        subl    $closure_FS, %esp
 L(UW10):
        # cfi_def_cfa_offset(closure_FS + 4)
@@ -338,6 +343,7 @@ ENDF(C(ffi_go_closure_ECX))
 C(ffi_closure_i386):
 L(UW12):
        # cfi_startproc
+       _CET_ENDBR
        subl    $closure_FS, %esp
 L(UW13):
        # cfi_def_cfa_offset(closure_FS + 4)
@@ -421,6 +427,7 @@ ENDF(C(ffi_closure_i386))
 C(ffi_go_closure_STDCALL):
 L(UW21):
        # cfi_startproc
+       _CET_ENDBR
        subl    $closure_FS, %esp
 L(UW22):
        # cfi_def_cfa_offset(closure_FS + 4)
@@ -446,6 +453,7 @@ L(UW24):
        # cfi_startproc
        # cfi_def_cfa(%esp, 8)
        # cfi_offset(%eip, -8)
+       _CET_ENDBR
        subl    $closure_FS-4, %esp
 L(UW25):
        # cfi_def_cfa_offset(closure_FS + 4)
@@ -468,6 +476,7 @@ ENDF(C(ffi_closure_REGISTER))
 C(ffi_closure_STDCALL):
 L(UW27):
        # cfi_startproc
+       _CET_ENDBR
        subl    $closure_FS, %esp
 L(UW28):
        # cfi_def_cfa_offset(closure_FS + 4)
@@ -564,6 +573,94 @@ L(UW31):
        # cfi_endproc
 ENDF(C(ffi_closure_STDCALL))
 
+#if defined(FFI_EXEC_STATIC_TRAMP)
+       .balign 16
+       .globl  C(ffi_closure_i386_alt)
+       FFI_HIDDEN(C(ffi_closure_i386_alt))
+C(ffi_closure_i386_alt):
+       /* See the comments above trampoline_code_table. */
+       _CET_ENDBR
+       movl    4(%esp), %eax                   /* Load closure in eax */
+       add     $8, %esp                        /* Restore the stack */
+       jmp     C(ffi_closure_i386)
+ENDF(C(ffi_closure_i386_alt))
+
+       .balign 16
+       .globl  C(ffi_closure_REGISTER_alt)
+       FFI_HIDDEN(C(ffi_closure_REGISTER_alt))
+C(ffi_closure_REGISTER_alt):
+       /* See the comments above trampoline_code_table. */
+       _CET_ENDBR
+       movl    (%esp), %eax                    /* Restore eax */
+       add     $4, %esp                        /* Leave closure on stack */
+       jmp     C(ffi_closure_REGISTER)
+ENDF(C(ffi_closure_REGISTER_alt))
+
+       .balign 16
+       .globl  C(ffi_closure_STDCALL_alt)
+       FFI_HIDDEN(C(ffi_closure_STDCALL_alt))
+C(ffi_closure_STDCALL_alt):
+       /* See the comments above trampoline_code_table. */
+       _CET_ENDBR
+       movl    4(%esp), %eax                   /* Load closure in eax */
+       add     $8, %esp                        /* Restore the stack */
+       jmp     C(ffi_closure_STDCALL)
+ENDF(C(ffi_closure_STDCALL_alt))
+
+/*
+ * Below is the definition of the trampoline code table. Each element in
+ * the code table is a trampoline.
+ *
+ * Because we jump to the trampoline, we place a _CET_ENDBR at the
+ * beginning of the trampoline to mark it as a valid branch target. This is
+ * part of the the Intel CET (Control Flow Enforcement Technology).
+ */
+/*
+ * The trampoline uses register eax.  It saves the original value of eax on
+ * the stack.
+ *
+ * The trampoline has two parameters - target code to jump to and data for
+ * the target code. The trampoline extracts the parameters from its parameter
+ * block (see tramp_table_map()). The trampoline saves the data address on
+ * the stack. Finally, it jumps to the target code.
+ *
+ * The target code can choose to:
+ *
+ * - restore the value of eax
+ * - load the data address in a register
+ * - restore the stack pointer to what it was when the trampoline was invoked.
+ */
+#ifdef ENDBR_PRESENT
+#define X86_DATA_OFFSET                4081
+#define X86_CODE_OFFSET                4070
+#else
+#define X86_DATA_OFFSET                4085
+#define X86_CODE_OFFSET                4074
+#endif
+
+       .align  X86_TRAMP_MAP_SIZE
+       .globl  C(trampoline_code_table)
+       FFI_HIDDEN(C(trampoline_code_table))
+C(trampoline_code_table):
+       .rept   X86_TRAMP_MAP_SIZE / X86_TRAMP_SIZE
+       _CET_ENDBR
+       sub     $8, %esp
+       movl    %eax, (%esp)                    /* Save %eax on stack */
+       call    1f                              /* Get next PC into %eax */
+       movl    X86_DATA_OFFSET(%eax), %eax     /* Copy data into %eax */
+       movl    %eax, 4(%esp)                   /* Save data on stack */
+       call    1f                              /* Get next PC into %eax */
+       movl    X86_CODE_OFFSET(%eax), %eax     /* Copy code into %eax */
+       jmp     *%eax                           /* Jump to code */
+1:
+       mov     (%esp), %eax
+       ret
+       .align  4
+       .endr
+ENDF(C(trampoline_code_table))
+       .align  X86_TRAMP_MAP_SIZE
+#endif /* FFI_EXEC_STATIC_TRAMP */
+
 #if !FFI_NO_RAW_API
 
 #define raw_closure_S_FS       (16+16+12)
@@ -574,6 +671,7 @@ ENDF(C(ffi_closure_STDCALL))
 C(ffi_closure_raw_SYSV):
 L(UW32):
        # cfi_startproc
+       _CET_ENDBR
        subl    $raw_closure_S_FS, %esp
 L(UW33):
        # cfi_def_cfa_offset(raw_closure_S_FS + 4)
@@ -677,6 +775,7 @@ ENDF(C(ffi_closure_raw_SYSV))
 C(ffi_closure_raw_THISCALL):
 L(UW41):
        # cfi_startproc
+       _CET_ENDBR
        /* Rearrange the stack such that %ecx is the first argument.
           This means moving the return address.  */
        popl    %edx
@@ -790,9 +889,9 @@ ENDF(C(ffi_closure_raw_THISCALL))
 
 #ifdef X86_DARWIN
 # define COMDAT(X)                                                     \
-        .section __TEXT,__textcoal_nt,coalesced,pure_instructions;     \
+        .section __TEXT,__text,coalesced,pure_instructions;            \
         .weak_definition X;                                            \
-        .private_extern X
+        FFI_HIDDEN(X)
 #elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
 # define COMDAT(X)                                                     \
        .section .text.X,"axG",@progbits,X,comdat;                      \
@@ -1033,7 +1132,95 @@ L(SFDE9):
 L(EFDE9):
 #endif /* !FFI_NO_RAW_API */
 
-#endif /* ifndef __x86_64__ */
+#ifdef _WIN32
+       .def     @feat.00;
+       .scl    3;
+       .type   0;
+       .endef
+       .globl  @feat.00
+@feat.00 = 1
+#endif
+
+#ifdef __APPLE__
+    .subsections_via_symbols
+    .section __LD,__compact_unwind,regular,debug
+
+    /* compact unwind for ffi_call_i386 */
+    .long    C(ffi_call_i386)
+    .set     L1,L(UW5)-L(UW0)
+    .long    L1
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_go_closure_EAX */
+    .long    C(ffi_go_closure_EAX)
+    .set     L2,L(UW8)-L(UW6)
+    .long    L2
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_go_closure_ECX */
+    .long    C(ffi_go_closure_ECX)
+    .set     L3,L(UW11)-L(UW9)
+    .long    L3
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_closure_i386 */
+    .long    C(ffi_closure_i386)
+    .set     L4,L(UW20)-L(UW12)
+    .long    L4
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_go_closure_STDCALL */
+    .long    C(ffi_go_closure_STDCALL)
+    .set     L5,L(UW23)-L(UW21)
+    .long    L5
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_closure_REGISTER */
+    .long    C(ffi_closure_REGISTER)
+    .set     L6,L(UW26)-L(UW24)
+    .long    L6
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_closure_STDCALL */
+    .long    C(ffi_closure_STDCALL)
+    .set     L7,L(UW31)-L(UW27)
+    .long    L7
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_closure_raw_SYSV */
+    .long    C(ffi_closure_raw_SYSV)
+    .set     L8,L(UW40)-L(UW32)
+    .long    L8
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+
+    /* compact unwind for ffi_closure_raw_THISCALL */
+    .long    C(ffi_closure_raw_THISCALL)
+    .set     L9,L(UW52)-L(UW41)
+    .long    L9
+    .long    0x04000000 /* use dwarf unwind info */
+    .long    0
+    .long    0
+#endif /* __APPLE__ */
+
+#endif /* ifndef _MSC_VER */
+
+#endif /* ifdef __i386__ */
 
 #if defined __ELF__ && defined __linux__
        .section        .note.GNU-stack,"",@progbits
diff --git a/libffi/src/x86/sysv_intel.S b/libffi/src/x86/sysv_intel.S
new file mode 100644 (file)
index 0000000..3cafd71
--- /dev/null
@@ -0,0 +1,995 @@
+/* -----------------------------------------------------------------------
+   sysv.S - Copyright (c) 2017  Anthony Green
+          - Copyright (c) 2013  The Written Word, Inc.
+          - Copyright (c) 1996,1998,2001-2003,2005,2008,2010  Red Hat, Inc.
+   
+   X86 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 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 __x86_64__
+#ifdef _MSC_VER
+
+#define LIBFFI_ASM     
+#include <fficonfig.h>
+#include <ffi.h>
+#include <ffi_cfi.h>
+#include "internal.h" 
+
+#define C2(X, Y)  X ## Y
+#define C1(X, Y)  C2(X, Y)
+#define L(X)     C1(L, X)
+# define ENDF(X) X ENDP
+
+/* This macro allows the safe creation of jump tables without an
+   actual table.  The entry points into the table are all 8 bytes.
+   The use of ORG asserts that we're at the correct location.  */
+/* ??? The clang assembler doesn't handle .org with symbolic expressions.  */
+#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
+# define E(BASE, X)    ALIGN 8
+#else
+# define E(BASE, X)    ALIGN 8; ORG BASE + X * 8
+#endif
+
+    .686P
+    .MODEL FLAT
+
+EXTRN  @ffi_closure_inner@8:PROC
+_TEXT SEGMENT
+
+/* This is declared as
+
+   void ffi_call_i386(struct call_frame *frame, char *argp)
+        __attribute__((fastcall));
+
+   Thus the arguments are present in
+
+        ecx: frame
+        edx: argp
+*/
+
+ALIGN 16
+PUBLIC @ffi_call_i386@8
+@ffi_call_i386@8 PROC
+L(UW0):
+       cfi_startproc
+ #if !HAVE_FASTCALL
+       mov         ecx, [esp+4]
+       mov     edx, [esp+8]
+ #endif
+       mov         eax, [esp]          /* move the return address */
+       mov         [ecx], ebp          /* store ebp into local frame */
+       mov     [ecx+4], eax    /* store retaddr into local frame */
+
+       /* New stack frame based off ebp.  This is a itty bit of unwind
+          trickery in that the CFA *has* changed.  There is no easy way
+          to describe it correctly on entry to the function.  Fortunately,
+          it doesn't matter too much since at all points we can correctly
+          unwind back to ffi_call.  Note that the location to which we
+          moved the return address is (the new) CFA-4, so from the
+          perspective of the unwind info, it hasn't moved.  */
+       mov     ebp, ecx
+L(UW1):
+       // cfi_def_cfa(%ebp, 8)
+       // cfi_rel_offset(%ebp, 0)
+
+       mov     esp, edx                /* set outgoing argument stack */
+       mov     eax, [20+R_EAX*4+ebp]   /* set register arguments */
+       mov     edx, [20+R_EDX*4+ebp]
+       mov         ecx, [20+R_ECX*4+ebp]
+
+       call    dword ptr [ebp+8]
+
+       mov         ecx, [12+ebp]               /* load return type code */
+       mov     [ebp+8], ebx            /* preserve %ebx */
+L(UW2):
+       // cfi_rel_offset(%ebx, 8)
+
+       and     ecx, X86_RET_TYPE_MASK
+       lea     ebx, [L(store_table) + ecx * 8]
+       mov     ecx, [ebp+16]           /* load result address */
+       jmp         ebx
+
+       ALIGN   8
+L(store_table):
+E(L(store_table), X86_RET_FLOAT)
+       fstp    DWORD PTR [ecx]
+       jmp     L(e1)
+E(L(store_table), X86_RET_DOUBLE)
+       fstp    QWORD PTR [ecx]
+       jmp     L(e1)
+E(L(store_table), X86_RET_LDOUBLE)
+       fstp    QWORD PTR [ecx]
+       jmp     L(e1)
+E(L(store_table), X86_RET_SINT8)
+       movsx   eax, al
+       mov     [ecx], eax
+       jmp     L(e1)
+E(L(store_table), X86_RET_SINT16)
+       movsx   eax, ax
+       mov     [ecx], eax
+       jmp     L(e1)
+E(L(store_table), X86_RET_UINT8)
+       movzx   eax, al
+       mov     [ecx], eax
+       jmp     L(e1)
+E(L(store_table), X86_RET_UINT16)
+       movzx   eax, ax
+       mov     [ecx], eax
+       jmp     L(e1)
+E(L(store_table), X86_RET_INT64)
+       mov     [ecx+4], edx
+       /* fallthru */
+E(L(store_table), X86_RET_int 32)
+       mov     [ecx], eax
+       /* fallthru */
+E(L(store_table), X86_RET_VOID)
+L(e1):
+       mov         ebx, [ebp+8]
+       mov         esp, ebp
+       pop     ebp
+L(UW3):
+       // cfi_remember_state
+       // cfi_def_cfa(%esp, 4)
+       // cfi_restore(%ebx)
+       // cfi_restore(%ebp)
+       ret
+L(UW4):
+       // cfi_restore_state
+
+E(L(store_table), X86_RET_STRUCTPOP)
+       jmp         L(e1)
+E(L(store_table), X86_RET_STRUCTARG)
+       jmp         L(e1)
+E(L(store_table), X86_RET_STRUCT_1B)
+       mov     [ecx], al
+       jmp         L(e1)
+E(L(store_table), X86_RET_STRUCT_2B)
+       mov     [ecx], ax
+       jmp         L(e1)
+
+       /* Fill out the table so that bad values are predictable.  */
+E(L(store_table), X86_RET_UNUSED14)
+       int 3
+E(L(store_table), X86_RET_UNUSED15)
+       int 3
+
+L(UW5):
+       // cfi_endproc
+ENDF(@ffi_call_i386@8)
+
+/* The inner helper is declared as
+
+   void ffi_closure_inner(struct closure_frame *frame, char *argp)
+       __attribute_((fastcall))
+
+   Thus the arguments are placed in
+
+       ecx:    frame
+       edx:    argp
+*/
+
+/* Macros to help setting up the closure_data structure.  */
+
+#if HAVE_FASTCALL
+# define closure_FS    (40 + 4)
+# define closure_CF    0
+#else
+# define closure_FS    (8 + 40 + 12)
+# define closure_CF    8
+#endif
+
+FFI_CLOSURE_SAVE_REGS MACRO
+       mov     [esp + closure_CF+16+R_EAX*4], eax
+       mov     [esp + closure_CF+16+R_EDX*4], edx
+       mov     [esp + closure_CF+16+R_ECX*4], ecx
+ENDM
+
+FFI_CLOSURE_COPY_TRAMP_DATA MACRO
+       mov     edx, [eax+FFI_TRAMPOLINE_SIZE]      /* copy cif */
+       mov     ecx, [eax+FFI_TRAMPOLINE_SIZE+4]    /* copy fun */
+       mov     eax, [eax+FFI_TRAMPOLINE_SIZE+8];   /* copy user_data */
+       mov     [esp+closure_CF+28], edx
+       mov     [esp+closure_CF+32], ecx
+       mov     [esp+closure_CF+36], eax
+ENDM
+
+#if HAVE_FASTCALL
+FFI_CLOSURE_PREP_CALL MACRO
+       mov         ecx, esp                    /* load closure_data */
+       lea     edx, [esp+closure_FS+4]     /* load incoming stack */
+ENDM
+#else
+FFI_CLOSURE_PREP_CALL MACRO
+       lea     ecx, [esp+closure_CF]       /* load closure_data */
+       lea     edx, [esp+closure_FS+4]     /* load incoming stack */
+       mov     [esp], ecx
+       mov     [esp+4], edx
+ENDM
+#endif
+
+FFI_CLOSURE_CALL_INNER MACRO UWN
+       call    @ffi_closure_inner@8
+ENDM
+
+FFI_CLOSURE_MASK_AND_JUMP MACRO LABEL
+       and         eax, X86_RET_TYPE_MASK
+       lea     edx, [LABEL+eax*8]
+       mov     eax, [esp+closure_CF]       /* optimiztic load */
+       jmp         edx
+ENDM
+
+ALIGN 16
+PUBLIC ffi_go_closure_EAX
+ffi_go_closure_EAX PROC C
+L(UW6):
+       // cfi_startproc
+       sub     esp, closure_FS
+L(UW7):
+       // cfi_def_cfa_offset(closure_FS + 4)
+       FFI_CLOSURE_SAVE_REGS
+       mov     edx, [eax+4]                    /* copy cif */
+       mov     ecx, [eax +8]                   /* copy fun */
+       mov     [esp+closure_CF+28], edx
+       mov     [esp+closure_CF+32], ecx
+       mov     [esp+closure_CF+36], eax        /* closure is user_data */
+       jmp     L(do_closure_i386)
+L(UW8):
+       // cfi_endproc
+ENDF(ffi_go_closure_EAX)
+
+ALIGN 16
+PUBLIC ffi_go_closure_ECX
+ffi_go_closure_ECX PROC C
+L(UW9):
+       // cfi_startproc
+       sub     esp, closure_FS
+L(UW10):
+       // cfi_def_cfa_offset(closure_FS + 4)
+       FFI_CLOSURE_SAVE_REGS
+       mov     edx, [ecx+4]                    /* copy cif */
+       mov     eax, [ecx+8]                    /* copy fun */
+       mov     [esp+closure_CF+28], edx
+       mov     [esp+closure_CF+32], eax
+       mov     [esp+closure_CF+36], ecx        /* closure is user_data */
+       jmp     L(do_closure_i386)
+L(UW11):
+       // cfi_endproc
+ENDF(ffi_go_closure_ECX)
+
+/* The closure entry points are reached from the ffi_closure trampoline.
+   On entry, %eax contains the address of the ffi_closure.  */
+
+ALIGN 16
+PUBLIC ffi_closure_i386
+ffi_closure_i386 PROC C
+L(UW12):
+       // cfi_startproc
+       sub         esp, closure_FS
+L(UW13):
+       // cfi_def_cfa_offset(closure_FS + 4)
+
+       FFI_CLOSURE_SAVE_REGS
+       FFI_CLOSURE_COPY_TRAMP_DATA
+
+       /* Entry point from preceeding Go closures.  */
+L(do_closure_i386)::
+
+       FFI_CLOSURE_PREP_CALL
+       FFI_CLOSURE_CALL_INNER(14)
+       FFI_CLOSURE_MASK_AND_JUMP L(C1(load_table,2))
+
+    ALIGN 8
+L(load_table2):
+E(L(load_table2), X86_RET_FLOAT)
+       fld     dword ptr [esp+closure_CF]
+       jmp     L(e2)
+E(L(load_table2), X86_RET_DOUBLE)
+       fld     qword ptr [esp+closure_CF]
+       jmp     L(e2)
+E(L(load_table2), X86_RET_LDOUBLE)
+       fld     qword ptr [esp+closure_CF]
+       jmp     L(e2)
+E(L(load_table2), X86_RET_SINT8)
+       movsx   eax, al
+       jmp     L(e2)
+E(L(load_table2), X86_RET_SINT16)
+       movsx   eax, ax
+       jmp     L(e2)
+E(L(load_table2), X86_RET_UINT8)
+       movzx   eax, al
+       jmp     L(e2)
+E(L(load_table2), X86_RET_UINT16)
+       movzx   eax, ax
+       jmp     L(e2)
+E(L(load_table2), X86_RET_INT64)
+       mov     edx, [esp+closure_CF+4]
+       jmp     L(e2)
+E(L(load_table2), X86_RET_INT32)
+       nop
+       /* fallthru */
+E(L(load_table2), X86_RET_VOID)
+L(e2):
+       add     esp, closure_FS
+L(UW16):
+       // cfi_adjust_cfa_offset(-closure_FS)
+       ret
+L(UW17):
+       // cfi_adjust_cfa_offset(closure_FS)
+E(L(load_table2), X86_RET_STRUCTPOP)
+       add     esp, closure_FS
+L(UW18):
+       // cfi_adjust_cfa_offset(-closure_FS)
+       ret     4
+L(UW19):
+       // cfi_adjust_cfa_offset(closure_FS)
+E(L(load_table2), X86_RET_STRUCTARG)
+       jmp     L(e2)
+E(L(load_table2), X86_RET_STRUCT_1B)
+       movzx   eax, al
+       jmp     L(e2)
+E(L(load_table2), X86_RET_STRUCT_2B)
+       movzx   eax, ax
+       jmp     L(e2)
+
+       /* Fill out the table so that bad values are predictable.  */
+E(L(load_table2), X86_RET_UNUSED14)
+       int 3
+E(L(load_table2), X86_RET_UNUSED15)
+       int 3
+
+L(UW20):
+       // cfi_endproc
+ENDF(ffi_closure_i386)
+
+ALIGN 16
+PUBLIC ffi_go_closure_STDCALL
+ffi_go_closure_STDCALL PROC C
+L(UW21):
+       // cfi_startproc
+       sub     esp, closure_FS
+L(UW22):
+       // cfi_def_cfa_offset(closure_FS + 4)
+       FFI_CLOSURE_SAVE_REGS
+       mov     edx, [ecx+4]                    /* copy cif */
+       mov     eax, [ecx+8]                    /* copy fun */
+       mov     [esp+closure_CF+28], edx
+       mov     [esp+closure_CF+32], eax
+       mov     [esp+closure_CF+36], ecx        /* closure is user_data */
+       jmp     L(do_closure_STDCALL)
+L(UW23):
+       // cfi_endproc
+ENDF(ffi_go_closure_STDCALL)
+
+/* For REGISTER, we have no available parameter registers, and so we
+   enter here having pushed the closure onto the stack.  */
+
+ALIGN 16
+PUBLIC ffi_closure_REGISTER
+ffi_closure_REGISTER PROC C
+L(UW24):
+       // cfi_startproc
+       // cfi_def_cfa(%esp, 8)
+       // cfi_offset(%eip, -8)
+       sub     esp, closure_FS-4
+L(UW25):
+       // cfi_def_cfa_offset(closure_FS + 4)
+       FFI_CLOSURE_SAVE_REGS
+       mov     ecx, [esp+closure_FS-4]         /* load retaddr */
+       mov     eax, [esp+closure_FS]           /* load closure */
+       mov     [esp+closure_FS], ecx           /* move retaddr */
+       jmp     L(do_closure_REGISTER)
+L(UW26):
+       // cfi_endproc
+ENDF(ffi_closure_REGISTER)
+
+/* For STDCALL (and others), we need to pop N bytes of arguments off
+   the stack following the closure.  The amount needing to be popped
+   is returned to us from ffi_closure_inner.  */
+
+ALIGN 16
+PUBLIC ffi_closure_STDCALL
+ffi_closure_STDCALL PROC C
+L(UW27):
+       // cfi_startproc
+       sub     esp, closure_FS
+L(UW28):
+       // cfi_def_cfa_offset(closure_FS + 4)
+
+       FFI_CLOSURE_SAVE_REGS
+
+       /* Entry point from ffi_closure_REGISTER.  */
+L(do_closure_REGISTER)::
+
+       FFI_CLOSURE_COPY_TRAMP_DATA
+
+       /* Entry point from preceeding Go closure.  */
+L(do_closure_STDCALL)::
+
+       FFI_CLOSURE_PREP_CALL
+       FFI_CLOSURE_CALL_INNER(29)
+
+       mov     ecx, eax
+       shr     ecx, X86_RET_POP_SHIFT      /* isolate pop count */
+       lea     ecx, [esp+closure_FS+ecx]       /* compute popped esp */
+       mov     edx, [esp+closure_FS]           /* move return address */
+       mov     [ecx], edx
+
+       /* From this point on, the value of %esp upon return is %ecx+4,
+          and we've copied the return address to %ecx to make return easy.
+          There's no point in representing this in the unwind info, as
+          there is always a window between the mov and the ret which
+          will be wrong from one point of view or another.  */
+
+       FFI_CLOSURE_MASK_AND_JUMP  L(C1(load_table,3))
+
+    ALIGN 8
+L(load_table3):
+E(L(load_table3), X86_RET_FLOAT)
+       fld    DWORD PTR [esp+closure_CF]
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_DOUBLE)
+       fld    QWORD PTR [esp+closure_CF]
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_LDOUBLE)
+       fld    QWORD PTR [esp+closure_CF]
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_SINT8)
+       movsx   eax, al
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_SINT16)
+       movsx   eax, ax
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_UINT8)
+       movzx   eax, al
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_UINT16)
+       movzx   eax, ax
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_INT64)
+       mov     edx, [esp+closure_CF+4]
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_int 32)
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_VOID)
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_STRUCTPOP)
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_STRUCTARG)
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_STRUCT_1B)
+       movzx   eax, al
+       mov     esp, ecx
+       ret
+E(L(load_table3), X86_RET_STRUCT_2B)
+       movzx   eax, ax
+       mov     esp, ecx
+       ret
+
+       /* Fill out the table so that bad values are predictable.  */
+E(L(load_table3), X86_RET_UNUSED14)
+       int 3
+E(L(load_table3), X86_RET_UNUSED15)
+       int 3
+
+L(UW31):
+       // cfi_endproc
+ENDF(ffi_closure_STDCALL)
+
+#if !FFI_NO_RAW_API
+
+#define raw_closure_S_FS       (16+16+12)
+
+ALIGN 16
+PUBLIC ffi_closure_raw_SYSV
+ffi_closure_raw_SYSV PROC C
+L(UW32):
+       // cfi_startproc
+       sub     esp, raw_closure_S_FS
+L(UW33):
+       // cfi_def_cfa_offset(raw_closure_S_FS + 4)
+       mov     [esp+raw_closure_S_FS-4], ebx
+L(UW34):
+       // cfi_rel_offset(%ebx, raw_closure_S_FS-4)
+
+       mov     edx, [eax+FFI_TRAMPOLINE_SIZE+8]        /* load cl->user_data */
+       mov     [esp+12], edx
+       lea     edx, [esp+raw_closure_S_FS+4]           /* load raw_args */
+       mov     [esp+8], edx
+       lea     edx, [esp+16]                           /* load &res */
+       mov     [esp+4], edx
+       mov     ebx, [eax+FFI_TRAMPOLINE_SIZE]          /* load cl->cif */
+       mov     [esp], ebx
+       call    DWORD PTR [eax+FFI_TRAMPOLINE_SIZE+4]           /* call cl->fun */
+
+       mov     eax, [ebx+20]                   /* load cif->flags */
+       and     eax, X86_RET_TYPE_MASK
+// #ifdef __PIC__
+//     call    __x86.get_pc_thunk.bx
+// L(pc4):
+//     lea     ecx, L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx
+// #else
+       lea     ecx, [L(load_table4)+eax+8]
+// #endif
+       mov     ebx, [esp+raw_closure_S_FS-4]
+L(UW35):
+       // cfi_restore(%ebx)
+       mov     eax, [esp+16]                           /* Optimistic load */
+       jmp         dword ptr [ecx]
+
+       ALIGN 8
+L(load_table4):
+E(L(load_table4), X86_RET_FLOAT)
+       fld     DWORD PTR [esp +16]
+       jmp     L(e4)
+E(L(load_table4), X86_RET_DOUBLE)
+       fld     QWORD PTR [esp +16]
+       jmp     L(e4)
+E(L(load_table4), X86_RET_LDOUBLE)
+       fld     QWORD PTR [esp +16]
+       jmp     L(e4)
+E(L(load_table4), X86_RET_SINT8)
+       movsx   eax, al
+       jmp     L(e4)
+E(L(load_table4), X86_RET_SINT16)
+       movsx   eax, ax
+       jmp     L(e4)
+E(L(load_table4), X86_RET_UINT8)
+       movzx   eax, al
+       jmp     L(e4)
+E(L(load_table4), X86_RET_UINT16)
+       movzx   eax, ax
+       jmp     L(e4)
+E(L(load_table4), X86_RET_INT64)
+       mov     edx, [esp+16+4]
+       jmp     L(e4)
+E(L(load_table4), X86_RET_int 32)
+       nop
+       /* fallthru */
+E(L(load_table4), X86_RET_VOID)
+L(e4):
+       add     esp, raw_closure_S_FS
+L(UW36):
+       // cfi_adjust_cfa_offset(-raw_closure_S_FS)
+       ret
+L(UW37):
+       // cfi_adjust_cfa_offset(raw_closure_S_FS)
+E(L(load_table4), X86_RET_STRUCTPOP)
+       add     esp, raw_closure_S_FS
+L(UW38):
+       // cfi_adjust_cfa_offset(-raw_closure_S_FS)
+       ret     4
+L(UW39):
+       // cfi_adjust_cfa_offset(raw_closure_S_FS)
+E(L(load_table4), X86_RET_STRUCTARG)
+       jmp     L(e4)
+E(L(load_table4), X86_RET_STRUCT_1B)
+       movzx   eax, al
+       jmp     L(e4)
+E(L(load_table4), X86_RET_STRUCT_2B)
+       movzx   eax, ax
+       jmp     L(e4)
+
+       /* Fill out the table so that bad values are predictable.  */
+E(L(load_table4), X86_RET_UNUSED14)
+       int 3
+E(L(load_table4), X86_RET_UNUSED15)
+       int 3
+
+L(UW40):
+       // cfi_endproc
+ENDF(ffi_closure_raw_SYSV)
+
+#define raw_closure_T_FS       (16+16+8)
+
+ALIGN 16
+PUBLIC ffi_closure_raw_THISCALL
+ffi_closure_raw_THISCALL PROC C
+L(UW41):
+       // cfi_startproc
+       /* Rearrange the stack such that %ecx is the first argument.
+          This means moving the return address.  */
+       pop     edx
+L(UW42):
+       // cfi_def_cfa_offset(0)
+       // cfi_register(%eip, %edx)
+       push    ecx
+L(UW43):
+       // cfi_adjust_cfa_offset(4)
+       push    edx
+L(UW44):
+       // cfi_adjust_cfa_offset(4)
+       // cfi_rel_offset(%eip, 0)
+       sub     esp, raw_closure_T_FS
+L(UW45):
+       // cfi_adjust_cfa_offset(raw_closure_T_FS)
+       mov     [esp+raw_closure_T_FS-4], ebx
+L(UW46):
+       // cfi_rel_offset(%ebx, raw_closure_T_FS-4)
+
+       mov     edx, [eax+FFI_TRAMPOLINE_SIZE+8]        /* load cl->user_data */
+       mov     [esp+12], edx
+       lea     edx, [esp+raw_closure_T_FS+4]           /* load raw_args */
+       mov     [esp+8], edx
+       lea     edx, [esp+16]                           /* load &res */
+       mov     [esp+4], edx
+       mov     ebx, [eax+FFI_TRAMPOLINE_SIZE]          /* load cl->cif */
+       mov     [esp], ebx
+       call    DWORD PTR [eax+FFI_TRAMPOLINE_SIZE+4]           /* call cl->fun */
+
+       mov     eax, [ebx+20]                           /* load cif->flags */
+       and     eax, X86_RET_TYPE_MASK
+// #ifdef __PIC__
+//     call    __x86.get_pc_thunk.bx
+// L(pc5):
+//     leal    L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx
+// #else
+       lea     ecx, [L(load_table5)+eax*8]
+//#endif
+       mov     ebx, [esp+raw_closure_T_FS-4]
+L(UW47):
+       // cfi_restore(%ebx)
+       mov     eax, [esp+16]                           /* Optimistic load */
+       jmp         DWORD PTR [ecx]
+
+       AlIGN 4
+L(load_table5):
+E(L(load_table5), X86_RET_FLOAT)
+       fld     DWORD PTR [esp +16]
+       jmp     L(e5)
+E(L(load_table5), X86_RET_DOUBLE)
+       fld     QWORD PTR [esp +16]
+       jmp     L(e5)
+E(L(load_table5), X86_RET_LDOUBLE)
+       fld     QWORD PTR [esp+16]
+       jmp     L(e5)
+E(L(load_table5), X86_RET_SINT8)
+       movsx   eax, al
+       jmp     L(e5)
+E(L(load_table5), X86_RET_SINT16)
+       movsx   eax, ax
+       jmp     L(e5)
+E(L(load_table5), X86_RET_UINT8)
+       movzx   eax, al
+       jmp     L(e5)
+E(L(load_table5), X86_RET_UINT16)
+       movzx   eax, ax
+       jmp     L(e5)
+E(L(load_table5), X86_RET_INT64)
+       mov     edx, [esp+16+4]
+       jmp     L(e5)
+E(L(load_table5), X86_RET_int 32)
+       nop
+       /* fallthru */
+E(L(load_table5), X86_RET_VOID)
+L(e5):
+       add     esp, raw_closure_T_FS
+L(UW48):
+       // cfi_adjust_cfa_offset(-raw_closure_T_FS)
+       /* Remove the extra %ecx argument we pushed.  */
+       ret     4
+L(UW49):
+       // cfi_adjust_cfa_offset(raw_closure_T_FS)
+E(L(load_table5), X86_RET_STRUCTPOP)
+       add     esp, raw_closure_T_FS
+L(UW50):
+       // cfi_adjust_cfa_offset(-raw_closure_T_FS)
+       ret     8
+L(UW51):
+       // cfi_adjust_cfa_offset(raw_closure_T_FS)
+E(L(load_table5), X86_RET_STRUCTARG)
+       jmp     L(e5)
+E(L(load_table5), X86_RET_STRUCT_1B)
+       movzx   eax, al
+       jmp     L(e5)
+E(L(load_table5), X86_RET_STRUCT_2B)
+       movzx   eax, ax
+       jmp     L(e5)
+
+       /* Fill out the table so that bad values are predictable.  */
+E(L(load_table5), X86_RET_UNUSED14)
+       int 3
+E(L(load_table5), X86_RET_UNUSED15)
+       int 3
+
+L(UW52):
+       // cfi_endproc
+ENDF(ffi_closure_raw_THISCALL)
+
+#endif /* !FFI_NO_RAW_API */
+
+#ifdef X86_DARWIN
+# define COMDAT(X)                                                     \
+        .section __TEXT,__text,coalesced,pure_instructions;            \
+        .weak_definition X;                                            \
+        FFI_HIDDEN(X)
+#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
+# define COMDAT(X)                                                     \
+       .section .text.X,"axG",@progbits,X,comdat;                      \
+       PUBLIC  X;                                                      \
+       FFI_HIDDEN(X)
+#else
+# define COMDAT(X)
+#endif
+
+// #if defined(__PIC__)
+//     COMDAT(C(__x86.get_pc_thunk.bx))
+// C(__x86.get_pc_thunk.bx):
+//     movl    (%esp), %ebx
+//     ret
+// ENDF(C(__x86.get_pc_thunk.bx))
+// # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
+//     COMDAT(C(__x86.get_pc_thunk.dx))
+// C(__x86.get_pc_thunk.dx):
+//     movl    (%esp), %edx
+//     ret
+// ENDF(C(__x86.get_pc_thunk.dx))
+// #endif /* DARWIN || HIDDEN */
+// #endif /* __PIC__ */
+
+#if 0
+/* Sadly, OSX cctools-as doesn't understand .cfi directives at all.  */
+
+#ifdef __APPLE__
+.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
+EHFrame0:
+#elif defined(X86_WIN32)
+.section .eh_frame,"r"
+#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
+.section .eh_frame,EH_FRAME_FLAGS,@unwind
+#else
+.section .eh_frame,EH_FRAME_FLAGS,@progbits
+#endif
+
+#ifdef HAVE_AS_X86_PCREL
+# define PCREL(X)      X - .
+#else
+# define PCREL(X)      X@rel
+#endif
+
+/* Simplify advancing between labels.  Assume DW_CFA_advance_loc1 fits.  */
+#define ADV(N, P)      .byte 2, L(N)-L(P)
+
+       .balign 4
+L(CIE):
+       .set    L(set0),L(ECIE)-L(SCIE)
+       .long   L(set0)                 /* CIE Length */
+L(SCIE):
+       .long   0                       /* CIE Identifier Tag */
+       .byte   1                       /* CIE Version */
+       .ascii  "zR\0"                  /* CIE Augmentation */
+       .byte   1                       /* CIE Code Alignment Factor */
+       .byte   0x7c                    /* CIE Data Alignment Factor */
+       .byte   0x8                     /* CIE RA Column */
+       .byte   1                       /* Augmentation size */
+       .byte   0x1b                    /* FDE Encoding (pcrel sdata4) */
+       .byte   0xc, 4, 4               /* DW_CFA_def_cfa, %esp offset 4 */
+       .byte   0x80+8, 1               /* DW_CFA_offset, %eip offset 1*-4 */
+       .balign 4
+L(ECIE):
+
+       .set    L(set1),L(EFDE1)-L(SFDE1)
+       .long   L(set1)                 /* FDE Length */
+L(SFDE1):
+       .long   L(SFDE1)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW0))           /* Initial location */
+       .long   L(UW5)-L(UW0)           /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW1, UW0)
+       .byte   0xc, 5, 8               /* DW_CFA_def_cfa, %ebp 8 */
+       .byte   0x80+5, 2               /* DW_CFA_offset, %ebp 2*-4 */
+       ADV(UW2, UW1)
+       .byte   0x80+3, 0               /* DW_CFA_offset, %ebx 0*-4 */
+       ADV(UW3, UW2)
+       .byte   0xa                     /* DW_CFA_remember_state */
+       .byte   0xc, 4, 4               /* DW_CFA_def_cfa, %esp 4 */
+       .byte   0xc0+3                  /* DW_CFA_restore, %ebx */
+       .byte   0xc0+5                  /* DW_CFA_restore, %ebp */
+       ADV(UW4, UW3)
+       .byte   0xb                     /* DW_CFA_restore_state */
+       .balign 4
+L(EFDE1):
+
+       .set    L(set2),L(EFDE2)-L(SFDE2)
+       .long   L(set2)                 /* FDE Length */
+L(SFDE2):
+       .long   L(SFDE2)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW6))           /* Initial location */
+       .long   L(UW8)-L(UW6)           /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW7, UW6)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE2):
+
+       .set    L(set3),L(EFDE3)-L(SFDE3)
+       .long   L(set3)                 /* FDE Length */
+L(SFDE3):
+       .long   L(SFDE3)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW9))           /* Initial location */
+       .long   L(UW11)-L(UW9)          /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW10, UW9)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE3):
+
+       .set    L(set4),L(EFDE4)-L(SFDE4)
+       .long   L(set4)                 /* FDE Length */
+L(SFDE4):
+       .long   L(SFDE4)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW12))          /* Initial location */
+       .long   L(UW20)-L(UW12)         /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW13, UW12)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
+       ADV(UW14, UW13)
+       .byte   0x80+3, (40-(closure_FS+4))/-4  /* DW_CFA_offset %ebx */
+       ADV(UW15, UW14)
+       .byte   0xc0+3                  /* DW_CFA_restore %ebx */
+       ADV(UW16, UW15)
+#else
+       ADV(UW16, UW13)
+#endif
+       .byte   0xe, 4                  /* DW_CFA_def_cfa_offset */
+       ADV(UW17, UW16)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+       ADV(UW18, UW17)
+       .byte   0xe, 4                  /* DW_CFA_def_cfa_offset */
+       ADV(UW19, UW18)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE4):
+
+       .set    L(set5),L(EFDE5)-L(SFDE5)
+       .long   L(set5)                 /* FDE Length */
+L(SFDE5):
+       .long   L(SFDE5)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW21))          /* Initial location */
+       .long   L(UW23)-L(UW21)         /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW22, UW21)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE5):
+
+       .set    L(set6),L(EFDE6)-L(SFDE6)
+       .long   L(set6)                 /* FDE Length */
+L(SFDE6):
+       .long   L(SFDE6)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW24))          /* Initial location */
+       .long   L(UW26)-L(UW24)         /* Address range */
+       .byte   0                       /* Augmentation size */
+       .byte   0xe, 8                  /* DW_CFA_def_cfa_offset */
+       .byte   0x80+8, 2               /* DW_CFA_offset %eip, 2*-4 */
+       ADV(UW25, UW24)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE6):
+
+       .set    L(set7),L(EFDE7)-L(SFDE7)
+       .long   L(set7)                 /* FDE Length */
+L(SFDE7):
+       .long   L(SFDE7)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW27))          /* Initial location */
+       .long   L(UW31)-L(UW27)         /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW28, UW27)
+       .byte   0xe, closure_FS+4       /* DW_CFA_def_cfa_offset */
+#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
+       ADV(UW29, UW28)
+       .byte   0x80+3, (40-(closure_FS+4))/-4  /* DW_CFA_offset %ebx */
+       ADV(UW30, UW29)
+       .byte   0xc0+3                  /* DW_CFA_restore %ebx */
+#endif
+       .balign 4
+L(EFDE7):
+
+#if !FFI_NO_RAW_API
+       .set    L(set8),L(EFDE8)-L(SFDE8)
+       .long   L(set8)                 /* FDE Length */
+L(SFDE8):
+       .long   L(SFDE8)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW32))          /* Initial location */
+       .long   L(UW40)-L(UW32)         /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW33, UW32)
+       .byte   0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
+       ADV(UW34, UW33)
+       .byte   0x80+3, 2               /* DW_CFA_offset %ebx 2*-4 */
+       ADV(UW35, UW34)
+       .byte   0xc0+3                  /* DW_CFA_restore %ebx */
+       ADV(UW36, UW35)
+       .byte   0xe, 4                  /* DW_CFA_def_cfa_offset */
+       ADV(UW37, UW36)
+       .byte   0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
+       ADV(UW38, UW37)
+       .byte   0xe, 4                  /* DW_CFA_def_cfa_offset */
+       ADV(UW39, UW38)
+       .byte   0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE8):
+
+       .set    L(set9),L(EFDE9)-L(SFDE9)
+       .long   L(set9)                 /* FDE Length */
+L(SFDE9):
+       .long   L(SFDE9)-L(CIE)         /* FDE CIE offset */
+       .long   PCREL(L(UW41))          /* Initial location */
+       .long   L(UW52)-L(UW41)         /* Address range */
+       .byte   0                       /* Augmentation size */
+       ADV(UW42, UW41)
+       .byte   0xe, 0                  /* DW_CFA_def_cfa_offset */
+       .byte   0x9, 8, 2               /* DW_CFA_register %eip, %edx */
+       ADV(UW43, UW42)
+       .byte   0xe, 4                  /* DW_CFA_def_cfa_offset */
+       ADV(UW44, UW43)
+       .byte   0xe, 8                  /* DW_CFA_def_cfa_offset */
+       .byte   0x80+8, 2               /* DW_CFA_offset %eip 2*-4 */
+       ADV(UW45, UW44)
+       .byte   0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
+       ADV(UW46, UW45)
+       .byte   0x80+3, 3               /* DW_CFA_offset %ebx 3*-4 */
+       ADV(UW47, UW46)
+       .byte   0xc0+3                  /* DW_CFA_restore %ebx */
+       ADV(UW48, UW47)
+       .byte   0xe, 8                  /* DW_CFA_def_cfa_offset */
+       ADV(UW49, UW48)
+       .byte   0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
+       ADV(UW50, UW49)
+       .byte   0xe, 8                  /* DW_CFA_def_cfa_offset */
+       ADV(UW51, UW50)
+       .byte   0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
+       .balign 4
+L(EFDE9):
+#endif /* !FFI_NO_RAW_API */
+
+#ifdef _WIN32
+       .def     @feat.00;
+       .scl    3;
+       .type   0;
+       .endef
+       PUBLIC  @feat.00
+@feat.00 = 1
+#endif
+
+#endif /* ifndef _MSC_VER */
+#endif /* ifndef __x86_64__ */
+
+#if defined __ELF__ && defined __linux__
+       .section        .note.GNU-stack,"",@progbits
+#endif
+#endif
+
+END
\ No newline at end of file
index c83010c75b5f37afc430de8f3e3fdec1b3b231db..ca6fe0cb4cfabb26f19f56b9654af9ecd1a75cf4 100644 (file)
 #include <fficonfig.h>
 #include <ffi.h>
 #include "internal64.h"
+#include "asmnames.h"
 
        .text
 
-#define C2(X, Y)  X ## Y
-#define C1(X, Y)  C2(X, Y)
-#ifdef __USER_LABEL_PREFIX__
-# define C(X)     C1(__USER_LABEL_PREFIX__, X)
-#else
-# define C(X)     X
-#endif
-
-#ifdef __APPLE__
-# define L(X)     C1(L, X)
-#else
-# define L(X)     C1(.L, X)
-#endif
-
-#ifdef __ELF__
-# define PLT(X)          X@PLT
-# define ENDF(X)  .type        X,@function; .size X, . - X
-#else
-# define PLT(X)          X
-# define ENDF(X)
-#endif
-
 /* This macro allows the safe creation of jump tables without an
    actual table.  The entry points into the table are all 8 bytes.
    The use of ORG asserts that we're at the correct location.  */
 #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
 # define E(BASE, X)    .balign 8
 #else
-# define E(BASE, X)    .balign 8; .org BASE + X * 8
+# ifdef __CET__
+#  define E(BASE, X)   .balign 8; .org BASE + X * 16
+# else
+#  define E(BASE, X)   .balign 8; .org BASE + X * 8
+# endif
 #endif
 
 /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
@@ -79,6 +62,7 @@
 
 C(ffi_call_unix64):
 L(UW0):
+       _CET_ENDBR
        movq    (%rsp), %r10            /* Load return address.  */
        leaq    (%rdi, %rsi), %rax      /* Find local stack base.  */
        movq    %rdx, (%rax)            /* Save flags.  */
@@ -100,7 +84,6 @@ L(UW1):
 
        movq    %rdi, %r10              /* Save a copy of the register area. */
        movq    %r8, %r11               /* Save a copy of the target fn.  */
-       movl    %r9d, %eax              /* Set number of SSE registers.  */
 
        /* Load up all argument registers.  */
        movq    (%r10), %rdi
@@ -109,7 +92,7 @@ L(UW1):
        movq    0x18(%r10), %rcx
        movq    0x20(%r10), %r8
        movq    0x28(%r10), %r9
-       movl    0xb0(%r10), %eax
+       movl    0xb0(%r10), %eax        /* Set number of SSE registers.  */
        testl   %eax, %eax
        jnz     L(load_sse)
 L(ret_from_load_sse):
@@ -137,6 +120,11 @@ L(UW2):
        movzbl  %cl, %r10d
        leaq    L(store_table)(%rip), %r11
        ja      L(sa)
+#ifdef __CET__
+       /* NB: Originally, each slot is 8 byte.  4 bytes of ENDBR64 +
+          4 bytes NOP padding double slot size to 16 bytes.  */
+       addl    %r10d, %r10d
+#endif
        leaq    (%r11, %r10, 8), %r10
 
        /* Prep for the structure cases: scratch area in redzone.  */
@@ -146,57 +134,73 @@ L(UW2):
        .balign 8
 L(store_table):
 E(L(store_table), UNIX64_RET_VOID)
+       _CET_ENDBR
        ret
 E(L(store_table), UNIX64_RET_UINT8)
+       _CET_ENDBR
        movzbl  %al, %eax
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_UINT16)
+       _CET_ENDBR
        movzwl  %ax, %eax
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_UINT32)
+       _CET_ENDBR
        movl    %eax, %eax
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_SINT8)
+       _CET_ENDBR
        movsbq  %al, %rax
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_SINT16)
+       _CET_ENDBR
        movswq  %ax, %rax
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_SINT32)
+       _CET_ENDBR
        cltq
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_INT64)
+       _CET_ENDBR
        movq    %rax, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_XMM32)
+       _CET_ENDBR
        movd    %xmm0, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_XMM64)
+       _CET_ENDBR
        movq    %xmm0, (%rdi)
        ret
 E(L(store_table), UNIX64_RET_X87)
+       _CET_ENDBR
        fstpt   (%rdi)
        ret
 E(L(store_table), UNIX64_RET_X87_2)
+       _CET_ENDBR
        fstpt   (%rdi)
        fstpt   16(%rdi)
        ret
 E(L(store_table), UNIX64_RET_ST_XMM0_RAX)
+       _CET_ENDBR
        movq    %rax, 8(%rsi)
        jmp     L(s3)
 E(L(store_table), UNIX64_RET_ST_RAX_XMM0)
+       _CET_ENDBR
        movq    %xmm0, 8(%rsi)
        jmp     L(s2)
 E(L(store_table), UNIX64_RET_ST_XMM0_XMM1)
+       _CET_ENDBR
        movq    %xmm1, 8(%rsi)
        jmp     L(s3)
 E(L(store_table), UNIX64_RET_ST_RAX_RDX)
+       _CET_ENDBR
        movq    %rdx, 8(%rsi)
 L(s2):
        movq    %rax, (%rsi)
@@ -248,6 +252,7 @@ ENDF(C(ffi_call_unix64))
 
 C(ffi_closure_unix64_sse):
 L(UW5):
+       _CET_ENDBR
        subq    $ffi_closure_FS, %rsp
 L(UW6):
        /* cfi_adjust_cfa_offset(ffi_closure_FS) */
@@ -271,6 +276,7 @@ ENDF(C(ffi_closure_unix64_sse))
 
 C(ffi_closure_unix64):
 L(UW8):
+       _CET_ENDBR
        subq    $ffi_closure_FS, %rsp
 L(UW9):
        /* cfi_adjust_cfa_offset(ffi_closure_FS) */
@@ -295,7 +301,7 @@ L(do_closure):
        leaq    ffi_closure_OFS_RVALUE(%rsp), %rcx      /* Load rvalue */
        movq    %rsp, %r8                               /* Load reg_args */
        leaq    ffi_closure_FS+8(%rsp), %r9             /* Load argp */
-       call    C(ffi_closure_unix64_inner)
+       call    PLT(C(ffi_closure_unix64_inner))
 
        /* Deallocate stack frame early; return value is now in redzone.  */
        addq    $ffi_closure_FS, %rsp
@@ -307,6 +313,11 @@ L(UW10):
        movzbl  %al, %r10d
        leaq    L(load_table)(%rip), %r11
        ja      L(la)
+#ifdef __CET__
+       /* NB: Originally, each slot is 8 byte.  4 bytes of ENDBR64 +
+          4 bytes NOP padding double slot size to 16 bytes.  */
+       addl    %r10d, %r10d
+#endif
        leaq    (%r11, %r10, 8), %r10
        leaq    ffi_closure_RED_RVALUE(%rsp), %rsi
        jmp     *%r10
@@ -314,51 +325,67 @@ L(UW10):
        .balign 8
 L(load_table):
 E(L(load_table), UNIX64_RET_VOID)
+       _CET_ENDBR
        ret
 E(L(load_table), UNIX64_RET_UINT8)
+       _CET_ENDBR
        movzbl  (%rsi), %eax
        ret
 E(L(load_table), UNIX64_RET_UINT16)
+       _CET_ENDBR
        movzwl  (%rsi), %eax
        ret
 E(L(load_table), UNIX64_RET_UINT32)
+       _CET_ENDBR
        movl    (%rsi), %eax
        ret
 E(L(load_table), UNIX64_RET_SINT8)
+       _CET_ENDBR
        movsbl  (%rsi), %eax
        ret
 E(L(load_table), UNIX64_RET_SINT16)
+       _CET_ENDBR
        movswl  (%rsi), %eax
        ret
 E(L(load_table), UNIX64_RET_SINT32)
+       _CET_ENDBR
        movl    (%rsi), %eax
        ret
 E(L(load_table), UNIX64_RET_INT64)
+       _CET_ENDBR
        movq    (%rsi), %rax
        ret
 E(L(load_table), UNIX64_RET_XMM32)
+       _CET_ENDBR
        movd    (%rsi), %xmm0
        ret
 E(L(load_table), UNIX64_RET_XMM64)
+       _CET_ENDBR
        movq    (%rsi), %xmm0
        ret
 E(L(load_table), UNIX64_RET_X87)
+       _CET_ENDBR
        fldt    (%rsi)
        ret
 E(L(load_table), UNIX64_RET_X87_2)
+       _CET_ENDBR
        fldt    16(%rsi)
        fldt    (%rsi)
        ret
 E(L(load_table), UNIX64_RET_ST_XMM0_RAX)
+       _CET_ENDBR
        movq    8(%rsi), %rax
        jmp     L(l3)
 E(L(load_table), UNIX64_RET_ST_RAX_XMM0)
+       _CET_ENDBR
        movq    8(%rsi), %xmm0
        jmp     L(l2)
 E(L(load_table), UNIX64_RET_ST_XMM0_XMM1)
+       _CET_ENDBR
        movq    8(%rsi), %xmm1
        jmp     L(l3)
 E(L(load_table), UNIX64_RET_ST_RAX_RDX)
+       _CET_ENDBR
        movq    8(%rsi), %rdx
 L(l2):
        movq    (%rsi), %rax
@@ -379,6 +406,7 @@ ENDF(C(ffi_closure_unix64))
 
 C(ffi_go_closure_unix64_sse):
 L(UW12):
+       _CET_ENDBR
        subq    $ffi_closure_FS, %rsp
 L(UW13):
        /* cfi_adjust_cfa_offset(ffi_closure_FS) */
@@ -402,6 +430,7 @@ ENDF(C(ffi_go_closure_unix64_sse))
 
 C(ffi_go_closure_unix64):
 L(UW15):
+       _CET_ENDBR
        subq    $ffi_closure_FS, %rsp
 L(UW16):
        /* cfi_adjust_cfa_offset(ffi_closure_FS) */
@@ -427,6 +456,81 @@ L(sse_entry2):
 L(UW17):
 ENDF(C(ffi_go_closure_unix64))
 
+#if defined(FFI_EXEC_STATIC_TRAMP)
+       .balign 8
+       .globl  C(ffi_closure_unix64_sse_alt)
+       FFI_HIDDEN(C(ffi_closure_unix64_sse_alt))
+
+C(ffi_closure_unix64_sse_alt):
+       /* See the comments above trampoline_code_table. */
+       _CET_ENDBR
+       movq    8(%rsp), %r10                   /* Load closure in r10 */
+       addq    $16, %rsp                       /* Restore the stack */
+       jmp     C(ffi_closure_unix64_sse)
+ENDF(C(ffi_closure_unix64_sse_alt))
+
+       .balign 8
+       .globl  C(ffi_closure_unix64_alt)
+       FFI_HIDDEN(C(ffi_closure_unix64_alt))
+
+C(ffi_closure_unix64_alt):
+       /* See the comments above trampoline_code_table. */
+       _CET_ENDBR
+       movq    8(%rsp), %r10                   /* Load closure in r10 */
+       addq    $16, %rsp                       /* Restore the stack */
+       jmp     C(ffi_closure_unix64)
+       ENDF(C(ffi_closure_unix64_alt))
+
+/*
+ * Below is the definition of the trampoline code table. Each element in
+ * the code table is a trampoline.
+ *
+ * Because we jump to the trampoline, we place a _CET_ENDBR at the
+ * beginning of the trampoline to mark it as a valid branch target. This is
+ * part of the the Intel CET (Control Flow Enforcement Technology).
+ */
+/*
+ * The trampoline uses register r10. It saves the original value of r10 on
+ * the stack.
+ *
+ * The trampoline has two parameters - target code to jump to and data for
+ * the target code. The trampoline extracts the parameters from its parameter
+ * block (see tramp_table_map()). The trampoline saves the data address on
+ * the stack. Finally, it jumps to the target code.
+ *
+ * The target code can choose to:
+ *
+ * - restore the value of r10
+ * - load the data address in a register
+ * - restore the stack pointer to what it was when the trampoline was invoked.
+ */
+#ifdef ENDBR_PRESENT
+#define X86_DATA_OFFSET                4077
+#define X86_CODE_OFFSET                4073
+#else
+#define X86_DATA_OFFSET                4081
+#define X86_CODE_OFFSET                4077
+#endif
+
+       .align  UNIX64_TRAMP_MAP_SIZE
+       .globl  trampoline_code_table
+       FFI_HIDDEN(C(trampoline_code_table))
+
+C(trampoline_code_table):
+       .rept   UNIX64_TRAMP_MAP_SIZE / UNIX64_TRAMP_SIZE
+       _CET_ENDBR
+       subq    $16, %rsp                       /* Make space on the stack */
+       movq    %r10, (%rsp)                    /* Save %r10 on stack */
+       movq    X86_DATA_OFFSET(%rip), %r10     /* Copy data into %r10 */
+       movq    %r10, 8(%rsp)                   /* Save data on stack */
+       movq    X86_CODE_OFFSET(%rip), %r10     /* Copy code into %r10 */
+       jmp     *%r10                           /* Jump to code */
+       .align  8
+       .endr
+ENDF(C(trampoline_code_table))
+       .align  UNIX64_TRAMP_MAP_SIZE
+#endif /* FFI_EXEC_STATIC_TRAMP */
+
 /* Sadly, OSX cctools-as doesn't understand .cfi directives at all.  */
 
 #ifdef __APPLE__
@@ -445,7 +549,12 @@ EHFrame0:
 #endif
 
 /* Simplify advancing between labels.  Assume DW_CFA_advance_loc1 fits.  */
-#define ADV(N, P)      .byte 2, L(N)-L(P)
+#ifdef __CET__
+/* Use DW_CFA_advance_loc2 when IBT is enabled.  */
+# define ADV(N, P)     .byte 3; .2byte L(N)-L(P)
+#else
+# define ADV(N, P)     .byte 2, L(N)-L(P)
+#endif
 
        .balign 8
 L(CIE):
@@ -538,6 +647,47 @@ L(SFDE5):
 L(EFDE5):
 #ifdef __APPLE__
        .subsections_via_symbols
+       .section __LD,__compact_unwind,regular,debug
+
+       /* compact unwind for ffi_call_unix64 */
+       .quad    C(ffi_call_unix64)
+       .set     L1,L(UW4)-L(UW0)
+       .long    L1
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_closure_unix64_sse */
+       .quad    C(ffi_closure_unix64_sse)
+       .set     L2,L(UW7)-L(UW5)
+       .long    L2
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_closure_unix64 */
+       .quad    C(ffi_closure_unix64)
+       .set     L3,L(UW11)-L(UW8)
+       .long    L3
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_go_closure_unix64_sse */
+       .quad    C(ffi_go_closure_unix64_sse)
+       .set     L4,L(UW14)-L(UW12)
+       .long    L4
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_go_closure_unix64 */
+       .quad    C(ffi_go_closure_unix64)
+       .set     L5,L(UW17)-L(UW15)
+       .long    L5
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
 #endif
 
 #endif /* __x86_64__ */
index a5a20b6437c1cb260ba8394f323f54e5121e863c..f3ace8d07733f0f6dc9179a50a5acca640c632d1 100644 (file)
@@ -1,27 +1,37 @@
+#ifdef __x86_64__
 #define LIBFFI_ASM
 #include <fficonfig.h>
 #include <ffi.h>
 #include <ffi_cfi.h>
+#include "asmnames.h"
 
 #if defined(HAVE_AS_CFI_PSEUDO_OP)
         .cfi_sections   .debug_frame
 #endif
 
+#ifdef X86_WIN64
+#define SEH(...) __VA_ARGS__
 #define arg0   %rcx
 #define arg1   %rdx
 #define arg2   %r8
 #define arg3   %r9
-
-#ifdef SYMBOL_UNDERSCORE
-#define SYMBOL_NAME(name) _##name
 #else
-#define SYMBOL_NAME(name) name
+#define SEH(...)
+#define arg0   %rdi
+#define arg1   %rsi
+#define arg2   %rdx
+#define arg3   %rcx
 #endif
 
-.macro E which
-       .align  8
-       .org    0b + \which * 8
-.endm
+/* This macro allows the safe creation of jump tables without an
+   actual table.  The entry points into the table are all 8 bytes.
+   The use of ORG asserts that we're at the correct location.  */
+/* ??? The clang assembler doesn't handle .org with symbolic expressions.  */
+#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
+# define E(BASE, X)    .balign 8
+#else
+# define E(BASE, X)    .balign 8; .org BASE + (X) * 8
+#endif
 
        .text
 
    deallocate some of the stack that has been alloca'd.  */
 
        .align  8
-       .globl  ffi_call_win64
+       .globl  C(ffi_call_win64)
+       FFI_HIDDEN(C(ffi_call_win64))
 
-       .seh_proc ffi_call_win64
-ffi_call_win64:
+       SEH(.seh_proc ffi_call_win64)
+C(ffi_call_win64):
        cfi_startproc
+       _CET_ENDBR
        /* Set up the local stack frame and install it in rbp/rsp.  */
        movq    (%rsp), %rax
        movq    %rbp, (arg1)
@@ -44,9 +56,9 @@ ffi_call_win64:
        movq    arg1, %rbp
        cfi_def_cfa(%rbp, 16)
        cfi_rel_offset(%rbp, 0)
-       .seh_pushreg %rbp
-       .seh_setframe %rbp, 0
-       .seh_endprologue
+       SEH(.seh_pushreg %rbp)
+       SEH(.seh_setframe %rbp, 0)
+       SEH(.seh_endprologue)
        movq    arg0, %rsp
 
        movq    arg2, %r10
@@ -69,7 +81,7 @@ ffi_call_win64:
        cmpl    $FFI_TYPE_SMALL_STRUCT_4B, %ecx
        leaq    (%r10, %rcx, 8), %r10
        ja      99f
-       jmp     *%r10
+       _CET_NOTRACK jmp *%r10
 
 /* Below, we're space constrained most of the time.  Thus we eschew the
    modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes).  */
@@ -84,72 +96,73 @@ ffi_call_win64:
 
        .align  8
 0:
-E FFI_TYPE_VOID
+E(0b, FFI_TYPE_VOID)
        epilogue
-E FFI_TYPE_INT
+E(0b, FFI_TYPE_INT)
        movslq  %eax, %rax
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_FLOAT
+E(0b, FFI_TYPE_FLOAT)
        movss   %xmm0, (%r8)
        epilogue
-E FFI_TYPE_DOUBLE
+E(0b, FFI_TYPE_DOUBLE)
        movsd   %xmm0, (%r8)
        epilogue
-E FFI_TYPE_LONGDOUBLE
-       call    abort
-E FFI_TYPE_UINT8
+// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here.
+E(0b, FFI_TYPE_DOUBLE + 1)
+       call    PLT(C(abort))
+E(0b, FFI_TYPE_UINT8)
        movzbl  %al, %eax
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_SINT8
+E(0b, FFI_TYPE_SINT8)
        movsbq  %al, %rax
        jmp     98f
-E FFI_TYPE_UINT16
+E(0b, FFI_TYPE_UINT16)
        movzwl  %ax, %eax
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_SINT16
+E(0b, FFI_TYPE_SINT16)
        movswq  %ax, %rax
        jmp     98f
-E FFI_TYPE_UINT32
+E(0b, FFI_TYPE_UINT32)
        movl    %eax, %eax
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_SINT32
+E(0b, FFI_TYPE_SINT32)
        movslq  %eax, %rax
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_UINT64
+E(0b, FFI_TYPE_UINT64)
 98:    movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_SINT64
+E(0b, FFI_TYPE_SINT64)
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_STRUCT
+E(0b, FFI_TYPE_STRUCT)
        epilogue
-E FFI_TYPE_POINTER
+E(0b, FFI_TYPE_POINTER)
        movq    %rax, (%r8)
        epilogue
-E FFI_TYPE_COMPLEX
-       call    abort
-E FFI_TYPE_SMALL_STRUCT_1B
+E(0b, FFI_TYPE_COMPLEX)
+       call    PLT(C(abort))
+E(0b, FFI_TYPE_SMALL_STRUCT_1B)
        movb    %al, (%r8)
        epilogue
-E FFI_TYPE_SMALL_STRUCT_2B
+E(0b, FFI_TYPE_SMALL_STRUCT_2B)
        movw    %ax, (%r8)
        epilogue
-E FFI_TYPE_SMALL_STRUCT_4B
+E(0b, FFI_TYPE_SMALL_STRUCT_4B)
        movl    %eax, (%r8)
        epilogue
 
        .align  8
-99:    call    abort
+99:    call    PLT(C(abort))
 
-.purgem epilogue
+       epilogue
 
        cfi_endproc
-       .seh_endproc
+       SEH(.seh_endproc)
 
 
 /* 32 bytes of outgoing register stack space, 8 bytes of alignment,
@@ -159,44 +172,48 @@ E FFI_TYPE_SMALL_STRUCT_4B
 #define ffi_clo_OFF_X  (32+8+16)
 
        .align  8
-       .globl  ffi_go_closure_win64
+       .globl  C(ffi_go_closure_win64)
+       FFI_HIDDEN(C(ffi_go_closure_win64))
 
-       .seh_proc ffi_go_closure_win64
-ffi_go_closure_win64:
+       SEH(.seh_proc ffi_go_closure_win64)
+C(ffi_go_closure_win64):
        cfi_startproc
+       _CET_ENDBR
        /* Save all integer arguments into the incoming reg stack space.  */
-       movq    arg0, 8(%rsp)
-       movq    arg1, 16(%rsp)
-       movq    arg2, 24(%rsp)
-       movq    arg3, 32(%rsp)
-
-       movq    8(%r10), arg0                   /* load cif */
-       movq    16(%r10), arg1                  /* load fun */
-       movq    %r10, arg2                      /* closure is user_data */
+       movq    %rcx, 8(%rsp)
+       movq    %rdx, 16(%rsp)
+       movq    %r8, 24(%rsp)
+       movq    %r9, 32(%rsp)
+
+       movq    8(%r10), %rcx                   /* load cif */
+       movq    16(%r10), %rdx                  /* load fun */
+       movq    %r10, %r8                       /* closure is user_data */
        jmp     0f
        cfi_endproc
-       .seh_endproc
+       SEH(.seh_endproc)
 
        .align  8
-       .globl  ffi_closure_win64
+       .globl  C(ffi_closure_win64)
+       FFI_HIDDEN(C(ffi_closure_win64))
 
-       .seh_proc ffi_closure_win64
-ffi_closure_win64:
+       SEH(.seh_proc ffi_closure_win64)
+C(ffi_closure_win64):
        cfi_startproc
+       _CET_ENDBR
        /* Save all integer arguments into the incoming reg stack space.  */
-       movq    arg0, 8(%rsp)
-       movq    arg1, 16(%rsp)
-       movq    arg2, 24(%rsp)
-       movq    arg3, 32(%rsp)
-
-       movq    FFI_TRAMPOLINE_SIZE(%r10), arg0         /* load cif */
-       movq    FFI_TRAMPOLINE_SIZE+8(%r10), arg1       /* load fun */
-       movq    FFI_TRAMPOLINE_SIZE+16(%r10), arg2      /* load user_data */
+       movq    %rcx, 8(%rsp)
+       movq    %rdx, 16(%rsp)
+       movq    %r8, 24(%rsp)
+       movq    %r9, 32(%rsp)
+
+       movq    FFI_TRAMPOLINE_SIZE(%r10), %rcx         /* load cif */
+       movq    FFI_TRAMPOLINE_SIZE+8(%r10), %rdx       /* load fun */
+       movq    FFI_TRAMPOLINE_SIZE+16(%r10), %r8       /* load user_data */
 0:
        subq    $ffi_clo_FS, %rsp
        cfi_adjust_cfa_offset(ffi_clo_FS)
-       .seh_stackalloc ffi_clo_FS
-       .seh_endprologue
+       SEH(.seh_stackalloc ffi_clo_FS)
+       SEH(.seh_endprologue)
 
        /* Save all sse arguments into the stack frame.  */
        movsd   %xmm0, ffi_clo_OFF_X(%rsp)
@@ -204,8 +221,8 @@ ffi_closure_win64:
        movsd   %xmm2, ffi_clo_OFF_X+16(%rsp)
        movsd   %xmm3, ffi_clo_OFF_X+24(%rsp)
 
-       leaq    ffi_clo_OFF_R(%rsp), arg3
-       call    ffi_closure_win64_inner
+       leaq    ffi_clo_OFF_R(%rsp), %r9
+       call    PLT(C(ffi_closure_win64_inner))
 
        /* Load the result into both possible result registers.  */
        movq    ffi_clo_OFF_R(%rsp), %rax
@@ -216,4 +233,23 @@ ffi_closure_win64:
        ret
 
        cfi_endproc
-       .seh_endproc
+       SEH(.seh_endproc)
+
+#if defined(FFI_EXEC_STATIC_TRAMP)
+       .align  8
+       .globl  C(ffi_closure_win64_alt)
+       FFI_HIDDEN(C(ffi_closure_win64_alt))
+
+       SEH(.seh_proc ffi_closure_win64_alt)
+C(ffi_closure_win64_alt):
+       _CET_ENDBR
+       movq    8(%rsp), %r10
+       addq    $16, %rsp
+       jmp     C(ffi_closure_win64)
+       SEH(.seh_endproc)
+#endif
+#endif /* __x86_64__ */
+
+#if defined __ELF__ && defined __linux__
+       .section        .note.GNU-stack,"",@progbits
+#endif
diff --git a/libffi/src/x86/win64_intel.S b/libffi/src/x86/win64_intel.S
new file mode 100644 (file)
index 0000000..970a4f9
--- /dev/null
@@ -0,0 +1,238 @@
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+#include <ffi_cfi.h>
+#include "asmnames.h"
+
+#if defined(HAVE_AS_CFI_PSEUDO_OP)
+        .cfi_sections   .debug_frame
+#endif
+
+#ifdef X86_WIN64
+#define SEH(...) __VA_ARGS__
+#define arg0   rcx
+#define arg1   rdx
+#define arg2   r8
+#define arg3   r9
+#else
+#define SEH(...)
+#define arg0   rdi
+#define arg1   rsi
+#define arg2   rdx
+#define arg3   rcx
+#endif
+
+/* This macro allows the safe creation of jump tables without an
+   actual table.  The entry points into the table are all 8 bytes.
+   The use of ORG asserts that we're at the correct location.  */
+/* ??? The clang assembler doesn't handle .org with symbolic expressions.  */
+#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
+# define E(BASE, X)    ALIGN 8
+#else
+# define E(BASE, X)    ALIGN 8; ORG BASE + (X) * 8
+#endif
+
+       .CODE
+       extern PLT(C(abort)):near
+       extern C(ffi_closure_win64_inner):near
+
+/* ffi_call_win64 (void *stack, struct win64_call_frame *frame, void *r10)
+
+   Bit o trickiness here -- FRAME is the base of the stack frame
+   for this function.  This has been allocated by ffi_call.  We also
+   deallocate some of the stack that has been alloca'd.  */
+
+       ALIGN   8
+       PUBLIC  C(ffi_call_win64)
+
+       ; SEH(.safesh ffi_call_win64)
+C(ffi_call_win64) proc SEH(frame)
+       cfi_startproc
+       /* Set up the local stack frame and install it in rbp/rsp.  */
+       mov     RAX, [RSP] ;    movq    (%rsp), %rax
+       mov [arg1], RBP ; movq  %rbp, (arg1)
+       mov [arg1 + 8], RAX;    movq    %rax, 8(arg1)
+       mov      RBP, arg1; movq        arg1, %rbp
+       cfi_def_cfa(rbp, 16)
+       cfi_rel_offset(rbp, 0)
+       SEH(.pushreg rbp)
+       SEH(.setframe rbp, 0)
+       SEH(.endprolog)
+       mov     RSP, arg0 ;     movq    arg0, %rsp
+
+       mov     R10, arg2 ; movq        arg2, %r10
+
+       /* Load all slots into both general and xmm registers.  */
+       mov     RCX, [RSP] ;    movq    (%rsp), %rcx
+       movsd XMM0, qword ptr [RSP] ; movsd     (%rsp), %xmm0
+       mov     RDX, [RSP + 8] ;movq    8(%rsp), %rdx
+       movsd XMM1, qword ptr [RSP + 8];        movsd   8(%rsp), %xmm1
+       mov R8, [RSP + 16] ; movq       16(%rsp), %r8
+       movsd   XMM2, qword ptr [RSP + 16] ; movsd      16(%rsp), %xmm2
+       mov     R9, [RSP + 24] ; movq   24(%rsp), %r9
+       movsd   XMM3, qword ptr [RSP + 24] ;movsd       24(%rsp), %xmm3
+
+       CALL qword ptr [RBP + 16] ; call        *16(%rbp)
+
+       mov      ECX, [RBP + 24] ; movl 24(%rbp), %ecx
+       mov     R8, [RBP + 32] ; movq   32(%rbp), %r8
+       LEA     R10, ffi_call_win64_tab ; leaq  0f(%rip), %r10
+       CMP     ECX, FFI_TYPE_SMALL_STRUCT_4B ; cmpl    $FFI_TYPE_SMALL_STRUCT_4B, %ecx
+       LEA     R10, [R10 + RCX*8] ; leaq       (%r10, %rcx, 8), %r10
+       JA      L99 ; ja        99f
+       JMP     R10 ; jmp       *%r10
+
+/* Below, we're space constrained most of the time.  Thus we eschew the
+   modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes).  */
+epilogue macro
+       LEAVE
+       cfi_remember_state
+       cfi_def_cfa(rsp, 8)
+       cfi_restore(rbp)
+       RET
+       cfi_restore_state
+endm
+
+       ALIGN 8
+ffi_call_win64_tab LABEL NEAR
+E(0b, FFI_TYPE_VOID)
+       epilogue
+E(0b, FFI_TYPE_INT)
+       movsxd rax, eax ; movslq        %eax, %rax
+       mov qword ptr [r8], rax; movq   %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_FLOAT)
+       movss dword ptr [r8], xmm0 ; movss      %xmm0, (%r8)
+       epilogue
+E(0b, FFI_TYPE_DOUBLE)
+       movsd qword ptr[r8], xmm0; movsd        %xmm0, (%r8)
+       epilogue
+// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here.
+E(0b, FFI_TYPE_DOUBLE + 1)
+       call    PLT(C(abort))
+E(0b, FFI_TYPE_UINT8)
+       movzx eax, al ;movzbl   %al, %eax
+       mov qword ptr[r8], rax; movq    %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_SINT8)
+       movsx rax, al ; movsbq  %al, %rax
+       jmp     L98
+E(0b, FFI_TYPE_UINT16)
+       movzx eax, ax ; movzwl  %ax, %eax
+       mov qword ptr[r8], rax; movq    %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_SINT16)
+       movsx rax, ax; movswq   %ax, %rax
+       jmp     L98
+E(0b, FFI_TYPE_UINT32)
+       mov eax, eax; movl      %eax, %eax
+       mov qword ptr[r8], rax ; movq   %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_SINT32)
+       movsxd rax, eax; movslq %eax, %rax
+       mov qword ptr [r8], rax; movq   %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_UINT64)
+L98 LABEL near
+       mov qword ptr [r8], rax ; movq  %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_SINT64)
+       mov qword ptr [r8], rax;movq    %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_STRUCT)
+       epilogue
+E(0b, FFI_TYPE_POINTER)
+       mov qword ptr [r8], rax ;movq   %rax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_COMPLEX)
+       call    PLT(C(abort))
+E(0b, FFI_TYPE_SMALL_STRUCT_1B)
+       mov byte ptr [r8], al ; movb    %al, (%r8)
+       epilogue
+E(0b, FFI_TYPE_SMALL_STRUCT_2B)
+       mov word ptr [r8], ax ; movw    %ax, (%r8)
+       epilogue
+E(0b, FFI_TYPE_SMALL_STRUCT_4B)
+       mov dword ptr [r8], eax ; movl  %eax, (%r8)
+       epilogue
+
+       align   8
+L99 LABEL near
+       call    PLT(C(abort))
+
+       epilogue
+
+       cfi_endproc
+       C(ffi_call_win64) endp
+
+
+/* 32 bytes of outgoing register stack space, 8 bytes of alignment,
+   16 bytes of result, 32 bytes of xmm registers.  */
+#define ffi_clo_FS     (32+8+16+32)
+#define ffi_clo_OFF_R  (32+8)
+#define ffi_clo_OFF_X  (32+8+16)
+
+       align   8
+       PUBLIC  C(ffi_go_closure_win64)
+
+C(ffi_go_closure_win64) proc
+       cfi_startproc
+       /* Save all integer arguments into the incoming reg stack space.  */
+       mov qword ptr [rsp + 8], rcx; movq      %rcx, 8(%rsp)
+       mov qword ptr [rsp + 16], rdx; movq     %rdx, 16(%rsp)
+       mov qword ptr [rsp + 24], r8; movq      %r8, 24(%rsp)
+       mov qword ptr [rsp + 32], r9 ;movq      %r9, 32(%rsp)
+
+       mov rcx, qword ptr [r10 + 8]; movq      8(%r10), %rcx                   /* load cif */
+       mov rdx, qword ptr [r10 + 16];  movq    16(%r10), %rdx                  /* load fun */
+       mov r8, r10 ; movq      %r10, %r8                       /* closure is user_data */
+       jmp     ffi_closure_win64_2
+       cfi_endproc
+       C(ffi_go_closure_win64) endp
+
+       align   8
+       
+PUBLIC C(ffi_closure_win64)
+C(ffi_closure_win64) PROC FRAME
+       cfi_startproc
+       /* Save all integer arguments into the incoming reg stack space.  */
+       mov qword ptr [rsp + 8], rcx; movq      %rcx, 8(%rsp)
+       mov qword ptr [rsp + 16], rdx;  movq    %rdx, 16(%rsp)
+       mov qword ptr [rsp + 24], r8;   movq    %r8, 24(%rsp)
+       mov qword ptr [rsp + 32], r9;   movq    %r9, 32(%rsp)
+
+       mov rcx, qword ptr [FFI_TRAMPOLINE_SIZE + r10]  ;movq   FFI_TRAMPOLINE_SIZE(%r10), %rcx         /* load cif */
+       mov rdx, qword ptr [FFI_TRAMPOLINE_SIZE + 8 + r10] ;    movq    FFI_TRAMPOLINE_SIZE+8(%r10), %rdx       /* load fun */
+       mov r8, qword ptr [FFI_TRAMPOLINE_SIZE+16+r10] ;movq    FFI_TRAMPOLINE_SIZE+16(%r10), %r8       /* load user_data */
+ffi_closure_win64_2 LABEL near
+       sub rsp, ffi_clo_FS ;subq       $ffi_clo_FS, %rsp
+       cfi_adjust_cfa_offset(ffi_clo_FS)
+       SEH(.allocstack ffi_clo_FS)
+       SEH(.endprolog)
+
+       /* Save all sse arguments into the stack frame.  */
+       movsd qword ptr [ffi_clo_OFF_X + rsp], xmm0     ; movsd %xmm0, ffi_clo_OFF_X(%rsp)
+       movsd qword ptr [ffi_clo_OFF_X+8+rsp], xmm1 ; movsd     %xmm1, ffi_clo_OFF_X+8(%rsp)
+       movsd qword ptr [ffi_clo_OFF_X+16+rsp], xmm2 ; movsd %xmm2, ffi_clo_OFF_X+16(%rsp)
+       movsd qword ptr [ffi_clo_OFF_X+24+rsp], xmm3 ; movsd %xmm3, ffi_clo_OFF_X+24(%rsp)
+
+       lea     r9, [ffi_clo_OFF_R + rsp] ; leaq        ffi_clo_OFF_R(%rsp), %r9
+       call C(ffi_closure_win64_inner)
+
+       /* Load the result into both possible result registers.  */
+       
+       mov rax, qword ptr [ffi_clo_OFF_R + rsp] ;movq    ffi_clo_OFF_R(%rsp), %rax
+       movsd xmm0, qword ptr [rsp + ffi_clo_OFF_R] ;movsd   ffi_clo_OFF_R(%rsp), %xmm0
+
+       add rsp, ffi_clo_FS ;addq       $ffi_clo_FS, %rsp
+       cfi_adjust_cfa_offset(-ffi_clo_FS)
+       ret
+
+       cfi_endproc
+       C(ffi_closure_win64) endp
+
+#if defined __ELF__ && defined __linux__
+       .section        .note.GNU-stack,"",@progbits
+#endif
+_text ends
+end
\ No newline at end of file
index fd94dafbe30349e7e557e3a870333656288ba234..9a0575ff90d44ef74fee170e1bc4b3800b75eedf 100644 (file)
@@ -89,7 +89,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   /* Round the stack up to a full 4 register frame, just in case
      (we use this size in movsp). This way, it's also a  multiple of
      8 bytes for 64-bit arguments.  */
-  cif->bytes = ALIGN(cif->bytes, 16);
+  cif->bytes = FFI_ALIGN(cif->bytes, 16);
 
   return FFI_OK;
 }
@@ -205,7 +205,7 @@ void ffi_call(ffi_cif* cif, void(*fn)(void), void *rvalue, void **avalue)
 
   if (flags == FFI_TYPE_STRUCT && (rsize <= 16 || rvalue == NULL))
   {
-    alloc = alloca(ALIGN(rsize, 4));
+    alloc = alloca(FFI_ALIGN(rsize, 4));
     ecif.rvalue = alloc;
   }
   else
index 64e6a0918d0248d9d19177769ccf8fc91c6cb872..e9421796fd868ea6898552114d714e8e37867392 100644 (file)
@@ -169,8 +169,13 @@ ENTRY(ffi_cacheflush)
 
        entry   a1, 16
 
-1:     dhwbi   a2, 0
+1:     
+#if XCHAL_DCACHE_SIZE
+       dhwbi   a2, 0
+#endif
+#if XCHAL_ICACHE_SIZE
        ihi     a2, 0
+#endif
        addi    a2, a2, 4
        blt     a2, a3, 1b
 
index 88509fc35d6d1f7a494e270874dac48d42b5419c..1e4b35a34117defde95a90ae614032339f550910 100644 (file)
 
 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
 
-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/return_ul.c libffi.call/cls_align_double.c                 \
-libffi.call/return_fl2.c libffi.call/cls_1_1byte.c                     \
-libffi.call/cls_64byte.c libffi.call/nested_struct7.c                  \
-libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c            \
-libffi.call/ffitest.h libffi.call/nested_struct4.c                     \
-libffi.call/cls_multi_ushort.c libffi.call/struct3.c                   \
-libffi.call/cls_3byte1.c libffi.call/cls_16byte.c                      \
-libffi.call/struct8.c libffi.call/nested_struct8.c                     \
-libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c                        \
-libffi.call/cls_pointer.c                      \
-libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c                        \
-libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c                 \
-libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c                 \
-libffi.call/call.exp libffi.call/cls_double.c                          \
-libffi.call/cls_align_sint16.c libffi.call/cls_uint.c                  \
-libffi.call/return_ll1.c libffi.call/nested_struct3.c                  \
-libffi.call/cls_20byte1.c libffi.call/closure_fn4.c                    \
-libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c  \
-libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c      \
-libffi.call/return_fl.c libffi.call/struct5.c                          \
-libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c            \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c    \
-libffi.call/return_fl3.c libffi.call/stret_medium.c                    \
-libffi.call/nested_struct6.c libffi.call/closure_fn3.c                 \
-libffi.call/float3.c libffi.call/many2.c                               \
-libffi.call/closure_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/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/cls_18byte.c libffi.call/cls_8byte.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                     \
-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/cls_align_sint64.c         \
-libffi.call/stret_large2.c libffi.call/return_sl.c                     \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c                      \
-libffi.call/cls_2byte.c libffi.call/float2.c                           \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c                   \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c                  \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c                  \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c              \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c                \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c             \
-libffi.call/struct1.c libffi.call/nested_struct9.c                     \
-libffi.call/huge_struct.c libffi.call/problem1.c                       \
-libffi.call/float4.c \
-libffi.call/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/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/strlen2.c \
-libffi.call/strlen3.c \
-libffi.call/strlen4.c
+EXTRA_DIST = lib/target-libpath.exp lib/libffi.exp lib/wrapper.exp \
+libffi.call/strlen4.c libffi.call/struct10.c libffi.call/many_mixed.c \
+libffi.call/float.c libffi.call/struct5.c libffi.call/return_fl3.c \
+libffi.call/return_fl1.c libffi.call/call.exp libffi.call/pyobjc-tc.c \
+libffi.call/float_va.c libffi.call/struct8.c libffi.call/pr1172638.c \
+libffi.call/return_sc.c libffi.call/va_struct1.c \
+libffi.call/align_stdcall.c libffi.call/struct9.c libffi.call/va_1.c \
+libffi.call/va_2.c libffi.call/va_struct2.c libffi.call/return_fl2.c \
+libffi.call/align_mixed.c libffi.call/ffitest.h libffi.call/struct4.c \
+libffi.call/return_ldl.c libffi.call/float3.c libffi.call/return_sl.c \
+libffi.call/return_dbl1.c libffi.call/err_bad_typedef.c \
+libffi.call/return_ll1.c libffi.call/return_dbl2.c \
+libffi.call/negint.c libffi.closures/nested_struct3.c \
+libffi.call/struct2.c libffi.call/struct3.c libffi.call/return_fl.c \
+libffi.call/offsets.c libffi.call/struct7.c libffi.call/va_struct3.c \
+libffi.call/float1.c libffi.call/uninitialized.c libffi.call/many2.c \
+libffi.call/struct6.c libffi.call/strlen2.c libffi.call/float2.c \
+libffi.call/return_ul.c libffi.call/struct1.c libffi.call/strlen3.c \
+libffi.call/return_dbl.c libffi.call/float4.c libffi.call/many.c \
+libffi.call/strlen.c libffi.call/return_uc.c libffi.call/many_double.c \
+libffi.call/return_ll.c libffi.call/promotion.c \
+libffi.complex/complex_defs_longdouble.inc \
+libffi.complex/cls_align_complex_float.c \
+libffi.complex/cls_complex_va_float.c \
+libffi.complex/cls_complex_struct_float.c \
+libffi.complex/return_complex2_longdouble.c \
+libffi.complex/cls_complex_float.c \
+libffi.complex/return_complex_longdouble.c \
+libffi.complex/return_complex2_float.c libffi.complex/cls_complex.inc \
+libffi.complex/cls_complex_va_longdouble.c \
+libffi.complex/return_complex_double.c \
+libffi.complex/return_complex.inc libffi.complex/many_complex.inc \
+libffi.complex/complex_float.c libffi.complex/cls_align_complex.inc \
+libffi.complex/return_complex2_double.c \
+libffi.complex/many_complex_float.c libffi.complex/ffitest.h \
+libffi.complex/return_complex1_double.c \
+libffi.complex/cls_complex_struct_longdouble.c \
+libffi.complex/complex_defs_double.inc \
+libffi.complex/cls_complex_va_double.c \
+libffi.complex/many_complex_double.c \
+libffi.complex/return_complex2.inc \
+libffi.complex/return_complex1_float.c \
+libffi.complex/complex_longdouble.c \
+libffi.complex/complex_defs_float.inc \
+libffi.complex/cls_complex_double.c \
+libffi.complex/cls_align_complex_double.c \
+libffi.complex/cls_align_complex_longdouble.c \
+libffi.complex/complex_double.c libffi.complex/cls_complex_va.inc \
+libffi.complex/many_complex_longdouble.c libffi.complex/complex.inc \
+libffi.complex/return_complex1_longdouble.c \
+libffi.complex/complex_int.c libffi.complex/cls_complex_longdouble.c \
+libffi.complex/cls_complex_struct_double.c \
+libffi.complex/return_complex1.inc libffi.complex/complex.exp \
+libffi.complex/cls_complex_struct.inc \
+libffi.complex/return_complex_float.c libffi.go/closure1.c \
+libffi.go/aa-direct.c libffi.go/ffitest.h libffi.go/go.exp \
+libffi.go/static-chain.h libffi.bhaible/bhaible.exp \
+libffi.bhaible/test-call.c libffi.bhaible/alignof.h \
+libffi.bhaible/testcases.c libffi.bhaible/test-callback.c \
+libffi.bhaible/Makefile libffi.bhaible/README config/default.exp \
+libffi.closures/cls_multi_sshort.c \
+libffi.closures/cls_align_longdouble_split2.c \
+libffi.closures/cls_1_1byte.c libffi.closures/cls_uint_va.c \
+libffi.closures/cls_3_1byte.c libffi.closures/cls_many_mixed_args.c \
+libffi.closures/cls_20byte1.c libffi.closures/cls_pointer_stack.c \
+libffi.closures/cls_align_float.c libffi.closures/cls_5_1_byte.c \
+libffi.closures/cls_9byte1.c libffi.closures/cls_align_uint32.c \
+libffi.closures/stret_medium.c libffi.closures/cls_3byte1.c \
+libffi.closures/cls_align_uint64.c libffi.closures/cls_longdouble_va.c \
+libffi.closures/cls_align_pointer.c libffi.closures/cls_19byte.c \
+libffi.closures/cls_ushort.c libffi.closures/cls_align_sint32.c \
+libffi.closures/cls_ulonglong.c libffi.closures/cls_struct_va1.c \
+libffi.closures/cls_9byte2.c libffi.closures/closure_fn5.c \
+libffi.closures/cls_5byte.c libffi.closures/cls_3float.c \
+libffi.closures/closure.exp libffi.closures/cls_schar.c \
+libffi.closures/closure_fn4.c \
+libffi.closures/closure_fn0.c libffi.closures/huge_struct.c \
+libffi.closures/cls_64byte.c libffi.closures/cls_longdouble.c \
+libffi.closures/cls_ulong_va.c libffi.closures/cls_6_1_byte.c \
+libffi.closures/cls_align_uint16.c libffi.closures/closure_fn2.c \
+libffi.closures/unwindtest_ffi_call.cc \
+libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_8byte.c \
+libffi.closures/ffitest.h libffi.closures/nested_struct8.c \
+libffi.closures/cls_pointer.c libffi.closures/nested_struct2.c \
+libffi.closures/nested_struct.c libffi.closures/cls_multi_schar.c \
+libffi.closures/cls_align_longdouble_split.c \
+libffi.closures/cls_uchar.c libffi.closures/nested_struct9.c \
+libffi.closures/cls_float.c libffi.closures/stret_medium2.c \
+libffi.closures/closure_loc_fn0.c libffi.closures/cls_6byte.c \
+libffi.closures/closure_simple.c libffi.closures/cls_align_double.c \
+libffi.closures/cls_multi_uchar.c libffi.closures/cls_4_1byte.c \
+libffi.closures/closure_fn3.c libffi.closures/cls_align_sint64.c \
+libffi.closures/nested_struct1.c libffi.closures/unwindtest.cc \
+libffi.closures/nested_struct5.c libffi.closures/cls_multi_ushort.c \
+libffi.closures/nested_struct11.c \
+libffi.closures/nested_struct12.c \
+libffi.closures/nested_struct13.c \
+libffi.closures/cls_multi_sshortchar.c \
+libffi.closures/cls_align_longdouble.c \
+libffi.closures/cls_dbls_struct.c \
+libffi.closures/cls_many_mixed_float_double.c \
+libffi.closures/stret_large.c libffi.closures/stret_large2.c \
+libffi.closures/cls_align_sint16.c libffi.closures/cls_2byte.c \
+libffi.closures/nested_struct4.c libffi.closures/problem1.c \
+libffi.closures/testclosure.c libffi.closures/nested_struct6.c \
+libffi.closures/cls_4byte.c libffi.closures/cls_24byte.c \
+libffi.closures/nested_struct10.c libffi.closures/cls_uint.c \
+libffi.closures/cls_12byte.c libffi.closures/cls_sint.c \
+libffi.closures/cls_7_1_byte.c libffi.closures/cls_sshort.c \
+libffi.closures/cls_16byte.c libffi.closures/nested_struct7.c \
+libffi.closures/cls_double_va.c libffi.closures/cls_3byte2.c \
+libffi.closures/cls_double.c libffi.closures/cls_7byte.c \
+libffi.closures/closure_fn6.c libffi.closures/closure_fn1.c \
+libffi.closures/cls_20byte.c libffi.closures/cls_18byte.c \
+libffi.closures/err_bad_abi.c \
+libffi.closures/single_entry_structs1.c \
+libffi.closures/single_entry_structs2.c \
+libffi.closures/single_entry_structs3.c
diff --git a/libffi/testsuite/Makefile.in b/libffi/testsuite/Makefile.in
deleted file mode 100644 (file)
index 8b574da..0000000
+++ /dev/null
@@ -1,572 +0,0 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-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 \
-      *\\[\ \  ]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
-    esac; \
-  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@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = testsuite
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
-       $(top_srcdir)/../config/asmcfi.m4 \
-       $(top_srcdir)/../config/depstand.m4 \
-       $(top_srcdir)/../config/lead-dot.m4 \
-       $(top_srcdir)/../config/multi.m4 \
-       $(top_srcdir)/../config/override.m4 \
-       $(top_srcdir)/../config/toolexeclibdir.m4 \
-       $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
-       $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
-       $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-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 =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    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
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = 
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-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@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OPT_LDFLAGS = @OPT_LDFLAGS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-TARGET_OBJ = @TARGET_OBJ@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-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@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-get_gcc_base_ver = @get_gcc_base_ver@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-multi_basedir = @multi_basedir@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-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/return_ul.c libffi.call/cls_align_double.c                 \
-libffi.call/return_fl2.c libffi.call/cls_1_1byte.c                     \
-libffi.call/cls_64byte.c libffi.call/nested_struct7.c                  \
-libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c            \
-libffi.call/ffitest.h libffi.call/nested_struct4.c                     \
-libffi.call/cls_multi_ushort.c libffi.call/struct3.c                   \
-libffi.call/cls_3byte1.c libffi.call/cls_16byte.c                      \
-libffi.call/struct8.c libffi.call/nested_struct8.c                     \
-libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c                        \
-libffi.call/cls_pointer.c                      \
-libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c                        \
-libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c                 \
-libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c                 \
-libffi.call/call.exp libffi.call/cls_double.c                          \
-libffi.call/cls_align_sint16.c libffi.call/cls_uint.c                  \
-libffi.call/return_ll1.c libffi.call/nested_struct3.c                  \
-libffi.call/cls_20byte1.c libffi.call/closure_fn4.c                    \
-libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c  \
-libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c      \
-libffi.call/return_fl.c libffi.call/struct5.c                          \
-libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c            \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c    \
-libffi.call/return_fl3.c libffi.call/stret_medium.c                    \
-libffi.call/nested_struct6.c libffi.call/closure_fn3.c                 \
-libffi.call/float3.c libffi.call/many2.c                               \
-libffi.call/closure_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/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/cls_18byte.c libffi.call/cls_8byte.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                     \
-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/cls_align_sint64.c         \
-libffi.call/stret_large2.c libffi.call/return_sl.c                     \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c                      \
-libffi.call/cls_2byte.c libffi.call/float2.c                           \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c                   \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c                  \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c                  \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c              \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c                \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c             \
-libffi.call/struct1.c libffi.call/nested_struct9.c                     \
-libffi.call/huge_struct.c libffi.call/problem1.c                       \
-libffi.call/float4.c \
-libffi.call/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/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/strlen2.c \
-libffi.call/strlen3.c \
-libffi.call/strlen4.c
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-               && { if test -f $@; then exit 0; else break; fi; }; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
-       $(am__cd) $(top_srcdir) && \
-         $(AUTOMAKE) --foreign testsuite/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-       esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-check-DEJAGNU: site.exp
-       srcdir='$(srcdir)'; export srcdir; \
-       EXPECT=$(EXPECT); export EXPECT; \
-       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); \
-           then :; else exit_status=1; fi; \
-         done; \
-       else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
-       fi; \
-       exit $$exit_status
-site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
-       @echo 'Making a new site.exp file ...'
-       @echo '## these variables are automatically generated by make ##' >site.tmp
-       @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
-       @echo '# edit the last section' >>site.tmp
-       @echo 'set srcdir "$(srcdir)"' >>site.tmp
-       @echo "set objdir `pwd`" >>site.tmp
-       @echo 'set build_alias "$(build_alias)"' >>site.tmp
-       @echo 'set build_triplet $(build_triplet)' >>site.tmp
-       @echo 'set host_alias "$(host_alias)"' >>site.tmp
-       @echo 'set host_triplet $(host_triplet)' >>site.tmp
-       @echo 'set target_alias "$(target_alias)"' >>site.tmp
-       @echo 'set target_triplet $(target_triplet)' >>site.tmp
-       @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
-         echo "## Begin content included from file $$f.  Do not modify. ##" \
-          && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
-          && echo "## End content included from file $$f. ##" \
-          || exit 1; \
-        done >> site.tmp
-       @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
-       @if test -f site.exp; then \
-          sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
-        fi
-       @-rm -f site.bak
-       @test ! -f site.exp || mv site.exp site.bak
-       @mv site.tmp site.exp
-
-distclean-DEJAGNU:
-       -rm -f site.exp site.bak
-       -l='$(DEJATOOL)'; for tool in $$l; do \
-         rm -f $$tool.sum $$tool.log; \
-       done
-check-am: all-am
-       $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-       if test -z '$(STRIP)'; then \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-             install; \
-       else \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
-mostlyclean-generic:
-
-clean-generic:
-       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-       -rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: check-am install-am install-strip
-
-.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
-       clean-libtool cscopelist-am ctags-am distclean \
-       distclean-DEJAGNU distclean-generic distclean-libtool 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
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
index a0f6ab397ee8e134ed3ba82a920e4ace1fd9529d..4f4dd48d2c61b06629059ae1c77a2b3347b57f15 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014 Free Software Foundation, Inc.
+#   Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019 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
 # <http://www.gnu.org/licenses/>.
 
 proc load_gcc_lib { filename } {
-    global srcdir loaded_libs
-
-    load_file $srcdir/../../gcc/testsuite/lib/$filename
-    set loaded_libs($filename) ""
+    global srcdir
+    load_file $srcdir/lib/$filename
 }
 
 load_lib dg.exp
 load_lib libgloss.exp
-load_gcc_lib target-supports.exp
-load_gcc_lib target-supports-dg.exp
 load_gcc_lib target-libpath.exp
 load_gcc_lib wrapper.exp
 
+proc check_effective_target_gccbug { } {
+    global has_gccbug
+    return $has_gccbug
+}
+
+# Return 1 if the target matches the effective target 'arg', 0 otherwise.
+# This can be used with any check_* proc that takes no argument and
+# returns only 1 or 0.  It could be used with check_* procs that take
+# arguments with keywords that pass particular arguments.
+
+proc is-effective-target { arg } {
+    global et_index
+    set selected 0
+    if { ![info exists et_index] } {
+       # Initialize the effective target index that is used in some
+       # check_effective_target_* procs.
+       set et_index 0
+    }
+    if { [info procs check_effective_target_${arg}] != [list] } {
+       set selected [check_effective_target_${arg}]
+    } else {
+       error "unknown effective target keyword `$arg'" 
+    }
+    verbose "is-effective-target: $arg $selected" 2
+    return $selected
+}
+
+proc is-effective-target-keyword { arg } {
+    if { [info procs check_effective_target_${arg}] != [list] } {
+       return 1
+    } else {
+       return 0
+    }
+}
+
+# Intercept the call to the DejaGnu version of dg-process-target to
+# support use of an effective-target keyword in place of a list of
+# target triplets to xfail or skip a test.
+#
+# The argument to dg-process-target is the keyword "target" or "xfail"
+# followed by a selector:
+#    target-triplet-1 ...
+#    effective-target-keyword
+#    selector-expression
+#
+# For a target list the result is "S" if the target is selected, "N" otherwise.
+# For an xfail list the result is "F" if the target is affected, "P" otherwise.
+
+# In contexts that allow either "target" or "xfail" the argument can be
+#    target selector1 xfail selector2
+# which returns "N" if selector1 is not selected, otherwise the result of
+# "xfail selector2".
+#
+# A selector expression appears within curly braces and uses a single logical
+# operator: !, &&, or ||.  An operand is another selector expression, an
+# effective-target keyword, or a list of target triplets within quotes or
+# curly braces.
+
+if { [info procs saved-dg-process-target] == [list] } {
+    rename dg-process-target saved-dg-process-target
+
+    # Evaluate an operand within a selector expression.
+    proc selector_opd { op } {
+       set selector "target"
+       lappend selector $op
+       set answer [ expr { [dg-process-target $selector] == "S" } ]
+       verbose "selector_opd: `$op' $answer" 2
+       return $answer
+    }
+
+    # Evaluate a target triplet list within a selector expression.
+    # Unlike other operands, this needs to be expanded from a list to
+    # the same string as "target".
+    proc selector_list { op } {
+       set selector "target [join $op]"
+       set answer [ expr { [dg-process-target $selector] == "S" } ]
+       verbose "selector_list: `$op' $answer" 2
+       return $answer
+    }
+
+    # Evaluate a selector expression.
+    proc selector_expression { exp } {
+       if { [llength $exp] == 2 } {
+           if [string match "!" [lindex $exp 0]] {
+               set op1 [lindex $exp 1]
+               set answer [expr { ! [selector_opd $op1] }]
+           } else {
+               # Assume it's a list of target triplets.
+               set answer [selector_list $exp]
+           }
+       } elseif { [llength $exp] == 3 } {
+           set op1 [lindex $exp 0]
+           set opr [lindex $exp 1]
+           set op2 [lindex $exp 2]
+           if [string match "&&" $opr] {
+               set answer [expr { [selector_opd $op1] && [selector_opd $op2] }]
+           } elseif [string match "||" $opr] {
+               set answer [expr { [selector_opd $op1] || [selector_opd $op2] }]
+           } else {
+               # Assume it's a list of target triplets.
+               set answer [selector_list $exp]
+           }
+       } else {
+           # Assume it's a list of target triplets.
+           set answer [selector_list $exp]
+       }
+
+       verbose "selector_expression: `$exp' $answer" 2
+       return $answer
+    }
+
+    # Evaluate "target selector" or "xfail selector".
+
+    proc dg-process-target-1 { args } {
+       verbose "dg-process-target-1: `$args'" 2
+
+       # Extract the 'what' keyword from the argument list.
+       set selector [string trim [lindex $args 0]]
+       if [regexp "^xfail " $selector] {
+           set what "xfail"
+       } elseif [regexp "^target " $selector] {
+           set what "target"
+       } else {
+           error "syntax error in target selector \"$selector\""
+       }
+
+       # Extract the rest of the list, which might be a keyword.
+       regsub "^${what}" $selector "" rest
+       set rest [string trim $rest]
+
+       if [is-effective-target-keyword $rest] {
+           # The selector is an effective target keyword.
+           if [is-effective-target $rest] {
+               return [expr { $what == "xfail" ? "F" : "S" }]
+           } else {
+               return [expr { $what == "xfail" ? "P" : "N" }]
+           }
+       }
+
+       if [string match "{*}" $rest] {
+           if [selector_expression [lindex $rest 0]] {
+               return [expr { $what == "xfail" ? "F" : "S" }]
+           } else {
+               return [expr { $what == "xfail" ? "P" : "N" }]
+           }
+       }
+
+       # The selector is not an effective-target keyword, so process
+       # the list of target triplets.
+       return [saved-dg-process-target $selector]
+    }
+
+    # Intercept calls to the DejaGnu function.  In addition to
+    # processing "target selector" or "xfail selector", handle
+    # "target selector1 xfail selector2".
+
+    proc dg-process-target { args } {
+       verbose "replacement dg-process-target: `$args'" 2
+
+       set selector [string trim [lindex $args 0]]
+
+       # If the argument list contains both 'target' and 'xfail',
+       # process 'target' and, if that succeeds, process 'xfail'.
+       if [regexp "^target .* xfail .*" $selector] {
+           set xfail_index [string first "xfail" $selector]
+           set xfail_selector [string range $selector $xfail_index end]
+           set target_selector [string range $selector 0 [expr $xfail_index-1]]
+           set target_selector [string trim $target_selector]
+           if { [dg-process-target-1 $target_selector] == "N" } {
+               return "N"
+           }
+           return [dg-process-target-1 $xfail_selector]
+           
+       }
+       return [dg-process-target-1 $selector]
+    }
+}
 
 # Define libffi callbacks for dg.exp.
 
@@ -93,12 +266,17 @@ proc libffi-dg-test { prog do_what extra_tool_flags } {
     return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags]
 }
 
+proc libffi-dg-prune { target_triplet text } {
+    # We get this with some qemu emulated systems (eg. ppc64le-linux-gnu)
+    regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text
+    return $text
+}
+
 proc libffi-init { args } {
     global gluefile wrap_flags;
     global srcdir
     global blddirffi
     global objdir
-    global blddircxx
     global TOOL_OPTIONS
     global tool
     global libffi_include
@@ -107,41 +285,41 @@ proc libffi-init { args } {
     global ld_library_path
     global compiler_vendor
 
-    set blddirffi [lookfor_file [get_multilibs] libffi]
-    verbose "libffi $blddirffi"
-    set blddircxx [lookfor_file [get_multilibs] libstdc++-v3]
-    verbose "libstdc++ $blddircxx"
-
-    set compiler_vendor "gnu"
-
-    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
-    if {$gccdir != ""} {
-       set gccdir [file dirname $gccdir]
+    if ![info exists blddirffi] {
+       set blddirffi [pwd]/..
     }
-    verbose "gccdir $gccdir"
 
-    set ld_library_path "."
-    append ld_library_path ":${gccdir}"
+    verbose "libffi $blddirffi"
 
-    set compiler "${gccdir}/xgcc"
-    if { [is_remote host] == 0 && [which $compiler] != 0 } {
-       foreach i "[exec $compiler --print-multi-lib]" {
-           set mldir ""
-           regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
-           set mldir [string trimright $mldir "\;@"]
-           if { "$mldir" == "." } {
-               continue
-           }
-           if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
-               append ld_library_path ":${gccdir}/${mldir}"
+    # Which compiler are we building with?
+    if { [string match $compiler_vendor "gnu"] } {
+        set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+        if {$gccdir != ""} {
+           set gccdir [file dirname $gccdir]
+        }
+        verbose "gccdir $gccdir"
+
+        set ld_library_path "."
+        append ld_library_path ":${gccdir}"
+
+        set compiler "${gccdir}/xgcc"
+        if { [is_remote host] == 0 && [which $compiler] != 0 } {
+           foreach i "[exec $compiler --print-multi-lib]" {
+               set mldir ""
+               regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
+               set mldir [string trimright $mldir "\;@"]
+               if { "$mldir" == "." } {
+                   continue
+               }
+               if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+                   append ld_library_path ":${gccdir}/${mldir}"
+               }
            }
-       }
+        }
     }
 
     # add the library path for libffi.
     append ld_library_path ":${blddirffi}/.libs"
-    # add the library path for libstdc++ as well.
-    append ld_library_path ":${blddircxx}/src/.libs"
 
     verbose "ld_library_path: $ld_library_path"
 
@@ -154,7 +332,6 @@ proc libffi-init { args } {
     if { $libffi_dir != "" } {
        set libffi_dir [file dirname ${libffi_dir}]
        set libffi_link_flags "-L${libffi_dir}/.libs"
-       lappend libffi_link_flags "-L${blddircxx}/src/.libs"
     }
 
     set_ld_library_path_env_vars
@@ -178,7 +355,7 @@ proc libffi_target_compile { source dest type options } {
     global libffi_link_flags
     global libffi_include
     global target_triplet
-
+    global compiler_vendor
 
     if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
        lappend options "libs=${gluefile}"
@@ -188,7 +365,7 @@ proc libffi_target_compile { source dest type options } {
     # TOOL_OPTIONS must come first, so that it doesn't override testcase
     # specific options.
     if [info exists TOOL_OPTIONS] {
-       lappend  options [concat "additional_flags=$TOOL_OPTIONS" $options];
+       lappend  options "additional_flags=$TOOL_OPTIONS"
     }
 
     # search for ffi_mips.h in srcdir, too
@@ -221,6 +398,15 @@ proc libffi_target_compile { source dest type options } {
        lappend options "libs= -lpthread"
     }
 
+    # this may be required for g++, but just confused clang.
+    if { [string match "*.cc" $source] } {
+        lappend options "c++"
+    }
+
+    if { [string match "arc*-*-linux*" $target_triplet] } {
+       lappend options "libs= -lpthread"
+    }
+
     verbose "options: $options"
     return [target_compile $source $dest $type $options]
 }
@@ -293,32 +479,54 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
 
 proc run-many-tests { testcases extra_flags } {
     global compiler_vendor
+    global has_gccbug
+    global env
     switch $compiler_vendor {
       "clang" {
-       set common "-W -Wall"
-       set optimizations { "-O0" "-O1" "-O2" "-O3" "-Os" }
+        set common "-W -Wall"
+        if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
+         set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
+        } else { 
+          set optimizations { "-O0" "-O2" }
+        }
       }
       "gnu" {
         set common "-W -Wall -Wno-psabi"
-        set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
+        if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
+         set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
+        } else { 
+          set optimizations { "-O0" "-O2" }
+        }
       }
       default {
         # Assume we are using the vendor compiler.
         set common ""
-        set optimizations { "" }
+        if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
+         set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
+        } else { 
+          set optimizations { "" }
+        }
       }
     }
 
+    info exists env(LD_LIBRARY_PATH)
+
     set targetabis { "" }
     if [string match $compiler_vendor "gnu"] {
-        if { ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"])
-            && [is-effective-target ia32] && ![istarget "*-*-darwin*"] } {
+        if [libffi_feature_test "#ifdef __i386__"] {
             set targetabis {
                 ""
                 "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
                 "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
                 "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
             }
+        } elseif { [istarget "x86_64-*-*"] \
+                  && [libffi_feature_test "#if !defined __ILP32__  \
+                                               && !defined __i386__"] } {
+            set targetabis {
+                ""
+                "-DABI_NUM=FFI_GNUW64 -DABI_ATTR=__MSABI__"
+            }
         }
     }
 
@@ -333,8 +541,22 @@ proc run-many-tests { testcases extra_flags } {
         foreach opt $optimizations {
             foreach abi $abis {
                 set options [concat $common $opt $abi]
-                verbose "Testing $testname, $options" 1
-                dg-test $test $options ""
+               set has_gccbug false;
+               if { [string match $compiler_vendor "gnu"] \
+                        && [string match "*MSABI*" $abi] \
+                        && ( ( [string match "*DGTEST=57 *" $common] \
+                                   && [string match "*call.c*" $testname] ) \
+                                 || ( [string match "*DGTEST=54 *" $common] \
+                                          && [string match "*callback*" $testname] ) \
+                                 || [string match "*DGTEST=55 *" $common] \
+                                 || [string match "*DGTEST=56 *" $common] ) } then {
+                   if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] {
+                       set has_gccbug true;
+                   }
+               }
+               verbose "Testing $testname, $options" 1
+               verbose "has_gccbug = $has_gccbug" 1
+               dg-test $test $options ""
             }
         }
     }
diff --git a/libffi/testsuite/libffi.bhaible/Makefile b/libffi/testsuite/libffi.bhaible/Makefile
new file mode 100644 (file)
index 0000000..3322de9
--- /dev/null
@@ -0,0 +1,28 @@
+CC = gcc
+CFLAGS = -O2 -Wall
+prefix =
+includedir = $(prefix)/include
+libdir = $(prefix)/lib
+CPPFLAGS = -I$(includedir)
+LDFLAGS = -L$(libdir) -Wl,-rpath,$(libdir)
+
+all: check-call check-callback
+
+test-call: test-call.c testcases.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-call test-call.c -lffi
+
+test-callback: test-callback.c testcases.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-callback test-callback.c -lffi
+
+check-call: test-call
+       ./test-call > test-call.out
+       LC_ALL=C uniq -u < test-call.out > failed-call
+       test '!' -s failed-call
+
+check-callback: test-callback
+       ./test-callback > test-callback.out
+       LC_ALL=C uniq -u < test-callback.out > failed-callback
+       test '!' -s failed-callback
+
+clean:
+       rm -f test-call test-callback test-call.out test-callback.out failed-call failed-callback
diff --git a/libffi/testsuite/libffi.bhaible/README b/libffi/testsuite/libffi.bhaible/README
new file mode 100644 (file)
index 0000000..be8540b
--- /dev/null
@@ -0,0 +1,78 @@
+This package contains a test suite for libffi.
+
+This test suite can be compiled with a C compiler. No need for 'expect'
+or some other package that is often not installed.
+
+The test suite consists of 81 C functions, each with a different signature.
+* test-call verifies that calling each function directly produces the same
+  results as calling the function indirectly through 'ffi_call'.
+* test-callback verifies that calling each function directly produces the same
+  results as calling a function that is a callback (object build by
+  'ffi_prep_closure_loc') and simulates the original function.
+
+Each direct or indirect invocation should produce one line of output to
+stdout. A correct output consists of paired lines, such as
+
+void f(void):
+void f(void):
+int f(void):->99
+int f(void):->99
+int f(int):(1)->2
+int f(int):(1)->2
+int f(2*int):(1,2)->3
+int f(2*int):(1,2)->3
+...
+
+The Makefile then creates two files:
+* failed-call, which consists of the non-paired lines of output of
+  'test-call',
+* failed-callback, which consists of the non-paired lines of output of
+  'test-callback'.
+
+The test suite passes if both failed-call and failed-callback come out
+as empty.
+
+
+How to use the test suite
+-------------------------
+
+1. Modify the Makefile's variables
+   prefix = the directory in which libffi was installed
+   CC = the C compiler, often with options such as "-m32" or "-m64"
+        that enforce a certain ABI,
+   CFLAGS = optimization options (need to change them only for non-GCC
+            compilers)
+2. Run "make". If it fails already in "test-call", run also
+   "make check-callback".
+3. If this failed, inspect the output files.
+
+
+How to interpret the results
+----------------------------
+
+The failed-call and failed-callback files consist of paired lines:
+The first line is the result of the direct invocation.
+The second line is the result of invocation through libffi.
+
+For example, this output
+
+uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->255
+uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->0
+
+indicates that the arguments were passed correctly, but the return
+value came out wrong.
+
+And this output
+
+float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,6,7,8,561,1105,1729,2465,2821,6601)->15319.1
+float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,-140443648,10,268042216,-72537980,-140443648,-140443648,-140443648,-140443648,-140443648)->-6.47158e+08
+
+indicates that integer arguments that come after 17 floating-point arguments
+were not passed correctly.
+
+
+Credits
+-------
+
+The test suite is based on the one of GNU libffcall-2.0.
+Authors: Bill Triggs, Bruno Haible
diff --git a/libffi/testsuite/libffi.bhaible/alignof.h b/libffi/testsuite/libffi.bhaible/alignof.h
new file mode 100644 (file)
index 0000000..00604a5
--- /dev/null
@@ -0,0 +1,50 @@
+/* Determine alignment of types.
+   Copyright (C) 2003-2004, 2006, 2009-2017 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
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   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, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ALIGNOF_H
+#define _ALIGNOF_H
+
+#include <stddef.h>
+
+/* alignof_slot (TYPE)
+   Determine the alignment of a structure slot (field) of a given type,
+   at compile time.  Note that the result depends on the ABI.
+   This is the same as alignof (TYPE) and _Alignof (TYPE), defined in
+   <stdalign.h> if __alignof_is_defined is 1.
+   Note: The result cannot be used as a value for an 'enum' constant,
+   due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
+#if defined __cplusplus
+  template <class type> struct alignof_helper { char __slot1; type __slot2; };
+# define alignof_slot(type) offsetof (alignof_helper<type>, __slot2)
+#else
+# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
+#endif
+
+/* alignof_type (TYPE)
+   Determine the good alignment of an object of the given type at compile time.
+   Note that this is not necessarily the same as alignof_slot(type).
+   For example, with GNU C on x86 platforms: alignof_type(double) = 8, but
+   - when -malign-double is not specified:  alignof_slot(double) = 4,
+   - when -malign-double is specified:      alignof_slot(double) = 8.
+   Note: The result cannot be used as a value for an 'enum' constant,
+   due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
+# define alignof_type __alignof__
+#else
+# define alignof_type alignof_slot
+#endif
+
+#endif /* _ALIGNOF_H */
diff --git a/libffi/testsuite/libffi.bhaible/bhaible.exp b/libffi/testsuite/libffi.bhaible/bhaible.exp
new file mode 100644 (file)
index 0000000..44aebc5
--- /dev/null
@@ -0,0 +1,63 @@
+# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2018 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+dg-init
+libffi-init
+
+global srcdir subdir
+global compiler_vendor
+
+# The conversion of this testsuite into a dejagnu compatible testsuite
+# was done in a pretty lazy fashion, and requires the use of compiler
+# flags to disable warnings for now.
+if { [string match $compiler_vendor "gnu"] } {
+    set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized";
+}
+if { [string match $compiler_vendor "microsoft"] } {
+    # -wd4996  suggest use of vsprintf_s instead of vsprintf
+    # -wd4116  unnamed type definition
+    # -wd4101  unreferenced local variable
+    # -wd4244  warning about implicit double to float conversion
+    set warning_options "-wd4996 -wd4116 -wd4101 -wd4244";
+}
+if { ![string match $compiler_vendor "microsoft"] && ![string match $compiler_vendor "gnu"] } {
+    set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-uninitialized";
+}
+
+
+set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/test-call.c]]
+
+for {set i 1} {$i < 82} {incr i} {
+    run-many-tests $tlist [format "-DDGTEST=%d %s" $i $warning_options]
+}
+
+set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/test-callback.c]]
+
+for {set i 1} {$i < 81} {incr i} {
+    if { [libffi_feature_test "#if FFI_CLOSURES"] } {
+        run-many-tests $tlist [format "-DDGTEST=%d %s" $i $warning_options]
+    } else {
+        foreach test $tlist {
+            unsupported [format "%s -DDGTEST=%d %s" $test $i $warning_options]
+        }
+    }
+}
+
+dg-finish
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/libffi/testsuite/libffi.bhaible/test-call.c b/libffi/testsuite/libffi.bhaible/test-call.c
new file mode 100644 (file)
index 0000000..cf9219e
--- /dev/null
@@ -0,0 +1,1745 @@
+/**
+  Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
+  Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
+
+  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
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  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, see <http://www.gnu.org/licenses/>.
+**/
+
+/* { dg-do run { xfail gccbug } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ffi.h>
+#include "alignof.h"
+#include <stdarg.h>
+
+/* libffi testsuite local changes -------------------------------- */
+#ifdef DGTEST
+/* Redefine exit(1) as a test failure */
+#define exit(V) (void)((V) ? (abort(), 1) : exit(0))
+int count = 0;
+char rbuf1[2048];
+char rbuf2[2048];
+int _fprintf(FILE *stream, const char *format, ...)
+{
+  va_list args;
+  va_start(args, format);
+
+  switch (count++)
+    {
+    case 0:
+    case 1:
+      vsprintf(&rbuf1[strlen(rbuf1)], format, args);
+      break;
+    case 2:
+      printf("%s", rbuf1);
+      vsprintf(rbuf2, format, args);
+      break;
+    case 3:
+      vsprintf(&rbuf2[strlen(rbuf2)], format, args);
+      printf("%s", rbuf2);
+      if (strcmp (rbuf1, rbuf2)) abort();
+      break;
+    }
+
+  va_end(args);
+
+  return 0;
+}
+#define fprintf _fprintf
+#endif
+/* --------------------------------------------------------------- */
+
+#include "testcases.c"
+
+#ifndef ABI_NUM
+#define ABI_NUM FFI_DEFAULT_ABI
+#endif
+
+/* Definitions that ought to be part of libffi. */
+static ffi_type ffi_type_char;
+#define ffi_type_slonglong ffi_type_sint64
+#define ffi_type_ulonglong ffi_type_uint64
+
+/* libffi does not support arrays inside structs. */
+#define SKIP_EXTRA_STRUCTS
+
+#define FFI_PREP_CIF(cif,argtypes,rettype) \
+  if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort()
+#define FFI_PREP_CIF_NOARGS(cif,rettype) \
+  if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort()
+#define FFI_CALL(cif,fn,args,retaddr) \
+  ffi_call(&(cif),(void(*)(void))(fn),retaddr,args)
+
+long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h,
+                     long i, long j, long k, long l, long m, long n, long o, long p)
+{ return 0; }
+float clear_traces_f (float a, float b, float c, float d, float e, float f, float g,
+                      float h, float i, float j, float k, float l, float m, float n,
+                      float o, float p)
+{ return 0.0; }
+double clear_traces_d (double a, double b, double c, double d, double e, double f, double g,
+                       double h, double i, double j, double k, double l, double m, double n,
+                       double o, double p)
+{ return 0.0; }
+J clear_traces_J (void)
+{ J j; j.l1 = j.l2 = 0; return j; }
+void clear_traces (void)
+{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+  clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+  clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+  clear_traces_J();
+}
+
+void
+  void_tests (void)
+{
+#if (!defined(DGTEST)) || DGTEST == 1  
+  v_v();
+  clear_traces();
+  {
+    ffi_cif cif;
+    FFI_PREP_CIF_NOARGS(cif,ffi_type_void);
+    {
+      FFI_CALL(cif,v_v,NULL,NULL);
+    }
+  }
+#endif  
+  return;
+}
+void
+  int_tests (void)
+{
+  int ir;
+  ffi_arg retvalue;
+#if (!defined(DGTEST)) || DGTEST == 2
+  ir = i_v();
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+  ir = 0; clear_traces();
+  {
+    ffi_cif cif;
+    FFI_PREP_CIF_NOARGS(cif,ffi_type_sint);
+    {
+      FFI_CALL(cif,i_v,NULL,&retvalue);
+      ir = retvalue;
+    }
+  }
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 3
+  ir = i_i(i1);
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+  ir = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+    {
+      /*const*/ void* args[] = { &i1 };
+      FFI_CALL(cif,i_i,args,&retvalue);
+      ir = retvalue;
+    }
+  }
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 4
+  ir = i_i2(i1,i2);
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+  ir = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+    {
+      /*const*/ void* args[] = { &i1, &i2 };
+      FFI_CALL(cif,i_i2,args,&retvalue);
+      ir = retvalue;
+    }
+  }
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 5
+  ir = i_i4(i1,i2,i3,i4);
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+  ir = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+    {
+      /*const*/ void* args[] = { &i1, &i2, &i3, &i4 };
+      FFI_CALL(cif,i_i4,args,&retvalue);
+      ir = retvalue;
+    }
+  }
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 6
+  ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8);
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+  ir = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+    {
+      /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8 };
+      FFI_CALL(cif,i_i8,args,&retvalue);
+      ir = retvalue;
+    }
+  }
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 7
+  ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+  ir = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+    {
+      /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8, &i9, &i10, &i11, &i12, &i13, &i14, &i15, &i16 };
+      FFI_CALL(cif,i_i16,args,&retvalue);
+      ir = retvalue;
+    }
+  }
+  fprintf(out,"->%d\n",ir);
+  fflush(out);
+#endif
+
+  return;
+}
+void
+  float_tests (void)
+{
+  float fr;
+
+#if (!defined(DGTEST)) || DGTEST == 8
+  fr = f_f(f1);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1 };
+      FFI_CALL(cif,f_f,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 9
+  fr = f_f2(f1,f2);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2 };
+      FFI_CALL(cif,f_f2,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 10
+  fr = f_f4(f1,f2,f3,f4);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4 };
+      FFI_CALL(cif,f_f4,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 11
+  fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8 };
+      FFI_CALL(cif,f_f8,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 12
+  fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16 };
+      FFI_CALL(cif,f_f16,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 13
+  fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &f18, &f19, &f20, &f21, &f22, &f23, &f24 };
+      FFI_CALL(cif,f_f24,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+}
+void
+  double_tests (void)
+{
+  double dr;
+
+#if (!defined(DGTEST)) || DGTEST == 14
+  
+  dr = d_d(d1);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1 };
+      FFI_CALL(cif,d_d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 15
+  dr = d_d2(d1,d2);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2 };
+      FFI_CALL(cif,d_d2,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 16
+  dr = d_d4(d1,d2,d3,d4);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4 };
+      FFI_CALL(cif,d_d4,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 17
+  dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8 };
+      FFI_CALL(cif,d_d8,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 18
+  dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16 };
+      FFI_CALL(cif,d_d16,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif  
+  return;
+}
+void
+  pointer_tests (void)
+{
+  void* vpr;
+
+#if (!defined(DGTEST)) || DGTEST == 19
+  vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4);
+  fprintf(out,"->0x%p\n",vpr);
+  fflush(out);
+  vpr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_pointer);
+    {
+      void* puc1 = &uc1;
+      void* pd2 = &d2;
+      void* pstr3 = str3;
+      void* pI4 = &I4;
+      /*const*/ void* args[] = { &puc1, &pd2, &pstr3, &pI4 };
+      FFI_CALL(cif,vp_vpdpcpsp,args,&vpr);
+    }
+  }
+  fprintf(out,"->0x%p\n",vpr);
+  fflush(out);
+#endif  
+  return;
+}
+void
+  mixed_number_tests (void)
+{
+  uchar ucr;
+  ushort usr;
+  float fr;
+  double dr;
+  long long llr;
+
+  /* Unsigned types.
+   */
+#if (!defined(DGTEST)) || DGTEST == 20
+  ucr = uc_ucsil(uc1, us2, ui3, ul4);
+  fprintf(out,"->%u\n",ucr);
+  fflush(out);
+  ucr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_uchar);
+    {
+      ffi_arg r;
+      /*const*/ void* args[] = { &uc1, &us2, &ui3, &ul4 };
+      FFI_CALL(cif,uc_ucsil,args,&r);
+      ucr = (uchar) r;
+    }
+  }
+  fprintf(out,"->%u\n",ucr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 21
+  /* Mixed int & float types.
+   */
+  dr = d_iidd(i1,i2,d3,d4);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &i1, &i2, &d3, &d4 };
+      FFI_CALL(cif,d_iidd,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 22
+  dr = d_iiidi(i1,i2,i3,d4,i5);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &i1, &i2, &i3, &d4, &i5 };
+      FFI_CALL(cif,d_iiidi,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 23
+  dr = d_idid(i1,d2,i3,d4);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &i1, &d2, &i3, &d4 };
+      FFI_CALL(cif,d_idid,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 24
+  dr = d_fdi(f1,d2,i3);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &f1, &d2, &i3 };
+      FFI_CALL(cif,d_fdi,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 25
+  usr = us_cdcd(c1,d2,c3,d4);
+  fprintf(out,"->%u\n",usr);
+  fflush(out);
+  usr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_ushort);
+    {
+      ffi_arg rint;
+      /*const*/ void* args[] = { &c1, &d2, &c3, &d4 };
+      FFI_CALL(cif,us_cdcd,args,&rint);
+      usr = (ushort) rint;
+    }
+  }
+  fprintf(out,"->%u\n",usr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 26
+  /* Long long types.
+   */
+  llr = ll_iiilli(i1,i2,i3,ll1,i13);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &i1, &i2, &i3, &ll1, &i13 };
+      FFI_CALL(cif,ll_iiilli,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 27
+  llr = ll_flli(f13,ll1,i13);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &f13, &ll1, &i13 };
+      FFI_CALL(cif,ll_flli,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 28
+  fr = f_fi(f1,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &i9 };
+      FFI_CALL(cif,f_fi,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 29
+  fr = f_f2i(f1,f2,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &i9 };
+      FFI_CALL(cif,f_f2i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 30
+  fr = f_f3i(f1,f2,f3,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &i9 };
+      FFI_CALL(cif,f_f3i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 31
+  fr = f_f4i(f1,f2,f3,f4,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &i9 };
+      FFI_CALL(cif,f_f4i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 32
+  fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &i9 };
+      FFI_CALL(cif,f_f7i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 33
+  fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &i9 };
+      FFI_CALL(cif,f_f8i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 34
+  fr = f_f12i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &i9 };
+      FFI_CALL(cif,f_f12i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 35
+  fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &i9 };
+      FFI_CALL(cif,f_f13i,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 36
+  dr = d_di(d1,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &i9 };
+      FFI_CALL(cif,d_di,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 37
+  dr = d_d2i(d1,d2,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &i9 };
+      FFI_CALL(cif,d_d2i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 38
+  dr = d_d3i(d1,d2,d3,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &i9 };
+      FFI_CALL(cif,d_d3i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 39
+  dr = d_d4i(d1,d2,d3,d4,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &i9 };
+      FFI_CALL(cif,d_d4i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 40
+  dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &i9 };
+      FFI_CALL(cif,d_d7i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 41
+  dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &i9 };
+      FFI_CALL(cif,d_d8i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 42
+  dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &i9 };
+      FFI_CALL(cif,d_d12i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 43
+  dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &i9 };
+      FFI_CALL(cif,d_d13i,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif  
+  return;
+}
+void
+  small_structure_return_tests (void)
+{
+#if (!defined(DGTEST)) || DGTEST == 44
+  {
+    Size1 r = S1_v();
+    fprintf(out,"->{%c}\n",r.x1);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL };
+      ffi_type ffi_type_Size1;
+      ffi_type_Size1.type = FFI_TYPE_STRUCT;
+      ffi_type_Size1.size = sizeof(Size1);
+      ffi_type_Size1.alignment = alignof_slot(Size1);
+      ffi_type_Size1.elements = ffi_type_Size1_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1);
+      {
+        FFI_CALL(cif,S1_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c}\n",r.x1);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 45
+  {
+    Size2 r = S2_v();
+    fprintf(out,"->{%c%c}\n",r.x1,r.x2);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size2;
+      ffi_type_Size2.type = FFI_TYPE_STRUCT;
+      ffi_type_Size2.size = sizeof(Size2);
+      ffi_type_Size2.alignment = alignof_slot(Size2);
+      ffi_type_Size2.elements = ffi_type_Size2_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2);
+      {
+        FFI_CALL(cif,S2_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c}\n",r.x1,r.x2);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 46
+  {
+    Size3 r = S3_v();
+    fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size3;
+      ffi_type_Size3.type = FFI_TYPE_STRUCT;
+      ffi_type_Size3.size = sizeof(Size3);
+      ffi_type_Size3.alignment = alignof_slot(Size3);
+      ffi_type_Size3.elements = ffi_type_Size3_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3);
+      {
+        FFI_CALL(cif,S3_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 47
+  {
+    Size4 r = S4_v();
+    fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size4;
+      ffi_type_Size4.type = FFI_TYPE_STRUCT;
+      ffi_type_Size4.size = sizeof(Size4);
+      ffi_type_Size4.alignment = alignof_slot(Size4);
+      ffi_type_Size4.elements = ffi_type_Size4_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4);
+      {
+        FFI_CALL(cif,S4_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 48
+  {
+    Size7 r = S7_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size7;
+      ffi_type_Size7.type = FFI_TYPE_STRUCT;
+      ffi_type_Size7.size = sizeof(Size7);
+      ffi_type_Size7.alignment = alignof_slot(Size7);
+      ffi_type_Size7.elements = ffi_type_Size7_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7);
+      {
+        FFI_CALL(cif,S7_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 49
+  {
+    Size8 r = S8_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size8;
+      ffi_type_Size8.type = FFI_TYPE_STRUCT;
+      ffi_type_Size8.size = sizeof(Size8);
+      ffi_type_Size8.alignment = alignof_slot(Size8);
+      ffi_type_Size8.elements = ffi_type_Size8_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8);
+      {
+        FFI_CALL(cif,S8_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 50
+  {
+    Size12 r = S12_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size12;
+      ffi_type_Size12.type = FFI_TYPE_STRUCT;
+      ffi_type_Size12.size = sizeof(Size12);
+      ffi_type_Size12.alignment = alignof_slot(Size12);
+      ffi_type_Size12.elements = ffi_type_Size12_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12);
+      {
+        FFI_CALL(cif,S12_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 51  
+  {
+    Size15 r = S15_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size15;
+      ffi_type_Size15.type = FFI_TYPE_STRUCT;
+      ffi_type_Size15.size = sizeof(Size15);
+      ffi_type_Size15.alignment = alignof_slot(Size15);
+      ffi_type_Size15.elements = ffi_type_Size15_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15);
+      {
+        FFI_CALL(cif,S15_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
+    fflush(out);
+  }
+#endif
+#if (!defined(DGTEST)) || DGTEST == 52  
+  {
+    Size16 r = S16_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    {
+      ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size16;
+      ffi_type_Size16.type = FFI_TYPE_STRUCT;
+      ffi_type_Size16.size = sizeof(Size16);
+      ffi_type_Size16.alignment = alignof_slot(Size16);
+      ffi_type_Size16.elements = ffi_type_Size16_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16);
+      {
+        FFI_CALL(cif,S16_v,NULL,&r);
+      }
+    }
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
+    fflush(out);
+  }
+#endif
+}
+void
+  structure_tests (void)
+{
+  Int Ir;
+  Char Cr;
+  Float Fr;
+  Double Dr;
+  J Jr;
+#ifndef SKIP_EXTRA_STRUCTS  
+  T Tr;
+  X Xr;
+#endif  
+
+#if (!defined(DGTEST)) || DGTEST == 53  
+  Ir = I_III(I1,I2,I3);
+  fprintf(out,"->{%d}\n",Ir.x);
+  fflush(out);
+  Ir.x = 0; clear_traces();
+  {
+    ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL };
+    ffi_type ffi_type_Int;
+    ffi_type_Int.type = FFI_TYPE_STRUCT;
+    ffi_type_Int.size = sizeof(Int);
+    ffi_type_Int.alignment = alignof_slot(Int);
+    ffi_type_Int.elements = ffi_type_Int_elements;
+    ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_Int);
+    {
+      /*const*/ void* args[] = { &I1, &I2, &I3 };
+      FFI_CALL(cif,I_III,args,&Ir);
+    }
+  }
+  fprintf(out,"->{%d}\n",Ir.x);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 54
+  Cr = C_CdC(C1,d2,C3);
+  fprintf(out,"->{'%c'}\n",Cr.x);
+  fflush(out);
+  Cr.x = '\0'; clear_traces();
+  {
+    ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL };
+    ffi_type ffi_type_Char;
+    ffi_type_Char.type = FFI_TYPE_STRUCT;
+    ffi_type_Char.size = sizeof(Char);
+    ffi_type_Char.alignment = alignof_slot(Char);
+    ffi_type_Char.elements = ffi_type_Char_elements;
+    ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_Char);
+    {
+      /*const*/ void* args[] = { &C1, &d2, &C3 };
+      FFI_CALL(cif,C_CdC,args,&Cr);
+    }
+  }
+  fprintf(out,"->{'%c'}\n",Cr.x);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 55
+  Fr = F_Ffd(F1,f2,d3);
+  fprintf(out,"->{%g}\n",Fr.x);
+  fflush(out);
+  Fr.x = 0.0; clear_traces();
+  {
+    ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL };
+    ffi_type ffi_type_Float;
+    ffi_type_Float.type = FFI_TYPE_STRUCT;
+    ffi_type_Float.size = sizeof(Float);
+    ffi_type_Float.alignment = alignof_slot(Float);
+    ffi_type_Float.elements = ffi_type_Float_elements;
+    ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_Float);
+    {
+      /*const*/ void* args[] = { &F1, &f2, &d3 };
+      FFI_CALL(cif,F_Ffd,args,&Fr);
+    }
+  }
+  fprintf(out,"->{%g}\n",Fr.x);
+  fflush(out);
+#endif  
+#if (!defined(DGTEST)) || DGTEST == 56  
+  Dr = D_fDd(f1,D2,d3);
+  fprintf(out,"->{%g}\n",Dr.x);
+  fflush(out);
+  Dr.x = 0.0; clear_traces();
+  {
+    ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
+    ffi_type ffi_type_Double;
+    ffi_type_Double.type = FFI_TYPE_STRUCT;
+    ffi_type_Double.size = sizeof(Double);
+    ffi_type_Double.alignment = alignof_slot(Double);
+    ffi_type_Double.elements = ffi_type_Double_elements;
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
+    {
+      /*const*/ void* args[] = { &f1, &D2, &d3 };
+      FFI_CALL(cif,D_fDd,args,&Dr);
+    }
+  }
+  fprintf(out,"->{%g}\n",Dr.x);
+  fflush(out);
+#endif  
+#if (!defined(DGTEST)) || DGTEST == 57  
+  Dr = D_Dfd(D1,f2,d3);
+  fprintf(out,"->{%g}\n",Dr.x);
+  fflush(out);
+  Dr.x = 0.0; clear_traces();
+  {
+    ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
+    ffi_type ffi_type_Double;
+    ffi_type_Double.type = FFI_TYPE_STRUCT;
+    ffi_type_Double.size = sizeof(Double);
+    ffi_type_Double.alignment = alignof_slot(Double);
+    ffi_type_Double.elements = ffi_type_Double_elements;
+    ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
+    {
+      /*const*/ void* args[] = { &D1, &f2, &d3 };
+      FFI_CALL(cif,D_Dfd,args,&Dr);
+    }
+  }
+  fprintf(out,"->{%g}\n",Dr.x);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 58  
+  Jr = J_JiJ(J1,i2,J2);
+  fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
+  fflush(out);
+  Jr.l1 = Jr.l2 = 0; clear_traces();
+  {
+    ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL };
+    ffi_type ffi_type_J;
+    ffi_type_J.type = FFI_TYPE_STRUCT;
+    ffi_type_J.size = sizeof(J);
+    ffi_type_J.alignment = alignof_slot(J);
+    ffi_type_J.elements = ffi_type_J_elements;
+    ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_J);
+    {
+      /*const*/ void* args[] = { &J1, &i2, &J2 };
+      FFI_CALL(cif,J_JiJ,args,&Jr);
+    }
+  }
+  fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
+  fflush(out);
+#endif
+#ifndef SKIP_EXTRA_STRUCTS
+#if (!defined(DGTEST)) || DGTEST == 59
+  Tr = T_TcT(T1,' ',T2);
+  fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
+  fflush(out);
+  Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces();
+  {
+    ffi_type* ffi_type_T_elements[] = { ??, NULL };
+    ffi_type ffi_type_T;
+    ffi_type_T.type = FFI_TYPE_STRUCT;
+    ffi_type_T.size = sizeof(T);
+    ffi_type_T.alignment = alignof_slot(T);
+    ffi_type_T.elements = ffi_type_T_elements;
+    ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_T);
+    {
+      char space = ' ';
+      /*const*/ void* args[] = { &T1, &space, &T2 };
+      FFI_CALL(cif,T_TcT,args,&Tr);
+    }
+  }
+  fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 60
+  Xr = X_BcdB(B1,c2,d3,B2);
+  fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
+  fflush(out);
+  Xr.c[0]=Xr.c1='\0'; clear_traces();
+  {
+    ffi_type* ffi_type_X_elements[] = { ??, NULL };
+    ffi_type ffi_type_X;
+    ffi_type_X.type = FFI_TYPE_STRUCT;
+    ffi_type_X.size = sizeof(X);
+    ffi_type_X.alignment = alignof_slot(X);
+    ffi_type_X.elements = ffi_type_X_elements;
+    ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_X);
+    {
+      /*const*/ void* args[] = { &B1, &c2, &d3, &B2 };
+      FFI_CALL(cif,X_BcdB,args,&Xr);
+    }
+  }
+  fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
+  fflush(out);
+#endif
+#endif
+
+  return;
+}
+
+void
+  gpargs_boundary_tests (void)
+{
+  ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
+  ffi_type ffi_type_K;
+  ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
+  ffi_type ffi_type_L;
+  long lr;
+  long long llr;
+  float fr;
+  double dr;
+
+  ffi_type_K.type = FFI_TYPE_STRUCT;
+  ffi_type_K.size = sizeof(K);
+  ffi_type_K.alignment = alignof_slot(K);
+  ffi_type_K.elements = ffi_type_K_elements;
+
+  ffi_type_L.type = FFI_TYPE_STRUCT;
+  ffi_type_L.size = sizeof(L);
+  ffi_type_L.alignment = alignof_slot(L);
+  ffi_type_L.elements = ffi_type_L_elements;
+
+#if (!defined(DGTEST)) || DGTEST == 61  
+  lr = l_l0K(K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &K1, &l9 };
+      FFI_CALL(cif,l_l0K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 62  
+  lr = l_l1K(l1,K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &l1, &K1, &l9 };
+      FFI_CALL(cif,l_l1K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 63  
+  lr = l_l2K(l1,l2,K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &K1, &l9 };
+      FFI_CALL(cif,l_l2K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 64  
+  lr = l_l3K(l1,l2,l3,K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &K1, &l9 };
+      FFI_CALL(cif,l_l3K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 65
+  lr = l_l4K(l1,l2,l3,l4,K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &K1, &l9 };
+      FFI_CALL(cif,l_l4K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 66
+  lr = l_l5K(l1,l2,l3,l4,l5,K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &K1, &l9 };
+      FFI_CALL(cif,l_l5K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 67  
+  lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9);
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+  lr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &K1, &l9 };
+      FFI_CALL(cif,l_l6K,args,&lr);
+    }
+  }
+  fprintf(out,"->%ld\n",lr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 68  
+  fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+  fr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+    {
+      /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &l6, &l7, &l8, &L1 };
+      FFI_CALL(cif,f_f17l3L,args,&fr);
+    }
+  }
+  fprintf(out,"->%g\n",fr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 69  
+  dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16, &d17, &l6, &l7, &l8, &L1 };
+      FFI_CALL(cif,d_d17l3L,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 70  
+  llr = ll_l2ll(l1,l2,ll1,l9);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &ll1, &l9 };
+      FFI_CALL(cif,ll_l2ll,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 71
+  llr = ll_l3ll(l1,l2,l3,ll1,l9);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &ll1, &l9 };
+      FFI_CALL(cif,ll_l3ll,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 72  
+  llr = ll_l4ll(l1,l2,l3,l4,ll1,l9);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &ll1, &l9 };
+      FFI_CALL(cif,ll_l4ll,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 73  
+  llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &ll1, &l9 };
+      FFI_CALL(cif,ll_l5ll,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 74  
+  llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &ll1, &l9 };
+      FFI_CALL(cif,ll_l6ll,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 75  
+  llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+  llr = 0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &ll1, &l9 };
+      FFI_CALL(cif,ll_l7ll,args,&llr);
+    }
+  }
+  fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 76  
+  dr = d_l2d(l1,l2,d2,l9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &d2, &l9 };
+      FFI_CALL(cif,d_l2d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 77  
+  dr = d_l3d(l1,l2,l3,d2,l9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &d2, &l9 };
+      FFI_CALL(cif,d_l3d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 78  
+  dr = d_l4d(l1,l2,l3,l4,d2,l9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &d2, &l9 };
+      FFI_CALL(cif,d_l4d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 79  
+  dr = d_l5d(l1,l2,l3,l4,l5,d2,l9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &d2, &l9 };
+      FFI_CALL(cif,d_l5d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 80  
+  dr = d_l6d(l1,l2,l3,l4,l5,l6,d2,l9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &d2, &l9 };
+      FFI_CALL(cif,d_l6d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+#if (!defined(DGTEST)) || DGTEST == 81  
+  dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,d2,l9);
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+  dr = 0.0; clear_traces();
+  {
+    ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+    ffi_cif cif;
+    FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+    {
+      /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &d2, &l9 };
+      FFI_CALL(cif,d_l7d,args,&dr);
+    }
+  }
+  fprintf(out,"->%g\n",dr);
+  fflush(out);
+#endif
+  return;
+}
+
+int
+  main (void)
+{
+  ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar;
+  out = stdout;
+
+  void_tests();
+  int_tests();
+  float_tests();
+  double_tests();
+  pointer_tests();
+  mixed_number_tests();
+  small_structure_return_tests();
+  structure_tests();
+  gpargs_boundary_tests();
+
+  exit(0);
+}
diff --git a/libffi/testsuite/libffi.bhaible/test-callback.c b/libffi/testsuite/libffi.bhaible/test-callback.c
new file mode 100644 (file)
index 0000000..0b16799
--- /dev/null
@@ -0,0 +1,2885 @@
+/*
+ * Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
+ * Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+/* { dg-do run { xfail gccbug } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ffi.h>
+#include "alignof.h"
+#include <stdarg.h>
+
+/* libffi testsuite local changes -------------------------------- */
+#ifdef DGTEST
+/* Redefine exit(1) as a test failure */
+#define exit(V) (void)((V) ? (abort(), 1) : exit(0))
+int count = 0;
+char rbuf1[2048];
+char rbuf2[2048];
+int _fprintf(FILE *stream, const char *format, ...)
+{
+  va_list args;
+  va_start(args, format);
+
+  switch (count++)
+    {
+    case 0:
+    case 1:
+      vsprintf(&rbuf1[strlen(rbuf1)], format, args);
+      break;
+    case 2:
+      printf("%s", rbuf1);
+      vsprintf(rbuf2, format, args);
+      break;
+    case 3:
+      vsprintf(&rbuf2[strlen(rbuf2)], format, args);
+      printf("%s", rbuf2);
+      if (strcmp (rbuf1, rbuf2)) abort();
+      break;
+    }
+
+  va_end(args);
+
+  return 0;
+}
+#define fprintf _fprintf
+#endif
+/* --------------------------------------------------------------- */
+
+#include "testcases.c"
+
+#ifndef ABI_NUM
+#define ABI_NUM FFI_DEFAULT_ABI
+#endif
+
+/* Definitions that ought to be part of libffi. */
+static ffi_type ffi_type_char;
+#define ffi_type_slonglong ffi_type_sint64
+#define ffi_type_ulonglong ffi_type_uint64
+
+/* libffi does not support arrays inside structs. */
+#define SKIP_EXTRA_STRUCTS
+
+#define FFI_PREP_CIF(cif,argtypes,rettype) \
+  if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort()
+#define FFI_PREP_CIF_NOARGS(cif,rettype) \
+  if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort()
+
+#if defined(__sparc__) && defined(__sun) && defined(__SUNPRO_C) /* SUNWspro cc */
+/* SunPRO cc miscompiles the simulator function for X_BcdB: d.i[1] is
+ * temporarily stored in %l2 and put onto the stack from %l2, but in between
+ * the copy of X has used %l2 as a counter without saving and restoring its
+ * value.
+ */
+#define SKIP_X
+#endif
+#if defined(__mipsn32__) && !defined(__GNUC__)
+/* The X test crashes for an unknown reason. */
+#define SKIP_X
+#endif
+
+
+/* These functions simulate the behaviour of the functions defined in testcases.c. */
+
+/* void tests */
+void v_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&v_v) { fprintf(out,"wrong data for v_v\n"); exit(1); }
+  fprintf(out,"void f(void):\n");
+  fflush(out);
+}
+
+/* int tests */
+void i_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&i_v) { fprintf(out,"wrong data for i_v\n"); exit(1); }
+ {int r=99;
+  fprintf(out,"int f(void):");
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void i_i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&i_i) { fprintf(out,"wrong data for i_i\n"); exit(1); }
+  int a = *(int*)(*args++);
+  int r=a+1;
+  fprintf(out,"int f(int):(%d)",a);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}
+void i_i2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&i_i2) { fprintf(out,"wrong data for i_i2\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  int r=a+b;
+  fprintf(out,"int f(2*int):(%d,%d)",a,b);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void i_i4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&i_i4) { fprintf(out,"wrong data for i_i4\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  int c = *(int*)(*args++);
+  int d = *(int*)(*args++);
+  int r=a+b+c+d;
+  fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void i_i8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&i_i8) { fprintf(out,"wrong data for i_i8\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  int c = *(int*)(*args++);
+  int d = *(int*)(*args++);
+  int e = *(int*)(*args++);
+  int f = *(int*)(*args++);
+  int g = *(int*)(*args++);
+  int h = *(int*)(*args++);
+  int r=a+b+c+d+e+f+g+h;
+  fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void i_i16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&i_i16) { fprintf(out,"wrong data for i_i16\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  int c = *(int*)(*args++);
+  int d = *(int*)(*args++);
+  int e = *(int*)(*args++);
+  int f = *(int*)(*args++);
+  int g = *(int*)(*args++);
+  int h = *(int*)(*args++);
+  int i = *(int*)(*args++);
+  int j = *(int*)(*args++);
+  int k = *(int*)(*args++);
+  int l = *(int*)(*args++);
+  int m = *(int*)(*args++);
+  int n = *(int*)(*args++);
+  int o = *(int*)(*args++);
+  int p = *(int*)(*args++);
+  int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
+  fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
+          a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+
+/* float tests */
+void f_f_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f) { fprintf(out,"wrong data for f_f\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float r=a+1.0;
+  fprintf(out,"float f(float):(%g)",a);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f2) { fprintf(out,"wrong data for f_f2\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float r=a+b;
+  fprintf(out,"float f(2*float):(%g,%g)",a,b);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f4) { fprintf(out,"wrong data for f_f4\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float r=a+b+c+d;
+  fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f8) { fprintf(out,"wrong data for f_f8\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  float r=a+b+c+d+e+f+g+h;
+  fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f16) { fprintf(out,"wrong data for f_f16\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  float i = *(float*)(*args++);
+  float j = *(float*)(*args++);
+  float k = *(float*)(*args++);
+  float l = *(float*)(*args++);
+  float m = *(float*)(*args++);
+  float n = *(float*)(*args++);
+  float o = *(float*)(*args++);
+  float p = *(float*)(*args++);
+  float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
+  fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f24_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f24) { fprintf(out,"wrong data for f_f24\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  float i = *(float*)(*args++);
+  float j = *(float*)(*args++);
+  float k = *(float*)(*args++);
+  float l = *(float*)(*args++);
+  float m = *(float*)(*args++);
+  float n = *(float*)(*args++);
+  float o = *(float*)(*args++);
+  float p = *(float*)(*args++);
+  float q = *(float*)(*args++);
+  float s = *(float*)(*args++);
+  float t = *(float*)(*args++);
+  float u = *(float*)(*args++);
+  float v = *(float*)(*args++);
+  float w = *(float*)(*args++);
+  float x = *(float*)(*args++);
+  float y = *(float*)(*args++);
+  float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y;
+  fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y);
+  fflush(out);
+  *(float*)retp = r;
+}}
+
+/* double tests */
+void d_d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d) { fprintf(out,"wrong data for d_d\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double r=a+1.0;
+  fprintf(out,"double f(double):(%g)",a);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d2) { fprintf(out,"wrong data for d_d2\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double r=a+b;
+  fprintf(out,"double f(2*double):(%g,%g)",a,b);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d4) { fprintf(out,"wrong data for d_d4\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double r=a+b+c+d;
+  fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d8) { fprintf(out,"wrong data for d_d8\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  double h = *(double*)(*args++);
+  double r=a+b+c+d+e+f+g+h;
+  fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d16) { fprintf(out,"wrong data for d_d16\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  double h = *(double*)(*args++);
+  double i = *(double*)(*args++);
+  double j = *(double*)(*args++);
+  double k = *(double*)(*args++);
+  double l = *(double*)(*args++);
+  double m = *(double*)(*args++);
+  double n = *(double*)(*args++);
+  double o = *(double*)(*args++);
+  double p = *(double*)(*args++);
+  double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
+  fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
+  fflush(out);
+  *(double*)retp = r;
+}}
+
+/* pointer tests */
+void vp_vpdpcpsp_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&vp_vpdpcpsp) { fprintf(out,"wrong data for vp_vpdpcpsp\n"); exit(1); }
+ {void* a = *(void* *)(*args++);
+  double* b = *(double* *)(*args++);
+  char* c = *(char* *)(*args++);
+  Int* d = *(Int* *)(*args++);
+  void* ret = (char*)b + 1;
+  fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d);
+  fflush(out);
+  *(void* *)retp = ret;
+}}
+
+/* mixed number tests */
+void uc_ucsil_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&uc_ucsil) { fprintf(out,"wrong data for uc_ucsil\n"); exit(1); }
+ {uchar a = *(unsigned char *)(*args++);
+  ushort b = *(unsigned short *)(*args++);
+  uint c = *(unsigned int *)(*args++);
+  ulong d = *(unsigned long *)(*args++);
+  uchar r = (uchar)-1;
+  fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d);
+  fflush(out);
+  *(ffi_arg *)retp = r;
+}}
+void d_iidd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_iidd) { fprintf(out,"wrong data for d_iidd\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double r=a+b+c+d;
+  fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_iiidi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_iiidi) { fprintf(out,"wrong data for d_iiidi\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  int c = *(int*)(*args++);
+  double d = *(double*)(*args++);
+  int e = *(int*)(*args++);
+  double r=a+b+c+d+e;
+  fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_idid_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_idid) { fprintf(out,"wrong data for d_idid\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  double b = *(double*)(*args++);
+  int c = *(int*)(*args++);
+  double d = *(double*)(*args++);
+  double r=a+b+c+d;
+  fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_fdi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_fdi) { fprintf(out,"wrong data for d_fdi\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  double b = *(double*)(*args++);
+  int c = *(int*)(*args++);
+  double r=a+b+c;
+  fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void us_cdcd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&us_cdcd) { fprintf(out,"wrong data for us_cdcd\n"); exit(1); }
+ {char a = *(char*)(*args++);
+  double b = *(double*)(*args++);
+  char c = *(char*)(*args++);
+  double d = *(double*)(*args++);
+  ushort r = (ushort)(a + b + c + d);
+  fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d);
+  fflush(out);
+  *(ffi_arg *)retp = r;
+}}
+void ll_iiilli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_iiilli) { fprintf(out,"wrong data for ll_iiilli\n"); exit(1); }
+ {int a = *(int*)(*args++);
+  int b = *(int*)(*args++);
+  int c = *(int*)(*args++);
+  long long d = *(long long *)(*args++);
+  int e = *(int*)(*args++);
+  long long r = (long long)(int)a + (long long)(int)b + (long long)(int)c + d + (long long)e;
+  fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void ll_flli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_flli) { fprintf(out,"wrong data for ll_flli\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  long long b = *(long long *)(*args++);
+  int c = *(int*)(*args++);
+  long long r = (long long)(int)a + b + (long long)c;
+  fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void f_fi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_fi) { fprintf(out,"wrong data for f_fi\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+z;
+  fprintf(out,"float f(float,int):(%g,%d)",a,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f2i) { fprintf(out,"wrong data for f_f2i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+z;
+  fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f3i) { fprintf(out,"wrong data for f_f3i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+c+z;
+  fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f4i) { fprintf(out,"wrong data for f_f4i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+c+d+z;
+  fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f7i) { fprintf(out,"wrong data for f_f7i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+c+d+e+f+g+z;
+  fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f8i) { fprintf(out,"wrong data for f_f8i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+c+d+e+f+g+h+z;
+  fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f12i) { fprintf(out,"wrong data for f_f12i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  float i = *(float*)(*args++);
+  float j = *(float*)(*args++);
+  float k = *(float*)(*args++);
+  float l = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+c+d+e+f+g+h+i+j+k+l+z;
+  fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void f_f13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f13i) { fprintf(out,"wrong data for f_f13i\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  float i = *(float*)(*args++);
+  float j = *(float*)(*args++);
+  float k = *(float*)(*args++);
+  float l = *(float*)(*args++);
+  float m = *(float*)(*args++);
+  int z = *(int*)(*args++);
+  float r=a+b+c+d+e+f+g+h+i+j+k+l+m+z;
+  fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void d_di_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_di) { fprintf(out,"wrong data for d_di\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+z;
+  fprintf(out,"double f(double,int):(%g,%d)",a,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d2i) { fprintf(out,"wrong data for d_d2i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+z;
+  fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d3i) { fprintf(out,"wrong data for d_d3i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+c+z;
+  fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d4i) { fprintf(out,"wrong data for d_d4i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+c+d+z;
+  fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d7i) { fprintf(out,"wrong data for d_d7i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+c+d+e+f+g+z;
+  fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d8i) { fprintf(out,"wrong data for d_d8i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  double h = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+c+d+e+f+g+h+z;
+  fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d12i) { fprintf(out,"wrong data for d_d12i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  double h = *(double*)(*args++);
+  double i = *(double*)(*args++);
+  double j = *(double*)(*args++);
+  double k = *(double*)(*args++);
+  double l = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+c+d+e+f+g+h+i+j+k+l+z;
+  fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_d13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d13i) { fprintf(out,"wrong data for d_d13i\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  double h = *(double*)(*args++);
+  double i = *(double*)(*args++);
+  double j = *(double*)(*args++);
+  double k = *(double*)(*args++);
+  double l = *(double*)(*args++);
+  double m = *(double*)(*args++);
+  int z = *(int*)(*args++);
+  double r=a+b+c+d+e+f+g+h+i+j+k+l+m+z;
+  fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
+  fflush(out);
+  *(double*)retp = r;
+}}
+
+/* small structure return tests */
+void S1_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S1_v) { fprintf(out,"wrong data for S1_v\n"); exit(1); }
+ {Size1 r = Size1_1;
+  fprintf(out,"Size1 f(void):");
+  fflush(out);
+  *(Size1*)retp = r;
+}}
+void S2_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S2_v) { fprintf(out,"wrong data for S2_v\n"); exit(1); }
+ {Size2 r = Size2_1;
+  fprintf(out,"Size2 f(void):");
+  fflush(out);
+  *(Size2*)retp = r;
+}}
+void S3_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S3_v) { fprintf(out,"wrong data for S3_v\n"); exit(1); }
+ {Size3 r = Size3_1;
+  fprintf(out,"Size3 f(void):");
+  fflush(out);
+  *(Size3*)retp = r;
+}}
+void S4_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S4_v) { fprintf(out,"wrong data for S4_v\n"); exit(1); }
+ {Size4 r = Size4_1;
+  fprintf(out,"Size4 f(void):");
+  fflush(out);
+  *(Size4*)retp = r;
+}}
+void S7_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S7_v) { fprintf(out,"wrong data for S7_v\n"); exit(1); }
+ {Size7 r = Size7_1;
+  fprintf(out,"Size7 f(void):");
+  fflush(out);
+  *(Size7*)retp = r;
+}}
+void S8_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S8_v) { fprintf(out,"wrong data for S8_v\n"); exit(1); }
+ {Size8 r = Size8_1;
+  fprintf(out,"Size8 f(void):");
+  fflush(out);
+  *(Size8*)retp = r;
+}}
+void S12_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S12_v) { fprintf(out,"wrong data for S12_v\n"); exit(1); }
+ {Size12 r = Size12_1;
+  fprintf(out,"Size12 f(void):");
+  fflush(out);
+  *(Size12*)retp = r;
+}}
+void S15_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S15_v) { fprintf(out,"wrong data for S15_v\n"); exit(1); }
+ {Size15 r = Size15_1;
+  fprintf(out,"Size15 f(void):");
+  fflush(out);
+  *(Size15*)retp = r;
+}}
+void S16_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&S16_v) { fprintf(out,"wrong data for S16_v\n"); exit(1); }
+ {Size16 r = Size16_1;
+  fprintf(out,"Size16 f(void):");
+  fflush(out);
+  *(Size16*)retp = r;
+}}
+
+/* structure tests */
+void I_III_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&I_III) { fprintf(out,"wrong data for I_III\n"); exit(1); }
+ {Int a = *(Int*)(*args++);
+  Int b = *(Int*)(*args++);
+  Int c = *(Int*)(*args++);
+  Int r;
+  r.x = a.x + b.x + c.x;
+  fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x);
+  fflush(out);
+  *(Int*)retp = r;
+}}
+void C_CdC_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&C_CdC) { fprintf(out,"wrong data for C_CdC\n"); exit(1); }
+ {Char a = *(Char*)(*args++);
+  double b = *(double*)(*args++);
+  Char c = *(Char*)(*args++);
+  Char r;
+  r.x = (a.x + c.x)/2;
+  fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x);
+  fflush(out);
+  *(Char*)retp = r;
+}}
+void F_Ffd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&F_Ffd) { fprintf(out,"wrong data for F_Ffd\n"); exit(1); }
+ {Float a = *(Float*)(*args++);
+  float b = *(float*)(*args++);
+  double c = *(double*)(*args++);
+  Float r;
+  r.x = a.x + b + c;
+  fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c);
+  fflush(out);
+  *(Float*)retp = r;
+}}
+void D_fDd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&D_fDd) { fprintf(out,"wrong data for D_fDd\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  Double b = *(Double*)(*args++);
+  double c = *(double*)(*args++);
+  Double r;
+  r.x = a + b.x + c;
+  fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c);
+  fflush(out);
+  *(Double*)retp = r;
+}}
+void D_Dfd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&D_Dfd) { fprintf(out,"wrong data for D_Dfd\n"); exit(1); }
+ {Double a = *(Double*)(*args++);
+  float b = *(float*)(*args++);
+  double c = *(double*)(*args++);
+  Double r;
+  r.x = a.x + b + c;
+  fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c);
+  fflush(out);
+  *(Double*)retp = r;
+}}
+void J_JiJ_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&J_JiJ) { fprintf(out,"wrong data for J_JiJ\n"); exit(1); }
+ {J a = *(J*)(*args++);
+  int b= *(int*)(*args++);
+  J c = *(J*)(*args++);
+  J r;
+  r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2;
+  fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2);
+  fflush(out);
+  *(J*)retp = r;
+}}
+#ifndef SKIP_EXTRA_STRUCTS
+void T_TcT_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&T_TcT) { fprintf(out,"wrong data for T_TcT\n"); exit(1); }
+ {T a = *(T*)(*args++);
+  char b = *(char*)(*args++);
+  T c = *(T*)(*args++);
+  T r;
+  r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2];
+  fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]);
+  fflush(out);
+  *(T*)retp = r;
+}}
+void X_BcdB_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&X_BcdB) { fprintf(out,"wrong data for X_BcdB\n"); exit(1); }
+ {B a = *(B*)(*args++);
+  char b = *(char*)(*args++);
+  double c = *(double*)(*args++);
+  B d = *(B*)(*args++);
+  static X xr={"return val",'R'};
+  X r;
+  r = xr;
+  r.c1 = b;
+  fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
+          a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]);
+  fflush(out);
+  *(X*)retp = r;
+}}
+#endif
+
+/* gpargs boundary tests */
+void l_l0K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l0K) { fprintf(out,"wrong data for l_l0K\n"); exit(1); }
+ {K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void l_l1K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l1K) { fprintf(out,"wrong data for l_l1K\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void l_l2K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l2K) { fprintf(out,"wrong data for l_l2K\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void l_l3K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l3K) { fprintf(out,"wrong data for l_l3K\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void l_l4K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l4K) { fprintf(out,"wrong data for l_l4K\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void l_l5K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l5K) { fprintf(out,"wrong data for l_l5K\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void l_l6K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&l_l6K) { fprintf(out,"wrong data for l_l6K\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  long a6 = *(long*)(*args++);
+  K b = *(K*)(*args++);
+  long c = *(long*)(*args++);
+  long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  *(ffi_arg*)retp = r;
+}}
+void f_f17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&f_f17l3L) { fprintf(out,"wrong data for f_f17l3L\n"); exit(1); }
+ {float a = *(float*)(*args++);
+  float b = *(float*)(*args++);
+  float c = *(float*)(*args++);
+  float d = *(float*)(*args++);
+  float e = *(float*)(*args++);
+  float f = *(float*)(*args++);
+  float g = *(float*)(*args++);
+  float h = *(float*)(*args++);
+  float i = *(float*)(*args++);
+  float j = *(float*)(*args++);
+  float k = *(float*)(*args++);
+  float l = *(float*)(*args++);
+  float m = *(float*)(*args++);
+  float n = *(float*)(*args++);
+  float o = *(float*)(*args++);
+  float p = *(float*)(*args++);
+  float q = *(float*)(*args++);
+  long s = *(long*)(*args++);
+  long t = *(long*)(*args++);
+  long u = *(long*)(*args++);
+  L z = *(L*)(*args++);
+  float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
+  fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
+  fflush(out);
+  *(float*)retp = r;
+}}
+void d_d17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_d17l3L) { fprintf(out,"wrong data for d_d17l3L\n"); exit(1); }
+ {double a = *(double*)(*args++);
+  double b = *(double*)(*args++);
+  double c = *(double*)(*args++);
+  double d = *(double*)(*args++);
+  double e = *(double*)(*args++);
+  double f = *(double*)(*args++);
+  double g = *(double*)(*args++);
+  double h = *(double*)(*args++);
+  double i = *(double*)(*args++);
+  double j = *(double*)(*args++);
+  double k = *(double*)(*args++);
+  double l = *(double*)(*args++);
+  double m = *(double*)(*args++);
+  double n = *(double*)(*args++);
+  double o = *(double*)(*args++);
+  double p = *(double*)(*args++);
+  double q = *(double*)(*args++);
+  long s = *(long*)(*args++);
+  long t = *(long*)(*args++);
+  long u = *(long*)(*args++);
+  L z = *(L*)(*args++);
+  double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
+  fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void ll_l2ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_l2ll) { fprintf(out,"wrong data for ll_l2ll\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long long b = *(long long *)(*args++);
+  long c = *(long*)(*args++);
+  long long r = (long long) (a1 + a2) + b + c;
+  fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void ll_l3ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_l3ll) { fprintf(out,"wrong data for ll_l3ll\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long long b = *(long long *)(*args++);
+  long c = *(long*)(*args++);
+  long long r = (long long) (a1 + a2 + a3) + b + c;
+  fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void ll_l4ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_l4ll) { fprintf(out,"wrong data for ll_l4ll\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long long b = *(long long *)(*args++);
+  long c = *(long*)(*args++);
+  long long r = (long long) (a1 + a2 + a3 + a4) + b + c;
+  fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void ll_l5ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_l5ll) { fprintf(out,"wrong data for ll_l5ll\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  long long b = *(long long *)(*args++);
+  long c = *(long*)(*args++);
+  long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c;
+  fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void ll_l6ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_l6ll) { fprintf(out,"wrong data for ll_l6ll\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  long a6 = *(long*)(*args++);
+  long long b = *(long long *)(*args++);
+  long c = *(long*)(*args++);
+  long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
+  fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void ll_l7ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&ll_l7ll) { fprintf(out,"wrong data for ll_l7ll\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  long a6 = *(long*)(*args++);
+  long a7 = *(long*)(*args++);
+  long long b = *(long long *)(*args++);
+  long c = *(long*)(*args++);
+  long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
+  fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  *(long long *)retp = r;
+}}
+void d_l2d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_l2d) { fprintf(out,"wrong data for d_l2d\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  double b = *(double*)(*args++);
+  long c = *(long*)(*args++);
+  double r = (double) (a1 + a2) + b + c;
+  fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_l3d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_l3d) { fprintf(out,"wrong data for d_l3d\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  double b = *(double*)(*args++);
+  long c = *(long*)(*args++);
+  double r = (double) (a1 + a2 + a3) + b + c;
+  fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_l4d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_l4d) { fprintf(out,"wrong data for d_l4d\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  double b = *(double*)(*args++);
+  long c = *(long*)(*args++);
+  double r = (double) (a1 + a2 + a3 + a4) + b + c;
+  fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_l5d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_l5d) { fprintf(out,"wrong data for d_l5d\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  double b = *(double*)(*args++);
+  long c = *(long*)(*args++);
+  double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c;
+  fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_l6d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_l6d) { fprintf(out,"wrong data for d_l6d\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  long a6 = *(long*)(*args++);
+  double b = *(double*)(*args++);
+  long c = *(long*)(*args++);
+  double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
+  fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+void d_l7d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
+{
+  if (data != (void*)&d_l7d) { fprintf(out,"wrong data for d_l7d\n"); exit(1); }
+ {long a1 = *(long*)(*args++);
+  long a2 = *(long*)(*args++);
+  long a3 = *(long*)(*args++);
+  long a4 = *(long*)(*args++);
+  long a5 = *(long*)(*args++);
+  long a6 = *(long*)(*args++);
+  long a7 = *(long*)(*args++);
+  double b = *(double*)(*args++);
+  long c = *(long*)(*args++);
+  double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
+  fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c);
+  fflush(out);
+  *(double*)retp = r;
+}}
+
+
+/*
+ * The way we run these tests - first call the function directly, then
+ * through vacall() - there is the danger that arguments or results seem
+ * to be passed correctly, but what we are seeing are in fact the vestiges
+ * (traces) or the previous call. This may seriously fake the test.
+ * Avoid this by clearing the registers between the first and the second call.
+ */
+long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h,
+                     long i, long j, long k, long l, long m, long n, long o, long p)
+{ return 0; }
+float clear_traces_f (float a, float b, float c, float d, float e, float f, float g,
+                      float h, float i, float j, float k, float l, float m, float n,
+                      float o, float p)
+{ return 0.0; }
+double clear_traces_d (double a, double b, double c, double d, double e, double f, double g,
+                       double h, double i, double j, double k, double l, double m, double n,
+                       double o, double p)
+{ return 0.0; }
+J clear_traces_J (void)
+{ J j; j.l1 = j.l2 = 0; return j; }
+void clear_traces (void)
+{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+  clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+  clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+  clear_traces_J();
+}
+
+int main (void)
+{
+  void* callback_code;
+  void* callback_writable;
+#define ALLOC_CALLBACK() \
+  callback_writable = ffi_closure_alloc(sizeof(ffi_closure),&callback_code); \
+  if (!callback_writable) abort()
+#define PREP_CALLBACK(cif,simulator,data) \
+  if (ffi_prep_closure_loc(callback_writable,&(cif),simulator,data,callback_code) != FFI_OK) abort()
+#define FREE_CALLBACK() \
+  ffi_closure_free(callback_writable)
+
+  ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar;
+  out = stdout;
+
+#if (!defined(DGTEST)) || DGTEST == 1  
+  /* void tests */
+  v_v();
+  clear_traces();
+  ALLOC_CALLBACK();
+  {
+    ffi_cif cif;
+    FFI_PREP_CIF_NOARGS(cif,ffi_type_void);
+    PREP_CALLBACK(cif,v_v_simulator,(void*)&v_v);
+    ((void (ABI_ATTR *) (void)) callback_code) ();
+  }
+  FREE_CALLBACK();
+#endif
+
+  /* int tests */
+  { int ir;
+
+#if (!defined(DGTEST)) || DGTEST == 2
+    ir = i_v();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+    ir = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_sint);
+      PREP_CALLBACK(cif,i_v_simulator,(void*)&i_v);
+      ir = ((int (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+#endif    
+
+#if (!defined(DGTEST)) || DGTEST == 3
+    ir = i_i(i1);
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+    ir = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+      PREP_CALLBACK(cif,i_i_simulator,(void*)&i_i);
+      ir = ((int (ABI_ATTR *) (int)) callback_code) (i1);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 4    
+    ir = i_i2(i1,i2);
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+    ir = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+      PREP_CALLBACK(cif,i_i2_simulator,(void*)&i_i2);
+      ir = ((int (ABI_ATTR *) (int,int)) callback_code) (i1,i2);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 5    
+    ir = i_i4(i1,i2,i3,i4);
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+    ir = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+      PREP_CALLBACK(cif,i_i4_simulator,(void*)&i_i4);
+      ir = ((int (ABI_ATTR *) (int,int,int,int)) callback_code) (i1,i2,i3,i4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 6    
+    ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8);
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+    ir = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+      PREP_CALLBACK(cif,i_i8_simulator,(void*)&i_i8);
+      ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+#endif
+  
+#if (!defined(DGTEST)) || DGTEST == 7
+    ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+    ir = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
+      PREP_CALLBACK(cif,i_i16_simulator,(void*)&i_i16);
+      ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%d\n",ir);
+    fflush(out);
+#endif
+  }
+
+  /* float tests */
+  { float fr;
+
+#if (!defined(DGTEST)) || DGTEST == 8  
+    fr = f_f(f1);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f_simulator,(void*)&f_f);
+      fr = ((float (ABI_ATTR *) (float)) callback_code) (f1);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 9    
+    fr = f_f2(f1,f2);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f2_simulator,(void*)&f_f2);
+      fr = ((float (ABI_ATTR *) (float,float)) callback_code) (f1,f2);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 10
+    fr = f_f4(f1,f2,f3,f4);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f4_simulator,(void*)&f_f4);
+      fr = ((float (ABI_ATTR *) (float,float,float,float)) callback_code) (f1,f2,f3,f4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 11    
+    fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f8_simulator,(void*)&f_f8);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 12    
+    fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f16_simulator,(void*)&f_f16);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 13    
+    fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f24_simulator,(void*)&f_f24);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+  }
+
+  /* double tests */
+  { double dr;
+
+#if (!defined(DGTEST)) || DGTEST == 14
+    dr = d_d(d1);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d_simulator,(void*)&d_d);
+      dr = ((double (ABI_ATTR *) (double)) callback_code) (d1);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 15    
+    dr = d_d2(d1,d2);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d2_simulator,(void*)&d_d2);
+      dr = ((double (ABI_ATTR *) (double,double)) callback_code) (d1,d2);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+  
+#if (!defined(DGTEST)) || DGTEST == 16    
+    dr = d_d4(d1,d2,d3,d4);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d4_simulator,(void*)&d_d4);
+      dr = ((double (ABI_ATTR *) (double,double,double,double)) callback_code) (d1,d2,d3,d4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 17    
+    dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d8_simulator,(void*)&d_d8);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 18    
+    dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d16_simulator,(void*)&d_d16);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+  }
+
+  /* pointer tests */
+  { void* vpr;
+
+#if (!defined(DGTEST)) || DGTEST == 19 
+    vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4);
+    fprintf(out,"->0x%p\n",vpr);
+    fflush(out);
+    vpr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_pointer);
+      PREP_CALLBACK(cif,vp_vpdpcpsp_simulator,(void*)&vp_vpdpcpsp);
+      vpr = ((void* (ABI_ATTR *) (void*,double*,char*,Int*)) callback_code) (&uc1,&d2,str3,&I4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%p\n",vpr);
+    fflush(out);
+#endif
+  }
+
+  /* mixed number tests */
+  { uchar ucr;
+    ushort usr;
+    float fr;
+    double dr;
+    long long llr;
+
+#if (!defined(DGTEST)) || DGTEST == 20
+    ucr = uc_ucsil(uc1,us2,ui3,ul4);
+    fprintf(out,"->%u\n",ucr);
+    fflush(out);
+    ucr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_uchar);
+      PREP_CALLBACK(cif,uc_ucsil_simulator,(void*)&uc_ucsil);
+      ucr = ((uchar (ABI_ATTR *) (uchar,ushort,uint,ulong)) callback_code) (uc1,us2,ui3,ul4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%u\n",ucr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 21    
+    dr = d_iidd(i1,i2,d3,d4);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_iidd_simulator,(void*)&d_iidd);
+      dr = ((double (ABI_ATTR *) (int,int,double,double)) callback_code) (i1,i2,d3,d4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 22    
+    dr = d_iiidi(i1,i2,i3,d4,i5);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_iiidi_simulator,(void*)&d_iiidi);
+      dr = ((double (ABI_ATTR *) (int,int,int,double,int)) callback_code) (i1,i2,i3,d4,i5);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 23    
+    dr = d_idid(i1,d2,i3,d4);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_idid_simulator,(void*)&d_idid);
+      dr = ((double (ABI_ATTR *) (int,double,int,double)) callback_code) (i1,d2,i3,d4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 24    
+    dr = d_fdi(f1,d2,i3);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_fdi_simulator,(void*)&d_fdi);
+      dr = ((double (ABI_ATTR *) (float,double,int)) callback_code) (f1,d2,i3);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 25    
+    usr = us_cdcd(c1,d2,c3,d4);
+    fprintf(out,"->%u\n",usr);
+    fflush(out);
+    usr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_ushort);
+      PREP_CALLBACK(cif,us_cdcd_simulator,(void*)&us_cdcd);
+      usr = ((ushort (ABI_ATTR *) (char,double,char,double)) callback_code) (c1,d2,c3,d4);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%u\n",usr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 26    
+    llr = ll_iiilli(i1,i2,i3,ll1,i13);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_iiilli_simulator,(void*)&ll_iiilli);
+      llr = ((long long (ABI_ATTR *) (int,int,int,long long,int)) callback_code) (i1,i2,i3,ll1,i13);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 27    
+    llr = ll_flli(f13,ll1,i13);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_flli_simulator,(void*)&ll_flli);
+      llr = ((long long (ABI_ATTR *) (float,long long,int)) callback_code) (f13,ll1,i13);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 28    
+    fr = f_fi(f1,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_fi_simulator,(void*)&f_fi);
+      fr = ((float (ABI_ATTR *) (float,int)) callback_code) (f1,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 29    
+    fr = f_f2i(f1,f2,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f2i_simulator,(void*)&f_f2i);
+      fr = ((float (ABI_ATTR *) (float,float,int)) callback_code) (f1,f2,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 30    
+    fr = f_f3i(f1,f2,f3,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f3i_simulator,(void*)&f_f3i);
+      fr = ((float (ABI_ATTR *) (float,float,float,int)) callback_code) (f1,f2,f3,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 31    
+    fr = f_f4i(f1,f2,f3,f4,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f4i_simulator,(void*)&f_f4i);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,int)) callback_code) (f1,f2,f3,f4,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 32    
+    fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f7i_simulator,(void*)&f_f7i);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 33    
+    fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f8i_simulator,(void*)&f_f8i);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 34    
+    fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f13i_simulator,(void*)&f_f13i);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 35    
+    dr = d_di(d1,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_di_simulator,(void*)&d_di);
+      dr = ((double (ABI_ATTR *) (double,int)) callback_code) (d1,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 36    
+    dr = d_d2i(d1,d2,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d2i_simulator,(void*)&d_d2i);
+      dr = ((double (ABI_ATTR *) (double,double,int)) callback_code) (d1,d2,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 37    
+    dr = d_d3i(d1,d2,d3,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d3i_simulator,(void*)&d_d3i);
+      dr = ((double (ABI_ATTR *) (double,double,double,int)) callback_code) (d1,d2,d3,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 38    
+    dr = d_d4i(d1,d2,d3,d4,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d4i_simulator,(void*)&d_d4i);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,int)) callback_code) (d1,d2,d3,d4,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 39    
+    dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d7i_simulator,(void*)&d_d7i);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 40    
+    dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d8i_simulator,(void*)&d_d8i);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 41    
+    dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d12i_simulator,(void*)&d_d12i);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 42    
+    dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d13i_simulator,(void*)&d_d13i);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+  }
+
+  /* small structure return tests */
+#if (!defined(DGTEST)) || DGTEST == 43
+  {
+    Size1 r = S1_v();
+    fprintf(out,"->{%c}\n",r.x1);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL };
+      ffi_type ffi_type_Size1;
+      ffi_type_Size1.type = FFI_TYPE_STRUCT;
+      ffi_type_Size1.size = sizeof(Size1);
+      ffi_type_Size1.alignment = alignof_slot(Size1);
+      ffi_type_Size1.elements = ffi_type_Size1_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1);
+      PREP_CALLBACK(cif,S1_v_simulator,(void*)&S1_v);
+      r = ((Size1 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c}\n",r.x1);
+    fflush(out);
+  }
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 44
+  {
+    Size2 r = S2_v();
+    fprintf(out,"->{%c%c}\n",r.x1,r.x2);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size2;
+      ffi_type_Size2.type = FFI_TYPE_STRUCT;
+      ffi_type_Size2.size = sizeof(Size2);
+      ffi_type_Size2.alignment = alignof_slot(Size2);
+      ffi_type_Size2.elements = ffi_type_Size2_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2);
+      PREP_CALLBACK(cif,S2_v_simulator,(void*)&S2_v);
+      r = ((Size2 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c}\n",r.x1,r.x2);
+    fflush(out);
+  }
+#endif    
+
+#if (!defined(DGTEST)) || DGTEST == 45
+  {
+    Size3 r = S3_v();
+    fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size3;
+      ffi_type_Size3.type = FFI_TYPE_STRUCT;
+      ffi_type_Size3.size = sizeof(Size3);
+      ffi_type_Size3.alignment = alignof_slot(Size3);
+      ffi_type_Size3.elements = ffi_type_Size3_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3);
+      PREP_CALLBACK(cif,S3_v_simulator,(void*)&S3_v);
+      r = ((Size3 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
+    fflush(out);
+  }
+#endif    
+
+#if (!defined(DGTEST)) || DGTEST == 46
+  {
+    Size4 r = S4_v();
+    fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size4;
+      ffi_type_Size4.type = FFI_TYPE_STRUCT;
+      ffi_type_Size4.size = sizeof(Size4);
+      ffi_type_Size4.alignment = alignof_slot(Size4);
+      ffi_type_Size4.elements = ffi_type_Size4_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4);
+      PREP_CALLBACK(cif,S4_v_simulator,(void*)&S4_v);
+      r = ((Size4 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
+    fflush(out);
+  }
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 47  
+  {
+    Size7 r = S7_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size7;
+      ffi_type_Size7.type = FFI_TYPE_STRUCT;
+      ffi_type_Size7.size = sizeof(Size7);
+      ffi_type_Size7.alignment = alignof_slot(Size7);
+      ffi_type_Size7.elements = ffi_type_Size7_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7);
+      PREP_CALLBACK(cif,S7_v_simulator,(void*)&S7_v);
+      r = ((Size7 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
+    fflush(out);
+  }
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 48  
+  {
+    Size8 r = S8_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size8;
+      ffi_type_Size8.type = FFI_TYPE_STRUCT;
+      ffi_type_Size8.size = sizeof(Size8);
+      ffi_type_Size8.alignment = alignof_slot(Size8);
+      ffi_type_Size8.elements = ffi_type_Size8_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8);
+      PREP_CALLBACK(cif,S8_v_simulator,(void*)&S8_v);
+      r = ((Size8 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
+    fflush(out);
+  }
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 49
+  {
+    Size12 r = S12_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size12;
+      ffi_type_Size12.type = FFI_TYPE_STRUCT;
+      ffi_type_Size12.size = sizeof(Size12);
+      ffi_type_Size12.alignment = alignof_slot(Size12);
+      ffi_type_Size12.elements = ffi_type_Size12_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12);
+      PREP_CALLBACK(cif,S12_v_simulator,(void*)&S12_v);
+      r = ((Size12 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
+    fflush(out);
+  }
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 50  
+  {
+    Size15 r = S15_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size15;
+      ffi_type_Size15.type = FFI_TYPE_STRUCT;
+      ffi_type_Size15.size = sizeof(Size15);
+      ffi_type_Size15.alignment = alignof_slot(Size15);
+      ffi_type_Size15.elements = ffi_type_Size15_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15);
+      PREP_CALLBACK(cif,S15_v_simulator,(void*)&S15_v);
+      r = ((Size15 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
+    fflush(out);
+  }
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 51
+  {
+    Size16 r = S16_v();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
+    fflush(out);
+    memset(&r,0,sizeof(r)); clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
+      ffi_type ffi_type_Size16;
+      ffi_type_Size16.type = FFI_TYPE_STRUCT;
+      ffi_type_Size16.size = sizeof(Size16);
+      ffi_type_Size16.alignment = alignof_slot(Size16);
+      ffi_type_Size16.elements = ffi_type_Size16_elements;
+      ffi_cif cif;
+      FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16);
+      PREP_CALLBACK(cif,S16_v_simulator,(void*)&S16_v);
+      r = ((Size16 (ABI_ATTR *) (void)) callback_code) ();
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
+    fflush(out);
+  }
+#endif
+
+  
+  /* structure tests */
+  { Int Ir;
+    Char Cr;
+    Float Fr;
+    Double Dr;
+    J Jr;
+#ifndef SKIP_EXTRA_STRUCTS
+    T Tr;
+    X Xr;
+#endif    
+
+#if (!defined(DGTEST)) || DGTEST == 52
+    Ir = I_III(I1,I2,I3);
+    fprintf(out,"->{%d}\n",Ir.x);
+    fflush(out);
+    Ir.x = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL };
+      ffi_type ffi_type_Int;
+      ffi_type_Int.type = FFI_TYPE_STRUCT;
+      ffi_type_Int.size = sizeof(Int);
+      ffi_type_Int.alignment = alignof_slot(Int);
+      ffi_type_Int.elements = ffi_type_Int_elements;
+      ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_Int);
+      PREP_CALLBACK(cif,I_III_simulator,(void*)&I_III);
+      Ir = ((Int (ABI_ATTR *) (Int,Int,Int)) callback_code) (I1,I2,I3);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%d}\n",Ir.x);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 53
+    Cr = C_CdC(C1,d2,C3);
+    fprintf(out,"->{'%c'}\n",Cr.x);
+    fflush(out);
+    Cr.x = '\0'; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL };
+      ffi_type ffi_type_Char;
+      ffi_type_Char.type = FFI_TYPE_STRUCT;
+      ffi_type_Char.size = sizeof(Char);
+      ffi_type_Char.alignment = alignof_slot(Char);
+      ffi_type_Char.elements = ffi_type_Char_elements;
+      ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_Char);
+      PREP_CALLBACK(cif,C_CdC_simulator,(void*)&C_CdC);
+      Cr = ((Char (ABI_ATTR *) (Char,double,Char)) callback_code) (C1,d2,C3);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{'%c'}\n",Cr.x);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 54    
+    Fr = F_Ffd(F1,f2,d3);
+    fprintf(out,"->{%g}\n",Fr.x);
+    fflush(out);
+    Fr.x = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL };
+      ffi_type ffi_type_Float;
+      ffi_type_Float.type = FFI_TYPE_STRUCT;
+      ffi_type_Float.size = sizeof(Float);
+      ffi_type_Float.alignment = alignof_slot(Float);
+      ffi_type_Float.elements = ffi_type_Float_elements;
+      ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_Float);
+      PREP_CALLBACK(cif,F_Ffd_simulator,(void*)&F_Ffd);
+      Fr = ((Float (ABI_ATTR *) (Float,float,double)) callback_code) (F1,f2,d3);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%g}\n",Fr.x);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 55    
+    Dr = D_fDd(f1,D2,d3);
+    fprintf(out,"->{%g}\n",Dr.x);
+    fflush(out);
+    Dr.x = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
+      ffi_type ffi_type_Double;
+      ffi_type_Double.type = FFI_TYPE_STRUCT;
+      ffi_type_Double.size = sizeof(Double);
+      ffi_type_Double.alignment = alignof_slot(Double);
+      ffi_type_Double.elements = ffi_type_Double_elements;
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
+      PREP_CALLBACK(cif,D_fDd_simulator,(void*)&D_fDd);
+      Dr = ((Double (ABI_ATTR *) (float,Double,double)) callback_code) (f1,D2,d3);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%g}\n",Dr.x);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 56
+    Dr = D_Dfd(D1,f2,d3);
+    fprintf(out,"->{%g}\n",Dr.x);
+    fflush(out);
+    Dr.x = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
+      ffi_type ffi_type_Double;
+      ffi_type_Double.type = FFI_TYPE_STRUCT;
+      ffi_type_Double.size = sizeof(Double);
+      ffi_type_Double.alignment = alignof_slot(Double);
+      ffi_type_Double.elements = ffi_type_Double_elements;
+      ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
+      PREP_CALLBACK(cif,D_Dfd_simulator,(void*)&D_Dfd);
+      Dr = ((Double (ABI_ATTR *) (Double,float,double)) callback_code) (D1,f2,d3);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%g}\n",Dr.x);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 57
+    Jr = J_JiJ(J1,i2,J2);
+    fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
+    fflush(out);
+    Jr.l1 = Jr.l2 = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL };
+      ffi_type ffi_type_J;
+      ffi_type_J.type = FFI_TYPE_STRUCT;
+      ffi_type_J.size = sizeof(J);
+      ffi_type_J.alignment = alignof_slot(J);
+      ffi_type_J.elements = ffi_type_J_elements;
+      ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_J);
+      PREP_CALLBACK(cif,J_JiJ_simulator,(void*)&J_JiJ);
+      Jr = ((J (ABI_ATTR *) (J,int,J)) callback_code) (J1,i2,J2);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
+    fflush(out);
+#endif
+
+#ifndef SKIP_EXTRA_STRUCTS
+#if (!defined(DGTEST)) || DGTEST == 58
+    Tr = T_TcT(T1,' ',T2);
+    fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
+    fflush(out);
+    Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_T_elements[] = { ??, NULL };
+      ffi_type ffi_type_T;
+      ffi_type_T.type = FFI_TYPE_STRUCT;
+      ffi_type_T.size = sizeof(T);
+      ffi_type_T.alignment = alignof_slot(T);
+      ffi_type_T.elements = ffi_type_T_elements;
+      ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_T);
+      PREP_CALLBACK(cif,T_TcT_simulator,(void*)&T_TcT);
+      Tr = ((T (ABI_ATTR *) (T,char,T)) callback_code) (T1,' ',T2);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
+    fflush(out);
+#endif
+
+#ifndef SKIP_X
+#if (!defined(DGTEST)) || DGTEST == 59
+    Xr = X_BcdB(B1,c2,d3,B2);
+    fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
+    fflush(out);
+    Xr.c[0]=Xr.c1='\0'; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* ffi_type_X_elements[] = { ??, NULL };
+      ffi_type ffi_type_X;
+      ffi_type_X.type = FFI_TYPE_STRUCT;
+      ffi_type_X.size = sizeof(X);
+      ffi_type_X.alignment = alignof_slot(X);
+      ffi_type_X.elements = ffi_type_X_elements;
+      ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_X);
+      PREP_CALLBACK(cif,X_BcdB_simulator,(void*)&X_BcdB);
+      Xr = ((X (ABI_ATTR *) (B,char,double,B)) callback_code) (B1,c2,d3,B2);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
+    fflush(out);
+#endif
+#endif
+#endif
+  }
+
+  
+  /* gpargs boundary tests */
+  {
+    ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
+    ffi_type ffi_type_K;
+    ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
+    ffi_type ffi_type_L;
+    long lr;
+    long long llr;
+    float fr;
+    double dr;
+
+    ffi_type_K.type = FFI_TYPE_STRUCT;
+    ffi_type_K.size = sizeof(K);
+    ffi_type_K.alignment = alignof_slot(K);
+    ffi_type_K.elements = ffi_type_K_elements;
+
+    ffi_type_L.type = FFI_TYPE_STRUCT;
+    ffi_type_L.size = sizeof(L);
+    ffi_type_L.alignment = alignof_slot(L);
+    ffi_type_L.elements = ffi_type_L_elements;
+
+#if (!defined(DGTEST)) || DGTEST == 60
+    lr = l_l0K(K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l0K_simulator,(void*)l_l0K);
+      lr = ((long (ABI_ATTR *) (K,long)) callback_code) (K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 61
+    lr = l_l1K(l1,K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l1K_simulator,(void*)l_l1K);
+      lr = ((long (ABI_ATTR *) (long,K,long)) callback_code) (l1,K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 62
+    lr = l_l2K(l1,l2,K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l2K_simulator,(void*)l_l2K);
+      lr = ((long (ABI_ATTR *) (long,long,K,long)) callback_code) (l1,l2,K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 63
+    lr = l_l3K(l1,l2,l3,K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l3K_simulator,(void*)l_l3K);
+      lr = ((long (ABI_ATTR *) (long,long,long,K,long)) callback_code) (l1,l2,l3,K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 64
+    lr = l_l4K(l1,l2,l3,l4,K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l4K_simulator,(void*)l_l4K);
+      lr = ((long (ABI_ATTR *) (long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 65  
+    lr = l_l5K(l1,l2,l3,l4,l5,K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l5K_simulator,(void*)l_l5K);
+      lr = ((long (ABI_ATTR *) (long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 66
+    lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9);
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+    lr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
+      PREP_CALLBACK(cif,l_l6K_simulator,(void*)l_l6K);
+      lr = ((long (ABI_ATTR *) (long,long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,l6,K1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%ld\n",lr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 67    
+    fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+    fr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_float);
+      PREP_CALLBACK(cif,f_f17l3L_simulator,(void*)&f_f17l3L);
+      fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,long,long,long,L)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",fr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 68    
+    dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_d17l3L_simulator,(void*)&d_d17l3L);
+      dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,long,long,long,L)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 69    
+    llr = ll_l2ll(l1,l2,ll1,l9);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_l2ll_simulator,(void*)ll_l2ll);
+      llr = ((long long (ABI_ATTR *) (long,long,long long,long)) callback_code) (l1,l2,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 70
+    llr = ll_l3ll(l1,l2,l3,ll1,l9);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_l3ll_simulator,(void*)ll_l3ll);
+      llr = ((long long (ABI_ATTR *) (long,long,long,long long,long)) callback_code) (l1,l2,l3,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 71    
+    llr = ll_l4ll(l1,l2,l3,l4,ll1,l9);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_l4ll_simulator,(void*)ll_l4ll);
+      llr = ((long long (ABI_ATTR *) (long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 72    
+    llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_l5ll_simulator,(void*)ll_l5ll);
+      llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 73    
+    llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_l6ll_simulator,(void*)ll_l6ll);
+      llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 74    
+    llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+    llr = 0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
+      PREP_CALLBACK(cif,ll_l7ll_simulator,(void*)ll_l7ll);
+      llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 75    
+    dr = d_l2d(l1,l2,ll1,l9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_l2d_simulator,(void*)d_l2d);
+      dr = ((double (ABI_ATTR *) (long,long,double,long)) callback_code) (l1,l2,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 76    
+    dr = d_l3d(l1,l2,l3,ll1,l9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_l3d_simulator,(void*)d_l3d);
+      dr = ((double (ABI_ATTR *) (long,long,long,double,long)) callback_code) (l1,l2,l3,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 77    
+    dr = d_l4d(l1,l2,l3,l4,ll1,l9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_l4d_simulator,(void*)d_l4d);
+      dr = ((double (ABI_ATTR *) (long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 78
+    dr = d_l5d(l1,l2,l3,l4,l5,ll1,l9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_l5d_simulator,(void*)d_l5d);
+      dr = ((double (ABI_ATTR *) (long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 79
+    dr = d_l6d(l1,l2,l3,l4,l5,l6,ll1,l9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_l6d_simulator,(void*)d_l6d);
+      dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+#if (!defined(DGTEST)) || DGTEST == 80
+    dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+    dr = 0.0; clear_traces();
+    ALLOC_CALLBACK();
+    {
+      ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
+      ffi_cif cif;
+      FFI_PREP_CIF(cif,argtypes,ffi_type_double);
+      PREP_CALLBACK(cif,d_l7d_simulator,(void*)d_l7d);
+      dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9);
+    }
+    FREE_CALLBACK();
+    fprintf(out,"->%g\n",dr);
+    fflush(out);
+#endif
+
+  }
+  
+  exit(0);
+}
+
diff --git a/libffi/testsuite/libffi.bhaible/testcases.c b/libffi/testsuite/libffi.bhaible/testcases.c
new file mode 100644 (file)
index 0000000..23a6f46
--- /dev/null
@@ -0,0 +1,747 @@
+/*
+ * Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
+ * Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+/* This file defines test functions of selected signatures, that exercise
+   dark corners of the various ABIs. */
+
+#include <stdio.h>
+
+FILE* out;
+
+#define uchar unsigned char
+#define ushort unsigned short
+#define uint unsigned int
+#define ulong unsigned long
+
+typedef struct { char x; } Char;
+typedef struct { short x; } Short;
+typedef struct { int x; } Int;
+typedef struct { long x; } Long;
+typedef struct { float x; } Float;
+typedef struct { double x; } Double;
+typedef struct { char c; float f; } A;
+typedef struct { double d; int i[3]; } B;
+typedef struct { long l1; long l2; } J;
+typedef struct { long l1; long l2; long l3; long l4; } K;
+typedef struct { long l1; long l2; long l3; long l4; long l5; long l6; } L;
+typedef struct { char x1; } Size1;
+typedef struct { char x1; char x2; } Size2;
+typedef struct { char x1; char x2; char x3; } Size3;
+typedef struct { char x1; char x2; char x3; char x4; } Size4;
+typedef struct {
+  char x1; char x2; char x3; char x4; char x5; char x6; char x7;
+} Size7;
+typedef struct {
+  char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
+} Size8;
+typedef struct {
+  char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
+  char x9; char x10; char x11; char x12;
+} Size12;
+typedef struct {
+  char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
+  char x9; char x10; char x11; char x12; char x13; char x14; char x15;
+} Size15;
+typedef struct {
+  char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
+  char x9; char x10; char x11; char x12; char x13; char x14; char x15; char x16;
+} Size16;
+typedef struct { char c[3]; } T;
+typedef struct { char c[33],c1; } X;
+
+/* Don't use a number over 127, as some systems use signed chars and
+   the test case 25 doesn't account for this, resulting in undefined
+   behavior. See https://github.com/libffi/libffi/issues/598. */
+char c1='a', c2=127, c3=(char)1;
+
+short s1=32767, s2=(short)32768, s3=3, s4=4, s5=5, s6=6, s7=7, s8=8, s9=9;
+int i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9,
+    i10=11, i11=12, i12=13, i13=14, i14=15, i15=16, i16=17;
+long l1=1, l2=2, l3=3, l4=4, l5=5, l6=6, l7=7, l8=8, l9=9;
+long long ll1 = 3875056143130689530LL;
+float f1=0.1f, f2=0.2f, f3=0.3f, f4=0.4f, f5=0.5f, f6=0.6f, f7=0.7f, f8=0.8f, f9=0.9f,
+      f10=1.1f, f11=1.2f, f12=1.3f, f13=1.4f, f14=1.5f, f15=1.6f, f16=1.7f, f17=1.8f,
+      f18=1.9f, f19=2.1f, f20=2.2f, f21=2.3f, f22=2.4f, f23=2.5f, f24=2.6f;
+double d1=0.1, d2=0.2, d3=0.3, d4=0.4, d5=0.5, d6=0.6, d7=0.7, d8=0.8, d9=0.9,
+       d10=1.1, d11=1.2, d12=1.3, d13=1.4, d14=1.5, d15=1.6, d16=1.7, d17=1.8;
+
+uchar uc1='a', uc2=127, uc3=128, uc4=255, uc5=(uchar)-1;
+ushort us1=1, us2=2, us3=3, us4=4, us5=5, us6=6, us7=7, us8=8, us9=9;
+uint ui1=1, ui2=2, ui3=3, ui4=4, ui5=5, ui6=6, ui7=7, ui8=8, ui9=9;
+ulong ul1=1, ul2=2, ul3=3, ul4=4, ul5=5, ul6=6, ul7=7, ul8=8, ul9=9;
+
+char *str1="hello",str2[]="goodbye",*str3="still here?";
+Char C1={'A'}, C2={'B'}, C3={'C'}, C4={'\377'}, C5={(char)(-1)};
+Short S1={1}, S2={2}, S3={3}, S4={4}, S5={5}, S6={6}, S7={7}, S8={8}, S9={9};
+Int I1={1}, I2={2}, I3={3}, I4={4}, I5={5}, I6={6}, I7={7}, I8={8}, I9={9};
+Float F1={0.1f}, F2={0.2f}, F3={0.3f}, F4={0.4f}, F5={0.5f}, F6={0.6f}, F7={0.7f}, F8={0.8f}, F9={0.9f};
+Double D1={0.1}, D2={0.2}, D3={0.3}, D4={0.4}, D5={0.5}, D6={0.6}, D7={0.7}, D8={0.8}, D9={0.9};
+
+A A1={'a',0.1f},A2={'b',0.2f},A3={'\377',0.3f};
+B B1={0.1,{1,2,3}},B2={0.2,{5,4,3}};
+J J1={47,11},J2={73,55};
+K K1={19,69,12,28};
+L L1={561,1105,1729,2465,2821,6601}; /* A002997 */
+Size1 Size1_1={'a'};
+Size2 Size2_1={'a','b'};
+Size3 Size3_1={'a','b','c'};
+Size4 Size4_1={'a','b','c','d'};
+Size7 Size7_1={'a','b','c','d','e','f','g'};
+Size8 Size8_1={'a','b','c','d','e','f','g','h'};
+Size12 Size12_1={'a','b','c','d','e','f','g','h','i','j','k','l'};
+Size15 Size15_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'};
+Size16 Size16_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'};
+T T1={{'t','h','e'}},T2={{'f','o','x'}};
+X X1={"abcdefghijklmnopqrstuvwxyzABCDEF",'G'}, X2={"123",'9'}, X3={"return-return-return",'R'};
+
+#if defined(__GNUC__)
+#define __STDCALL__ __attribute__((stdcall))
+#define __THISCALL__ __attribute__((thiscall))
+#define __FASTCALL__ __attribute__((fastcall))
+#define __MSABI__ __attribute__((ms_abi))
+#else
+#define __STDCALL__ __stdcall
+#define __THISCALL__ __thiscall
+#define __FASTCALL__ __fastcall
+#endif
+
+#ifndef ABI_ATTR
+#define ABI_ATTR
+#endif
+
+/* void tests */
+void ABI_ATTR v_v (void)
+{
+  fprintf(out,"void f(void):\n");
+  fflush(out);
+}
+
+/* int tests */
+int ABI_ATTR i_v (void)
+{
+  int r=99;
+  fprintf(out,"int f(void):");
+  fflush(out);
+  return r;
+}
+int ABI_ATTR i_i (int a)
+{
+  int r=a+1;
+  fprintf(out,"int f(int):(%d)",a);
+  fflush(out);
+  return r;
+}
+int ABI_ATTR i_i2 (int a, int b)
+{
+  int r=a+b;
+  fprintf(out,"int f(2*int):(%d,%d)",a,b);
+  fflush(out);
+  return r;
+}
+int ABI_ATTR i_i4 (int a, int b, int c, int d)
+{
+  int r=a+b+c+d;
+  fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+int ABI_ATTR i_i8 (int a, int b, int c, int d, int e, int f, int g, int h)
+{
+  int r=a+b+c+d+e+f+g+h;
+  fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h);
+  fflush(out);
+  return r;
+}
+int ABI_ATTR i_i16 (int a, int b, int c, int d, int e, int f, int g, int h,
+           int i, int j, int k, int l, int m, int n, int o, int p)
+{
+  int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
+  fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
+          a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
+  fflush(out);
+  return r;
+}
+
+/* float tests */
+float ABI_ATTR f_f (float a)
+{
+  float r=a+1.0f;
+  fprintf(out,"float f(float):(%g)",a);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f2 (float a, float b)
+{
+  float r=a+b;
+  fprintf(out,"float f(2*float):(%g,%g)",a,b);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f4 (float a, float b, float c, float d)
+{
+  float r=a+b+c+d;
+  fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f8 (float a, float b, float c, float d, float e, float f,
+            float g, float h)
+{
+  float r=a+b+c+d+e+f+g+h;
+  fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f16 (float a, float b, float c, float d, float e, float f, float g, float h,
+             float i, float j, float k, float l, float m, float n, float o, float p)
+{
+  float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
+  fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f24 (float a, float b, float c, float d, float e, float f, float g, float h,
+             float i, float j, float k, float l, float m, float n, float o, float p,
+             float q, float s, float t, float u, float v, float w, float x, float y)
+{
+  float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y;
+  fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y);
+  fflush(out);
+  return r;
+}
+
+/* double tests */
+double ABI_ATTR d_d (double a)
+{
+  double r=a+1.0;
+  fprintf(out,"double f(double):(%g)",a);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d2 (double a, double b)
+{
+  double r=a+b;
+  fprintf(out,"double f(2*double):(%g,%g)",a,b);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d4 (double a, double b, double c, double d)
+{
+  double r=a+b+c+d;
+  fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d8 (double a, double b, double c, double d, double e, double f,
+             double g, double h)
+{
+  double r=a+b+c+d+e+f+g+h;
+  fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d16 (double a, double b, double c, double d, double e, double f,
+              double g, double h, double i, double j, double k, double l,
+              double m, double n, double o, double p)
+{
+  double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
+  fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
+  fflush(out);
+  return r;
+}
+
+/* pointer tests */
+void* ABI_ATTR vp_vpdpcpsp (void* a, double* b, char* c, Int* d)
+{
+  void* ret = (char*)b + 1;
+  fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d);
+  fflush(out);
+  return ret;
+}
+
+/* mixed number tests */
+uchar ABI_ATTR uc_ucsil (uchar a, ushort b, uint c, ulong d)
+{
+  uchar r = (uchar)-1;
+  fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_iidd (int a, int b, double c, double d)
+{
+  double r = a+b+c+d;
+  fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_iiidi (int a, int b, int c, double d, int e)
+{
+  double r = a+b+c+d+e;
+  fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_idid (int a, double b, int c, double d)
+{
+  double r = a+b+c+d;
+  fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_fdi (float a, double b, int c)
+{
+  double r = a+b+c;
+  fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c);
+  fflush(out);
+  return r;
+}
+ushort ABI_ATTR us_cdcd (char a, double b, char c, double d)
+{
+  ushort r = (ushort)(a + b + c + d);
+  fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d);
+  fflush(out);
+  return r;
+}
+
+long long ABI_ATTR ll_iiilli (int a, int b, int c, long long d, int e)
+{
+  long long r = (long long)(int)a+(long long)(int)b+(long long)(int)c+d+(long long)(int)e;
+  fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e);
+  fflush(out);
+  return r;
+}
+long long ABI_ATTR ll_flli (float a, long long b, int c)
+{
+  long long r = (long long)(int)a + b + (long long)c;
+  fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c);
+  fflush(out);
+  return r;
+}
+
+float ABI_ATTR f_fi (float a, int z)
+{
+  float r = a+z;
+  fprintf(out,"float f(float,int):(%g,%d)",a,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f2i (float a, float b, int z)
+{
+  float r = a+b+z;
+  fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f3i (float a, float b, float c, int z)
+{
+  float r = a+b+c+z;
+  fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f4i (float a, float b, float c, float d, int z)
+{
+  float r = a+b+c+d+z;
+  fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f7i (float a, float b, float c, float d, float e, float f, float g,
+             int z)
+{
+  float r = a+b+c+d+e+f+g+z;
+  fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f8i (float a, float b, float c, float d, float e, float f, float g,
+             float h, int z)
+{
+  float r = a+b+c+d+e+f+g+h+z;
+  fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f12i (float a, float b, float c, float d, float e, float f, float g,
+              float h, float i, float j, float k, float l, int z)
+{
+  float r = a+b+c+d+e+f+g+h+i+j+k+l+z;
+  fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
+  fflush(out);
+  return r;
+}
+float ABI_ATTR f_f13i (float a, float b, float c, float d, float e, float f, float g,
+              float h, float i, float j, float k, float l, float m, int z)
+{
+  float r = a+b+c+d+e+f+g+h+i+j+k+l+m+z;
+  fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
+  fflush(out);
+  return r;
+}
+
+double ABI_ATTR d_di (double a, int z)
+{
+  double r = a+z;
+  fprintf(out,"double f(double,int):(%g,%d)",a,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d2i (double a, double b, int z)
+{
+  double r = a+b+z;
+  fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d3i (double a, double b, double c, int z)
+{
+  double r = a+b+c+z;
+  fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d4i (double a, double b, double c, double d, int z)
+{
+  double r = a+b+c+d+z;
+  fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d7i (double a, double b, double c, double d, double e, double f,
+              double g, int z)
+{
+  double r = a+b+c+d+e+f+g+z;
+  fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d8i (double a, double b, double c, double d, double e, double f,
+              double g, double h, int z)
+{
+  double r = a+b+c+d+e+f+g+h+z;
+  fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d12i (double a, double b, double c, double d, double e, double f,
+               double g, double h, double i, double j, double k, double l,
+               int z)
+{
+  double r = a+b+c+d+e+f+g+h+i+j+k+l+z;
+  fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d13i (double a, double b, double c, double d, double e, double f,
+               double g, double h, double i, double j, double k, double l,
+               double m, int z)
+{
+  double r = a+b+c+d+e+f+g+h+i+j+k+l+m+z;
+  fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
+  fflush(out);
+  return r;
+}
+
+/* small structure return tests */
+Size1 ABI_ATTR S1_v (void)
+{
+  fprintf(out,"Size1 f(void):");
+  fflush(out);
+  return Size1_1;
+}
+Size2 ABI_ATTR S2_v (void)
+{
+  fprintf(out,"Size2 f(void):");
+  fflush(out);
+  return Size2_1;
+}
+Size3 ABI_ATTR S3_v (void)
+{
+  fprintf(out,"Size3 f(void):");
+  fflush(out);
+  return Size3_1;
+}
+Size4 ABI_ATTR S4_v (void)
+{
+  fprintf(out,"Size4 f(void):");
+  fflush(out);
+  return Size4_1;
+}
+Size7 ABI_ATTR S7_v (void)
+{
+  fprintf(out,"Size7 f(void):");
+  fflush(out);
+  return Size7_1;
+}
+Size8 ABI_ATTR S8_v (void)
+{
+  fprintf(out,"Size8 f(void):");
+  fflush(out);
+  return Size8_1;
+}
+Size12 ABI_ATTR S12_v (void)
+{
+  fprintf(out,"Size12 f(void):");
+  fflush(out);
+  return Size12_1;
+}
+Size15 ABI_ATTR S15_v (void)
+{
+  fprintf(out,"Size15 f(void):");
+  fflush(out);
+  return Size15_1;
+}
+Size16 ABI_ATTR S16_v (void)
+{
+  fprintf(out,"Size16 f(void):");
+  fflush(out);
+  return Size16_1;
+}
+
+/* structure tests */
+Int ABI_ATTR I_III (Int a, Int b, Int c)
+{
+  Int r;
+  r.x = a.x + b.x + c.x;
+  fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x);
+  fflush(out);
+  return r;
+}
+Char ABI_ATTR C_CdC (Char a, double b, Char c)
+{
+  Char r;
+  r.x = (a.x + c.x)/2;
+  fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x);
+  fflush(out);
+  return r;
+}
+Float ABI_ATTR F_Ffd (Float a, float b, double c)
+{
+  Float r;
+  r.x = (float) (a.x + b + c);
+  fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c);
+  fflush(out);
+  return r;
+}
+Double ABI_ATTR D_fDd (float a, Double b, double c)
+{
+  Double r;
+  r.x = a + b.x + c;
+  fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c);
+  fflush(out);
+  return r;
+}
+Double ABI_ATTR D_Dfd (Double a, float b, double c)
+{
+  Double r;
+  r.x = a.x + b + c;
+  fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c);
+  fflush(out);
+  return r;
+}
+J ABI_ATTR J_JiJ (J a, int b, J c)
+{
+  J r;
+  r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2;
+  fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2);
+  fflush(out);
+  return r;
+}
+T ABI_ATTR T_TcT (T a, char b, T c)
+{
+  T r;
+  r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2];
+  fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]);
+  fflush(out);
+  return r;
+}
+X ABI_ATTR X_BcdB (B a, char b, double c, B d)
+{
+  static X xr={"return val",'R'};
+  X r;
+  r = xr;
+  r.c1 = b;
+  fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
+          a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]);
+  fflush(out);
+  return r;
+}
+
+/* Test for cases where some argument (especially structure, 'long long', or
+   'double') may be passed partially in general-purpose argument registers
+   and partially on the stack. Different ABIs pass between 4 and 8 arguments
+   (or none) in general-purpose argument registers. */
+
+long ABI_ATTR l_l0K (K b, long c)
+{
+  long r = b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+long ABI_ATTR l_l1K (long a1, K b, long c)
+{
+  long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+long ABI_ATTR l_l2K (long a1, long a2, K b, long c)
+{
+  long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+long ABI_ATTR l_l3K (long a1, long a2, long a3, K b, long c)
+{
+  long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+long ABI_ATTR l_l4K (long a1, long a2, long a3, long a4, K b, long c)
+{
+  long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+long ABI_ATTR l_l5K (long a1, long a2, long a3, long a4, long a5, K b, long c)
+{
+  long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+long ABI_ATTR l_l6K (long a1, long a2, long a3, long a4, long a5, long a6, K b, long c)
+{
+  long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c;
+  fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c);
+  fflush(out);
+  return r;
+}
+/* These tests is crafted on the knowledge that for all known ABIs:
+   * 17 > number of floating-point argument registers,
+   * 3 < number of general-purpose argument registers < 3 + 6. */
+float ABI_ATTR f_f17l3L (float a, float b, float c, float d, float e, float f, float g,
+                float h, float i, float j, float k, float l, float m, float n,
+                float o, float p, float q,
+                long s, long t, long u, L z)
+{
+  float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
+  fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_d17l3L (double a, double b, double c, double d, double e, double f,
+                 double g, double h, double i, double j, double k, double l,
+                 double m, double n, double o, double p, double q,
+                 long s, long t, long u, L z)
+{
+  double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
+  fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
+  fflush(out);
+  return r;
+}
+
+long long ABI_ATTR ll_l2ll (long a1, long a2, long long b, long c)
+{
+  long long r = (long long) (a1 + a2) + b + c;
+  fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  return r;
+}
+long long ABI_ATTR ll_l3ll (long a1, long a2, long a3, long long b, long c)
+{
+  long long r = (long long) (a1 + a2 + a3) + b + c;
+  fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  return r;
+}
+long long ABI_ATTR ll_l4ll (long a1, long a2, long a3, long a4, long long b, long c)
+{
+  long long r = (long long) (a1 + a2 + a3 + a4) + b + c;
+  fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  return r;
+}
+long long ABI_ATTR ll_l5ll (long a1, long a2, long a3, long a4, long a5, long long b, long c)
+{
+  long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c;
+  fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  return r;
+}
+long long ABI_ATTR ll_l6ll (long a1, long a2, long a3, long a4, long a5, long a6, long long b, long c)
+{
+  long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
+  fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  return r;
+}
+long long ABI_ATTR ll_l7ll (long a1, long a2, long a3, long a4, long a5, long a6, long a7, long long b, long c)
+{
+  long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
+  fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c);
+  fflush(out);
+  return r;
+}
+
+double ABI_ATTR d_l2d (long a1, long a2, double b, long c)
+{
+  double r = (double) (a1 + a2) + b + c;
+  fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_l3d (long a1, long a2, long a3, double b, long c)
+{
+  double r = (double) (a1 + a2 + a3) + b + c;
+  fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_l4d (long a1, long a2, long a3, long a4, double b, long c)
+{
+  double r = (double) (a1 + a2 + a3 + a4) + b + c;
+  fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_l5d (long a1, long a2, long a3, long a4, long a5, double b, long c)
+{
+  double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c;
+  fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_l6d (long a1, long a2, long a3, long a4, long a5, long a6, double b, long c)
+{
+  double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
+  fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c);
+  fflush(out);
+  return r;
+}
+double ABI_ATTR d_l7d (long a1, long a2, long a3, long a4, long a5, long a6, long a7, double b, long c)
+{
+  double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
+  fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c);
+  fflush(out);
+  return r;
+}
diff --git a/libffi/testsuite/libffi.call/align_mixed.c b/libffi/testsuite/libffi.call/align_mixed.c
new file mode 100644 (file)
index 0000000..5d4959c
--- /dev/null
@@ -0,0 +1,46 @@
+/* Area:       ffi_call
+   Purpose:    Check for proper argument alignment.
+   Limitations:        none.
+   PR:         none.
+   Originator: <twalljava@java.net> (from many_win32.c) */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static float ABI_ATTR align_arguments(int i1,
+                                      double f2,
+                                      int i3,
+                                      double f4)
+{
+  return i1+f2+i3+f4;
+}
+
+int main(void)
+{
+  ffi_cif cif;
+  ffi_type *args[4] = {
+    &ffi_type_sint,
+    &ffi_type_double,
+    &ffi_type_sint,
+    &ffi_type_double
+  };
+  double fa[2] = {1,2};
+  int ia[2] = {1,2};
+  void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]};
+  float f, ff;
+
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
+                    &ffi_type_float, args) == FFI_OK);
+
+  ff = align_arguments(ia[0], fa[0], ia[1], fa[1]);
+
+  ffi_call(&cif, FFI_FN(align_arguments), &f, values);
+
+  if (f == ff)
+    printf("align arguments tests ok!\n");
+  else
+    CHECK(0);
+  exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/align_stdcall.c b/libffi/testsuite/libffi.call/align_stdcall.c
new file mode 100644 (file)
index 0000000..5e5cb86
--- /dev/null
@@ -0,0 +1,46 @@
+/* Area:       ffi_call
+   Purpose:    Check for proper argument alignment.
+   Limitations:        none.
+   PR:         none.
+   Originator: <twalljava@java.net> (from many_win32.c) */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static float ABI_ATTR align_arguments(int i1,
+                                      double f2,
+                                      int i3,
+                                      double f4)
+{
+  return i1+f2+i3+f4;
+}
+
+int main(void)
+{
+  ffi_cif cif;
+  ffi_type *args[4] = {
+    &ffi_type_sint,
+    &ffi_type_double,
+    &ffi_type_sint,
+    &ffi_type_double
+  };
+  double fa[2] = {1,2};
+  int ia[2] = {1,2};
+  void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]};
+  float f, ff;
+
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
+                    &ffi_type_float, args) == FFI_OK);
+
+  ff = align_arguments(ia[0], fa[0], ia[1], fa[1]);;
+
+  ffi_call(&cif, FFI_FN(align_arguments), &f, values);
+
+  if (f == ff)
+    printf("align arguments tests ok!\n");
+  else
+    CHECK(0);
+  exit(0);
+}
index 46fb1ebb75f86637a6fd0338ff5fadeda976e72b..13ba2bdcd4922b2c454589833dd562792e796c73 100644 (file)
@@ -19,9 +19,33 @@ libffi-init
 
 global srcdir subdir
 
-set tlist [lsearch -inline -all -not -glob [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] *complex*]
+if { [string match $compiler_vendor "microsoft"] } {
+    # -wd4005  macro redefinition
+    # -wd4244  implicit conversion to type of smaller size
+    # -wd4305  truncation to smaller type
+    # -wd4477  printf %lu of uintptr_t
+    # -wd4312  implicit conversion to type of greater size
+    # -wd4311  pointer truncation to unsigned long
+    # -EHsc    C++ Exception Handling (no SEH exceptions)
+    set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
+} else {
+    set additional_options "";
+}
 
-run-many-tests $tlist ""
+set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]]
+
+run-many-tests $tlist $additional_options
+
+set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.cc]]
+
+# No C++ for or1k
+if { [istarget "or1k-*-*"] } {
+    foreach test $tlist {
+        unsupported "$test"
+    }
+} else {
+    run-many-tests $tlist $additional_options
+}
 
 dg-finish
 
diff --git a/libffi/testsuite/libffi.call/cls_uchar_va.c b/libffi/testsuite/libffi.call/cls_uchar_va.c
deleted file mode 100644 (file)
index 6491c5b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area:       closure_call
-   Purpose:    Test anonymous unsigned char argument.
-   Limitations:        none.
-   PR:         none.
-   Originator: ARM Ltd. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef unsigned char T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
-                        void* userdata __UNUSED__)
- {
-   *(ffi_arg *)resp = *(T *)args[0];
-
-   printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
-  ffi_cif cif;
-  void *code;
-  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
-  ffi_type * cl_arg_types[3];
-  T res;
-
-  cl_arg_types[0] = &ffi_type_uchar;
-  cl_arg_types[1] = &ffi_type_uchar;
-  cl_arg_types[2] = NULL;
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
-                        &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
-  CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code)  == FFI_OK);
-  res = ((((cls_ret_T)code)(67, 4)));
-  /* { dg-output "67: 67 4" } */
-  printf("res: %d\n", res);
-  /* { dg-output "\nres: 67" } */
-  exit(0);
-}
diff --git a/libffi/testsuite/libffi.call/cls_ushort_va.c b/libffi/testsuite/libffi.call/cls_ushort_va.c
deleted file mode 100644 (file)
index 37aa106..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area:       closure_call
-   Purpose:    Test anonymous unsigned short argument.
-   Limitations:        none.
-   PR:         none.
-   Originator: ARM Ltd. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef unsigned short T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
-                        void* userdata __UNUSED__)
- {
-   *(ffi_arg *)resp = *(T *)args[0];
-
-   printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
-  ffi_cif cif;
-  void *code;
-  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
-  ffi_type * cl_arg_types[3];
-  T res;
-
-  cl_arg_types[0] = &ffi_type_ushort;
-  cl_arg_types[1] = &ffi_type_ushort;
-  cl_arg_types[2] = NULL;
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
-                        &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
-  CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code)  == FFI_OK);
-  res = ((((cls_ret_T)code)(67, 4)));
-  /* { dg-output "67: 67 4" } */
-  printf("res: %d\n", res);
-  /* { dg-output "\nres: 67" } */
-  exit(0);
-}
index 15d5e44123481942d4dbd59960620f7f9d243c55..95d96a83f18c7dfa3cb6beea988e71e7f90b1514 100644 (file)
 
 #define MAX_ARGS 256
 
-#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0)
+#define CHECK(x) \
+   do { \
+      if(!(x)){ \
+         printf("Check failed:\n%s\n", #x); \
+         abort(); \
+      } \
+   } while(0)
 
 /* Define macros so that compilers other than gcc can run the tests.  */
 #undef __UNUSED__
@@ -24,6 +30,7 @@
 #define __STDCALL__ __attribute__((stdcall))
 #define __THISCALL__ __attribute__((thiscall))
 #define __FASTCALL__ __attribute__((fastcall))
+#define __MSABI__ __attribute__((ms_abi))
 #else
 #define __UNUSED__
 #define __STDCALL__ __stdcall
@@ -63,7 +70,7 @@
 #endif
 
 /* MinGW kludge.  */
-#ifdef _WIN64
+#if defined(_WIN64) | defined(_WIN32)
 #define PRIdLL "I64d"
 #define PRIuLL "I64u"
 #else
 
 /* MSVC kludge.  */
 #if defined _MSC_VER
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
 #define PRIuPTR "lu"
 #define PRIu8 "u"
 #define PRId8 "d"
 #define PRIu64 "I64u"
 #define PRId64 "I64d"
 #endif
+#endif
 
 #ifndef PRIuPTR
 #define PRIuPTR "u"
index 55b9fba86f851e89464212311f0adea4ca8094d6..57cd9e30f92866a25e49ae849aa5ef4255202218 100644 (file)
@@ -3,7 +3,7 @@
    Limitations:        none.
    PR:         none.
    Originator: From the original ffitest.c  */
-/* { dg-do run { target { ! hppa*-*-hpux* } } } */
+/* { dg-do run } */
 
 #include "ffitest.h"
 #include "float.h"
@@ -22,6 +22,7 @@ int main (void)
   void *values[MAX_ARGS];
   float f;
   long double ld;
+  long double original;
 
   args[0] = &ffi_type_float;
   values[0] = &f;
@@ -32,24 +33,26 @@ int main (void)
 
   f = 3.14159;
 
-#if 1
-  /* This is ifdef'd out for now. long double support under SunOS/gcc
-     is pretty much non-existent.  You'll get the odd bus error in library
-     routines like printf().  */
+#if defined(__sun) && defined(__GNUC__)
+  /* long double support under SunOS/gcc is pretty much non-existent.
+     You'll get the odd bus error in library routines like printf() */
+#else
   printf ("%Lf\n", ldblit(f));
 #endif
+
   ld = 666;
   ffi_call(&cif, FFI_FN(ldblit), &ld, values);
 
-#if 1
-  /* This is ifdef'd out for now. long double support under SunOS/gcc
-     is pretty much non-existent.  You'll get the odd bus error in library
-     routines like printf().  */
+#if defined(__sun) && defined(__GNUC__)
+  /* long double support under SunOS/gcc is pretty much non-existent.
+     You'll get the odd bus error in library routines like printf() */
+#else
   printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
 #endif
 
   /* These are not always the same!! Check for a reasonable delta */
-  if (fabsl(ld - ldblit(f)) < LDBL_EPSILON)
+  original = ldblit(f);
+  if (((ld > original) ? (ld - original) : (original - ld)) < LDBL_EPSILON)
     puts("long double return value tests ok!");
   else
     CHECK(0);
diff --git a/libffi/testsuite/libffi.call/offsets.c b/libffi/testsuite/libffi.call/offsets.c
new file mode 100644 (file)
index 0000000..23d88b3
--- /dev/null
@@ -0,0 +1,46 @@
+/* Area:               Struct layout
+   Purpose:            Test ffi_get_struct_offsets
+   Limitations:                none.
+   PR:                 none.
+   Originator:                 Tom Tromey. */
+
+/* { dg-do run } */
+#include "ffitest.h"
+#include <stddef.h>
+
+struct test_1
+{
+  char c;
+  float f;
+  char c2;
+  int i;
+};
+
+int
+main (void)
+{
+  ffi_type test_1_type;
+  ffi_type *test_1_elements[5];
+  size_t test_1_offsets[4];
+
+  test_1_elements[0] = &ffi_type_schar;
+  test_1_elements[1] = &ffi_type_float;
+  test_1_elements[2] = &ffi_type_schar;
+  test_1_elements[3] = &ffi_type_sint;
+  test_1_elements[4] = NULL;
+
+  test_1_type.size = 0;
+  test_1_type.alignment = 0;
+  test_1_type.type = FFI_TYPE_STRUCT;
+  test_1_type.elements = test_1_elements;
+
+  CHECK (ffi_get_struct_offsets (FFI_DEFAULT_ABI, &test_1_type, test_1_offsets)
+        == FFI_OK);
+  CHECK (test_1_type.size == sizeof (struct test_1));
+  CHECK (offsetof (struct test_1, c) == test_1_offsets[0]);
+  CHECK (offsetof (struct test_1, f) == test_1_offsets[1]);
+  CHECK (offsetof (struct test_1, c2) == test_1_offsets[2]);
+  CHECK (offsetof (struct test_1, i) == test_1_offsets[3]);
+
+  return 0;
+}
diff --git a/libffi/testsuite/libffi.call/struct10.c b/libffi/testsuite/libffi.call/struct10.c
new file mode 100644 (file)
index 0000000..17b1377
--- /dev/null
@@ -0,0 +1,57 @@
+/* Area:       ffi_call
+   Purpose:    Check structures.
+   Limitations:        none.
+   PR:         none.
+   Originator: Sergei Trofimovich <slyfox@gentoo.org>
+
+   The test originally discovered in ruby's bindings
+   for ffi in https://bugs.gentoo.org/634190  */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+struct s {
+  int s32;
+  float f32;
+  signed char s8;
+};
+
+struct s make_s(void) {
+  struct s r;
+  r.s32 = 0x1234;
+  r.f32 = 7.0;
+  r.s8  = 0x78;
+  return r;
+}
+
+int main() {
+  ffi_cif cif;
+  struct s r;
+  ffi_type rtype;
+  ffi_type* s_fields[] = {
+    &ffi_type_sint,
+    &ffi_type_float,
+    &ffi_type_schar,
+    NULL,
+  };
+
+  rtype.size      = 0;
+  rtype.alignment = 0,
+  rtype.type      = FFI_TYPE_STRUCT,
+  rtype.elements  = s_fields,
+
+  r.s32 = 0xbad;
+  r.f32 = 999.999;
+  r.s8  = 0x51;
+
+  // Here we emulate the following call:
+  //r = make_s();
+
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &rtype, NULL) == FFI_OK);
+  ffi_call(&cif, FFI_FN(make_s), &r, NULL);
+
+  CHECK(r.s32 == 0x1234);
+  CHECK(r.f32 == 7.0);
+  CHECK(r.s8  == 0x78);
+  exit(0);
+}
index 7f96809ea9ecf180805c5ace9f57a342ab591992..ccc6faf5c932dfe8f018795c7d9478e0c0e60629 100644 (file)
@@ -5,7 +5,6 @@
    Originator:         ARM Ltd. */
 
 /* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
 
 #include "ffitest.h"
 #include <stdarg.h>
@@ -25,62 +24,10 @@ struct large_tag
   unsigned e;
 };
 
-static int
-test_fn (int n, ...)
-{
-  va_list ap;
-  struct small_tag s1;
-  struct small_tag s2;
-  struct large_tag l;
-  unsigned char uc;
-  signed char sc;
-  unsigned short us;
-  signed short ss;
-  unsigned int ui;
-  signed int si;
-  unsigned long ul;
-  signed long sl;
-  float f;
-  double d;
-
-  va_start (ap, n);
-  s1 = va_arg (ap, struct small_tag);
-  l = va_arg (ap, struct large_tag);
-  s2 = va_arg (ap, struct small_tag);
-
-  uc = va_arg (ap, unsigned);
-  sc = va_arg (ap, signed);
-
-  us = va_arg (ap, unsigned);
-  ss = va_arg (ap, signed);
-
-  ui = va_arg (ap, unsigned int);
-  si = va_arg (ap, signed int);
-
-  ul = va_arg (ap, unsigned long);
-  sl = va_arg (ap, signed long);
-
-  f = va_arg (ap, double);     /* C standard promotes float->double
-                                  when anonymous */
-  d = va_arg (ap, double);
-
-  printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
-         s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
-         s2.a, s2.b,
-         uc, sc,
-         us, ss,
-         ui, si,
-         ul, sl,
-         f, d);
-  va_end (ap);
-  return n + 1;
-}
-
 int
 main (void)
 {
   ffi_cif cif;
-  void* args[15];
   ffi_type* arg_types[15];
 
   ffi_type s_type;
@@ -89,24 +36,6 @@ main (void)
   ffi_type l_type;
   ffi_type *l_type_elements[6];
 
-  struct small_tag s1;
-  struct small_tag s2;
-  struct large_tag l1;
-
-  int n;
-  ffi_arg res;
-
-  unsigned char uc;
-  signed char sc;
-  unsigned short us;
-  signed short ss;
-  unsigned int ui;
-  signed int si;
-  unsigned long ul;
-  signed long sl;
-  double d1;
-  double f1;
-
   s_type.size = 0;
   s_type.alignment = 0;
   s_type.type = FFI_TYPE_STRUCT;
@@ -144,53 +73,6 @@ main (void)
   arg_types[13] = &ffi_type_double;
   arg_types[14] = NULL;
 
-  CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK);
-
-  s1.a = 5;
-  s1.b = 6;
-
-  l1.a = 10;
-  l1.b = 11;
-  l1.c = 12;
-  l1.d = 13;
-  l1.e = 14;
-
-  s2.a = 7;
-  s2.b = 8;
-
-  n = 41;
-
-  uc = 9;
-  sc = 10;
-  us = 11;
-  ss = 12;
-  ui = 13;
-  si = 14;
-  ul = 15;
-  sl = 16;
-  f1 = 2.12;
-  d1 = 3.13;
-
-  args[0] = &n;
-  args[1] = &s1;
-  args[2] = &l1;
-  args[3] = &s2;
-  args[4] = &uc;
-  args[5] = &sc;
-  args[6] = &us;
-  args[7] = &ss;
-  args[8] = &ui;
-  args[9] = &si;
-  args[10] = &ul;
-  args[11] = &sl;
-  args[12] = &f1;
-  args[13] = &d1;
-  args[14] = NULL;
-
-  ffi_call(&cif, FFI_FN(test_fn), &res, args);
-  /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
-  printf("res: %d\n", (int) res);
-  /* { dg-output "\nres: 42" } */
-
+  CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_BAD_ARGTYPE);
   return 0;
 }
diff --git a/libffi/testsuite/libffi.call/va_2.c b/libffi/testsuite/libffi.call/va_2.c
new file mode 100644 (file)
index 0000000..0589d08
--- /dev/null
@@ -0,0 +1,196 @@
+/* Area:               ffi_call
+   Purpose:            Test passing struct in variable argument lists.
+   Limitations:        none.
+   PR:                 none.
+   Originator:         ARM Ltd. */
+
+/* { dg-do run } */
+/* { dg-output "" { xfail avr32*-*-* m68k-*-* alpha-*-* } } */
+
+#include "ffitest.h"
+#include <stdarg.h>
+
+struct small_tag
+{
+  unsigned char a;
+  unsigned char b;
+};
+
+struct large_tag
+{
+  unsigned a;
+  unsigned b;
+  unsigned c;
+  unsigned d;
+  unsigned e;
+};
+
+static int
+test_fn (int n, ...)
+{
+  va_list ap;
+  struct small_tag s1;
+  struct small_tag s2;
+  struct large_tag l;
+  unsigned char uc;
+  signed char sc;
+  unsigned short us;
+  signed short ss;
+  unsigned int ui;
+  signed int si;
+  unsigned long ul;
+  signed long sl;
+  float f;
+  double d;
+
+  va_start (ap, n);
+  s1 = va_arg (ap, struct small_tag);
+  l = va_arg (ap, struct large_tag);
+  s2 = va_arg (ap, struct small_tag);
+
+  uc = va_arg (ap, unsigned);
+  sc = va_arg (ap, signed);
+
+  us = va_arg (ap, unsigned);
+  ss = va_arg (ap, signed);
+
+  ui = va_arg (ap, unsigned int);
+  si = va_arg (ap, signed int);
+
+  ul = va_arg (ap, unsigned long);
+  sl = va_arg (ap, signed long);
+
+  f = va_arg (ap, double);     /* C standard promotes float->double
+                                  when anonymous */
+  d = va_arg (ap, double);
+
+  printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
+         s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
+         s2.a, s2.b,
+         uc, sc,
+         us, ss,
+         ui, si,
+         ul, sl,
+         f, d);
+  va_end (ap);
+  return n + 1;
+}
+
+int
+main (void)
+{
+  ffi_cif cif;
+  void* args[15];
+  ffi_type* arg_types[15];
+
+  ffi_type s_type;
+  ffi_type *s_type_elements[3];
+
+  ffi_type l_type;
+  ffi_type *l_type_elements[6];
+
+  struct small_tag s1;
+  struct small_tag s2;
+  struct large_tag l1;
+
+  int n;
+  ffi_arg res;
+
+  unsigned int uc;
+  signed int sc;
+  unsigned int us;
+  signed int ss;
+  unsigned int ui;
+  signed int si;
+  unsigned long ul;
+  signed long sl;
+  double d1;
+  double f1;
+
+  s_type.size = 0;
+  s_type.alignment = 0;
+  s_type.type = FFI_TYPE_STRUCT;
+  s_type.elements = s_type_elements;
+
+  s_type_elements[0] = &ffi_type_uchar;
+  s_type_elements[1] = &ffi_type_uchar;
+  s_type_elements[2] = NULL;
+
+  l_type.size = 0;
+  l_type.alignment = 0;
+  l_type.type = FFI_TYPE_STRUCT;
+  l_type.elements = l_type_elements;
+
+  l_type_elements[0] = &ffi_type_uint;
+  l_type_elements[1] = &ffi_type_uint;
+  l_type_elements[2] = &ffi_type_uint;
+  l_type_elements[3] = &ffi_type_uint;
+  l_type_elements[4] = &ffi_type_uint;
+  l_type_elements[5] = NULL;
+
+  arg_types[0] = &ffi_type_sint;
+  arg_types[1] = &s_type;
+  arg_types[2] = &l_type;
+  arg_types[3] = &s_type;
+  arg_types[4] = &ffi_type_uint;
+  arg_types[5] = &ffi_type_sint;
+  arg_types[6] = &ffi_type_uint;
+  arg_types[7] = &ffi_type_sint;
+  arg_types[8] = &ffi_type_uint;
+  arg_types[9] = &ffi_type_sint;
+  arg_types[10] = &ffi_type_ulong;
+  arg_types[11] = &ffi_type_slong;
+  arg_types[12] = &ffi_type_double;
+  arg_types[13] = &ffi_type_double;
+  arg_types[14] = NULL;
+
+  CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK);
+
+  s1.a = 5;
+  s1.b = 6;
+
+  l1.a = 10;
+  l1.b = 11;
+  l1.c = 12;
+  l1.d = 13;
+  l1.e = 14;
+
+  s2.a = 7;
+  s2.b = 8;
+
+  n = 41;
+
+  uc = 9;
+  sc = 10;
+  us = 11;
+  ss = 12;
+  ui = 13;
+  si = 14;
+  ul = 15;
+  sl = 16;
+  f1 = 2.12;
+  d1 = 3.13;
+
+  args[0] = &n;
+  args[1] = &s1;
+  args[2] = &l1;
+  args[3] = &s2;
+  args[4] = &uc;
+  args[5] = &sc;
+  args[6] = &us;
+  args[7] = &ss;
+  args[8] = &ui;
+  args[9] = &si;
+  args[10] = &ul;
+  args[11] = &sl;
+  args[12] = &f1;
+  args[13] = &d1;
+  args[14] = NULL;
+
+  ffi_call(&cif, FFI_FN(test_fn), &res, args);
+  /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
+  printf("res: %d\n", (int) res);
+  /* { dg-output "\nres: 42" } */
+
+  return 0;
+}
diff --git a/libffi/testsuite/libffi.closures/closure.exp b/libffi/testsuite/libffi.closures/closure.exp
new file mode 100644 (file)
index 0000000..ed4145c
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2019 Free Software Foundation, Inc.
+# Copyright (C) 2019 Anthony Green
+
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+dg-init
+libffi-init
+
+global srcdir subdir
+
+if { [string match $compiler_vendor "microsoft"] } {
+    # -wd4005  macro redefinition
+    # -wd4244  implicit conversion to type of smaller size
+    # -wd4305  truncation to smaller type
+    # -wd4477  printf %lu of uintptr_t
+    # -wd4312  implicit conversion to type of greater size
+    # -wd4311  pointer truncation to unsigned long
+    # -EHsc    C++ Exception Handling (no SEH exceptions)
+    set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
+} else {
+    set additional_options "";
+}
+
+set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]]
+
+if { [libffi_feature_test "#if FFI_CLOSURES"] } {
+    run-many-tests $tlist ""
+} else {
+    foreach test $tlist {
+       unsupported "$test"
+    }
+}
+
+set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.cc]]
+
+# No C++ for or1k
+if { [istarget "or1k-*-*"] } {
+    foreach test $tlist {
+        unsupported "$test"
+    }
+} else {
+    if { [libffi_feature_test "#if FFI_CLOSURES"] } {
+        run-many-tests $tlist  $additional_options
+    } else {
+        foreach test $tlist {
+           unsupported "$test"
+        }
+    }
+}
+
+dg-finish
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
similarity index 96%
rename from libffi/testsuite/libffi.call/closure_loc_fn0.c
rename to libffi/testsuite/libffi.closures/closure_loc_fn0.c
index b3afa0bbdfcf9a8ce32568eb298be4ad622509c2..ad488acaa877d8317ae30b8c180a18074255e579 100644 (file)
@@ -83,7 +83,10 @@ int main (void)
   CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0,
                         (void *) 3 /* userdata */, codeloc) == FFI_OK);
   
+#ifndef FFI_EXEC_STATIC_TRAMP
+  /* With static trampolines, the codeloc does not point to closure */
   CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0);
+#endif
 
   res = (*((closure_loc_test_type0)codeloc))
     (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_20byte.c
rename to libffi/testsuite/libffi.closures/cls_20byte.c
index 3f8bb28ad297cd77709923c824610128cef3fa06..34ea021fb885eddb15151e5c8b87a3e83f320188 100644 (file)
@@ -14,7 +14,7 @@ typedef struct cls_struct_20byte {
   int c;
 } cls_struct_20byte;
 
-cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
+static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
                            struct cls_struct_20byte a2)
 {
   struct cls_struct_20byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_20byte1.c
rename to libffi/testsuite/libffi.closures/cls_20byte1.c
index 65627273c84b693415f4a6d43dcbf5cffdf1f513..eab4be6031d8a9f6a558a401d3901071ddc1a89c 100644 (file)
@@ -16,7 +16,7 @@ typedef struct cls_struct_20byte {
   double c;
 } cls_struct_20byte;
 
-cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
+static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
                            struct cls_struct_20byte a2)
 {
   struct cls_struct_20byte result;
similarity index 95%
rename from libffi/testsuite/libffi.call/cls_24byte.c
rename to libffi/testsuite/libffi.closures/cls_24byte.c
index 1d82f6e4a45bbc8878fb9eec6a63f91c429fb55c..78796da92dd92d8f7320cdee1e1914cecd3ce27a 100644 (file)
@@ -31,7 +31,7 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
         b0.a, b0.b, b0.c, b0.d,
         b1.a, b1.b, b1.c, b1.d,
         b2.a, b2.b, b2.c, b2.d,
-        b3.a, b3.b, b3.c, b2.d,
+        b3.a, b3.b, b3.c, b3.d,
         result.a, result.b, result.c, result.d);
 
   return result;
@@ -94,7 +94,7 @@ int main (void)
   args_dbl[4] = NULL;
 
   ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
-  /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
+  /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */
   printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
   /* { dg-output "\nres: 22 15 17 25" } */
 
@@ -105,7 +105,7 @@ int main (void)
                                   cls_struct_24byte,
                                   cls_struct_24byte))
             (code))(e_dbl, f_dbl, g_dbl, h_dbl);
-  /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
+  /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */
   printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
   /* { dg-output "\nres: 22 15 17 25" } */
 
diff --git a/libffi/testsuite/libffi.closures/cls_3float.c b/libffi/testsuite/libffi.closures/cls_3float.c
new file mode 100644 (file)
index 0000000..48888f8
--- /dev/null
@@ -0,0 +1,95 @@
+/* Area:       ffi_call, closure_call
+   Purpose:    Check structure passing with different structure size.
+               Depending on the ABI. Check overlapping.
+   Limitations:>none.
+   PR:         none.
+   Originator: <compnerd@compnerd.org> 20171026         */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+typedef struct cls_struct_3float {
+  float f;
+  float g;
+  float h;
+} cls_struct_3float;
+
+cls_struct_3float cls_struct_3float_fn(struct cls_struct_3float a1,
+                                      struct cls_struct_3float a2)
+{
+  struct cls_struct_3float result;
+
+  result.f = a1.f + a2.f;
+  result.g = a1.g + a2.g;
+  result.h = a1.h + a2.h;
+
+  printf("%g %g %g %g %g %g: %g %g %g\n", a1.f, a1.g, a1.h,
+        a2.f, a2.g, a2.h, result.f, result.g, result.h);
+
+  return result;
+}
+
+static void
+cls_struct_3float_gn(ffi_cif *cif __UNUSED__, void* resp, void **args,
+                    void* userdata __UNUSED__)
+{
+  struct cls_struct_3float a1, a2;
+
+  a1 = *(struct cls_struct_3float*)(args[0]);
+  a2 = *(struct cls_struct_3float*)(args[1]);
+
+  *(cls_struct_3float*)resp = cls_struct_3float_fn(a1, a2);
+}
+
+int main (void)
+{
+  ffi_cif cif;
+  void *code;
+  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+  void *args_dbl[3];
+  ffi_type* cls_struct_fields[4];
+  ffi_type cls_struct_type;
+  ffi_type* dbl_arg_types[3];
+
+  struct cls_struct_3float g_dbl = { 1.0f, 2.0f, 3.0f };
+  struct cls_struct_3float f_dbl = { 1.0f, 2.0f, 3.0f };
+  struct cls_struct_3float res_dbl;
+
+  cls_struct_fields[0] = &ffi_type_float;
+  cls_struct_fields[1] = &ffi_type_float;
+  cls_struct_fields[2] = &ffi_type_float;
+  cls_struct_fields[3] = NULL;
+
+  cls_struct_type.size = 0;
+  cls_struct_type.alignment = 0;
+  cls_struct_type.type = FFI_TYPE_STRUCT;
+  cls_struct_type.elements = cls_struct_fields;
+
+  dbl_arg_types[0] = &cls_struct_type;
+  dbl_arg_types[1] = &cls_struct_type;
+  dbl_arg_types[2] = NULL;
+
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+                    dbl_arg_types) == FFI_OK);
+
+  args_dbl[0] = &g_dbl;
+  args_dbl[1] = &f_dbl;
+  args_dbl[2] = NULL;
+
+  ffi_call(&cif, FFI_FN(cls_struct_3float_fn), &res_dbl, args_dbl);
+  /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
+  printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h);
+  /* { dg-output "\nres: 2 4 6" } */
+
+  CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3float_gn, NULL, code) ==
+       FFI_OK);
+
+  res_dbl = ((cls_struct_3float(*)(cls_struct_3float,
+                                  cls_struct_3float))(code))(g_dbl, f_dbl);
+  /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
+  printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h);
+  /* { dg-output "\nres: 2 4 6" } */
+
+  exit(0);
+}
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_5_1_byte.c
rename to libffi/testsuite/libffi.closures/cls_5_1_byte.c
index ad9d51c248c2da4f3ee010b8e5df770e38f91dfb..8db761cd5b79c1693390bad3a9d45d2ec8fffab3 100644 (file)
@@ -16,7 +16,7 @@ typedef struct cls_struct_5byte {
   unsigned char e;
 } cls_struct_5byte;
 
-cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
+static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
                            struct cls_struct_5byte a2)
 {
   struct cls_struct_5byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_5byte.c
rename to libffi/testsuite/libffi.closures/cls_5byte.c
index 4e0c0003c0aa5878c0bc327544bb279d7b5b94ed..fbb69ce4a83095092a1a37c8472239a7dcc0495e 100644 (file)
@@ -14,7 +14,7 @@ typedef struct cls_struct_5byte {
   unsigned char c;
 } cls_struct_5byte;
 
-cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
+static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
                            struct cls_struct_5byte a2)
 {
   struct cls_struct_5byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_6_1_byte.c
rename to libffi/testsuite/libffi.closures/cls_6_1_byte.c
index b4dcdba47283f770454bf10f806980e7bb6b9fef..797098628663af9fa7ebc765c4d203d23e5fa534 100644 (file)
@@ -17,7 +17,7 @@ typedef struct cls_struct_6byte {
   unsigned char f;
 } cls_struct_6byte;
 
-cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
+static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
                            struct cls_struct_6byte a2)
 {
   struct cls_struct_6byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_6byte.c
rename to libffi/testsuite/libffi.closures/cls_6byte.c
index 740678017b3a021fd11a330eb7adc0e491d8209b..e89c73cf88d13164fec105a18f9e6f2d3e4c6aa3 100644 (file)
@@ -16,7 +16,7 @@ typedef struct cls_struct_6byte {
   unsigned char d;
 } cls_struct_6byte;
 
-cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
+static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
                            struct cls_struct_6byte a2)
 {
   struct cls_struct_6byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_7_1_byte.c
rename to libffi/testsuite/libffi.closures/cls_7_1_byte.c
index 14a7e96f9d6569b4f94247297ab58ba6e6a1a6da..94b1a44bded9a6dfcede9148e6792f5e46bd1b47 100644 (file)
@@ -18,7 +18,7 @@ typedef struct cls_struct_7byte {
   unsigned char g;
 } cls_struct_7byte;
 
-cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
+static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
                            struct cls_struct_7byte a2)
 {
   struct cls_struct_7byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_7byte.c
rename to libffi/testsuite/libffi.closures/cls_7byte.c
index 1645cc635f9afb6410c650bb68f2a066e7cee391..3aa8d6cfe377ab2a6868716b94000c7d38b93313 100644 (file)
@@ -15,7 +15,7 @@ typedef struct cls_struct_7byte {
   unsigned short d;
 } cls_struct_7byte;
 
-cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
+static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
                            struct cls_struct_7byte a2)
 {
   struct cls_struct_7byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_9byte1.c
rename to libffi/testsuite/libffi.closures/cls_9byte1.c
index 0b8572223c9c5e5f6d8e2179535647c52916a28e..6eb45203688ae92c765ccb673db80e544876c72b 100644 (file)
@@ -15,7 +15,7 @@ typedef struct cls_struct_9byte {
   double b;
 } cls_struct_9byte;
 
-cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
+static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
                            struct cls_struct_9byte b2)
 {
   struct cls_struct_9byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_9byte2.c
rename to libffi/testsuite/libffi.closures/cls_9byte2.c
index edf991de73eefcbf379294528ecb8727ff19b0f9..26e460bc7ecf81c59dd5253bd098cfbcb2622d12 100644 (file)
@@ -15,7 +15,7 @@ typedef struct cls_struct_9byte {
   int b;
 } cls_struct_9byte;
 
-cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
+static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
                            struct cls_struct_9byte b2)
 {
   struct cls_struct_9byte result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_double.c
rename to libffi/testsuite/libffi.closures/cls_align_double.c
index aad5f3ced6a038aa1b8e93b8f27f0dea350b534f..910e2287d9e339344570e50ab1ffb03db1dd52e8 100644 (file)
@@ -15,7 +15,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_float.c
rename to libffi/testsuite/libffi.closures/cls_align_float.c
index 37e085529e7a08314effe15244faf38b8ddfac78..56161ef632e2446aa2605a79cecf64a641d9d32f 100644 (file)
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_longdouble.c
rename to libffi/testsuite/libffi.closures/cls_align_longdouble.c
index b3322d8615136813f541c3f051fbfc4c3803c328..3dccdef10e15d814538b522df62de1bb9850924f 100644 (file)
@@ -14,7 +14,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 98%
rename from libffi/testsuite/libffi.call/cls_align_longdouble_split.c
rename to libffi/testsuite/libffi.closures/cls_align_longdouble_split.c
index cc1c43b8ca45a857b3287c8be9a9858457143b29..9b01cbd01a5873068743a213ad9ecb0f776f3dbd 100644 (file)
@@ -19,7 +19,7 @@ typedef struct cls_struct_align {
   long double g;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(
+static cls_struct_align cls_struct_align_fn(
        cls_struct_align        a1,
        cls_struct_align        a2)
 {
similarity index 98%
rename from libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
rename to libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c
index 5d3bec071968701c32f2b24c5ed937166a3940d6..8a973e7a22d15ac4482a30800a7189ffaf99450b 100644 (file)
@@ -20,7 +20,7 @@ typedef struct cls_struct_align {
   long double g;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(
+static cls_struct_align cls_struct_align_fn(
        cls_struct_align        a1,
        cls_struct_align        a2)
 {
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_pointer.c
rename to libffi/testsuite/libffi.closures/cls_align_pointer.c
index 8fbf36a5c1151513c0eb6faa0d71da6b2d32692c..ef59259dff0233e34426364769a2498ff2561b43 100644 (file)
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_sint16.c
rename to libffi/testsuite/libffi.closures/cls_align_sint16.c
index 039b874732005140eea0cb02f941b04f9972cfc6..79977093d0e497acd583bfa39d31b1efdc0f1345 100644 (file)
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_sint32.c
rename to libffi/testsuite/libffi.closures/cls_align_sint32.c
index c96c6d136df1bba986759d2804edba9d1ccd698a..5edde72249fa27dbe3336478e24a0e1daa11e08a 100644 (file)
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_sint64.c
rename to libffi/testsuite/libffi.closures/cls_align_sint64.c
index 9aa7bdddff7a5fee1e98917c6629143cdb0b3def..bcba22f3ed66405dda680f79f97244990593bbf1 100644 (file)
@@ -14,7 +14,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_uint16.c
rename to libffi/testsuite/libffi.closures/cls_align_uint16.c
index 97620b79d1fbec68d434a018453ab8db62aa723f..f33c0ec6866046ae404a1f56c1f6b4a50dde0211 100644 (file)
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_uint32.c
rename to libffi/testsuite/libffi.closures/cls_align_uint32.c
index 5766fadf0dc9b53934194558b7d7559830482693..c96eee6bb29bf9fb955954bdec6e8d4d4278c90f 100644 (file)
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 97%
rename from libffi/testsuite/libffi.call/cls_align_uint64.c
rename to libffi/testsuite/libffi.closures/cls_align_uint64.c
index a52cb8939c4fa161b383628a8d72e6b8fdd6a64e..958e1c2cab035ebf1cbb3785497c53c73b9f1f28 100644 (file)
@@ -15,7 +15,7 @@ typedef struct cls_struct_align {
   unsigned char c;
 } cls_struct_align;
 
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
                            struct cls_struct_align a2)
 {
   struct cls_struct_align result;
similarity index 92%
rename from libffi/testsuite/libffi.call/cls_dbls_struct.c
rename to libffi/testsuite/libffi.closures/cls_dbls_struct.c
index d6637911e584f9c11dce73d69e7d3da0811d800e..25b8b635069e24a9e7db29bce9b8f35f4a60d915 100644 (file)
@@ -56,11 +56,11 @@ int main(int argc __UNUSED__, char** argv __UNUSED__)
 
        CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK);
 
-       ((void*(*)(Dbls))(code))(arg);
-       /* { dg-output "1.0 2.0\n" } */
+       ((void (*)(Dbls))(code))(arg);
+       /* { dg-output "1.0 2.0" } */
 
        closure_test_fn(arg);
-       /* { dg-output "1.0 2.0\n" } */
+       /* { dg-output "\n1.0 2.0" } */
 
        return 0;
 }
similarity index 96%
rename from libffi/testsuite/libffi.call/cls_multi_schar.c
rename to libffi/testsuite/libffi.closures/cls_multi_schar.c
index 71df7b6516e657cee68bcc430d36cbd75f1c17fc..417f7be8299c8c981c9e6e335afd32fca599a80f 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-signed char test_func_fn(signed char a1, signed char a2)
+static signed char test_func_fn(signed char a1, signed char a2)
 {
   signed char result;
 
similarity index 96%
rename from libffi/testsuite/libffi.call/cls_multi_sshort.c
rename to libffi/testsuite/libffi.closures/cls_multi_sshort.c
index 4c39153266765ca91376f1c899fcc4e0d7a4dd17..467146dbd60c4e88f1d53e17cc92273d349b3bfb 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-signed short test_func_fn(signed short a1, signed short a2)
+static signed short test_func_fn(signed short a1, signed short a2)
 {
   signed short result;
 
similarity index 96%
rename from libffi/testsuite/libffi.call/cls_multi_sshortchar.c
rename to libffi/testsuite/libffi.closures/cls_multi_sshortchar.c
index 1c3aeb5a66c157292dd1c87af44a9b938b3be3a0..de45b593e32a4e084f7c02e9979888a837342cf6 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-signed short test_func_fn(signed char a1, signed short a2,
+static signed short test_func_fn(signed char a1, signed short a2,
                          signed char a3, signed short a4)
 {
   signed short result;
similarity index 96%
rename from libffi/testsuite/libffi.call/cls_multi_uchar.c
rename to libffi/testsuite/libffi.closures/cls_multi_uchar.c
index 009c02c72ba5360c95122443520595194be3cbb0..eb93e95e3b3545196941103a7038be26fa6f0fa3 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-unsigned char test_func_fn(unsigned char a1, unsigned char a2,
+static unsigned char test_func_fn(unsigned char a1, unsigned char a2,
                           unsigned char a3, unsigned char a4)
 {
   unsigned char result;
similarity index 95%
rename from libffi/testsuite/libffi.call/cls_multi_ushort.c
rename to libffi/testsuite/libffi.closures/cls_multi_ushort.c
index dd10ca734685dfb48cc7df9d2309722ba0cb85d1..0e5838df103a31ca440bac2c16127172f3c9cda8 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-unsigned short test_func_fn(unsigned short a1, unsigned short a2)
+static unsigned short test_func_fn(unsigned short a1, unsigned short a2)
 {
   unsigned short result;
 
similarity index 96%
rename from libffi/testsuite/libffi.call/cls_multi_ushortchar.c
rename to libffi/testsuite/libffi.closures/cls_multi_ushortchar.c
index 2588e97f987fbb5c386f78bc9b80719b674244b1..69aedfe0d233531def5e876a8b19377a079881b6 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-unsigned short test_func_fn(unsigned char a1, unsigned short a2,
+static unsigned short test_func_fn(unsigned char a1, unsigned short a2,
                            unsigned char a3, unsigned short a4)
 {
   unsigned short result;
diff --git a/libffi/testsuite/libffi.closures/ffitest.h b/libffi/testsuite/libffi.closures/ffitest.h
new file mode 100644 (file)
index 0000000..95d96a8
--- /dev/null
@@ -0,0 +1,144 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <ffi.h>
+#include "fficonfig.h"
+
+#if defined HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#if defined HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#define MAX_ARGS 256
+
+#define CHECK(x) \
+   do { \
+      if(!(x)){ \
+         printf("Check failed:\n%s\n", #x); \
+         abort(); \
+      } \
+   } while(0)
+
+/* Define macros so that compilers other than gcc can run the tests.  */
+#undef __UNUSED__
+#if defined(__GNUC__)
+#define __UNUSED__ __attribute__((__unused__))
+#define __STDCALL__ __attribute__((stdcall))
+#define __THISCALL__ __attribute__((thiscall))
+#define __FASTCALL__ __attribute__((fastcall))
+#define __MSABI__ __attribute__((ms_abi))
+#else
+#define __UNUSED__
+#define __STDCALL__ __stdcall
+#define __THISCALL__ __thiscall
+#define __FASTCALL__ __fastcall
+#endif
+
+#ifndef ABI_NUM
+#define ABI_NUM FFI_DEFAULT_ABI
+#define ABI_ATTR
+#endif
+
+/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
+   file open.  */
+#ifdef HAVE_MMAP_ANON
+# undef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+#  define MAP_FAILED -1
+# endif
+# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+#  define MAP_ANONYMOUS MAP_ANON
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+#  define MAP_FAILED -1
+# endif
+# define USING_MMAP
+
+#endif
+
+/* MinGW kludge.  */
+#if defined(_WIN64) | defined(_WIN32)
+#define PRIdLL "I64d"
+#define PRIuLL "I64u"
+#else
+#define PRIdLL "lld"
+#define PRIuLL "llu"
+#endif
+
+/* Tru64 UNIX kludge.  */
+#if defined(__alpha__) && defined(__osf__)
+/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit.  */
+#undef PRIdLL
+#define PRIdLL "ld"
+#undef PRIuLL
+#define PRIuLL "lu"
+#define PRId8 "hd"
+#define PRIu8 "hu"
+#define PRId64 "ld"
+#define PRIu64 "lu"
+#define PRIuPTR "lu"
+#endif
+
+/* PA HP-UX kludge.  */
+#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR)
+#define PRIuPTR "lu"
+#endif
+
+/* IRIX kludge.  */
+#if defined(__sgi)
+/* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
+   compilations.  */
+#define PRId8 "hhd"
+#define PRIu8 "hhu"
+#if (_MIPS_SZLONG == 32)
+#define PRId64 "lld"
+#define PRIu64 "llu"
+#endif
+/* This doesn't match <inttypes.h>, which always has "lld" here, but the
+   arguments are uint64_t, int64_t, which are unsigned long, long for
+   64-bit in <sgidefs.h>.  */
+#if (_MIPS_SZLONG == 64)
+#define PRId64 "ld"
+#define PRIu64 "lu"
+#endif
+/* This doesn't match <inttypes.h>, which has "u" here, but the arguments
+   are uintptr_t, which is always unsigned long.  */
+#define PRIuPTR "lu"
+#endif
+
+/* Solaris < 10 kludge.  */
+#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
+#if defined(__arch64__) || defined (__x86_64__)
+#define PRIuPTR "lu"
+#else
+#define PRIuPTR "u"
+#endif
+#endif
+
+/* MSVC kludge.  */
+#if defined _MSC_VER
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
+#define PRIuPTR "lu"
+#define PRIu8 "u"
+#define PRId8 "d"
+#define PRIu64 "I64u"
+#define PRId64 "I64d"
+#endif
+#endif
+
+#ifndef PRIuPTR
+#define PRIuPTR "u"
+#endif
similarity index 99%
rename from libffi/testsuite/libffi.call/huge_struct.c
rename to libffi/testsuite/libffi.closures/huge_struct.c
index 187c42cc33492dd7f1a37f2f534c44c05f770373..e8e1d8601fb050e937a711778773afa7092d0a54 100644 (file)
@@ -7,7 +7,9 @@
 
 /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
 /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
-/* { dg-options -Wformat=0 { target moxie*-*-elf } } */
+/* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */
+
+#include <inttypes.h>
 
 #include "ffitest.h"
 
similarity index 98%
rename from libffi/testsuite/libffi.call/nested_struct.c
rename to libffi/testsuite/libffi.closures/nested_struct.c
index c15e3a0338294bfea5de2bf1652f2b01875c9253..10797a345f2ed1f91bdac82e3f857998226edaf6 100644 (file)
@@ -25,7 +25,7 @@ typedef struct cls_struct_combined {
   cls_struct_16byte2 e;
 } cls_struct_combined;
 
-cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
+static cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
                            struct cls_struct_16byte2 b1,
                            struct cls_struct_combined b2)
 {
similarity index 98%
rename from libffi/testsuite/libffi.call/nested_struct1.c
rename to libffi/testsuite/libffi.closures/nested_struct1.c
index 477a6b9bdee2cdb2b775b4eb678dec12b0a0ab33..df8ab5973d1a4b8f6322f6443b2c494f7a6ebde5 100644 (file)
@@ -25,7 +25,7 @@ typedef struct cls_struct_combined {
   cls_struct_16byte2 e;
 } cls_struct_combined;
 
-cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
+static cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
                                           struct cls_struct_16byte2 b1,
                                           struct cls_struct_combined b2,
                                           struct cls_struct_16byte1 b3)
similarity index 99%
rename from libffi/testsuite/libffi.call/nested_struct10.c
rename to libffi/testsuite/libffi.closures/nested_struct10.c
index 34a74e71874ddf129571c4e236226afabb2045df..3cf2b44abe89e9790fd75cdc0af3469b50aa0faa 100644 (file)
@@ -32,6 +32,7 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
   result.x.a = b2.a + b3.x.a + b3.z + b4.d;
   result.x.b = b2.b + b3.x.b + b3.y + b4.e;
   result.y = b2.b + b3.x.b + b4.e;
+  result.z = 0;
 
   printf("%d %d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
         (int)b3.x.a, b3.x.b, b3.y, b3.z, (int)b4.d, b4.e,
diff --git a/libffi/testsuite/libffi.closures/nested_struct12.c b/libffi/testsuite/libffi.closures/nested_struct12.c
new file mode 100644 (file)
index 0000000..0d307ae
--- /dev/null
@@ -0,0 +1,86 @@
+/* Area:       ffi_call
+   Purpose:    Check nested float struct.
+   Limitations:        none.
+   PR:         none.
+   Originator: Cheng Jin <jincheng@ca.ibm.com>  */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct stru_FF stru_FF;
+typedef struct stru_Nested_F stru_Nested_F;
+
+struct stru_FF {
+       float elem1;
+       float elem2;
+};
+
+struct stru_Nested_F {
+       float elem1;
+       stru_FF elem2;
+};
+
+static float testNestedFloatStruct(float arg1, stru_Nested_F arg2)
+{
+       float floatSum = arg1 + arg2.elem1 + arg2.elem2.elem1 + arg2.elem2.elem2;
+       return floatSum;
+}
+
+int main (void)
+{
+       float ts12_result = 0;
+       int structElemNum = 2;
+       int nestedStructElemNum = 2;
+       int argNum = 2;
+
+       ffi_cif cif;
+       ffi_type **struct_float1 = (ffi_type **)malloc(sizeof(ffi_type *) * (structElemNum + 1));
+       ffi_type **struct_float2 = (ffi_type **)malloc(sizeof(ffi_type *) * (nestedStructElemNum + 1));
+       ffi_type **args = (ffi_type **)malloc(sizeof(ffi_type *) * (argNum + 1));
+       void **values = (void **)malloc(sizeof(void *) * (argNum + 1));
+       ffi_type struct_float_type1, struct_float_type2;
+       ffi_type *retType = &ffi_type_float;
+       float arg1;
+       float *arg2 = (float *)malloc(sizeof(stru_Nested_F));
+
+       struct_float2[0] = &ffi_type_float;
+       struct_float2[1] = &ffi_type_float;
+       struct_float2[2] = NULL;
+
+       struct_float_type2.size = 0;
+       struct_float_type2.alignment = 0;
+       struct_float_type2.type = FFI_TYPE_STRUCT;
+       struct_float_type2.elements = struct_float2;
+
+       struct_float1[0] = &ffi_type_float;
+       struct_float1[1] = &struct_float_type2;
+       struct_float1[2] = NULL;
+
+       struct_float_type1.size = 0;
+       struct_float_type1.alignment = 0;
+       struct_float_type1.type = FFI_TYPE_STRUCT;
+       struct_float_type1.elements = struct_float1;
+
+       args[0] = &ffi_type_float;
+       args[1] = &struct_float_type1;
+       args[2] = NULL;
+
+       arg1 = 37.88;
+       arg2[0] = 31.22;
+       arg2[1] = 33.44;
+       arg2[2] = 35.66;
+       values[0] = &arg1;
+       values[1] = arg2;
+       values[2] = NULL;
+
+       CHECK( ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, retType, args) == FFI_OK);
+       ffi_call(&cif, FFI_FN(testNestedFloatStruct), &ts12_result, values);
+       CHECK(ts12_result == 138.2f);
+
+       free(struct_float1);
+       free(struct_float2);
+       free(args);
+       free(values);
+
+       exit(0);
+}
similarity index 88%
rename from libffi/testsuite/libffi.call/nested_struct12.c
rename to libffi/testsuite/libffi.closures/nested_struct13.c
index 6f3d7369f274c3ffab7fc505c84b08d6ae4e53fe..6c139b9526882b7d3bd1a6fdb7055727eaa43996 100644 (file)
@@ -1,8 +1,8 @@
-/* Area:       ffi_call, closure_call
-   Purpose:    Check structure passing.
-   Limitations:        none.
-   PR:         none.
-   Originator: <jincheng@ca.ibm.com> and <jakub@redhat.com> 20210609    */
+/* Area:       ffi_call, closure_call
+   Purpose:    Check structure passing.
+   Limitations:        none.
+   PR:         none.
+   Originator: <jincheng@ca.ibm.com> and <jakub@redhat.com> 20210609    */
 
 /* { dg-do run } */
 #include "ffitest.h"
@@ -25,7 +25,7 @@ B B_fn(float b0, struct B b1)
   result.y.b = b0 + b1.y.b;
 
   printf("%g %g %g %g: %g %g %g\n", b0, b1.x, b1.y.a, b1.y.b,
-        result.x, result.y.a, result.y.b);
+        result.x, result.y.a, result.y.b);
 
   return result;
 }
@@ -83,7 +83,7 @@ int main (void)
   dbl_arg_types[2] = NULL;
 
   CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
-                    dbl_arg_types) == FFI_OK);
+                    dbl_arg_types) == FFI_OK);
 
   args_dbl[0] = &e_dbl;
   args_dbl[1] = &f_dbl;
similarity index 98%
rename from libffi/testsuite/libffi.call/nested_struct2.c
rename to libffi/testsuite/libffi.closures/nested_struct2.c
index 69268cdb8af34d690e24970564c67315f4de66d0..d919e5c932db663d4d8285265417a14321014750 100644 (file)
@@ -19,7 +19,7 @@ typedef struct B {
   unsigned char y;
 } B;
 
-B B_fn(struct A b0, struct B b1)
+static B B_fn(struct A b0, struct B b1)
 {
   struct B result;
 
similarity index 98%
rename from libffi/testsuite/libffi.call/nested_struct3.c
rename to libffi/testsuite/libffi.closures/nested_struct3.c
index ab18cad733521046f936b8c7c672bfb0153064dd..7d4c2cf801b41bca9368c45f2e362f3dd849840b 100644 (file)
@@ -19,7 +19,7 @@ typedef struct B {
   unsigned char y;
 } B;
 
-B B_fn(struct A b0, struct B b1)
+static B B_fn(struct A b0, struct B b1)
 {
   struct B result;
 
diff --git a/libffi/testsuite/libffi.closures/single_entry_structs1.c b/libffi/testsuite/libffi.closures/single_entry_structs1.c
new file mode 100644 (file)
index 0000000..00c4e17
--- /dev/null
@@ -0,0 +1,86 @@
+/* Area:       ffi_call, closure_call
+   Purpose:    Single argument structs have a different ABI in emscripten.
+   Limitations:        none.
+   PR:         none.
+   Originator: <hood@mit.edu>  */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+  int a;
+} A;
+
+static struct A A_fn(int b0, struct A b1)
+{
+  b1.a += b0;
+  return b1;
+}
+
+static void
+A_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
+{
+  int b0;
+  struct A b1;
+
+  b0 = *(int*)(args[0]);
+  b1 = *(struct A*)(args[1]);
+
+  *(A*)resp = A_fn(b0, b1);
+}
+
+int main (void)
+{
+  printf("123\n");
+  ffi_cif cif;
+  void *code;
+  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+  void* args_dbl[3];
+  ffi_type* cls_struct_fields[2];
+  ffi_type cls_struct_type;
+  ffi_type* dbl_arg_types[3];
+
+  int e_dbl = 12125;
+  struct A f_dbl = { 31625 };
+
+  struct A res_dbl;
+
+  cls_struct_type.size = 0;
+  cls_struct_type.alignment = 0;
+  cls_struct_type.type = FFI_TYPE_STRUCT;
+  cls_struct_type.elements = cls_struct_fields;
+
+  cls_struct_fields[0] = &ffi_type_sint;
+  cls_struct_fields[1] = NULL;
+
+  dbl_arg_types[0] = &ffi_type_sint;
+  dbl_arg_types[1] = &cls_struct_type;
+  dbl_arg_types[2] = NULL;
+
+  res_dbl = A_fn(e_dbl, f_dbl);
+  printf("0 res: %d\n", res_dbl.a);
+  /* { dg-output "0 res: 43750" } */
+
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+                    dbl_arg_types) == FFI_OK);
+
+  args_dbl[0] = &e_dbl;
+  args_dbl[1] = &f_dbl;
+  args_dbl[2] = NULL;
+
+
+  ffi_call(&cif, FFI_FN(A_fn), &res_dbl, args_dbl);
+  printf("1 res: %d\n", res_dbl.a);
+  /* { dg-output "\n1 res: 43750" } */
+  CHECK( res_dbl.a == (e_dbl + f_dbl.a));
+
+  CHECK(ffi_prep_closure_loc(pcl, &cif, A_gn, NULL, code) == FFI_OK);
+
+  res_dbl = ((A(*)(int, A))(code))(e_dbl, f_dbl);
+  printf("2 res: %d\n", res_dbl.a);
+  /* { dg-output "\n2 res: 43750" } */
+  CHECK( res_dbl.a == (e_dbl + f_dbl.a));
+
+  exit(0);
+}
diff --git a/libffi/testsuite/libffi.closures/single_entry_structs2.c b/libffi/testsuite/libffi.closures/single_entry_structs2.c
new file mode 100644 (file)
index 0000000..ab6556b
--- /dev/null
@@ -0,0 +1,102 @@
+/* Area:       ffi_call, closure_call
+   Purpose:    Single argument structs have a different ABI in emscripten.
+   Limitations:        none.
+   PR:         none.
+   Originator: <hood@mit.edu>  */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+  int a, b;
+} A;
+
+typedef struct B {
+  struct A y;
+} B;
+
+static struct B B_fn(int b0, struct B b1)
+{
+  b1.y.a += b0;
+  b1.y.b -= b0;
+  return b1;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
+{
+  int b0;
+  struct B b1;
+
+  b0 = *(int*)(args[0]);
+  b1 = *(struct B*)(args[1]);
+
+  *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+  ffi_cif cif;
+  void *code;
+  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+  void* args_dbl[3];
+  ffi_type* cls_struct_fields[3];
+  ffi_type* cls_struct_fields1[2];
+  ffi_type cls_struct_type, cls_struct_type1;
+  ffi_type* dbl_arg_types[3];
+
+  int e_dbl = 12125;
+  struct B f_dbl = { { 31625, 16723 } };
+
+  struct B res_dbl;
+
+  cls_struct_type.size = 0;
+  cls_struct_type.alignment = 0;
+  cls_struct_type.type = FFI_TYPE_STRUCT;
+  cls_struct_type.elements = cls_struct_fields;
+
+  cls_struct_type1.size = 0;
+  cls_struct_type1.alignment = 0;
+  cls_struct_type1.type = FFI_TYPE_STRUCT;
+  cls_struct_type1.elements = cls_struct_fields1;
+
+  cls_struct_fields[0] = &ffi_type_sint;
+  cls_struct_fields[1] = &ffi_type_sint;
+  cls_struct_fields[2] = NULL;
+
+  cls_struct_fields1[0] = &cls_struct_type;
+  cls_struct_fields1[1] = NULL;
+
+
+  dbl_arg_types[0] = &ffi_type_sint;
+  dbl_arg_types[1] = &cls_struct_type1;
+  dbl_arg_types[2] = NULL;
+
+  res_dbl = B_fn(e_dbl, f_dbl);
+  printf("0 res: %d %d\n", res_dbl.y.a, res_dbl.y.b);
+  /* { dg-output "0 res: 43750 4598" } */
+
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+                    dbl_arg_types) == FFI_OK);
+
+  args_dbl[0] = &e_dbl;
+  args_dbl[1] = &f_dbl;
+  args_dbl[2] = NULL;
+
+  ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+  printf("1 res: %d %d\n", res_dbl.y.a, res_dbl.y.b);
+  /* { dg-output "\n1 res: 43750 4598" } */
+  CHECK( res_dbl.y.a == (f_dbl.y.a + e_dbl));
+  CHECK( res_dbl.y.b == (f_dbl.y.b - e_dbl));
+
+  CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+  res_dbl = ((B(*)(int, B))(code))(e_dbl, f_dbl);
+  printf("2 res: %d %d\n", res_dbl.y.a, res_dbl.y.b);
+  /* { dg-output "\n2 res: 43750 4598" } */
+  CHECK( res_dbl.y.a == (f_dbl.y.a + e_dbl));
+  CHECK( res_dbl.y.b == (f_dbl.y.b - e_dbl));
+
+  exit(0);
+}
diff --git a/libffi/testsuite/libffi.closures/single_entry_structs3.c b/libffi/testsuite/libffi.closures/single_entry_structs3.c
new file mode 100644 (file)
index 0000000..4f619cb
--- /dev/null
@@ -0,0 +1,101 @@
+/* Area:       ffi_call, closure_call
+   Purpose:    Single argument structs have a different ABI in emscripten.
+   Limitations:        none.
+   PR:         none.
+   Originator: <hood@mit.edu>  */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct A {
+  int a;
+} A;
+
+typedef struct B {
+  struct A y;
+} B;
+
+static struct B B_fn(int b0, struct B b1)
+{
+  b1.y.a += b0;
+  return b1;
+}
+
+static void
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
+{
+  int b0;
+  struct B b1;
+
+  b0 = *(int*)(args[0]);
+  b1 = *(struct B*)(args[1]);
+
+  *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+  printf("123\n");
+  ffi_cif cif;
+  void *code;
+  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+  void* args_dbl[3];
+  ffi_type* cls_struct_fields[2];
+  ffi_type* cls_struct_fields1[2];
+  ffi_type cls_struct_type, cls_struct_type1;
+  ffi_type* dbl_arg_types[3];
+
+  int e_dbl = 12125;
+  struct B f_dbl = { { 31625 } };
+
+  struct B res_dbl;
+
+  cls_struct_type.size = 0;
+  cls_struct_type.alignment = 0;
+  cls_struct_type.type = FFI_TYPE_STRUCT;
+  cls_struct_type.elements = cls_struct_fields;
+
+  cls_struct_type1.size = 0;
+  cls_struct_type1.alignment = 0;
+  cls_struct_type1.type = FFI_TYPE_STRUCT;
+  cls_struct_type1.elements = cls_struct_fields1;
+
+  cls_struct_fields[0] = &ffi_type_sint;
+  cls_struct_fields[1] = NULL;
+
+  cls_struct_fields1[0] = &cls_struct_type;
+  cls_struct_fields1[1] = NULL;
+
+
+  dbl_arg_types[0] = &ffi_type_sint;
+  dbl_arg_types[1] = &cls_struct_type1;
+  dbl_arg_types[2] = NULL;
+
+  res_dbl = B_fn(e_dbl, f_dbl);
+  printf("0 res: %d\n", res_dbl.y.a);
+  /* { dg-output "0 res: 43750" } */
+
+
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+                    dbl_arg_types) == FFI_OK);
+
+  args_dbl[0] = &e_dbl;
+  args_dbl[1] = &f_dbl;
+  args_dbl[2] = NULL;
+
+
+  ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+  printf("1 res: %d\n", res_dbl.y.a);
+  /* { dg-output "\n1 res: 43750" } */
+  CHECK( res_dbl.y.a == (e_dbl + f_dbl.y.a));
+
+  CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
+
+  res_dbl = ((B(*)(int, B))(code))(e_dbl, f_dbl);
+  printf("2 res: %d\n", res_dbl.y.a);
+  /* { dg-output "\n2 res: 43750" } */
+  CHECK( res_dbl.y.a == (e_dbl + f_dbl.y.a));
+
+  exit(0);
+}
similarity index 98%
rename from libffi/testsuite/libffi.call/stret_medium.c
rename to libffi/testsuite/libffi.closures/stret_medium.c
index 973ee02ede887cc20e3e76a4f4b279337e1be679..56e3d9d8fc06dcc877d7f79919dd7727c78bef1f 100644 (file)
@@ -21,7 +21,7 @@ typedef struct struct_72byte {
        double i;
 } struct_72byte;
 
-struct_72byte cls_struct_72byte_fn(
+static struct_72byte cls_struct_72byte_fn(
        struct_72byte b0,
        struct_72byte b1,
        struct_72byte b2,
similarity index 98%
rename from libffi/testsuite/libffi.call/stret_medium2.c
rename to libffi/testsuite/libffi.closures/stret_medium2.c
index 84323d16a918c87084c443a8dbefed8afbdfc696..0746b6ee4b7425d120718bba9d12d1ad2bf0244b 100644 (file)
@@ -22,7 +22,7 @@ typedef struct struct_72byte {
        long long i;
 } struct_72byte;
 
-struct_72byte cls_struct_72byte_fn(
+static struct_72byte cls_struct_72byte_fn(
        struct_72byte b0,
        struct_72byte b1,
        struct_72byte b2,
similarity index 95%
rename from libffi/testsuite/libffi.call/testclosure.c
rename to libffi/testsuite/libffi.closures/testclosure.c
index ca31056d8c834059a936ab625cd96f967bfc6235..600368e0c9d08944d9c32157ddc2b52fd188d771 100644 (file)
@@ -14,7 +14,7 @@ typedef struct cls_struct_combined {
   float d;
 } cls_struct_combined;
 
-void cls_struct_combined_fn(struct cls_struct_combined arg)
+static void cls_struct_combined_fn(struct cls_struct_combined arg)
 {
   printf("%g %g %g %g\n",
         arg.a, arg.b,
similarity index 95%
rename from libffi/testsuite/libffi.special/unwindtest.cc
rename to libffi/testsuite/libffi.closures/unwindtest.cc
index d7ffd4aa21477d87e5dfb6d9ad6d2c65e4adc4dc..e1145657d14d59509706914cc7f23366a0e6202a 100644 (file)
@@ -4,18 +4,11 @@
    PR:         none.
    Originator: Jeff Sturm <jsturm@one-point.com>  */
 
-/* { dg-do run } */
-#include "ffitestcxx.h"
+/* { dg-do run { xfail x86_64-apple-darwin* moxie*-*-* } } */
 
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#endif
+#include "ffitest.h"
 
-#if defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-void
+void ABI_ATTR
 closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
                void** args __UNUSED__, void* userdata __UNUSED__)
 {
similarity index 94%
rename from libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
rename to libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc
index 29739cdb1719b7dd7493909cf6d702d7aaf049bd..153d24094080e00f75e92b10a575feea296ca9ca 100644 (file)
@@ -4,8 +4,9 @@
    PR:         none.
    Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213  */
 
-/* { dg-do run } */
-#include "ffitestcxx.h"
+/* { dg-do run { xfail moxie*-*-* } } */
+
+#include "ffitest.h"
 
 static int checking(int a __UNUSED__, short b __UNUSED__,
                    signed char c __UNUSED__)
index e120eea5e75b4a069d85fab1494c9459ddc0190d..3675b40a54c844358369bc8720818efe3843339f 100644 (file)
@@ -4,12 +4,6 @@
 # define STATIC_CHAIN_REG  "$1"
 #elif defined(__arm__)
 # define STATIC_CHAIN_REG  "ip"
-#elif defined(__hppa__)
-# if defined(__LP64)
-#   define define STATIC_CHAIN_REG  "%r31"
-# else
-#   define define STATIC_CHAIN_REG  "%r29"   /* %ret1 */
-# endif
 #elif defined(__sparc__)
 # if defined(__arch64__) || defined(__sparcv9)
 #  define STATIC_CHAIN_REG "g5"
diff --git a/libffi/testsuite/libffi.special/ffitestcxx.h b/libffi/testsuite/libffi.special/ffitestcxx.h
deleted file mode 100644 (file)
index 83f5442..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <ffi.h>
-#include "fficonfig.h"
-
-#define MAX_ARGS 256
-
-
-/* Define __UNUSED__ that also other compilers than gcc can run the tests.  */
-#undef __UNUSED__
-#if defined(__GNUC__)
-#define __UNUSED__ __attribute__((__unused__))
-#else
-#define __UNUSED__
-#endif
-
-#define CHECK(x) (!(x) ? abort() : (void)0)
-
-/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
-   file open.  */
-#ifdef HAVE_MMAP_ANON
-# undef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-#  define MAP_FAILED -1
-# endif
-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
-#  define MAP_ANONYMOUS MAP_ANON
-# endif
-# define USING_MMAP
-
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-#  define MAP_FAILED -1
-# endif
-# define USING_MMAP
-
-#endif
-
-
-/* MinGW kludge.  */
-#ifdef _WIN64
-#define PRIdLL "I64d"
-#define PRIuLL "I64u"
-#else
-#define PRIdLL "lld"
-#define PRIuLL "llu"
-#endif
-
-#ifdef USING_MMAP
-static inline void *
-allocate_mmap (size_t size)
-{
-  void *page;
-#if defined (HAVE_MMAP_DEV_ZERO)
-  static int dev_zero_fd = -1;
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-  if (dev_zero_fd == -1)
-    {
-      dev_zero_fd = open ("/dev/zero", O_RDONLY);
-      if (dev_zero_fd == -1)
-       {
-         perror ("open /dev/zero: %m");
-         exit (1);
-       }
-    }
-#endif
-
-
-#ifdef HAVE_MMAP_ANON
-  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-              MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
-#ifdef HAVE_MMAP_DEV_ZERO
-  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-              MAP_PRIVATE, dev_zero_fd, 0);
-#endif
-
-  if (page == (char *) MAP_FAILED)
-    {
-      perror ("virtual memory exhausted");
-      exit (1);
-    }
-
-  return page;
-}
-
-#endif
diff --git a/libffi/testsuite/libffi.special/special.exp b/libffi/testsuite/libffi.special/special.exp
deleted file mode 100644 (file)
index 74671b1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010 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
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-global cxx_options
-
-set cxx_options " -shared-libgcc -lstdc++"
-
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O0 -W -Wall"
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O2"
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O3"
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-Os"
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End: