From 1ff9c604bb214b5a305064af1049577ef783730a Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Wed, 1 Feb 2012 16:34:30 -0600 Subject: [PATCH] Rebase from GCC --- .pc/aix-ibm-xlc/ChangeLog | 24 + .pc/alpha/ChangeLog | 26 +- .pc/amiga/ChangeLog | 26 +- .pc/amiga/configure | 1463 +++----------------- .pc/amiga/configure.ac | 2 +- .pc/bad-abi-fix/ChangeLog | 24 + .pc/darwin-EH-fix/ChangeLog | 24 + .pc/darwin11/ChangeLog | 24 + .pc/darwin11/configure | 24 - .pc/debug-build/ChangeLog | 24 + .pc/ffi_last_abi/ChangeLog | 24 + .pc/ffi_last_abi/src/x86/ffitarget.h | 2 + .pc/fix-grammar/ChangeLog | 24 + .pc/fix-ppc32/ChangeLog | 24 + .pc/fix-xfails/ChangeLog | 24 + .pc/fix_maxopt/ChangeLog | 24 + .pc/hpux-mallinfo/ChangeLog | 24 + .pc/interix/ChangeLog | 24 + .pc/interix/configure | 24 - .pc/ios-fixes/ChangeLog | 24 + .pc/ios/ChangeLog | 24 + .pc/ios/Makefile.in | 1 - .pc/ios/fficonfig.h.in | 3 - .pc/irix/ChangeLog | 24 + .pc/kfreebsd-mmap/ChangeLog | 24 + .pc/m68k-patches/src/m68k/sysv.S | 270 ---- .pc/ml64-safeseh/ChangeLog | 24 + .pc/more-openbsd/ChangeLog | 24 + .pc/msvcc-warning/ChangeLog | 24 + .pc/msvcc/Makefile.in | 1 - .pc/powerpc-ffi-softfloat/ChangeLog | 24 + .pc/powerpc-sysv-without-string-ops/ChangeLog | 24 + .pc/ppc64-darwin/ChangeLog | 24 + .pc/ppc64-darwin/configure | 24 - .pc/remove-debug-code/ChangeLog | 24 + .pc/remove-debug-code/Makefile.in | 11 - .pc/sparc-abi-check/ChangeLog | 24 + .pc/sparc-v8-aggregate-returns/ChangeLog | 24 + .pc/stdcall-x86-closure-fix/ChangeLog | 24 + .pc/stdcall-x86-closure-fix/src/x86/ffi.c | 143 +- .pc/stdcall-x86-closure-fix/src/x86/ffitarget.h | 7 +- .pc/ungccify/Makefile.in | 1 - .pc/unlikely/ChangeLog | 26 +- .pc/variadic/ChangeLog | 24 + .pc/win64-struct-args/ChangeLog | 24 + .pc/win64-struct-args/src/x86/ffi.c | 143 +- .pc/win64-underscore/ChangeLog | 24 + .pc/windows-ce-arm/ChangeLog | 24 + .pc/x86_pcrel_test/ChangeLog | 24 + ChangeLog | 29 +- Makefile.in | 10 - aclocal.m4 | 8 - configure | 1463 +++----------------- configure.ac | 2 +- doc/libffi.info | 74 +- doc/stamp-vti | 8 +- doc/version.texi | 8 +- fficonfig.h.in | 3 - include/Makefile.in | 10 - man/Makefile.in | 10 - patches/aix-ibm-xlc | 4 +- patches/alpha | 12 +- patches/amiga | 6 +- patches/bad-abi-fix | 2 +- patches/darwin-EH-fix | 2 +- patches/darwin11 | 1657 +---------------------- patches/debug-build | 2 +- patches/ffi_last_abi | 18 +- patches/fix-grammar | 2 +- patches/fix-ppc32 | 2 +- patches/fix-xfails | 4 +- patches/fix_maxopt | 2 +- patches/hpux-mallinfo | 2 +- patches/interix | 4 +- patches/ios | 14 +- patches/ios-fixes | 2 +- patches/irix | 2 +- patches/kfreebsd-mmap | 2 +- patches/m68k-patches | 75 - patches/ml64-safeseh | 2 +- patches/more-openbsd | 2 +- patches/msvcc | 4 +- patches/msvcc-warning | 2 +- patches/powerpc-ffi-softfloat | 2 +- patches/powerpc-sysv-without-string-ops | 2 +- patches/ppc64-darwin | 6 +- patches/remove-debug-code | 14 +- patches/sparc-abi-check | 2 +- patches/sparc-v8-aggregate-returns | 2 +- patches/stdcall-x86-closure-fix | 10 +- patches/ungccify | 2 +- patches/unlikely | 7 +- patches/variadic | 2 +- patches/win64-struct-args | 4 +- patches/win64-underscore | 2 +- patches/windows-ce-arm | 2 +- patches/x86_pcrel_test | 2 +- src/x86/ffi.c | 143 +- src/x86/ffitarget.h | 7 +- src/x86/win32.S | 55 +- testsuite/Makefile.in | 10 - testsuite/libffi.call/fastthis1_win32.c | 50 + testsuite/libffi.call/fastthis2_win32.c | 50 + testsuite/libffi.call/fastthis3_win32.c | 56 + testsuite/libffi.call/many2_win32.c | 63 + testsuite/libffi.call/strlen2_win32.c | 45 + testsuite/libffi.call/struct1_win32.c | 65 + testsuite/libffi.call/struct2_win32.c | 67 + 108 files changed, 2180 insertions(+), 4880 deletions(-) delete mode 100644 .pc/m68k-patches/src/m68k/sysv.S create mode 100644 testsuite/libffi.call/fastthis1_win32.c create mode 100644 testsuite/libffi.call/fastthis2_win32.c create mode 100644 testsuite/libffi.call/fastthis3_win32.c create mode 100644 testsuite/libffi.call/many2_win32.c create mode 100644 testsuite/libffi.call/strlen2_win32.c create mode 100644 testsuite/libffi.call/struct1_win32.c create mode 100644 testsuite/libffi.call/struct2_win32.c diff --git a/.pc/aix-ibm-xlc/ChangeLog b/.pc/aix-ibm-xlc/ChangeLog index 93644c1..6af22cb 100644 --- a/.pc/aix-ibm-xlc/ChangeLog +++ b/.pc/aix-ibm-xlc/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/alpha/ChangeLog b/.pc/alpha/ChangeLog index 2746f5f..5afcc13 100644 --- a/.pc/alpha/ChangeLog +++ b/.pc/alpha/ChangeLog @@ -1,3 +1,22 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + 2012-01-23 Anthony Green Chris Young @@ -8,16 +27,11 @@ * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. -2012-01-23 Andreas Schwab +2012-01-23 Andreas Schwab * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain mc68000. Test for __HAVE_68881__ in addition to __MC68881__. -2012-01-23 Alan Hourihane - - * src/m68k/ffi.c (ffi_prep_closure_loc): Fix ABI check. - * testsuite/libffi.call/return_sc.c (main): Fix test check. - 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/amiga/ChangeLog b/.pc/amiga/ChangeLog index b926890..59e12f4 100644 --- a/.pc/amiga/ChangeLog +++ b/.pc/amiga/ChangeLog @@ -1,18 +1,32 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + 2012-01-23 Anthony Green Dmitry Nadezhin * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. -2012-01-23 Andreas Schwab +2012-01-23 Andreas Schwab * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain mc68000. Test for __HAVE_68881__ in addition to __MC68881__. -2012-01-23 Alan Hourihane - - * src/m68k/ffi.c (ffi_prep_closure_loc): Fix ABI check. - * testsuite/libffi.call/return_sc.c (main): Fix test check. - 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/amiga/configure b/.pc/amiga/configure index 3e7d415..70a15e3 100755 --- a/.pc/amiga/configure +++ b/.pc/amiga/configure @@ -688,7 +688,6 @@ TESTSUBDIR_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE -PRTDIAG CPP OTOOL64 OTOOL @@ -755,7 +754,6 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM -ax_enable_builddir_sed target_os target_vendor target_cpu @@ -809,7 +807,6 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_builddir enable_dependency_tracking enable_shared enable_static @@ -818,8 +815,6 @@ enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock -enable_portable_binary -with_gcc_arch enable_maintainer_mode enable_debug enable_structs @@ -1454,8 +1449,6 @@ 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] - --disable-builddir disable automatic build in subdir of sources - --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1463,9 +1456,6 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-portable-binary - disable compiler optimizations that would produce - unportable binaries --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-debug debugging mode @@ -1481,8 +1471,6 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-gcc-arch= use architecture for gcc -march/-mtune, - instead of guessing Some influential environment variables: CC C compiler command @@ -2658,109 +2646,7 @@ target_alias=${target_alias-$host_alias} . ${srcdir}/configure.host - - # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args - if test "${ac_configure_args+set}" != "set" ; then - ac_configure_args= - for ac_arg in ${1+"$@"}; do - ac_configure_args="$ac_configure_args '$ac_arg'" - done - fi - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - - -ax_enable_builddir="." -# Check whether --enable-builddir was given. -if test "${enable_builddir+set}" = set; then : - enableval=$enable_builddir; ax_enable_builddir="$enableval" -else - ax_enable_builddir="auto" -fi - -if test ".$ac_srcdir_defaulted" != ".no" ; then -if test ".$srcdir" = ".." ; then - if test -f config.status ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: toplevel srcdir already configured... skipping subdir build" >&5 -$as_echo "$as_me: toplevel srcdir already configured... skipping subdir build" >&6;} - else - test ".$ax_enable_builddir" = "." && ax_enable_builddir="." - test ".$ax_enable_builddir" = ".no" && ax_enable_builddir="." - test ".$TARGET" = "." && TARGET="$target" - test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="$TARGET" - if test ".$ax_enable_builddir" != ".." ; then # we know where to go and - as_dir=$ax_enable_builddir; as_fn_mkdir_p - echo __.$ax_enable_builddir.__ > $ax_enable_builddir/conftest.tmp - cd $ax_enable_builddir - if grep __.$ax_enable_builddir.__ conftest.tmp >/dev/null 2>/dev/null ; then - rm conftest.tmp - { $as_echo "$as_me:${as_lineno-$LINENO}: result: continue configure in default builddir \"./$ax_enable_builddir\"" >&5 -$as_echo "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; } - else - as_fn_error $? "could not change to default builddir \"./$ax_enable_builddir\"" "$LINENO" 5 - fi - srcdir=`echo "$ax_enable_builddir" | - sed -e 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g;s,[/]$,,;'` - # going to restart from subdirectory location - test -f $srcdir/config.log && mv $srcdir/config.log . - test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . - test -f $srcdir/conftest.log && mv $srcdir/conftest.log . - test -f $srcdir/$cache_file && mv $srcdir/$cache_file . - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&5 -$as_echo "....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&6; } - case "$0" in # restart - /\\*) eval $SHELL "'$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; - *) eval $SHELL "'$srcdir/$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; - esac ; exit $? - fi - fi -fi fi -test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="." -# Extract the first word of "gsed sed", so it can be a program name with args. -set dummy gsed sed; 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_path_ax_enable_builddir_sed+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ax_enable_builddir_sed in - [\\/]* | ?:[\\/]*) - ac_cv_path_ax_enable_builddir_sed="$ax_enable_builddir_sed" # Let the user override the test with a path. - ;; - *) - 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ax_enable_builddir_sed="$as_dir/$ac_word$ac_exec_ext" - $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 - - test -z "$ac_cv_path_ax_enable_builddir_sed" && ac_cv_path_ax_enable_builddir_sed="sed" - ;; -esac -fi -ax_enable_builddir_sed=$ac_cv_path_ax_enable_builddir_sed -if test -n "$ax_enable_builddir_sed"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_enable_builddir_sed" >&5 -$as_echo "$ax_enable_builddir_sed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -ax_enable_builddir_auxdir="$am_aux_dir" -ac_config_commands="$ac_config_commands buildir" - +AX_ENABLE_BUILDDIR am__api_version='1.11' @@ -2919,6 +2805,9 @@ test "$program_suffix" != NONE && 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 *\ * | *\ *) @@ -11950,1083 +11839,204 @@ CC="$lt_save_CC" +AX_CC_MAXOPT +AX_CFLAGS_WARN_ALL +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fexceptions" +fi + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 -$as_echo_n "checking for C compiler vendor... " >&6; } -if ${ax_cv_c_compiler_vendor+:} false; then : - $as_echo_n "(cached) " >&6 +{ $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 - ax_cv_c_compiler_vendor=unknown - # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ clang:__clang__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do - vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + USE_MAINTAINER_MODE=no +fi -int -main () -{ + { $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 -#if !($vencpp) - thisisanerror; -#endif + MAINT=$MAINTAINER_MODE_TRUE - ; - return 0; -} + + +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 -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_compiler_vendor=`echo $ventest | cut -d: -f1`; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 -$as_echo "$ax_cv_c_compiler_vendor" >&6; } +done + +for ac_func in mmap +do : + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MMAP 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 -# Check whether --enable-portable-binary was given. -if test "${enable_portable_binary+set}" = set; then : - enableval=$enable_portable_binary; acx_maxopt_portable=$withval +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 - acx_maxopt_portable=no + 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; } -# Try to determine "good" native compiler flags if none specified via CFLAGS -if test "$ac_test_CFLAGS" != "set"; then - CFLAGS="" - case $ax_cv_c_compiler_vendor in - dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" - if test "x$acx_maxopt_portable" = xno; then - CFLAGS="$CFLAGS -arch host" - fi;; - - sun) CFLAGS="-native -fast -xO5 -dalign" - if test "x$acx_maxopt_portable" = xyes; then - CFLAGS="$CFLAGS -xarch=generic" - fi;; - - hp) CFLAGS="+Oall +Optrs_ansi +DSnative" - if test "x$acx_maxopt_portable" = xyes; then - CFLAGS="$CFLAGS +DAportable" - fi;; - - ibm) if test "x$acx_maxopt_portable" = xno; then - xlc_opt="-qarch=auto -qtune=auto" - else - xlc_opt="-qtune=auto" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 -$as_echo_n "checking whether C compiler accepts $xlc_opt... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$xlc_opt" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # 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 +#include +#include + +#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 : - eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=yes + ac_cv_decl_map_anon=yes else - eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=no + ac_cv_decl_map_anon=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - CFLAGS="-O3 -qansialias -w $xlc_opt" -else - CFLAGS="-O3 -qansialias -w" - echo "******************************************************" - echo "* You seem to have the IBM C compiler. It is *" - echo "* recommended for best performance that you use: *" - echo "* *" - echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" - echo "* ^^^ ^^^ *" - echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" - echo "* CPU you have. (Set the CFLAGS environment var. *" - echo "* and re-run configure.) For more info, man cc. *" - echo "******************************************************" -fi - - ;; - - intel) CFLAGS="-O3 -ansi_alias" - if test "x$acx_maxopt_portable" = xno; then - icc_archflag=unknown - icc_flags="" - case $host_cpu in - i686*|x86_64*) - # icc accepts gcc assembly syntax, so these should work: - -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: $ac_cv_decl_map_anon" >&5 +$as_echo "$ac_cv_decl_map_anon" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 -$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0+:} false; then : + 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 - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_0=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ + # 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 - int op = 0, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; +$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid -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_cv_func_mmap_dev_zero = yes; then + +$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } -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 $ac_cv_func_mmap_anon = yes; then +$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h +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 x86 cpuid 1 output" >&5 -$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_1=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 1, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_1" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } -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 - - - case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG - *:756e6547:*:*) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *6a?:*[234]:*:*|*6[789b]?:*:*:*) icc_flags="-xK";; - *f3[347]:*:*:*|*f41347:*:*:*) icc_flags="-xP -xN -xW -xK";; - *f??:*:*:*) icc_flags="-xN -xW -xK";; - esac ;; - esac ;; - esac - if test "x$icc_flags" != x; then - for flag in $icc_flags; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes -else - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - icc_archflag=$flag; break -else - : -fi - - done - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 -$as_echo_n "checking for icc architecture flag... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 -$as_echo "$icc_archflag" >&6; } - if test "x$icc_archflag" != xunknown; then - CFLAGS="$CFLAGS $icc_archflag" - fi - fi - ;; - - gnu) - # default optimization flags for gcc on all systems - CFLAGS="-O3 -fomit-frame-pointer" - - # -fstrict-aliasing for gcc-2.95+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 -$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; } -if ${ax_cv_c_flags__fstrict_aliasing+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_save_FLAGS=$CFLAGS - CFLAGS="-fstrict-aliasing" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_flags__fstrict_aliasing=yes -else - ax_cv_c_flags__fstrict_aliasing=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -fi - -eval ax_check_compiler_flags=$ax_cv_c_flags__fstrict_aliasing -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - CFLAGS="$CFLAGS -fstrict-aliasing" -else - : -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 -$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; } -if ${ax_cv_c_flags__ffast_math+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_save_FLAGS=$CFLAGS - CFLAGS="-ffast-math" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_flags__ffast_math=yes -else - ax_cv_c_flags__ffast_math=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -fi - -eval ax_check_compiler_flags=$ax_cv_c_flags__ffast_math -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - CFLAGS="$CFLAGS -ffast-math" -else - : -fi - - - - - - -# Check whether --with-gcc-arch was given. -if test "${with_gcc_arch+set}" = set; then : - withval=$with_gcc_arch; ax_gcc_arch=$withval -else - ax_gcc_arch=yes -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -$as_echo_n "checking for gcc architecture flag... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } -if ${ax_cv_gcc_archflag+:} false; then : - $as_echo_n "(cached) " >&6 -else - -ax_cv_gcc_archflag="unknown" - -if test "$GCC" = yes; then - -if test "x$ax_gcc_arch" = xyes; then -ax_gcc_arch="" -if test "$cross_compiling" = no; then -case $host_cpu in - i[3456]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones - -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 x86 cpuid 0 output" >&5 -$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_0=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 0, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_0" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } -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 for x86 cpuid 1 output" >&5 -$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_1=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 1, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_1" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } -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 - - - case $ax_cv_gcc_x86_cpuid_0 in - *:756e6547:*:*) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *5[48]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; - *5??:*:*:*) ax_gcc_arch=pentium ;; - *6[3456]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *6a?:*[01]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *6a?:*[234]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *6[9d]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; - *6[78b]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *6??:*:*:*) ax_gcc_arch=pentiumpro ;; - *f3[347]:*:*:*|*f41347:*:*:*) - case $host_cpu in - x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; - *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; - esac ;; - *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; - esac ;; - *:68747541:*:*) # AMD - case $ax_cv_gcc_x86_cpuid_1 in - *5[67]?:*:*:*) ax_gcc_arch=k6 ;; - *5[8d]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; - *5[9]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; - *60?:*:*:*) ax_gcc_arch=k7 ;; - *6[12]?:*:*:*) ax_gcc_arch="athlon k7" ;; - *6[34]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; - *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; - *6[68a]?:*:*:*) - -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 x86 cpuid 0x80000006 output" >&5 -$as_echo_n "checking for x86 cpuid 0x80000006 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0x80000006+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_0x80000006=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 0x80000006, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_0x80000006=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_0x80000006=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_0x80000006" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0x80000006" >&6; } -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 - - # L2 cache size - case $ax_cv_gcc_x86_cpuid_0x80000006 in - *:*:*[1-9a-f]??????:*) # (L2 = ecx >> 16) >= 256 - ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; - *) ax_gcc_arch="athlon-4 athlon k7" ;; - esac ;; - *f[4cef8b]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; - *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; - *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; - *f??:*:*:*) ax_gcc_arch="k8" ;; - esac ;; - *:746e6543:*:*) # IDT - case $ax_cv_gcc_x86_cpuid_1 in - *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; - *58?:*:*:*) ax_gcc_arch=winchip2 ;; - *6[78]?:*:*:*) ax_gcc_arch=c3 ;; - *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; - esac ;; - esac - if test x"$ax_gcc_arch" = x; then # fallback - case $host_cpu in - i586*) ax_gcc_arch=pentium ;; - i686*) ax_gcc_arch=pentiumpro ;; - esac - fi - ;; - - sparc*) - # Extract the first word of "prtdiag", so it can be a program name with args. -set dummy prtdiag; 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_path_PRTDIAG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PRTDIAG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" - $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 - - test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag" - ;; -esac -fi -PRTDIAG=$ac_cv_path_PRTDIAG -if test -n "$PRTDIAG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 -$as_echo "$PRTDIAG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` - cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` - case $cputype in - *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; - *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; - *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; - *supersparc*|*tms390z5[05]*) ax_gcc_arch="supersparc v8" ;; - *hypersparc*|*rt62[056]*) ax_gcc_arch="hypersparc v8" ;; - *cypress*) ax_gcc_arch=cypress ;; - esac ;; - - alphaev5) ax_gcc_arch=ev5 ;; - alphaev56) ax_gcc_arch=ev56 ;; - alphapca56) ax_gcc_arch="pca56 ev56" ;; - alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; - alphaev6) ax_gcc_arch=ev6 ;; - alphaev67) ax_gcc_arch=ev67 ;; - alphaev68) ax_gcc_arch="ev68 ev67" ;; - alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; - alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; - alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; - - powerpc*) - cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` - cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` - case $cputype in - *750*) ax_gcc_arch="750 G3" ;; - *740[0-9]*) ax_gcc_arch="$cputype 7400 G4" ;; - *74[4-5][0-9]*) ax_gcc_arch="$cputype 7450 G4" ;; - *74[0-9][0-9]*) ax_gcc_arch="$cputype G4" ;; - *970*) ax_gcc_arch="970 G5 power4";; - *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; - *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; - 603ev|8240) ax_gcc_arch="$cputype 603e 603";; - *) ax_gcc_arch=$cputype ;; - esac - ax_gcc_arch="$ax_gcc_arch powerpc" - ;; -esac -fi # not cross-compiling -fi # guess arch - -if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then -for arch in $ax_gcc_arch; do - if test "x$acx_maxopt_portable" = xyes; then # if we require portable code - flags="-mtune=$arch" - # -mcpu=$arch and m$arch generate nonportable code on every arch except - # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. - case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac - else - flags="-march=$arch -mcpu=$arch -m$arch" - fi - for flag in $flags; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes -else - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - ax_cv_gcc_archflag=$flag; break -else - : -fi - - done - test "x$ax_cv_gcc_archflag" = xunknown || break -done -fi - -fi # $GCC=yes - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -$as_echo_n "checking for gcc architecture flag... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 -$as_echo "$ax_cv_gcc_archflag" >&6; } -if test "x$ax_cv_gcc_archflag" = xunknown; then - : -else - CFLAGS="$CFLAGS $ax_cv_gcc_archflag" -fi - - ;; - esac - - if test -z "$CFLAGS"; then - echo "" - echo "********************************************************" - echo "* WARNING: Don't know the best CFLAGS for this system *" - echo "* Use ./configure CFLAGS=... to specify your own flags *" - echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" - echo "********************************************************" - echo "" - CFLAGS="-O3" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 -$as_echo_n "checking whether C compiler accepts $CFLAGS... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=yes -else - eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - : -else - - echo "" - echo "********************************************************" - echo "* WARNING: The guessed CFLAGS don't seem to work with *" - echo "* your compiler. *" - echo "* Use ./configure CFLAGS=... to specify your own flags *" - echo "********************************************************" - echo "" - CFLAGS="" - -fi - - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 -$as_echo_n "checking CFLAGS for maximum warnings... " >&6; } -if ${ac_cv_cflags_warn_all+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_cflags_warn_all="no, unknown" - 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_save_CFLAGS="$CFLAGS" -for ac_arg in "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # -do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - 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_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done - CFLAGS="$ac_save_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 - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 -$as_echo "$ac_cv_cflags_warn_all" >&6; } -case ".$ac_cv_cflags_warn_all" in - .ok|.ok,*) ;; - .|.no|.no,*) - ;; - *) - if echo " $CFLAGS " | grep " $ac_cv_cflags_warn_all " 2>&1 >/dev/null - then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$ac_cv_cflags_warn_all"; } >&5 - (: CFLAGS does contain $ac_cv_cflags_warn_all) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$ac_cv_cflags_warn_all\""; } >&5 - (: CFLAGS="$CFLAGS $ac_cv_cflags_warn_all") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - CFLAGS="$CFLAGS $ac_cv_cflags_warn_all" - fi - ;; -esac - -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -fexceptions" -fi - - -{ $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 -do : - ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -if test "x$ac_cv_func_mmap" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MMAP 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 -#include -#include - -#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='#' + if test -d $srcdir/testsuite; then + TESTSUBDIR_TRUE= + TESTSUBDIR_FALSE='#' else TESTSUBDIR_TRUE='#' TESTSUBDIR_FALSE= @@ -14297,7 +13307,7 @@ case "$target" in $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h ;; - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) + *-apple-darwin1[10]* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*) $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h @@ -15345,14 +14355,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -ax_enable_builddir_srcdir="$srcdir" # $srcdir -ax_enable_builddir_host="$HOST" # $HOST / $host -ax_enable_builddir_version="$VERSION" # $VERSION -ax_enable_builddir_package="$PACKAGE" # $PACKAGE -ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX -ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED -ax_enable_builddir="$ax_enable_builddir" # $SUB - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" @@ -15642,7 +14644,6 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;; - "buildir") CONFIG_COMMANDS="$CONFIG_COMMANDS buildir" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;; @@ -16281,150 +15282,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in - "buildir":C) ac_top_srcdir="$ax_enable_builddir_srcdir" - if test ".$ax_enable_builddir" = ".." ; then - if test -f "$top_srcdir/Makefile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - left untouched" >&5 -$as_echo "$as_me: skipping top_srcdir/Makefile - left untouched" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - not created" >&5 -$as_echo "$as_me: skipping top_srcdir/Makefile - not created" >&6;} - fi - else - if test -f "$ac_top_srcdir/Makefile" ; then - a=`grep "^VERSION " "$ac_top_srcdir/Makefile"` ; b=`grep "^VERSION " Makefile` - test "$a" != "$b" && rm "$ac_top_srcdir/Makefile" - fi - if test -f "$ac_top_srcdir/Makefile" ; then - echo "$ac_top_srcdir/Makefile : $ac_top_srcdir/Makefile.in" > $tmp/conftemp.mk - echo " @ echo 'REMOVED,,,' >\$@" >> $tmp/conftemp.mk - eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null" - if grep '^REMOVED,,,' "$ac_top_srcdir/Makefile" >/dev/null - then rm $ac_top_srcdir/Makefile ; fi - cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING - fi - if test ! -f "$ac_top_srcdir/Makefile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5 -$as_echo "$as_me: create top_srcdir/Makefile guessed from local Makefile" >&6;} - x='`' ; cat >$tmp/conftemp.sed <<_EOF -/^\$/n -x -/^\$/bS -x -/\\\\\$/{H;d;} -{H;s/.*//;x;} -bM -:S -x -/\\\\\$/{h;d;} -{h;s/.*//;x;} -:M -s/\\(\\n\\) /\\1 /g -/^ /d -/^[ ]*[\\#]/d -/^VPATH *=/d -s/^srcdir *=.*/srcdir = ./ -s/^top_srcdir *=.*/top_srcdir = ./ -/[:=]/!d -/^\\./d -/ = /b -/ .= /b -/:/!b -s/:.*/:/ -s/ / /g -s/ \\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/ \\1 \\1-all\\2/g -s/^\\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/\\1 \\1-all\\2/ -s/ / /g -/^all all-all[ :]/i\\ -all-configured : all-all -s/ [a-zA-Z0-9-]*-all [a-zA-Z0-9-]*-all-all//g -/-all-all/d -a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\ - ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ - ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done -/dist-all *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\ - ; if test "\$\$found" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ - ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\ - ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -/dist-[a-zA-Z0-9]*-all *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\ - ; if test "\$\$found" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ - ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\ - ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -/distclean-all *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\ - ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\ - ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\ - ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\ - ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile -_EOF - cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING - $ax_enable_builddir_sed -f $tmp/conftemp.sed Makefile >$ac_top_srcdir/Makefile - if test -f "$ac_top_srcdir/Makefile.mk" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5 -$as_echo "$as_me: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&6;} - cat $ac_top_srcdir/Makefile.mk >>$ac_top_srcdir/Makefile - fi ; xxxx="####" - echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$ac_top_srcdir/Makefile - # sanity check - if grep '^; echo "MAKE ' $ac_top_srcdir/Makefile >/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: buggy sed found - it deletes tab in \"a\" text parts" >&5 -$as_echo "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;} - $ax_enable_builddir_sed -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $ac_top_srcdir/Makefile \ - >$ac_top_srcdir/Makefile~ - (test -s $ac_top_srcdir/Makefile~ && mv $ac_top_srcdir/Makefile~ $ac_top_srcdir/Makefile) 2>/dev/null - fi - else - xxxx="\\#\\#\\#\\#" - # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed - echo "s!^$xxxx [^|]* | *$ax_enable_builddir *\$!$xxxx ...... $ax_enable_builddir!" >$tmp/conftemp.sed - $ax_enable_builddir_sed -f "$tmp/conftemp.sed" "$ac_top_srcdir/Makefile" >$tmp/mkfile.tmp - cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING - cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING - if cmp -s "$ac_top_srcdir/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5 -$as_echo "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;} - rm "$tmp/mkfile.tmp" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: reusing top_srcdir/Makefile from earlier configure" >&5 -$as_echo "$as_me: reusing top_srcdir/Makefile from earlier configure" >&6;} - mv "$tmp/mkfile.tmp" "$ac_top_srcdir/Makefile" - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&5 -$as_echo "$as_me: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&6;} - xxxx="####" - echo "$xxxx" "$ax_enable_builddir_host" "|$ax_enable_builddir" >>$ac_top_srcdir/Makefile - fi - ;; "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval diff --git a/.pc/amiga/configure.ac b/.pc/amiga/configure.ac index f56c7f0..b4a60c8 100644 --- a/.pc/amiga/configure.ac +++ b/.pc/amiga/configure.ac @@ -339,7 +339,7 @@ case "$target" in [Cannot use PROT_EXEC on this target, so, we revert to alternative means]) ;; - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) + *-apple-darwin1[[10]]* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1, [Cannot use malloc on this target, so, we revert to alternative means]) diff --git a/.pc/bad-abi-fix/ChangeLog b/.pc/bad-abi-fix/ChangeLog index 25b1961..d90ef49 100644 --- a/.pc/bad-abi-fix/ChangeLog +++ b/.pc/bad-abi-fix/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/darwin-EH-fix/ChangeLog b/.pc/darwin-EH-fix/ChangeLog index cea8334..0868fc8 100644 --- a/.pc/darwin-EH-fix/ChangeLog +++ b/.pc/darwin-EH-fix/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/darwin11/ChangeLog b/.pc/darwin11/ChangeLog index a6b2b61..07020f9 100644 --- a/.pc/darwin11/ChangeLog +++ b/.pc/darwin11/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/darwin11/configure b/.pc/darwin11/configure index 06756f2..975dc0e 100755 --- a/.pc/darwin11/configure +++ b/.pc/darwin11/configure @@ -621,9 +621,6 @@ FFI_DEBUG_FALSE FFI_DEBUG_TRUE TARGETDIR TARGET -FFI_EXEC_TRAMPOLINE_TABLE -FFI_EXEC_TRAMPOLINE_TABLE_FALSE -FFI_EXEC_TRAMPOLINE_TABLE_TRUE sys_symbol_underscore HAVE_LONG_DOUBLE ALLOCA @@ -13290,30 +13287,13 @@ $as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h fi fi - -FFI_EXEC_TRAMPOLINE_TABLE=0 case "$target" in - *arm*-apple-darwin*) - FFI_EXEC_TRAMPOLINE_TABLE=1 - -$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h - - ;; *-apple-darwin10* | *-*-freebsd* | *-*-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 assembler supports unwind section type" >&5 @@ -13741,10 +13721,6 @@ if test -z "${PA64_HPUX_TRUE}" && test -z "${PA64_HPUX_FALSE}"; then 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 diff --git a/.pc/debug-build/ChangeLog b/.pc/debug-build/ChangeLog index 143f385..bc94393 100644 --- a/.pc/debug-build/ChangeLog +++ b/.pc/debug-build/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/ffi_last_abi/ChangeLog b/.pc/ffi_last_abi/ChangeLog index 433978e..1142f60 100644 --- a/.pc/ffi_last_abi/ChangeLog +++ b/.pc/ffi_last_abi/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/ffi_last_abi/src/x86/ffitarget.h b/.pc/ffi_last_abi/src/x86/ffitarget.h index b85016c..4154762 100644 --- a/.pc/ffi_last_abi/src/x86/ffitarget.h +++ b/.pc/ffi_last_abi/src/x86/ffitarget.h @@ -64,6 +64,8 @@ typedef enum ffi_abi { #ifdef X86_WIN32 FFI_SYSV, FFI_STDCALL, + FFI_THISCALL, + FFI_FASTCALL, /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV, #endif diff --git a/.pc/fix-grammar/ChangeLog b/.pc/fix-grammar/ChangeLog index cadc0bb..b1c068b 100644 --- a/.pc/fix-grammar/ChangeLog +++ b/.pc/fix-grammar/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/fix-ppc32/ChangeLog b/.pc/fix-ppc32/ChangeLog index 2dc9a9b..936cc71 100644 --- a/.pc/fix-ppc32/ChangeLog +++ b/.pc/fix-ppc32/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/fix-xfails/ChangeLog b/.pc/fix-xfails/ChangeLog index 4392664..792bea0 100644 --- a/.pc/fix-xfails/ChangeLog +++ b/.pc/fix-xfails/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/fix_maxopt/ChangeLog b/.pc/fix_maxopt/ChangeLog index d80fd19..2a0665b 100644 --- a/.pc/fix_maxopt/ChangeLog +++ b/.pc/fix_maxopt/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/hpux-mallinfo/ChangeLog b/.pc/hpux-mallinfo/ChangeLog index 5e6c786..b35ca19 100644 --- a/.pc/hpux-mallinfo/ChangeLog +++ b/.pc/hpux-mallinfo/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/interix/ChangeLog b/.pc/interix/ChangeLog index d43e2e0..b0a77e4 100644 --- a/.pc/interix/ChangeLog +++ b/.pc/interix/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/interix/configure b/.pc/interix/configure index 6c06926..ce7d191 100755 --- a/.pc/interix/configure +++ b/.pc/interix/configure @@ -621,9 +621,6 @@ FFI_DEBUG_FALSE FFI_DEBUG_TRUE TARGETDIR TARGET -FFI_EXEC_TRAMPOLINE_TABLE -FFI_EXEC_TRAMPOLINE_TABLE_FALSE -FFI_EXEC_TRAMPOLINE_TABLE_TRUE sys_symbol_underscore HAVE_LONG_DOUBLE ALLOCA @@ -13290,30 +13287,13 @@ $as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h fi fi - -FFI_EXEC_TRAMPOLINE_TABLE=0 case "$target" in - *arm*-apple-darwin*) - FFI_EXEC_TRAMPOLINE_TABLE=1 - -$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h - - ;; *-apple-darwin10* | *-*-freebsd* | *-*-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 assembler supports unwind section type" >&5 @@ -13741,10 +13721,6 @@ if test -z "${PA64_HPUX_TRUE}" && test -z "${PA64_HPUX_FALSE}"; then 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 diff --git a/.pc/ios-fixes/ChangeLog b/.pc/ios-fixes/ChangeLog index 21f0207..6d490ac 100644 --- a/.pc/ios-fixes/ChangeLog +++ b/.pc/ios-fixes/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/ios/ChangeLog b/.pc/ios/ChangeLog index d926082..6eae3a1 100644 --- a/.pc/ios/ChangeLog +++ b/.pc/ios/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/ios/Makefile.in b/.pc/ios/Makefile.in index e706e16..7b81a99 100644 --- a/.pc/ios/Makefile.in +++ b/.pc/ios/Makefile.in @@ -389,7 +389,6 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ diff --git a/.pc/ios/fficonfig.h.in b/.pc/ios/fficonfig.h.in index 5e68ae7..e012ebb 100644 --- a/.pc/ios/fficonfig.h.in +++ b/.pc/ios/fficonfig.h.in @@ -176,9 +176,6 @@ # endif #endif -/* Define to `unsigned int' if does not define. */ -#undef size_t - #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE #ifdef LIBFFI_ASM diff --git a/.pc/irix/ChangeLog b/.pc/irix/ChangeLog index f6e0bd8..78579a7 100644 --- a/.pc/irix/ChangeLog +++ b/.pc/irix/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/kfreebsd-mmap/ChangeLog b/.pc/kfreebsd-mmap/ChangeLog index 083cf93..0ff1933 100644 --- a/.pc/kfreebsd-mmap/ChangeLog +++ b/.pc/kfreebsd-mmap/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/m68k-patches/src/m68k/sysv.S b/.pc/m68k-patches/src/m68k/sysv.S deleted file mode 100644 index c782f51..0000000 --- a/.pc/m68k-patches/src/m68k/sysv.S +++ /dev/null @@ -1,270 +0,0 @@ -/* ----------------------------------------------------------------------- - - sysv.S - Copyright (c) 1998 Andreas Schwab - Copyright (c) 2008 Red Hat, Inc. - - m68k 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 -#include - -#ifdef HAVE_AS_CFI_PSEUDO_OP -#define CFI_STARTPROC() .cfi_startproc -#define CFI_OFFSET(reg,off) .cfi_offset reg,off -#define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off -#define CFI_ENDPROC() .cfi_endproc -#else -#define CFI_STARTPROC() -#define CFI_OFFSET(reg,off) -#define CFI_DEF_CFA(reg,off) -#define CFI_ENDPROC() -#endif - - .text - - .globl ffi_call_SYSV - .type ffi_call_SYSV,@function - .align 4 - -ffi_call_SYSV: - CFI_STARTPROC() - link %fp,#0 - CFI_OFFSET(14,-8) - CFI_DEF_CFA(14,8) - move.l %d2,-(%sp) - CFI_OFFSET(2,-12) - - | Make room for all of the new args. - sub.l 12(%fp),%sp - - | Call ffi_prep_args - move.l 8(%fp),-(%sp) - pea 4(%sp) -#if !defined __PIC__ - jsr ffi_prep_args -#else - bsr.l ffi_prep_args@PLTPC -#endif - addq.l #8,%sp - - | Pass pointer to struct value, if any - move.l %a0,%a1 - - | Call the function - move.l 24(%fp),%a0 - jsr (%a0) - - | Remove the space we pushed for the args - add.l 12(%fp),%sp - - | Load the pointer to storage for the return value - move.l 20(%fp),%a1 - - | Load the return type code - move.l 16(%fp),%d2 - - | If the return value pointer is NULL, assume no return value. - | NOTE: On the mc68000, tst on an address register is not supported. -#if defined(__mc68000__) && !defined(__mcoldfire__) - cmp.w #0, %a1 -#else - tst.l %a1 -#endif - jbeq noretval - - btst #0,%d2 - jbeq retlongint - move.l %d0,(%a1) - jbra epilogue - -retlongint: - btst #1,%d2 - jbeq retfloat - move.l %d0,(%a1) - move.l %d1,4(%a1) - jbra epilogue - -retfloat: - btst #2,%d2 - jbeq retdouble -#if defined(__MC68881__) - fmove.s %fp0,(%a1) -#else - move.l %d0,(%a1) -#endif - jbra epilogue - -retdouble: - btst #3,%d2 - jbeq retlongdouble -#if defined(__MC68881__) - fmove.d %fp0,(%a1) -#else - move.l %d0,(%a1)+ - move.l %d1,(%a1) -#endif - jbra epilogue - -retlongdouble: - btst #4,%d2 - jbeq retpointer -#if defined(__MC68881__) - fmove.x %fp0,(%a1) -#else - move.l %d0,(%a1)+ - move.l %d1,(%a1)+ - move.l %d2,(%a1) -#endif - jbra epilogue - -retpointer: - btst #5,%d2 - jbeq retstruct1 - move.l %a0,(%a1) - jbra epilogue - -retstruct1: - btst #6,%d2 - jbeq retstruct2 - move.b %d0,(%a1) - jbra epilogue - -retstruct2: - btst #7,%d2 - jbeq noretval - move.w %d0,(%a1) - -noretval: -epilogue: - move.l (%sp)+,%d2 - unlk %fp - rts - CFI_ENDPROC() - .size ffi_call_SYSV,.-ffi_call_SYSV - - .globl ffi_closure_SYSV - .type ffi_closure_SYSV, @function - .align 4 - -ffi_closure_SYSV: - CFI_STARTPROC() - link %fp,#-12 - CFI_OFFSET(14,-8) - CFI_DEF_CFA(14,8) - move.l %sp,-12(%fp) - pea 8(%fp) - pea -12(%fp) - move.l %a0,-(%sp) -#if !defined __PIC__ - jsr ffi_closure_SYSV_inner -#else - bsr.l ffi_closure_SYSV_inner@PLTPC -#endif - - lsr.l #1,%d0 - jne 1f - jcc .Lcls_epilogue - move.l -12(%fp),%d0 -.Lcls_epilogue: - unlk %fp - rts -1: - lea -12(%fp),%a0 - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_float - move.l (%a0)+,%d0 - move.l (%a0),%d1 - jra .Lcls_epilogue -.Lcls_ret_float: -#if defined(__MC68881__) - fmove.s (%a0),%fp0 -#else - move.l (%a0),%d0 -#endif - jra .Lcls_epilogue -1: - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_ldouble -#if defined(__MC68881__) - fmove.d (%a0),%fp0 -#else - move.l (%a0)+,%d0 - move.l (%a0),%d1 -#endif - jra .Lcls_epilogue -.Lcls_ret_ldouble: -#if defined(__MC68881__) - fmove.x (%a0),%fp0 -#else - move.l (%a0)+,%d0 - move.l (%a0)+,%d1 - move.l (%a0),%d2 -#endif - jra .Lcls_epilogue -1: - lsr.l #2,%d0 - jne .Lcls_ret_struct2 - jcs .Lcls_ret_struct1 - move.l (%a0),%a0 - move.l %a0,%d0 - jra .Lcls_epilogue -.Lcls_ret_struct1: - move.b (%a0),%d0 - jra .Lcls_epilogue -.Lcls_ret_struct2: - move.w (%a0),%d0 - jra .Lcls_epilogue - CFI_ENDPROC() - - .size ffi_closure_SYSV,.-ffi_closure_SYSV - - .globl ffi_closure_struct_SYSV - .type ffi_closure_struct_SYSV, @function - .align 4 - -ffi_closure_struct_SYSV: - CFI_STARTPROC() - link %fp,#0 - CFI_OFFSET(14,-8) - CFI_DEF_CFA(14,8) - move.l %sp,-12(%fp) - pea 8(%fp) - move.l %a1,-(%sp) - move.l %a0,-(%sp) -#if !defined __PIC__ - jsr ffi_closure_SYSV_inner -#else - bsr.l ffi_closure_SYSV_inner@PLTPC -#endif - unlk %fp - rts - CFI_ENDPROC() - .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/.pc/ml64-safeseh/ChangeLog b/.pc/ml64-safeseh/ChangeLog index 376c0fd..1ae97c7 100644 --- a/.pc/ml64-safeseh/ChangeLog +++ b/.pc/ml64-safeseh/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/more-openbsd/ChangeLog b/.pc/more-openbsd/ChangeLog index 0964f10..3e182f9 100644 --- a/.pc/more-openbsd/ChangeLog +++ b/.pc/more-openbsd/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/msvcc-warning/ChangeLog b/.pc/msvcc-warning/ChangeLog index 75ce3bf..10ad4fc 100644 --- a/.pc/msvcc-warning/ChangeLog +++ b/.pc/msvcc-warning/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/msvcc/Makefile.in b/.pc/msvcc/Makefile.in index 9c2fb0a..6074fda 100644 --- a/.pc/msvcc/Makefile.in +++ b/.pc/msvcc/Makefile.in @@ -391,7 +391,6 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ diff --git a/.pc/powerpc-ffi-softfloat/ChangeLog b/.pc/powerpc-ffi-softfloat/ChangeLog index 4a7d7ff..7fc467e 100644 --- a/.pc/powerpc-ffi-softfloat/ChangeLog +++ b/.pc/powerpc-ffi-softfloat/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/powerpc-sysv-without-string-ops/ChangeLog b/.pc/powerpc-sysv-without-string-ops/ChangeLog index 2c0d3ec..c79a568 100644 --- a/.pc/powerpc-sysv-without-string-ops/ChangeLog +++ b/.pc/powerpc-sysv-without-string-ops/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/ppc64-darwin/ChangeLog b/.pc/ppc64-darwin/ChangeLog index 5b6b6e6..a76ed28 100644 --- a/.pc/ppc64-darwin/ChangeLog +++ b/.pc/ppc64-darwin/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/ppc64-darwin/configure b/.pc/ppc64-darwin/configure index 73b7fd3..f8c7c3a 100755 --- a/.pc/ppc64-darwin/configure +++ b/.pc/ppc64-darwin/configure @@ -621,9 +621,6 @@ FFI_DEBUG_FALSE FFI_DEBUG_TRUE TARGETDIR TARGET -FFI_EXEC_TRAMPOLINE_TABLE -FFI_EXEC_TRAMPOLINE_TABLE_FALSE -FFI_EXEC_TRAMPOLINE_TABLE_TRUE sys_symbol_underscore HAVE_LONG_DOUBLE ALLOCA @@ -13290,30 +13287,13 @@ $as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h fi fi - -FFI_EXEC_TRAMPOLINE_TABLE=0 case "$target" in - *arm*-apple-darwin*) - FFI_EXEC_TRAMPOLINE_TABLE=1 - -$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h - - ;; *-apple-darwin10* | *-*-freebsd* | *-*-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 assembler supports unwind section type" >&5 @@ -13741,10 +13721,6 @@ if test -z "${PA64_HPUX_TRUE}" && test -z "${PA64_HPUX_FALSE}"; then 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 diff --git a/.pc/remove-debug-code/ChangeLog b/.pc/remove-debug-code/ChangeLog index 34ef110..e94379c 100644 --- a/.pc/remove-debug-code/ChangeLog +++ b/.pc/remove-debug-code/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/remove-debug-code/Makefile.in b/.pc/remove-debug-code/Makefile.in index b3a2706..13c17d0 100644 --- a/.pc/remove-debug-code/Makefile.in +++ b/.pc/remove-debug-code/Makefile.in @@ -75,14 +75,6 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ mdate-sh missing texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_cc_maxopt.m4 \ - $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ - $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ - $(top_srcdir)/m4/ax_compiler_vendor.m4 \ - $(top_srcdir)/m4/ax_configure_args.m4 \ - $(top_srcdir)/m4/ax_enable_builddir.m4 \ - $(top_srcdir)/m4/ax_gcc_archflag.m4 \ - $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ @@ -344,7 +336,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -365,7 +356,6 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ -ax_enable_builddir_sed = @ax_enable_builddir_sed@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -401,7 +391,6 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ diff --git a/.pc/sparc-abi-check/ChangeLog b/.pc/sparc-abi-check/ChangeLog index a2680c4..e5ca60e 100644 --- a/.pc/sparc-abi-check/ChangeLog +++ b/.pc/sparc-abi-check/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/sparc-v8-aggregate-returns/ChangeLog b/.pc/sparc-v8-aggregate-returns/ChangeLog index 0bb5101..5e404b2 100644 --- a/.pc/sparc-v8-aggregate-returns/ChangeLog +++ b/.pc/sparc-v8-aggregate-returns/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/stdcall-x86-closure-fix/ChangeLog b/.pc/stdcall-x86-closure-fix/ChangeLog index cb3bcda..7b56624 100644 --- a/.pc/stdcall-x86-closure-fix/ChangeLog +++ b/.pc/stdcall-x86-closure-fix/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/stdcall-x86-closure-fix/src/x86/ffi.c b/.pc/stdcall-x86-closure-fix/src/x86/ffi.c index 568ef9f..2ab98d1 100644 --- a/.pc/stdcall-x86-closure-fix/src/x86/ffi.c +++ b/.pc/stdcall-x86-closure-fix/src/x86/ffi.c @@ -48,6 +48,13 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; @@ -59,6 +66,16 @@ void ffi_prep_args(char *stack, extended_cif *ecif) ) { *(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*); } @@ -134,6 +151,24 @@ void ffi_prep_args(char *stack, extended_cif *ecif) { 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); @@ -141,7 +176,45 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; } @@ -252,7 +325,7 @@ ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *, #elif defined(X86_WIN32) extern void ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)(void)); + 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)); @@ -297,8 +370,37 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) #elif defined(X86_WIN32) case FFI_SYSV: case FFI_STDCALL: - ffi_call_win32(ffi_prep_args, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); + 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: @@ -625,8 +727,37 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue) #ifdef X86_WIN32 case FFI_SYSV: case FFI_STDCALL: - ffi_call_win32(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); + 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) + cif->abi = abi = FFI_THISCALL; + if (passed_regs < 1 && abi == FFI_THISCALL) + cif->abi = abi = FFI_STDCALL; + ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + } break; #else case FFI_SYSV: diff --git a/.pc/stdcall-x86-closure-fix/src/x86/ffitarget.h b/.pc/stdcall-x86-closure-fix/src/x86/ffitarget.h index 2738875..a3b96e6 100644 --- a/.pc/stdcall-x86-closure-fix/src/x86/ffitarget.h +++ b/.pc/stdcall-x86-closure-fix/src/x86/ffitarget.h @@ -1,6 +1,7 @@ /* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 1996-2003, 2010 Red Hat, Inc. - Copyright (C) 2008 Free Software Foundation, Inc. + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003, 2010 Red Hat, Inc. + Copyright (C) 2008 Free Software Foundation, Inc. Target configuration macros for x86 and x86-64. @@ -64,6 +65,8 @@ typedef enum ffi_abi { #ifdef X86_WIN32 FFI_SYSV, FFI_STDCALL, + FFI_THISCALL, + FFI_FASTCALL, FFI_LAST_ABI, /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV diff --git a/.pc/ungccify/Makefile.in b/.pc/ungccify/Makefile.in index 9311f5c..09da764 100644 --- a/.pc/ungccify/Makefile.in +++ b/.pc/ungccify/Makefile.in @@ -393,7 +393,6 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ diff --git a/.pc/unlikely/ChangeLog b/.pc/unlikely/ChangeLog index 7e2b4d7..f9435da 100644 --- a/.pc/unlikely/ChangeLog +++ b/.pc/unlikely/ChangeLog @@ -1,13 +1,27 @@ -2012-01-23 Andreas Schwab +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain mc68000. Test for __HAVE_68881__ in addition to __MC68881__. -2012-01-23 Alan Hourihane - - * src/m68k/ffi.c (ffi_prep_closure_loc): Fix ABI check. - * testsuite/libffi.call/return_sc.c (main): Fix test check. - 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/variadic/ChangeLog b/.pc/variadic/ChangeLog index 69d172b..d85c060 100644 --- a/.pc/variadic/ChangeLog +++ b/.pc/variadic/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/win64-struct-args/ChangeLog b/.pc/win64-struct-args/ChangeLog index 54460fa..c6157d4 100644 --- a/.pc/win64-struct-args/ChangeLog +++ b/.pc/win64-struct-args/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/win64-struct-args/src/x86/ffi.c b/.pc/win64-struct-args/src/x86/ffi.c index fea9d6d..bbfd95e 100644 --- a/.pc/win64-struct-args/src/x86/ffi.c +++ b/.pc/win64-struct-args/src/x86/ffi.c @@ -48,6 +48,13 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; @@ -59,6 +66,16 @@ void ffi_prep_args(char *stack, extended_cif *ecif) ) { *(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*); } @@ -134,6 +151,24 @@ void ffi_prep_args(char *stack, extended_cif *ecif) { 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); @@ -141,7 +176,45 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; } @@ -252,7 +325,7 @@ ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *, #elif defined(X86_WIN32) extern void ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)(void)); + 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)); @@ -316,8 +389,37 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) #elif defined(X86_WIN32) case FFI_SYSV: case FFI_STDCALL: - ffi_call_win32(ffi_prep_args, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); + 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: @@ -644,8 +746,37 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue) #ifdef X86_WIN32 case FFI_SYSV: case FFI_STDCALL: - ffi_call_win32(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); + 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) + cif->abi = abi = FFI_THISCALL; + if (passed_regs < 1 && abi == FFI_THISCALL) + cif->abi = abi = FFI_STDCALL; + ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + } break; #else case FFI_SYSV: diff --git a/.pc/win64-underscore/ChangeLog b/.pc/win64-underscore/ChangeLog index 1cbf179..4d2e4e3 100644 --- a/.pc/win64-underscore/ChangeLog +++ b/.pc/win64-underscore/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/windows-ce-arm/ChangeLog b/.pc/windows-ce-arm/ChangeLog index 136b7bd..9f0edcb 100644 --- a/.pc/windows-ce-arm/ChangeLog +++ b/.pc/windows-ce-arm/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/.pc/x86_pcrel_test/ChangeLog b/.pc/x86_pcrel_test/ChangeLog index 8077349..2e77803 100644 --- a/.pc/x86_pcrel_test/ChangeLog +++ b/.pc/x86_pcrel_test/ChangeLog @@ -1,3 +1,27 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/ChangeLog b/ChangeLog index 0fdc482..0558cf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,28 @@ +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + 2012-01-23 Uros Bizjak * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI. -2012-01-23 Chris Young +2012-01-23 Anthony Green + Chris Young * configure.ac: Add Amiga support. * configure: Rebuilt. @@ -11,16 +31,11 @@ * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. -2012-01-23 Andreas Schwab +2012-01-23 Andreas Schwab * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain mc68000. Test for __HAVE_68881__ in addition to __MC68881__. -2012-01-23 Alan Hourihane - - * src/m68k/ffi.c (ffi_prep_closure_loc): Fix ABI check. - * testsuite/libffi.call/return_sc.c (main): Fix test check. - 2012-01-19 Jakub Jelinek PR rtl-optimization/48496 diff --git a/Makefile.in b/Makefile.in index 4dc1103..73ff260 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,14 +76,6 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ mdate-sh missing texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_cc_maxopt.m4 \ - $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ - $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ - $(top_srcdir)/m4/ax_compiler_vendor.m4 \ - $(top_srcdir)/m4/ax_configure_args.m4 \ - $(top_srcdir)/m4/ax_enable_builddir.m4 \ - $(top_srcdir)/m4/ax_gcc_archflag.m4 \ - $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ @@ -347,7 +339,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -368,7 +359,6 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ -ax_enable_builddir_sed = @ax_enable_builddir_sed@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/aclocal.m4 b/aclocal.m4 index af48af3..15f8de3 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1858,14 +1858,6 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/asmcfi.m4]) -m4_include([m4/ax_cc_maxopt.m4]) -m4_include([m4/ax_cflags_warn_all.m4]) -m4_include([m4/ax_check_compiler_flags.m4]) -m4_include([m4/ax_compiler_vendor.m4]) -m4_include([m4/ax_configure_args.m4]) -m4_include([m4/ax_enable_builddir.m4]) -m4_include([m4/ax_gcc_archflag.m4]) -m4_include([m4/ax_gcc_x86_cpuid.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/configure b/configure index f1a812b..2b6e029 100755 --- a/configure +++ b/configure @@ -688,7 +688,6 @@ TESTSUBDIR_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE -PRTDIAG CPP OTOOL64 OTOOL @@ -755,7 +754,6 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM -ax_enable_builddir_sed target_os target_vendor target_cpu @@ -809,7 +807,6 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_builddir enable_dependency_tracking enable_shared enable_static @@ -818,8 +815,6 @@ enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock -enable_portable_binary -with_gcc_arch enable_maintainer_mode enable_debug enable_structs @@ -1454,8 +1449,6 @@ 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] - --disable-builddir disable automatic build in subdir of sources - --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1463,9 +1456,6 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-portable-binary - disable compiler optimizations that would produce - unportable binaries --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-debug debugging mode @@ -1481,8 +1471,6 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-gcc-arch= use architecture for gcc -march/-mtune, - instead of guessing Some influential environment variables: CC C compiler command @@ -2658,109 +2646,7 @@ target_alias=${target_alias-$host_alias} . ${srcdir}/configure.host - - # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args - if test "${ac_configure_args+set}" != "set" ; then - ac_configure_args= - for ac_arg in ${1+"$@"}; do - ac_configure_args="$ac_configure_args '$ac_arg'" - done - fi - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - - -ax_enable_builddir="." -# Check whether --enable-builddir was given. -if test "${enable_builddir+set}" = set; then : - enableval=$enable_builddir; ax_enable_builddir="$enableval" -else - ax_enable_builddir="auto" -fi - -if test ".$ac_srcdir_defaulted" != ".no" ; then -if test ".$srcdir" = ".." ; then - if test -f config.status ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: toplevel srcdir already configured... skipping subdir build" >&5 -$as_echo "$as_me: toplevel srcdir already configured... skipping subdir build" >&6;} - else - test ".$ax_enable_builddir" = "." && ax_enable_builddir="." - test ".$ax_enable_builddir" = ".no" && ax_enable_builddir="." - test ".$TARGET" = "." && TARGET="$target" - test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="$TARGET" - if test ".$ax_enable_builddir" != ".." ; then # we know where to go and - as_dir=$ax_enable_builddir; as_fn_mkdir_p - echo __.$ax_enable_builddir.__ > $ax_enable_builddir/conftest.tmp - cd $ax_enable_builddir - if grep __.$ax_enable_builddir.__ conftest.tmp >/dev/null 2>/dev/null ; then - rm conftest.tmp - { $as_echo "$as_me:${as_lineno-$LINENO}: result: continue configure in default builddir \"./$ax_enable_builddir\"" >&5 -$as_echo "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; } - else - as_fn_error $? "could not change to default builddir \"./$ax_enable_builddir\"" "$LINENO" 5 - fi - srcdir=`echo "$ax_enable_builddir" | - sed -e 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g;s,[/]$,,;'` - # going to restart from subdirectory location - test -f $srcdir/config.log && mv $srcdir/config.log . - test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . - test -f $srcdir/conftest.log && mv $srcdir/conftest.log . - test -f $srcdir/$cache_file && mv $srcdir/$cache_file . - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&5 -$as_echo "....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&6; } - case "$0" in # restart - /\\*) eval $SHELL "'$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; - *) eval $SHELL "'$srcdir/$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; - esac ; exit $? - fi - fi -fi fi -test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="." -# Extract the first word of "gsed sed", so it can be a program name with args. -set dummy gsed sed; 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_path_ax_enable_builddir_sed+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ax_enable_builddir_sed in - [\\/]* | ?:[\\/]*) - ac_cv_path_ax_enable_builddir_sed="$ax_enable_builddir_sed" # Let the user override the test with a path. - ;; - *) - 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ax_enable_builddir_sed="$as_dir/$ac_word$ac_exec_ext" - $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 - - test -z "$ac_cv_path_ax_enable_builddir_sed" && ac_cv_path_ax_enable_builddir_sed="sed" - ;; -esac -fi -ax_enable_builddir_sed=$ac_cv_path_ax_enable_builddir_sed -if test -n "$ax_enable_builddir_sed"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_enable_builddir_sed" >&5 -$as_echo "$ax_enable_builddir_sed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -ax_enable_builddir_auxdir="$am_aux_dir" -ac_config_commands="$ac_config_commands buildir" - +AX_ENABLE_BUILDDIR am__api_version='1.11' @@ -2919,6 +2805,9 @@ test "$program_suffix" != NONE && 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 *\ * | *\ *) @@ -11950,1083 +11839,204 @@ CC="$lt_save_CC" +AX_CC_MAXOPT +AX_CFLAGS_WARN_ALL +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fexceptions" +fi + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 -$as_echo_n "checking for C compiler vendor... " >&6; } -if ${ax_cv_c_compiler_vendor+:} false; then : - $as_echo_n "(cached) " >&6 +{ $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 - ax_cv_c_compiler_vendor=unknown - # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ clang:__clang__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do - vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + USE_MAINTAINER_MODE=no +fi -int -main () -{ + { $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 -#if !($vencpp) - thisisanerror; -#endif + MAINT=$MAINTAINER_MODE_TRUE - ; - return 0; -} + + +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 -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_compiler_vendor=`echo $ventest | cut -d: -f1`; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 -$as_echo "$ax_cv_c_compiler_vendor" >&6; } +done + +for ac_func in mmap +do : + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MMAP 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 -# Check whether --enable-portable-binary was given. -if test "${enable_portable_binary+set}" = set; then : - enableval=$enable_portable_binary; acx_maxopt_portable=$withval +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 - acx_maxopt_portable=no + 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; } -# Try to determine "good" native compiler flags if none specified via CFLAGS -if test "$ac_test_CFLAGS" != "set"; then - CFLAGS="" - case $ax_cv_c_compiler_vendor in - dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" - if test "x$acx_maxopt_portable" = xno; then - CFLAGS="$CFLAGS -arch host" - fi;; - - sun) CFLAGS="-native -fast -xO5 -dalign" - if test "x$acx_maxopt_portable" = xyes; then - CFLAGS="$CFLAGS -xarch=generic" - fi;; - - hp) CFLAGS="+Oall +Optrs_ansi +DSnative" - if test "x$acx_maxopt_portable" = xyes; then - CFLAGS="$CFLAGS +DAportable" - fi;; - - ibm) if test "x$acx_maxopt_portable" = xno; then - xlc_opt="-qarch=auto -qtune=auto" - else - xlc_opt="-qtune=auto" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 -$as_echo_n "checking whether C compiler accepts $xlc_opt... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$xlc_opt" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # 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 +#include +#include + +#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 : - eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=yes + ac_cv_decl_map_anon=yes else - eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=no + ac_cv_decl_map_anon=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - CFLAGS="-O3 -qansialias -w $xlc_opt" -else - CFLAGS="-O3 -qansialias -w" - echo "******************************************************" - echo "* You seem to have the IBM C compiler. It is *" - echo "* recommended for best performance that you use: *" - echo "* *" - echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" - echo "* ^^^ ^^^ *" - echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" - echo "* CPU you have. (Set the CFLAGS environment var. *" - echo "* and re-run configure.) For more info, man cc. *" - echo "******************************************************" -fi - - ;; - - intel) CFLAGS="-O3 -ansi_alias" - if test "x$acx_maxopt_portable" = xno; then - icc_archflag=unknown - icc_flags="" - case $host_cpu in - i686*|x86_64*) - # icc accepts gcc assembly syntax, so these should work: - -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: $ac_cv_decl_map_anon" >&5 +$as_echo "$ac_cv_decl_map_anon" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 -$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0+:} false; then : + 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 - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_0=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ + # 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 - int op = 0, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; +$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid -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_cv_func_mmap_dev_zero = yes; then + +$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } -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 $ac_cv_func_mmap_anon = yes; then +$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h +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 x86 cpuid 1 output" >&5 -$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_1=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 1, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_1" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } -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 - - - case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG - *:756e6547:*:*) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *6a?:*[234]:*:*|*6[789b]?:*:*:*) icc_flags="-xK";; - *f3[347]:*:*:*|*f41347:*:*:*) icc_flags="-xP -xN -xW -xK";; - *f??:*:*:*) icc_flags="-xN -xW -xK";; - esac ;; - esac ;; - esac - if test "x$icc_flags" != x; then - for flag in $icc_flags; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes -else - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - icc_archflag=$flag; break -else - : -fi - - done - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 -$as_echo_n "checking for icc architecture flag... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 -$as_echo "$icc_archflag" >&6; } - if test "x$icc_archflag" != xunknown; then - CFLAGS="$CFLAGS $icc_archflag" - fi - fi - ;; - - gnu) - # default optimization flags for gcc on all systems - CFLAGS="-O3 -fomit-frame-pointer" - - # -fstrict-aliasing for gcc-2.95+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 -$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; } -if ${ax_cv_c_flags__fstrict_aliasing+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_save_FLAGS=$CFLAGS - CFLAGS="-fstrict-aliasing" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_flags__fstrict_aliasing=yes -else - ax_cv_c_flags__fstrict_aliasing=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -fi - -eval ax_check_compiler_flags=$ax_cv_c_flags__fstrict_aliasing -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - CFLAGS="$CFLAGS -fstrict-aliasing" -else - : -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 -$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; } -if ${ax_cv_c_flags__ffast_math+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_save_FLAGS=$CFLAGS - CFLAGS="-ffast-math" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_c_flags__ffast_math=yes -else - ax_cv_c_flags__ffast_math=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -fi - -eval ax_check_compiler_flags=$ax_cv_c_flags__ffast_math -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - CFLAGS="$CFLAGS -ffast-math" -else - : -fi - - - - - - -# Check whether --with-gcc-arch was given. -if test "${with_gcc_arch+set}" = set; then : - withval=$with_gcc_arch; ax_gcc_arch=$withval -else - ax_gcc_arch=yes -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -$as_echo_n "checking for gcc architecture flag... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } -if ${ax_cv_gcc_archflag+:} false; then : - $as_echo_n "(cached) " >&6 -else - -ax_cv_gcc_archflag="unknown" - -if test "$GCC" = yes; then - -if test "x$ax_gcc_arch" = xyes; then -ax_gcc_arch="" -if test "$cross_compiling" = no; then -case $host_cpu in - i[3456]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones - -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 x86 cpuid 0 output" >&5 -$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_0=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 0, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_0" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } -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 for x86 cpuid 1 output" >&5 -$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_1=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 1, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_1" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } -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 - - - case $ax_cv_gcc_x86_cpuid_0 in - *:756e6547:*:*) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *5[48]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; - *5??:*:*:*) ax_gcc_arch=pentium ;; - *6[3456]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *6a?:*[01]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *6a?:*[234]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *6[9d]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; - *6[78b]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *6??:*:*:*) ax_gcc_arch=pentiumpro ;; - *f3[347]:*:*:*|*f41347:*:*:*) - case $host_cpu in - x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; - *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; - esac ;; - *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; - esac ;; - *:68747541:*:*) # AMD - case $ax_cv_gcc_x86_cpuid_1 in - *5[67]?:*:*:*) ax_gcc_arch=k6 ;; - *5[8d]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; - *5[9]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; - *60?:*:*:*) ax_gcc_arch=k7 ;; - *6[12]?:*:*:*) ax_gcc_arch="athlon k7" ;; - *6[34]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; - *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; - *6[68a]?:*:*:*) - -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 x86 cpuid 0x80000006 output" >&5 -$as_echo_n "checking for x86 cpuid 0x80000006 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0x80000006+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_gcc_x86_cpuid_0x80000006=unknown -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - int op = 0x80000006, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_gcc_x86_cpuid_0x80000006=`cat conftest_cpuid`; rm -f conftest_cpuid -else - ax_cv_gcc_x86_cpuid_0x80000006=unknown; rm -f conftest_cpuid -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: $ax_cv_gcc_x86_cpuid_0x80000006" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0x80000006" >&6; } -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 - - # L2 cache size - case $ax_cv_gcc_x86_cpuid_0x80000006 in - *:*:*[1-9a-f]??????:*) # (L2 = ecx >> 16) >= 256 - ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; - *) ax_gcc_arch="athlon-4 athlon k7" ;; - esac ;; - *f[4cef8b]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; - *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; - *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; - *f??:*:*:*) ax_gcc_arch="k8" ;; - esac ;; - *:746e6543:*:*) # IDT - case $ax_cv_gcc_x86_cpuid_1 in - *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; - *58?:*:*:*) ax_gcc_arch=winchip2 ;; - *6[78]?:*:*:*) ax_gcc_arch=c3 ;; - *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; - esac ;; - esac - if test x"$ax_gcc_arch" = x; then # fallback - case $host_cpu in - i586*) ax_gcc_arch=pentium ;; - i686*) ax_gcc_arch=pentiumpro ;; - esac - fi - ;; - - sparc*) - # Extract the first word of "prtdiag", so it can be a program name with args. -set dummy prtdiag; 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_path_PRTDIAG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PRTDIAG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" - $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 - - test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag" - ;; -esac -fi -PRTDIAG=$ac_cv_path_PRTDIAG -if test -n "$PRTDIAG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 -$as_echo "$PRTDIAG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` - cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` - case $cputype in - *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; - *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; - *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; - *supersparc*|*tms390z5[05]*) ax_gcc_arch="supersparc v8" ;; - *hypersparc*|*rt62[056]*) ax_gcc_arch="hypersparc v8" ;; - *cypress*) ax_gcc_arch=cypress ;; - esac ;; - - alphaev5) ax_gcc_arch=ev5 ;; - alphaev56) ax_gcc_arch=ev56 ;; - alphapca56) ax_gcc_arch="pca56 ev56" ;; - alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; - alphaev6) ax_gcc_arch=ev6 ;; - alphaev67) ax_gcc_arch=ev67 ;; - alphaev68) ax_gcc_arch="ev68 ev67" ;; - alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; - alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; - alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; - - powerpc*) - cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` - cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` - case $cputype in - *750*) ax_gcc_arch="750 G3" ;; - *740[0-9]*) ax_gcc_arch="$cputype 7400 G4" ;; - *74[4-5][0-9]*) ax_gcc_arch="$cputype 7450 G4" ;; - *74[0-9][0-9]*) ax_gcc_arch="$cputype G4" ;; - *970*) ax_gcc_arch="970 G5 power4";; - *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; - *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; - 603ev|8240) ax_gcc_arch="$cputype 603e 603";; - *) ax_gcc_arch=$cputype ;; - esac - ax_gcc_arch="$ax_gcc_arch powerpc" - ;; -esac -fi # not cross-compiling -fi # guess arch - -if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then -for arch in $ax_gcc_arch; do - if test "x$acx_maxopt_portable" = xyes; then # if we require portable code - flags="-mtune=$arch" - # -mcpu=$arch and m$arch generate nonportable code on every arch except - # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. - case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac - else - flags="-march=$arch -mcpu=$arch -m$arch" - fi - for flag in $flags; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes -else - eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - ax_cv_gcc_archflag=$flag; break -else - : -fi - - done - test "x$ax_cv_gcc_archflag" = xunknown || break -done -fi - -fi # $GCC=yes - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -$as_echo_n "checking for gcc architecture flag... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 -$as_echo "$ax_cv_gcc_archflag" >&6; } -if test "x$ax_cv_gcc_archflag" = xunknown; then - : -else - CFLAGS="$CFLAGS $ax_cv_gcc_archflag" -fi - - ;; - esac - - if test -z "$CFLAGS"; then - echo "" - echo "********************************************************" - echo "* WARNING: Don't know the best CFLAGS for this system *" - echo "* Use ./configure CFLAGS=... to specify your own flags *" - echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" - echo "********************************************************" - echo "" - CFLAGS="-O3" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 -$as_echo_n "checking whether C compiler accepts $CFLAGS... " >&6; } -ax_save_FLAGS=$CFLAGS - CFLAGS="$CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=yes -else - eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$ax_save_FLAGS -eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -$as_echo "$ax_check_compiler_flags" >&6; } -if test "x$ax_check_compiler_flags" = xyes; then - : -else - - echo "" - echo "********************************************************" - echo "* WARNING: The guessed CFLAGS don't seem to work with *" - echo "* your compiler. *" - echo "* Use ./configure CFLAGS=... to specify your own flags *" - echo "********************************************************" - echo "" - CFLAGS="" - -fi - - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 -$as_echo_n "checking CFLAGS for maximum warnings... " >&6; } -if ${ac_cv_cflags_warn_all+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_cflags_warn_all="no, unknown" - 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_save_CFLAGS="$CFLAGS" -for ac_arg in "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # -do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - 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_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done - CFLAGS="$ac_save_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 - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 -$as_echo "$ac_cv_cflags_warn_all" >&6; } -case ".$ac_cv_cflags_warn_all" in - .ok|.ok,*) ;; - .|.no|.no,*) - ;; - *) - if echo " $CFLAGS " | grep " $ac_cv_cflags_warn_all " 2>&1 >/dev/null - then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$ac_cv_cflags_warn_all"; } >&5 - (: CFLAGS does contain $ac_cv_cflags_warn_all) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$ac_cv_cflags_warn_all\""; } >&5 - (: CFLAGS="$CFLAGS $ac_cv_cflags_warn_all") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - CFLAGS="$CFLAGS $ac_cv_cflags_warn_all" - fi - ;; -esac - -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -fexceptions" -fi - - -{ $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 -do : - ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -if test "x$ac_cv_func_mmap" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MMAP 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 -#include -#include - -#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='#' + if test -d $srcdir/testsuite; then + TESTSUBDIR_TRUE= + TESTSUBDIR_FALSE='#' else TESTSUBDIR_TRUE='#' TESTSUBDIR_FALSE= @@ -14300,7 +13310,7 @@ case "$target" in $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h ;; - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) + *-apple-darwin1[10]* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h @@ -15348,14 +14358,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -ax_enable_builddir_srcdir="$srcdir" # $srcdir -ax_enable_builddir_host="$HOST" # $HOST / $host -ax_enable_builddir_version="$VERSION" # $VERSION -ax_enable_builddir_package="$PACKAGE" # $PACKAGE -ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX -ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED -ax_enable_builddir="$ax_enable_builddir" # $SUB - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" @@ -15645,7 +14647,6 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;; - "buildir") CONFIG_COMMANDS="$CONFIG_COMMANDS buildir" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;; @@ -16284,150 +15285,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in - "buildir":C) ac_top_srcdir="$ax_enable_builddir_srcdir" - if test ".$ax_enable_builddir" = ".." ; then - if test -f "$top_srcdir/Makefile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - left untouched" >&5 -$as_echo "$as_me: skipping top_srcdir/Makefile - left untouched" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - not created" >&5 -$as_echo "$as_me: skipping top_srcdir/Makefile - not created" >&6;} - fi - else - if test -f "$ac_top_srcdir/Makefile" ; then - a=`grep "^VERSION " "$ac_top_srcdir/Makefile"` ; b=`grep "^VERSION " Makefile` - test "$a" != "$b" && rm "$ac_top_srcdir/Makefile" - fi - if test -f "$ac_top_srcdir/Makefile" ; then - echo "$ac_top_srcdir/Makefile : $ac_top_srcdir/Makefile.in" > $tmp/conftemp.mk - echo " @ echo 'REMOVED,,,' >\$@" >> $tmp/conftemp.mk - eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null" - if grep '^REMOVED,,,' "$ac_top_srcdir/Makefile" >/dev/null - then rm $ac_top_srcdir/Makefile ; fi - cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING - fi - if test ! -f "$ac_top_srcdir/Makefile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5 -$as_echo "$as_me: create top_srcdir/Makefile guessed from local Makefile" >&6;} - x='`' ; cat >$tmp/conftemp.sed <<_EOF -/^\$/n -x -/^\$/bS -x -/\\\\\$/{H;d;} -{H;s/.*//;x;} -bM -:S -x -/\\\\\$/{h;d;} -{h;s/.*//;x;} -:M -s/\\(\\n\\) /\\1 /g -/^ /d -/^[ ]*[\\#]/d -/^VPATH *=/d -s/^srcdir *=.*/srcdir = ./ -s/^top_srcdir *=.*/top_srcdir = ./ -/[:=]/!d -/^\\./d -/ = /b -/ .= /b -/:/!b -s/:.*/:/ -s/ / /g -s/ \\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/ \\1 \\1-all\\2/g -s/^\\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/\\1 \\1-all\\2/ -s/ / /g -/^all all-all[ :]/i\\ -all-configured : all-all -s/ [a-zA-Z0-9-]*-all [a-zA-Z0-9-]*-all-all//g -/-all-all/d -a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\ - ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ - ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done -/dist-all *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\ - ; if test "\$\$found" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ - ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\ - ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -/dist-[a-zA-Z0-9]*-all *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\ - ; if test "\$\$found" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ - ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\ - ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -/distclean-all *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\ - ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\ - ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\ - ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\ - ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile -_EOF - cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING - $ax_enable_builddir_sed -f $tmp/conftemp.sed Makefile >$ac_top_srcdir/Makefile - if test -f "$ac_top_srcdir/Makefile.mk" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5 -$as_echo "$as_me: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&6;} - cat $ac_top_srcdir/Makefile.mk >>$ac_top_srcdir/Makefile - fi ; xxxx="####" - echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$ac_top_srcdir/Makefile - # sanity check - if grep '^; echo "MAKE ' $ac_top_srcdir/Makefile >/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: buggy sed found - it deletes tab in \"a\" text parts" >&5 -$as_echo "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;} - $ax_enable_builddir_sed -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $ac_top_srcdir/Makefile \ - >$ac_top_srcdir/Makefile~ - (test -s $ac_top_srcdir/Makefile~ && mv $ac_top_srcdir/Makefile~ $ac_top_srcdir/Makefile) 2>/dev/null - fi - else - xxxx="\\#\\#\\#\\#" - # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed - echo "s!^$xxxx [^|]* | *$ax_enable_builddir *\$!$xxxx ...... $ax_enable_builddir!" >$tmp/conftemp.sed - $ax_enable_builddir_sed -f "$tmp/conftemp.sed" "$ac_top_srcdir/Makefile" >$tmp/mkfile.tmp - cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING - cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING - if cmp -s "$ac_top_srcdir/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5 -$as_echo "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;} - rm "$tmp/mkfile.tmp" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: reusing top_srcdir/Makefile from earlier configure" >&5 -$as_echo "$as_me: reusing top_srcdir/Makefile from earlier configure" >&6;} - mv "$tmp/mkfile.tmp" "$ac_top_srcdir/Makefile" - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&5 -$as_echo "$as_me: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&6;} - xxxx="####" - echo "$xxxx" "$ax_enable_builddir_host" "|$ax_enable_builddir" >>$ac_top_srcdir/Makefile - fi - ;; "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval diff --git a/configure.ac b/configure.ac index f78b6c1..df20c2f 100644 --- a/configure.ac +++ b/configure.ac @@ -342,7 +342,7 @@ case "$target" in [Cannot use PROT_EXEC on this target, so, we revert to alternative means]) ;; - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) + *-apple-darwin1[[10]]* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1, [Cannot use malloc on this target, so, we revert to alternative means]) diff --git a/doc/libffi.info b/doc/libffi.info index 402f760..c0fb005 100644 --- a/doc/libffi.info +++ b/doc/libffi.info @@ -1,10 +1,10 @@ -This is ../libffi/doc/libffi.info, produced by makeinfo version 4.13 -from ../libffi/doc/libffi.texi. +This is /home/green/libffi/doc/libffi.info, produced by makeinfo +version 4.13 from /home/green/libffi/doc/libffi.texi. This manual is for Libffi, a portable foreign-function interface library. - Copyright (C) 2008, 2010, 2011 Red Hat, Inc. + Copyright (C) 2008, 2010 Red Hat, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -27,7 +27,7 @@ libffi This manual is for Libffi, a portable foreign-function interface library. - Copyright (C) 2008, 2010, 2011 Red Hat, Inc. + Copyright (C) 2008, 2010 Red Hat, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as @@ -115,6 +115,8 @@ To prepare a call interface object, use the function `ffi_prep_cif'. want. *note Multiple ABIs:: for more information. NARGS is the number of arguments that this function accepts. + `libffi' does not yet handle varargs functions; see *note Missing + Features:: for more information. RTYPE is a pointer to an `ffi_type' structure that describes the return type of the function. *Note Types::. @@ -127,30 +129,6 @@ To prepare a call interface object, use the function `ffi_prep_cif'. properly; `FFI_BAD_TYPEDEF' if one of the `ffi_type' objects is incorrect; or `FFI_BAD_ABI' if the ABI parameter is invalid. - If the function being called is variadic (varargs) then -`ffi_prep_cif_var' must be used instead of `ffi_prep_cif'. - - -- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi - varabi, unsigned int NFIXEDARGS, unsigned int varntotalargs, - ffi_type *RTYPE, ffi_type **ARGTYPES) - This initializes CIF according to the given parameters for a call - to a variadic function. In general it's operation is the same as - for `ffi_prep_cif' except that: - - NFIXEDARGS is the number of fixed arguments, prior to any variadic - arguments. It must be greater than zero. - - NTOTALARGS the total number of arguments, including variadic and - fixed arguments. - - Note that, different cif's must be prepped for calls to the same - function when different numbers of arguments are passed. - - Also note that a call to `ffi_prep_cif_var' with - NFIXEDARGS=NOTOTALARGS is NOT equivalent to a call to - `ffi_prep_cif'. - - To call a function using an initialized `ffi_cif', use the `ffi_call' function: @@ -533,7 +511,9 @@ File: libffi.info, Node: Missing Features, Next: Index, Prev: Using libffi, `libffi' is missing a few features. We welcome patches to add support for these. - * Variadic closures. + * There is no support for calling varargs functions. This may work + on some platforms, depending on how the ABI is defined, but it is + not reliable. * There is no support for bit fields in structures. @@ -541,9 +521,6 @@ for these. * The "raw" API is undocumented. - Note that variadic support is very new and tested on a relatively -small number of platforms. -  File: libffi.info, Node: Index, Prev: Missing Features, Up: Top @@ -561,12 +538,11 @@ Index * closure API: The Closure API. (line 13) * closures: The Closure API. (line 13) * FFI: Introduction. (line 31) -* ffi_call: The Basics. (line 63) +* ffi_call: The Basics. (line 41) * ffi_closure_alloc: The Closure API. (line 19) * ffi_closure_free: The Closure API. (line 26) * FFI_CLOSURES: The Closure API. (line 13) * ffi_prep_cif: The Basics. (line 16) -* ffi_prep_cif_var: The Basics. (line 39) * ffi_prep_closure_loc: The Closure API. (line 34) * ffi_status <1>: The Closure API. (line 37) * ffi_status: The Basics. (line 18) @@ -594,24 +570,24 @@ Index * ffi_type_void: Primitive Types. (line 10) * Foreign Function Interface: Introduction. (line 31) * void <1>: The Closure API. (line 20) -* void: The Basics. (line 65) +* void: The Basics. (line 43)  Tag Table: -Node: Top712 -Node: Introduction1460 -Node: Using libffi3096 -Node: The Basics3582 -Node: Simple Example7224 -Node: Types8251 -Node: Primitive Types8534 -Node: Structures10354 -Node: Type Example11214 -Node: Multiple ABIs12437 -Node: The Closure API12808 -Node: Closure Example15752 -Node: Missing Features17311 -Node: Index17764 +Node: Top724 +Node: Introduction1466 +Node: Using libffi3102 +Node: The Basics3588 +Node: Simple Example6374 +Node: Types7401 +Node: Primitive Types7684 +Node: Structures9504 +Node: Type Example10364 +Node: Multiple ABIs11587 +Node: The Closure API11958 +Node: Closure Example14902 +Node: Missing Features16461 +Node: Index16954  End Tag Table diff --git a/doc/stamp-vti b/doc/stamp-vti index bbbefdb..81d0b79 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 23 January 2012 -@set UPDATED-MONTH January 2012 -@set EDITION 3.0.11-rc2 -@set VERSION 3.0.11-rc2 +@set UPDATED 14 February 2008 +@set UPDATED-MONTH February 2008 +@set EDITION 3.0.8 +@set VERSION 3.0.8 diff --git a/doc/version.texi b/doc/version.texi index bbbefdb..81d0b79 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 23 January 2012 -@set UPDATED-MONTH January 2012 -@set EDITION 3.0.11-rc2 -@set VERSION 3.0.11-rc2 +@set UPDATED 14 February 2008 +@set UPDATED-MONTH February 2008 +@set EDITION 3.0.8 +@set VERSION 3.0.8 diff --git a/fficonfig.h.in b/fficonfig.h.in index 6c92c56..b54b273 100644 --- a/fficonfig.h.in +++ b/fficonfig.h.in @@ -179,9 +179,6 @@ # endif #endif -/* Define to `unsigned int' if does not define. */ -#undef size_t - #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE #ifdef LIBFFI_ASM diff --git a/include/Makefile.in b/include/Makefile.in index adda034..93c3820 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -40,14 +40,6 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ffi.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_cc_maxopt.m4 \ - $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ - $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ - $(top_srcdir)/m4/ax_compiler_vendor.m4 \ - $(top_srcdir)/m4/ax_configure_args.m4 \ - $(top_srcdir)/m4/ax_enable_builddir.m4 \ - $(top_srcdir)/m4/ax_gcc_archflag.m4 \ - $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ @@ -150,7 +142,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -171,7 +162,6 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ -ax_enable_builddir_sed = @ax_enable_builddir_sed@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/man/Makefile.in b/man/Makefile.in index a5dc123..bb27fac 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -38,14 +38,6 @@ subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_cc_maxopt.m4 \ - $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ - $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ - $(top_srcdir)/m4/ax_compiler_vendor.m4 \ - $(top_srcdir)/m4/ax_configure_args.m4 \ - $(top_srcdir)/m4/ax_enable_builddir.m4 \ - $(top_srcdir)/m4/ax_gcc_archflag.m4 \ - $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ @@ -148,7 +140,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -169,7 +160,6 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ -ax_enable_builddir_sed = @ax_enable_builddir_sed@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/patches/aix-ibm-xlc b/patches/aix-ibm-xlc index bb24fba..a2cc902 100644 --- a/patches/aix-ibm-xlc +++ b/patches/aix-ibm-xlc @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,19 @@ +@@ -93,6 +93,19 @@ * configure: Regenerate. @@ -22,7 +22,7 @@ Index: libffi/ChangeLog 2011-02-09 Rainer Orth PR libffi/46661 -@@ -79,7 +92,7 @@ +@@ -103,7 +116,7 @@ 2011-02-08 Rafael Avila de Espindola * configure.ac: Fix x86 test for pc related relocs. diff --git a/patches/alpha b/patches/alpha index ff4a64a..ed452ef 100644 --- a/patches/alpha +++ b/patches/alpha @@ -2,17 +2,17 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -1,5 +1,8 @@ --2012-01-23 Anthony Green -- Chris Young +@@ -17,6 +17,10 @@ + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Uros Bizjak + + * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI. + -+2012-01-23 Chris Young + 2012-01-23 Anthony Green + Chris Young - * configure.ac: Add Amiga support. - * configure: Rebuilt. Index: libffi/src/alpha/ffi.c =================================================================== --- libffi.orig/src/alpha/ffi.c diff --git a/patches/amiga b/patches/amiga index 2f727ef..e56ce71 100644 --- a/patches/amiga +++ b/patches/amiga @@ -2,7 +2,9 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -1,5 +1,10 @@ +@@ -18,7 +18,12 @@ + * testsuite/libffi.call/struct2_win32.c: New test. + 2012-01-23 Anthony Green - Dmitry Nadezhin + Chris Young @@ -18,7 +20,7 @@ Index: libffi/configure =================================================================== --- libffi.orig/configure +++ libffi/configure -@@ -13128,6 +13128,9 @@ case "$host" in +@@ -12138,6 +12138,9 @@ case "$host" in powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc ;; diff --git a/patches/bad-abi-fix b/patches/bad-abi-fix index 6423460..412d33a 100644 --- a/patches/bad-abi-fix +++ b/patches/bad-abi-fix @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,23 @@ +@@ -93,6 +93,23 @@ * configure: Regenerate. diff --git a/patches/darwin-EH-fix b/patches/darwin-EH-fix index bd90baa..4d857b4 100644 --- a/patches/darwin-EH-fix +++ b/patches/darwin-EH-fix @@ -28,7 +28,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -65,6 +65,11 @@ +@@ -89,6 +89,11 @@ Use them to handle ELF vs. ECOFF differences. [__osf__] (_GLOBAL__F_ffi_call_osf): Define. diff --git a/patches/darwin11 b/patches/darwin11 index f2ac311..657c166 100644 --- a/patches/darwin11 +++ b/patches/darwin11 @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -17,6 +17,14 @@ +@@ -41,6 +41,14 @@ * configure: Regenerate. @@ -21,1446 +21,39 @@ Index: libffi/configure =================================================================== --- libffi.orig/configure +++ libffi/configure -@@ -688,6 +688,7 @@ TESTSUBDIR_TRUE - MAINT - MAINTAINER_MODE_FALSE - MAINTAINER_MODE_TRUE -+PRTDIAG - CPP - OTOOL64 - OTOOL -@@ -754,6 +755,7 @@ am__isrc - INSTALL_DATA - INSTALL_SCRIPT - INSTALL_PROGRAM -+ax_enable_builddir_sed - target_os - target_vendor - target_cpu -@@ -807,6 +809,7 @@ SHELL' - ac_subst_files='' - ac_user_opts=' - enable_option_checking -+enable_builddir - enable_dependency_tracking - enable_shared - enable_static -@@ -815,6 +818,8 @@ enable_fast_install - with_gnu_ld - with_sysroot - enable_libtool_lock -+enable_portable_binary -+with_gcc_arch - enable_maintainer_mode - enable_debug - enable_structs -@@ -1449,6 +1454,8 @@ 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] -+ --disable-builddir disable automatic build in subdir of sources -+ - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] build shared libraries [default=yes] -@@ -1456,6 +1463,9 @@ Optional Features: - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) -+ --enable-portable-binary -+ disable compiler optimizations that would produce -+ unportable binaries - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer - --enable-debug debugging mode -@@ -1471,6 +1481,8 @@ Optional Packages: - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). -+ --with-gcc-arch= use architecture for gcc -march/-mtune, -+ instead of guessing - - Some influential environment variables: - CC C compiler command -@@ -2646,6 +2658,110 @@ target_alias=${target_alias-$host_alias} +@@ -621,6 +621,9 @@ FFI_DEBUG_FALSE + FFI_DEBUG_TRUE + TARGETDIR + TARGET ++FFI_EXEC_TRAMPOLINE_TABLE ++FFI_EXEC_TRAMPOLINE_TABLE_FALSE ++FFI_EXEC_TRAMPOLINE_TABLE_TRUE + sys_symbol_underscore + HAVE_LONG_DOUBLE + ALLOCA +@@ -2643,6 +2646,8 @@ target_alias=${target_alias-$host_alias} . ${srcdir}/configure.host -+ -+ # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args -+ if test "${ac_configure_args+set}" != "set" ; then -+ ac_configure_args= -+ for ac_arg in ${1+"$@"}; do -+ ac_configure_args="$ac_configure_args '$ac_arg'" -+ done -+ fi -+ -+# expand $ac_aux_dir to an absolute path -+am_aux_dir=`cd $ac_aux_dir && pwd` -+ -+ -+ax_enable_builddir="." -+# Check whether --enable-builddir was given. -+if test "${enable_builddir+set}" = set; then : -+ enableval=$enable_builddir; ax_enable_builddir="$enableval" -+else -+ ax_enable_builddir="auto" -+fi -+ -+if test ".$ac_srcdir_defaulted" != ".no" ; then -+if test ".$srcdir" = ".." ; then -+ if test -f config.status ; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: toplevel srcdir already configured... skipping subdir build" >&5 -+$as_echo "$as_me: toplevel srcdir already configured... skipping subdir build" >&6;} -+ else -+ test ".$ax_enable_builddir" = "." && ax_enable_builddir="." -+ test ".$ax_enable_builddir" = ".no" && ax_enable_builddir="." -+ test ".$TARGET" = "." && TARGET="$target" -+ test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="$TARGET" -+ if test ".$ax_enable_builddir" != ".." ; then # we know where to go and -+ as_dir=$ax_enable_builddir; as_fn_mkdir_p -+ echo __.$ax_enable_builddir.__ > $ax_enable_builddir/conftest.tmp -+ cd $ax_enable_builddir -+ if grep __.$ax_enable_builddir.__ conftest.tmp >/dev/null 2>/dev/null ; then -+ rm conftest.tmp -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: continue configure in default builddir \"./$ax_enable_builddir\"" >&5 -+$as_echo "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; } -+ else -+ as_fn_error $? "could not change to default builddir \"./$ax_enable_builddir\"" "$LINENO" 5 -+ fi -+ srcdir=`echo "$ax_enable_builddir" | -+ sed -e 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g;s,[/]$,,;'` -+ # going to restart from subdirectory location -+ test -f $srcdir/config.log && mv $srcdir/config.log . -+ test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . -+ test -f $srcdir/conftest.log && mv $srcdir/conftest.log . -+ test -f $srcdir/$cache_file && mv $srcdir/$cache_file . -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&5 -+$as_echo "....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&6; } -+ case "$0" in # restart -+ /\\*) eval $SHELL "'$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; -+ *) eval $SHELL "'$srcdir/$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; -+ esac ; exit $? -+ fi -+ fi -+fi fi -+test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="." -+# Extract the first word of "gsed sed", so it can be a program name with args. -+set dummy gsed sed; 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_path_ax_enable_builddir_sed+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $ax_enable_builddir_sed in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_ax_enable_builddir_sed="$ax_enable_builddir_sed" # Let the user override the test with a path. -+ ;; -+ *) -+ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_path_ax_enable_builddir_sed="$as_dir/$ac_word$ac_exec_ext" -+ $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 -+ -+ test -z "$ac_cv_path_ax_enable_builddir_sed" && ac_cv_path_ax_enable_builddir_sed="sed" -+ ;; -+esac -+fi -+ax_enable_builddir_sed=$ac_cv_path_ax_enable_builddir_sed -+if test -n "$ax_enable_builddir_sed"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_enable_builddir_sed" >&5 -+$as_echo "$ax_enable_builddir_sed" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ax_enable_builddir_auxdir="$am_aux_dir" -+ac_config_commands="$ac_config_commands buildir" -+ ++AX_ENABLE_BUILDDIR + am__api_version='1.11' # Find a good install program. We prefer a C program (faster), -@@ -2803,9 +2919,6 @@ test "$program_suffix" != NONE && - 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 - *\ * | *\ *) -@@ -11838,210 +11951,1095 @@ CC="$lt_save_CC" +@@ -11834,6 +11839,12 @@ CC="$lt_save_CC" --{ $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='#' -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 -+$as_echo_n "checking for C compiler vendor... " >&6; } -+if ${ax_cv_c_compiler_vendor+:} false; then : -+ $as_echo_n "(cached) " >&6 - else -- MAINTAINER_MODE_TRUE='#' -- MAINTAINER_MODE_FALSE= --fi -- -- MAINT=$MAINTAINER_MODE_TRUE -+ ax_cv_c_compiler_vendor=unknown -+ # note: don't check for gcc first since some other compilers define __GNUC__ -+ for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ clang:__clang__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do -+ vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ - -+int -+main () -+{ - -+#if !($vencpp) -+ thisisanerror; -+#endif - --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 -+ ; -+ return 0; -+} - _ACEOF -- -+if ac_fn_c_try_compile "$LINENO"; then : -+ ax_cv_c_compiler_vendor=`echo $ventest | cut -d: -f1`; break - fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - --done -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 -+$as_echo "$ax_cv_c_compiler_vendor" >&6; } - --for ac_func in mmap --do : -- ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" --if test "x$ac_cv_func_mmap" = xyes; then : -- cat >>confdefs.h <<_ACEOF --#define HAVE_MMAP 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 -+# Check whether --enable-portable-binary was given. -+if test "${enable_portable_binary+set}" = set; then : -+ enableval=$enable_portable_binary; acx_maxopt_portable=$withval - else -- libffi_func_mmap=no -+ acx_maxopt_portable=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 -+# Try to determine "good" native compiler flags if none specified via CFLAGS -+if test "$ac_test_CFLAGS" != "set"; then -+ CFLAGS="" -+ case $ax_cv_c_compiler_vendor in -+ dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" -+ if test "x$acx_maxopt_portable" = xno; then -+ CFLAGS="$CFLAGS -arch host" -+ fi;; -+ -+ sun) CFLAGS="-native -fast -xO5 -dalign" -+ if test "x$acx_maxopt_portable" = xyes; then -+ CFLAGS="$CFLAGS -xarch=generic" -+ fi;; -+ -+ hp) CFLAGS="+Oall +Optrs_ansi +DSnative" -+ if test "x$acx_maxopt_portable" = xyes; then -+ CFLAGS="$CFLAGS +DAportable" -+ fi;; -+ -+ ibm) if test "x$acx_maxopt_portable" = xno; then -+ xlc_opt="-qarch=auto -qtune=auto" -+ else -+ xlc_opt="-qtune=auto" -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 -+$as_echo_n "checking whether C compiler accepts $xlc_opt... " >&6; } -+ax_save_FLAGS=$CFLAGS -+ CFLAGS="$xlc_opt" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ --#include --#include --#include -- --#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 -+ eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=yes - else -- ac_cv_decl_map_anon=no -+ eval `$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh`=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; } -+ CFLAGS=$ax_save_FLAGS -+eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$xlc_opt" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -+$as_echo "$ax_check_compiler_flags" >&6; } -+if test "x$ax_check_compiler_flags" = xyes; then -+ CFLAGS="-O3 -qansialias -w $xlc_opt" -+else -+ CFLAGS="-O3 -qansialias -w" -+ echo "******************************************************" -+ echo "* You seem to have the IBM C compiler. It is *" -+ echo "* recommended for best performance that you use: *" -+ echo "* *" -+ echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" -+ echo "* ^^^ ^^^ *" -+ echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" -+ echo "* CPU you have. (Set the CFLAGS environment var. *" -+ echo "* and re-run configure.) For more info, man cc. *" -+ echo "******************************************************" -+fi -+ -+ ;; -+ -+ intel) CFLAGS="-O3 -ansi_alias" -+ if test "x$acx_maxopt_portable" = xno; then -+ icc_archflag=unknown -+ icc_flags="" -+ case $host_cpu in -+ i686*|x86_64*) -+ # icc accepts gcc assembly syntax, so these should work: - -- 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 : -+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 x86 cpuid 0 output" >&5 -+$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -+if ${ax_cv_gcc_x86_cpuid_0+:} 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 -+ if test "$cross_compiling" = yes; then : -+ ax_cv_gcc_x86_cpuid_0=unknown -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ - --$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h -+ int op = 0, eax, ebx, ecx, edx; -+ FILE *f; -+ __asm__("cpuid" -+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) -+ : "a" (op)); -+ f = fopen("conftest_cpuid", "w"); if (!f) return 1; -+ fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); -+ fclose(f); -+ return 0; - -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -+else -+ ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid - fi --if test $ac_cv_func_mmap_dev_zero = yes; then -- --$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h -- -+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_cv_func_mmap_anon = yes; then -- --$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h - - fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 -+$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } -+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 -d $srcdir/testsuite; then -- TESTSUBDIR_TRUE= -- TESTSUBDIR_FALSE='#' --else -- TESTSUBDIR_TRUE='#' -- TESTSUBDIR_FALSE= --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 - --TARGETDIR="unknown" --case "$host" in -- alpha*-*-*) -- TARGET=ALPHA; TARGETDIR=alpha; -- # Support 128-bit long double, changeable via command-line switch. -- HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)' -- ;; -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 -+$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -+if ${ax_cv_gcc_x86_cpuid_1+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ax_cv_gcc_x86_cpuid_1=unknown -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+ int op = 1, eax, ebx, ecx, edx; -+ FILE *f; -+ __asm__("cpuid" -+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) -+ : "a" (op)); -+ f = fopen("conftest_cpuid", "w"); if (!f) return 1; -+ fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); -+ fclose(f); -+ return 0; -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -+else -+ ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid -+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: $ax_cv_gcc_x86_cpuid_1" >&5 -+$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } -+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 -+ -+ -+ case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG -+ *:756e6547:*:*) # Intel -+ case $ax_cv_gcc_x86_cpuid_1 in -+ *6a?:*[234]:*:*|*6[789b]?:*:*:*) icc_flags="-xK";; -+ *f3[347]:*:*:*|*f41347:*:*:*) icc_flags="-xP -xN -xW -xK";; -+ *f??:*:*:*) icc_flags="-xN -xW -xK";; -+ esac ;; -+ esac ;; -+ esac -+ if test "x$icc_flags" != x; then -+ for flag in $icc_flags; do -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -+$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -+ax_save_FLAGS=$CFLAGS -+ CFLAGS="$flag" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes -+else -+ eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS=$ax_save_FLAGS -+eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -+$as_echo "$ax_check_compiler_flags" >&6; } -+if test "x$ax_check_compiler_flags" = xyes; then -+ icc_archflag=$flag; break -+else -+ : -+fi -+ -+ done -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 -+$as_echo_n "checking for icc architecture flag... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 -+$as_echo "$icc_archflag" >&6; } -+ if test "x$icc_archflag" != xunknown; then -+ CFLAGS="$CFLAGS $icc_archflag" -+ fi -+ fi -+ ;; -+ -+ gnu) -+ # default optimization flags for gcc on all systems -+ CFLAGS="-O3 -fomit-frame-pointer" -+ -+ # -fstrict-aliasing for gcc-2.95+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 -+$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; } -+if ${ax_cv_c_flags__fstrict_aliasing+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ -+ ax_save_FLAGS=$CFLAGS -+ CFLAGS="-fstrict-aliasing" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ax_cv_c_flags__fstrict_aliasing=yes -+else -+ ax_cv_c_flags__fstrict_aliasing=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS=$ax_save_FLAGS -+fi -+ -+eval ax_check_compiler_flags=$ax_cv_c_flags__fstrict_aliasing -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -+$as_echo "$ax_check_compiler_flags" >&6; } -+if test "x$ax_check_compiler_flags" = xyes; then -+ CFLAGS="$CFLAGS -fstrict-aliasing" -+else -+ : -+fi -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 -+$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; } -+if ${ax_cv_c_flags__ffast_math+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ -+ ax_save_FLAGS=$CFLAGS -+ CFLAGS="-ffast-math" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ax_cv_c_flags__ffast_math=yes -+else -+ ax_cv_c_flags__ffast_math=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS=$ax_save_FLAGS -+fi -+ -+eval ax_check_compiler_flags=$ax_cv_c_flags__ffast_math -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -+$as_echo "$ax_check_compiler_flags" >&6; } -+if test "x$ax_check_compiler_flags" = xyes; then -+ CFLAGS="$CFLAGS -ffast-math" -+else -+ : -+fi -+ -+ -+ -+ -+ -+ -+# Check whether --with-gcc-arch was given. -+if test "${with_gcc_arch+set}" = set; then : -+ withval=$with_gcc_arch; ax_gcc_arch=$withval -+else -+ ax_gcc_arch=yes -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -+$as_echo_n "checking for gcc architecture flag... " >&6; } -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -+$as_echo "" >&6; } -+if ${ax_cv_gcc_archflag+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ -+ax_cv_gcc_archflag="unknown" -+ -+if test "$GCC" = yes; then -+ -+if test "x$ax_gcc_arch" = xyes; then -+ax_gcc_arch="" -+if test "$cross_compiling" = no; then -+case $host_cpu in -+ i[3456]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones -+ -+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 x86 cpuid 0 output" >&5 -+$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -+if ${ax_cv_gcc_x86_cpuid_0+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ax_cv_gcc_x86_cpuid_0=unknown -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+ int op = 0, eax, ebx, ecx, edx; -+ FILE *f; -+ __asm__("cpuid" -+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) -+ : "a" (op)); -+ f = fopen("conftest_cpuid", "w"); if (!f) return 1; -+ fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); -+ fclose(f); -+ return 0; -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -+else -+ ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid -+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: $ax_cv_gcc_x86_cpuid_0" >&5 -+$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } -+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 for x86 cpuid 1 output" >&5 -+$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -+if ${ax_cv_gcc_x86_cpuid_1+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ax_cv_gcc_x86_cpuid_1=unknown -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+ int op = 1, eax, ebx, ecx, edx; -+ FILE *f; -+ __asm__("cpuid" -+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) -+ : "a" (op)); -+ f = fopen("conftest_cpuid", "w"); if (!f) return 1; -+ fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); -+ fclose(f); -+ return 0; -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -+else -+ ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid -+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: $ax_cv_gcc_x86_cpuid_1" >&5 -+$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } -+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 -+ -+ -+ case $ax_cv_gcc_x86_cpuid_0 in -+ *:756e6547:*:*) # Intel -+ case $ax_cv_gcc_x86_cpuid_1 in -+ *5[48]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; -+ *5??:*:*:*) ax_gcc_arch=pentium ;; -+ *6[3456]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; -+ *6a?:*[01]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; -+ *6a?:*[234]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; -+ *6[9d]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; -+ *6[78b]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; -+ *6??:*:*:*) ax_gcc_arch=pentiumpro ;; -+ *f3[347]:*:*:*|*f41347:*:*:*) -+ case $host_cpu in -+ x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; -+ *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; -+ esac ;; -+ *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; -+ esac ;; -+ *:68747541:*:*) # AMD -+ case $ax_cv_gcc_x86_cpuid_1 in -+ *5[67]?:*:*:*) ax_gcc_arch=k6 ;; -+ *5[8d]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; -+ *5[9]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; -+ *60?:*:*:*) ax_gcc_arch=k7 ;; -+ *6[12]?:*:*:*) ax_gcc_arch="athlon k7" ;; -+ *6[34]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; -+ *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; -+ *6[68a]?:*:*:*) -+ -+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 x86 cpuid 0x80000006 output" >&5 -+$as_echo_n "checking for x86 cpuid 0x80000006 output... " >&6; } -+if ${ax_cv_gcc_x86_cpuid_0x80000006+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ax_cv_gcc_x86_cpuid_0x80000006=unknown -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+ int op = 0x80000006, eax, ebx, ecx, edx; -+ FILE *f; -+ __asm__("cpuid" -+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) -+ : "a" (op)); -+ f = fopen("conftest_cpuid", "w"); if (!f) return 1; -+ fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); -+ fclose(f); -+ return 0; -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ax_cv_gcc_x86_cpuid_0x80000006=`cat conftest_cpuid`; rm -f conftest_cpuid -+else -+ ax_cv_gcc_x86_cpuid_0x80000006=unknown; rm -f conftest_cpuid -+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: $ax_cv_gcc_x86_cpuid_0x80000006" >&5 -+$as_echo "$ax_cv_gcc_x86_cpuid_0x80000006" >&6; } -+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 -+ -+ # L2 cache size -+ case $ax_cv_gcc_x86_cpuid_0x80000006 in -+ *:*:*[1-9a-f]??????:*) # (L2 = ecx >> 16) >= 256 -+ ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; -+ *) ax_gcc_arch="athlon-4 athlon k7" ;; -+ esac ;; -+ *f[4cef8b]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; -+ *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; -+ *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; -+ *f??:*:*:*) ax_gcc_arch="k8" ;; -+ esac ;; -+ *:746e6543:*:*) # IDT -+ case $ax_cv_gcc_x86_cpuid_1 in -+ *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; -+ *58?:*:*:*) ax_gcc_arch=winchip2 ;; -+ *6[78]?:*:*:*) ax_gcc_arch=c3 ;; -+ *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; -+ esac ;; -+ esac -+ if test x"$ax_gcc_arch" = x; then # fallback -+ case $host_cpu in -+ i586*) ax_gcc_arch=pentium ;; -+ i686*) ax_gcc_arch=pentiumpro ;; -+ esac -+ fi -+ ;; -+ -+ sparc*) -+ # Extract the first word of "prtdiag", so it can be a program name with args. -+set dummy prtdiag; 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_path_PRTDIAG+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $PRTDIAG in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/" -+for as_dir in $as_dummy -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" -+ $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 -+ -+ test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag" -+ ;; -+esac -+fi -+PRTDIAG=$ac_cv_path_PRTDIAG -+if test -n "$PRTDIAG"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 -+$as_echo "$PRTDIAG" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` -+ cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` -+ case $cputype in -+ *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; -+ *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; -+ *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; -+ *supersparc*|*tms390z5[05]*) ax_gcc_arch="supersparc v8" ;; -+ *hypersparc*|*rt62[056]*) ax_gcc_arch="hypersparc v8" ;; -+ *cypress*) ax_gcc_arch=cypress ;; -+ esac ;; -+ -+ alphaev5) ax_gcc_arch=ev5 ;; -+ alphaev56) ax_gcc_arch=ev56 ;; -+ alphapca56) ax_gcc_arch="pca56 ev56" ;; -+ alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; -+ alphaev6) ax_gcc_arch=ev6 ;; -+ alphaev67) ax_gcc_arch=ev67 ;; -+ alphaev68) ax_gcc_arch="ev68 ev67" ;; -+ alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; -+ alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; -+ alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; -+ -+ powerpc*) -+ cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` -+ cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` -+ case $cputype in -+ *750*) ax_gcc_arch="750 G3" ;; -+ *740[0-9]*) ax_gcc_arch="$cputype 7400 G4" ;; -+ *74[4-5][0-9]*) ax_gcc_arch="$cputype 7450 G4" ;; -+ *74[0-9][0-9]*) ax_gcc_arch="$cputype G4" ;; -+ *970*) ax_gcc_arch="970 G5 power4";; -+ *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; -+ *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; -+ 603ev|8240) ax_gcc_arch="$cputype 603e 603";; -+ *) ax_gcc_arch=$cputype ;; -+ esac -+ ax_gcc_arch="$ax_gcc_arch powerpc" -+ ;; -+esac -+fi # not cross-compiling -+fi # guess arch -+ -+if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then -+for arch in $ax_gcc_arch; do -+ if test "x$acx_maxopt_portable" = xyes; then # if we require portable code -+ flags="-mtune=$arch" -+ # -mcpu=$arch and m$arch generate nonportable code on every arch except -+ # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. -+ case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac -+ else -+ flags="-march=$arch -mcpu=$arch -m$arch" -+ fi -+ for flag in $flags; do -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -+$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -+ax_save_FLAGS=$CFLAGS -+ CFLAGS="$flag" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=yes -+else -+ eval `$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh`=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS=$ax_save_FLAGS -+eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$flag" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -+$as_echo "$ax_check_compiler_flags" >&6; } -+if test "x$ax_check_compiler_flags" = xyes; then -+ ax_cv_gcc_archflag=$flag; break -+else -+ : -+fi -+ -+ done -+ test "x$ax_cv_gcc_archflag" = xunknown || break -+done -+fi -+ -+fi # $GCC=yes -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -+$as_echo_n "checking for gcc architecture flag... " >&6; } -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 -+$as_echo "$ax_cv_gcc_archflag" >&6; } -+if test "x$ax_cv_gcc_archflag" = xunknown; then -+ : -+else -+ CFLAGS="$CFLAGS $ax_cv_gcc_archflag" -+fi -+ -+ ;; -+ esac -+ -+ if test -z "$CFLAGS"; then -+ echo "" -+ echo "********************************************************" -+ echo "* WARNING: Don't know the best CFLAGS for this system *" -+ echo "* Use ./configure CFLAGS=... to specify your own flags *" -+ echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" -+ echo "********************************************************" -+ echo "" -+ CFLAGS="-O3" -+ fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 -+$as_echo_n "checking whether C compiler accepts $CFLAGS... " >&6; } -+ax_save_FLAGS=$CFLAGS -+ CFLAGS="$CFLAGS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=yes -+else -+ eval `$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh`=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS=$ax_save_FLAGS -+eval ax_check_compiler_flags=$`$as_echo "ax_cv_c_flags_$CFLAGS" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5 -+$as_echo "$ax_check_compiler_flags" >&6; } -+if test "x$ax_check_compiler_flags" = xyes; then -+ : -+else -+ -+ echo "" -+ echo "********************************************************" -+ echo "* WARNING: The guessed CFLAGS don't seem to work with *" -+ echo "* your compiler. *" -+ echo "* Use ./configure CFLAGS=... to specify your own flags *" -+ echo "********************************************************" -+ echo "" -+ CFLAGS="" -+ -+fi -+ -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 -+$as_echo_n "checking CFLAGS for maximum warnings... " >&6; } -+if ${ac_cv_cflags_warn_all+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_cv_cflags_warn_all="no, unknown" -+ 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_save_CFLAGS="$CFLAGS" -+for ac_arg in "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # -+do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` -+ 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_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+ CFLAGS="$ac_save_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 -+ -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 -+$as_echo "$ac_cv_cflags_warn_all" >&6; } -+case ".$ac_cv_cflags_warn_all" in -+ .ok|.ok,*) ;; -+ .|.no|.no,*) -+ ;; -+ *) -+ if echo " $CFLAGS " | grep " $ac_cv_cflags_warn_all " 2>&1 >/dev/null -+ then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$ac_cv_cflags_warn_all"; } >&5 -+ (: CFLAGS does contain $ac_cv_cflags_warn_all) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } -+ else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$ac_cv_cflags_warn_all\""; } >&5 -+ (: CFLAGS="$CFLAGS $ac_cv_cflags_warn_all") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } -+ CFLAGS="$CFLAGS $ac_cv_cflags_warn_all" -+ fi -+ ;; -+esac -+ ++AX_CC_MAXOPT ++AX_CFLAGS_WARN_ALL +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fexceptions" +fi + -+ -+{ $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 -+do : -+ ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -+if test "x$ac_cv_func_mmap" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_MMAP 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 -+#include -+#include -+ -+#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" -+case "$host" in -+ alpha*-*-*) -+ TARGET=ALPHA; TARGETDIR=alpha; -+ # Support 128-bit long double, changeable via command-line switch. -+ HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)' -+ ;; - arm*-*-*) - TARGET=ARM; TARGETDIR=arm -@@ -12067,7 +13065,7 @@ case "$host" in + { $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; } +@@ -12064,7 +12075,7 @@ case "$host" in TARGET=FRV; TARGETDIR=frv ;; @@ -1469,7 +62,7 @@ Index: libffi/configure TARGET=PA_LINUX; TARGETDIR=pa ;; hppa*64-*-hpux*) -@@ -12117,7 +13115,7 @@ case "$host" in +@@ -12114,7 +12125,7 @@ case "$host" in mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) TARGET=MIPS; TARGETDIR=mips ;; @@ -1478,7 +71,7 @@ Index: libffi/configure # Support 128-bit long double for NewABI. HAVE_LONG_DOUBLE='defined(__mips64)' TARGET=MIPS; TARGETDIR=mips -@@ -12139,7 +13137,7 @@ case "$host" in +@@ -12136,7 +12147,7 @@ case "$host" in powerpc-*-aix* | rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc ;; @@ -1487,189 +80,49 @@ Index: libffi/configure TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc ;; powerpc64-*-freebsd*) -@@ -13299,7 +14297,7 @@ case "$target" in - $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h +@@ -13287,13 +13298,30 @@ $as_echo "#define SYMBOL_UNDERSCORE 1" > + fi + fi - ;; ++ ++FFI_EXEC_TRAMPOLINE_TABLE=0 + case "$target" in - *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*) ++ *arm*-apple-darwin*) ++ FFI_EXEC_TRAMPOLINE_TABLE=1 ++ ++$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h ++ ++ ;; + *-apple-darwin1[10]* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*) $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h -@@ -14347,6 +15345,14 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - # - # INIT-COMMANDS - # -+ax_enable_builddir_srcdir="$srcdir" # $srcdir -+ax_enable_builddir_host="$HOST" # $HOST / $host -+ax_enable_builddir_version="$VERSION" # $VERSION -+ax_enable_builddir_package="$PACKAGE" # $PACKAGE -+ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX -+ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED -+ax_enable_builddir="$ax_enable_builddir" # $SUB + ;; + 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 ++ + - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -@@ -14636,6 +15642,7 @@ for ac_config_target in $ac_config_targe - do - case $ac_config_target in - "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;; -+ "buildir") CONFIG_COMMANDS="$CONFIG_COMMANDS buildir" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;; -@@ -15274,6 +16281,150 @@ $as_echo "$as_me: executing $ac_file com + if test x$TARGET = xX86_64; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports unwind section type" >&5 +@@ -13721,6 +13749,10 @@ if test -z "${PA64_HPUX_TRUE}" && test - + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi - case $ac_file$ac_mode in -+ "buildir":C) ac_top_srcdir="$ax_enable_builddir_srcdir" -+ if test ".$ax_enable_builddir" = ".." ; then -+ if test -f "$top_srcdir/Makefile" ; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - left untouched" >&5 -+$as_echo "$as_me: skipping top_srcdir/Makefile - left untouched" >&6;} -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - not created" >&5 -+$as_echo "$as_me: skipping top_srcdir/Makefile - not created" >&6;} -+ fi -+ else -+ if test -f "$ac_top_srcdir/Makefile" ; then -+ a=`grep "^VERSION " "$ac_top_srcdir/Makefile"` ; b=`grep "^VERSION " Makefile` -+ test "$a" != "$b" && rm "$ac_top_srcdir/Makefile" -+ fi -+ if test -f "$ac_top_srcdir/Makefile" ; then -+ echo "$ac_top_srcdir/Makefile : $ac_top_srcdir/Makefile.in" > $tmp/conftemp.mk -+ echo " @ echo 'REMOVED,,,' >\$@" >> $tmp/conftemp.mk -+ eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null" -+ if grep '^REMOVED,,,' "$ac_top_srcdir/Makefile" >/dev/null -+ then rm $ac_top_srcdir/Makefile ; fi -+ cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING -+ fi -+ if test ! -f "$ac_top_srcdir/Makefile" ; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5 -+$as_echo "$as_me: create top_srcdir/Makefile guessed from local Makefile" >&6;} -+ x='`' ; cat >$tmp/conftemp.sed <<_EOF -+/^\$/n -+x -+/^\$/bS -+x -+/\\\\\$/{H;d;} -+{H;s/.*//;x;} -+bM -+:S -+x -+/\\\\\$/{h;d;} -+{h;s/.*//;x;} -+:M -+s/\\(\\n\\) /\\1 /g -+/^ /d -+/^[ ]*[\\#]/d -+/^VPATH *=/d -+s/^srcdir *=.*/srcdir = ./ -+s/^top_srcdir *=.*/top_srcdir = ./ -+/[:=]/!d -+/^\\./d -+/ = /b -+/ .= /b -+/:/!b -+s/:.*/:/ -+s/ / /g -+s/ \\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/ \\1 \\1-all\\2/g -+s/^\\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/\\1 \\1-all\\2/ -+s/ / /g -+/^all all-all[ :]/i\\ -+all-configured : all-all -+s/ [a-zA-Z0-9-]*-all [a-zA-Z0-9-]*-all-all//g -+/-all-all/d -+a\\ -+ @ HOST="\$(HOST)\" \\\\\\ -+ ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ -+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ -+ ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ -+ ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\ -+ ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\ -+ ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ -+ ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\ -+ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ -+ ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done -+/dist-all *:/a\\ -+ @ HOST="\$(HOST)\" \\\\\\ -+ ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ -+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ -+ ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ -+ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\ -+ ; if test "\$\$found" -eq "0" ; then : \\\\\\ -+ ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ -+ ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ -+ ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\ -+ ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -+/dist-[a-zA-Z0-9]*-all *:/a\\ -+ @ HOST="\$(HOST)\" \\\\\\ -+ ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\ -+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ -+ ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ -+ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\ -+ ; if test "\$\$found" -eq "0" ; then : \\\\\\ -+ ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ -+ ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ -+ ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\ -+ ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -+/distclean-all *:/a\\ -+ @ HOST="\$(HOST)\" \\\\\\ -+ ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\ -+ ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\ -+ ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ -+ ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\ -+ ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ -+ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ -+ ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\ -+ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ -+ ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\ -+ ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\ -+ ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile -+_EOF -+ cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING -+ $ax_enable_builddir_sed -f $tmp/conftemp.sed Makefile >$ac_top_srcdir/Makefile -+ if test -f "$ac_top_srcdir/Makefile.mk" ; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5 -+$as_echo "$as_me: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&6;} -+ cat $ac_top_srcdir/Makefile.mk >>$ac_top_srcdir/Makefile -+ fi ; xxxx="####" -+ echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$ac_top_srcdir/Makefile -+ # sanity check -+ if grep '^; echo "MAKE ' $ac_top_srcdir/Makefile >/dev/null ; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: buggy sed found - it deletes tab in \"a\" text parts" >&5 -+$as_echo "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;} -+ $ax_enable_builddir_sed -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $ac_top_srcdir/Makefile \ -+ >$ac_top_srcdir/Makefile~ -+ (test -s $ac_top_srcdir/Makefile~ && mv $ac_top_srcdir/Makefile~ $ac_top_srcdir/Makefile) 2>/dev/null -+ fi -+ else -+ xxxx="\\#\\#\\#\\#" -+ # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed -+ echo "s!^$xxxx [^|]* | *$ax_enable_builddir *\$!$xxxx ...... $ax_enable_builddir!" >$tmp/conftemp.sed -+ $ax_enable_builddir_sed -f "$tmp/conftemp.sed" "$ac_top_srcdir/Makefile" >$tmp/mkfile.tmp -+ cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING -+ cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING -+ if cmp -s "$ac_top_srcdir/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5 -+$as_echo "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;} -+ rm "$tmp/mkfile.tmp" -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: reusing top_srcdir/Makefile from earlier configure" >&5 -+$as_echo "$as_me: reusing top_srcdir/Makefile from earlier configure" >&6;} -+ mv "$tmp/mkfile.tmp" "$ac_top_srcdir/Makefile" -+ fi -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&5 -+$as_echo "$as_me: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&6;} -+ xxxx="####" -+ echo "$xxxx" "$ax_enable_builddir_host" "|$ax_enable_builddir" >>$ac_top_srcdir/Makefile -+ fi -+ ;; - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval ++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 Index: libffi/configure.ac =================================================================== --- libffi.orig/configure.ac diff --git a/patches/debug-build b/patches/debug-build index 9ec5449..7571f3f 100644 --- a/patches/debug-build +++ b/patches/debug-build @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -201,6 +201,13 @@ +@@ -225,6 +225,13 @@ * testsuite/libffi.call/cls_longdouble.c: Likewise. * testsuite/libffi.call/huge_struct.c: Likewise. diff --git a/patches/ffi_last_abi b/patches/ffi_last_abi index dc2a581..ab8eb22 100644 --- a/patches/ffi_last_abi +++ b/patches/ffi_last_abi @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -201,6 +201,12 @@ +@@ -225,6 +225,12 @@ * testsuite/libffi.call/cls_longdouble.c: Likewise. * testsuite/libffi.call/huge_struct.c: Likewise. @@ -299,10 +299,20 @@ Index: libffi/src/x86/ffitarget.h =================================================================== --- libffi.orig/src/x86/ffitarget.h +++ libffi/src/x86/ffitarget.h -@@ -64,28 +64,29 @@ typedef enum ffi_abi { - #ifdef X86_WIN32 - FFI_SYSV, +@@ -1,6 +1,7 @@ + /* -----------------------------------------------------------------*-C-*- +- ffitarget.h - Copyright (c) 1996-2003, 2010 Red Hat, Inc. +- Copyright (C) 2008 Free Software Foundation, Inc. ++ ffitarget.h - Copyright (c) 2012 Anthony Green ++ Copyright (c) 1996-2003, 2010 Red Hat, Inc. ++ Copyright (C) 2008 Free Software Foundation, Inc. + + Target configuration macros for x86 and x86-64. + +@@ -66,28 +67,29 @@ typedef enum ffi_abi { FFI_STDCALL, + FFI_THISCALL, + FFI_FASTCALL, + FFI_LAST_ABI, /* TODO: Add fastcall support for the sake of completeness */ - FFI_DEFAULT_ABI = FFI_SYSV, diff --git a/patches/fix-grammar b/patches/fix-grammar index 742758e..4911b92 100644 --- a/patches/fix-grammar +++ b/patches/fix-grammar @@ -15,7 +15,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -78,6 +78,10 @@ +@@ -102,6 +102,10 @@ instructions. * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. diff --git a/patches/fix-ppc32 b/patches/fix-ppc32 index e1937c3..e2699be 100644 --- a/patches/fix-ppc32 +++ b/patches/fix-ppc32 @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -65,6 +65,11 @@ +@@ -89,6 +89,11 @@ Use them to handle ELF vs. ECOFF differences. [__osf__] (_GLOBAL__F_ffi_call_osf): Define. diff --git a/patches/fix-xfails b/patches/fix-xfails index 2186486..78e5264 100644 --- a/patches/fix-xfails +++ b/patches/fix-xfails @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -71,7 +71,12 @@ +@@ -95,7 +95,12 @@ 2011-02-09 Anthony Green @@ -16,7 +16,7 @@ Index: libffi/ChangeLog 2011-02-09 Landon Fuller -@@ -91,6 +96,7 @@ +@@ -115,6 +120,7 @@ * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case. * build-ios.sh: New file. * fficonfig.h.in, configure, Makefile.in: Rebuilt. diff --git a/patches/fix_maxopt b/patches/fix_maxopt index 2f642db..d6cbd2e 100644 --- a/patches/fix_maxopt +++ b/patches/fix_maxopt @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -65,6 +65,11 @@ +@@ -89,6 +89,11 @@ Use them to handle ELF vs. ECOFF differences. [__osf__] (_GLOBAL__F_ffi_call_osf): Define. diff --git a/patches/hpux-mallinfo b/patches/hpux-mallinfo index bca0220..8a9536d 100644 --- a/patches/hpux-mallinfo +++ b/patches/hpux-mallinfo @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,11 @@ +@@ -93,6 +93,11 @@ * configure: Regenerate. diff --git a/patches/interix b/patches/interix index 7bec602..0c83b13 100644 --- a/patches/interix +++ b/patches/interix @@ -2,7 +2,7 @@ Index: libffi/configure =================================================================== --- libffi.orig/configure +++ libffi/configure -@@ -12080,7 +12080,7 @@ case "$host" in +@@ -12077,7 +12077,7 @@ case "$host" in i?86-*-freebsd* | i?86-*-openbsd*) TARGET=X86_FREEBSD; TARGETDIR=x86 ;; @@ -64,7 +64,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -71,6 +71,17 @@ +@@ -95,6 +95,17 @@ 2011-02-09 Anthony Green diff --git a/patches/ios b/patches/ios index 83d1923..a50d8a5 100644 --- a/patches/ios +++ b/patches/ios @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,29 @@ +@@ -93,6 +93,29 @@ * configure: Regenerate. @@ -208,7 +208,7 @@ Index: libffi/Makefile.in FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ -@@ -409,31 +413,27 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change +@@ -408,31 +412,27 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change src/avr32/ffi.c src/avr32/sysv.S src/avr32/ffitarget.h \ src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \ src/ia64/ffi.c src/ia64/ffitarget.h src/ia64/ia64_flags.h \ @@ -259,7 +259,7 @@ Index: libffi/Makefile.in info_TEXINFOS = doc/libffi.texi -@@ -492,10 +492,11 @@ nodist_libffi_la_SOURCES = $(am__append_ +@@ -491,10 +491,11 @@ nodist_libffi_la_SOURCES = $(am__append_ $(am__append_15) $(am__append_16) $(am__append_17) \ $(am__append_18) $(am__append_19) $(am__append_20) \ $(am__append_21) $(am__append_22) $(am__append_23) \ @@ -273,7 +273,7 @@ Index: libffi/Makefile.in libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS) AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src AM_CCASFLAGS = $(AM_CPPFLAGS) -@@ -731,6 +732,8 @@ src/arm/sysv.lo: src/arm/$(am__dirstamp) +@@ -730,6 +731,8 @@ src/arm/sysv.lo: src/arm/$(am__dirstamp) src/arm/$(DEPDIR)/$(am__dirstamp) src/arm/ffi.lo: src/arm/$(am__dirstamp) \ src/arm/$(DEPDIR)/$(am__dirstamp) @@ -282,7 +282,7 @@ Index: libffi/Makefile.in src/avr32/$(am__dirstamp): @$(MKDIR_P) src/avr32 @: > src/avr32/$(am__dirstamp) -@@ -828,6 +831,8 @@ mostlyclean-compile: +@@ -827,6 +830,8 @@ mostlyclean-compile: -rm -f src/arm/ffi.lo -rm -f src/arm/sysv.$(OBJEXT) -rm -f src/arm/sysv.lo @@ -291,7 +291,7 @@ Index: libffi/Makefile.in -rm -f src/avr32/ffi.$(OBJEXT) -rm -f src/avr32/ffi.lo -rm -f src/avr32/sysv.$(OBJEXT) -@@ -950,6 +955,7 @@ distclean-compile: +@@ -949,6 +954,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.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@ @@ -299,7 +299,7 @@ Index: libffi/Makefile.in @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/cris/$(DEPDIR)/ffi.Plo@am__quote@ -@@ -1817,6 +1823,7 @@ uninstall-am: uninstall-dvi-am uninstall +@@ -1816,6 +1822,7 @@ uninstall-am: uninstall-dvi-am uninstall uninstall-info-am uninstall-libLTLIBRARIES uninstall-pdf-am \ uninstall-pkgconfigDATA uninstall-ps-am diff --git a/patches/ios-fixes b/patches/ios-fixes index dbeb7aa..502f46e 100644 --- a/patches/ios-fixes +++ b/patches/ios-fixes @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -106,7 +106,7 @@ +@@ -130,7 +130,7 @@ * src/prep_cif.c (UNLIKELY, LIKELY): Define. (initialize_aggregate): Check for bad types. diff --git a/patches/irix b/patches/irix index 589c6fa..8c63ece 100644 --- a/patches/irix +++ b/patches/irix @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,14 @@ +@@ -93,6 +93,14 @@ * configure: Regenerate. diff --git a/patches/kfreebsd-mmap b/patches/kfreebsd-mmap index 725d6b0..7b801bc 100644 --- a/patches/kfreebsd-mmap +++ b/patches/kfreebsd-mmap @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -17,6 +17,11 @@ +@@ -41,6 +41,11 @@ * configure: Regenerate. diff --git a/patches/m68k-patches b/patches/m68k-patches index 07642e2..3f4c12b 100644 --- a/patches/m68k-patches +++ b/patches/m68k-patches @@ -12,81 +12,6 @@ Index: libffi/src/m68k/ffi.c *(unsigned short *)closure->tramp = 0x207c; *(void **)(closure->tramp + 2) = codeloc; -Index: libffi/src/m68k/sysv.S -=================================================================== ---- libffi.orig/src/m68k/sysv.S -+++ libffi/src/m68k/sysv.S -@@ -1,6 +1,6 @@ - /* ----------------------------------------------------------------------- - -- sysv.S - Copyright (c) 1998 Andreas Schwab -+ sysv.S - Copyright (c) 1998, 2012 Andreas Schwab - Copyright (c) 2008 Red Hat, Inc. - - m68k Foreign Function Interface -@@ -87,7 +87,7 @@ ffi_call_SYSV: - - | If the return value pointer is NULL, assume no return value. - | NOTE: On the mc68000, tst on an address register is not supported. --#if defined(__mc68000__) && !defined(__mcoldfire__) -+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) - cmp.w #0, %a1 - #else - tst.l %a1 -@@ -109,7 +109,7 @@ retlongint: - retfloat: - btst #2,%d2 - jbeq retdouble --#if defined(__MC68881__) -+#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.s %fp0,(%a1) - #else - move.l %d0,(%a1) -@@ -119,7 +119,7 @@ retfloat: - retdouble: - btst #3,%d2 - jbeq retlongdouble --#if defined(__MC68881__) -+#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.d %fp0,(%a1) - #else - move.l %d0,(%a1)+ -@@ -130,7 +130,7 @@ retdouble: - retlongdouble: - btst #4,%d2 - jbeq retpointer --#if defined(__MC68881__) -+#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.x %fp0,(%a1) - #else - move.l %d0,(%a1)+ -@@ -199,7 +199,7 @@ ffi_closure_SYSV: - move.l (%a0),%d1 - jra .Lcls_epilogue - .Lcls_ret_float: --#if defined(__MC68881__) -+#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.s (%a0),%fp0 - #else - move.l (%a0),%d0 -@@ -209,7 +209,7 @@ ffi_closure_SYSV: - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_ldouble --#if defined(__MC68881__) -+#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.d (%a0),%fp0 - #else - move.l (%a0)+,%d0 -@@ -217,7 +217,7 @@ ffi_closure_SYSV: - #endif - jra .Lcls_epilogue - .Lcls_ret_ldouble: --#if defined(__MC68881__) -+#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.x (%a0),%fp0 - #else - move.l (%a0)+,%d0 Index: libffi/testsuite/libffi.call/return_sc.c =================================================================== --- libffi.orig/testsuite/libffi.call/return_sc.c diff --git a/patches/ml64-safeseh b/patches/ml64-safeseh index bd6422d..d5c643f 100644 --- a/patches/ml64-safeseh +++ b/patches/ml64-safeseh @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -209,6 +209,10 @@ +@@ -233,6 +233,10 @@ * src/prep_cif.c: Push stack space computation into src/x86/ffi.c for X86_ANY so return value space doesn't get added twice. diff --git a/patches/more-openbsd b/patches/more-openbsd index fea0c5b..1bf3e6e 100644 --- a/patches/more-openbsd +++ b/patches/more-openbsd @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -808,6 +808,11 @@ +@@ -832,6 +832,11 @@ * man/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. diff --git a/patches/msvcc b/patches/msvcc index 13675f5..8f5e0e7 100644 --- a/patches/msvcc +++ b/patches/msvcc @@ -19,7 +19,7 @@ Index: libffi/Makefile.in =================================================================== --- libffi.orig/Makefile.in +++ libffi/Makefile.in -@@ -431,7 +431,9 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change +@@ -430,7 +430,9 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \ src/moxie/ffi.c src/moxie/eabi.S libtool-version \ ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4 \ @@ -30,7 +30,7 @@ Index: libffi/Makefile.in info_TEXINFOS = doc/libffi.texi -@@ -1821,7 +1823,6 @@ uninstall-am: uninstall-dvi-am uninstall +@@ -1820,7 +1822,6 @@ uninstall-am: uninstall-dvi-am uninstall uninstall-info-am uninstall-libLTLIBRARIES uninstall-pdf-am \ uninstall-pkgconfigDATA uninstall-ps-am diff --git a/patches/msvcc-warning b/patches/msvcc-warning index 96ff409..c9d2691 100644 --- a/patches/msvcc-warning +++ b/patches/msvcc-warning @@ -55,7 +55,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -267,6 +267,11 @@ +@@ -291,6 +291,11 @@ * man/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. diff --git a/patches/powerpc-ffi-softfloat b/patches/powerpc-ffi-softfloat index b12b35e..215a312 100644 --- a/patches/powerpc-ffi-softfloat +++ b/patches/powerpc-ffi-softfloat @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -17,6 +17,12 @@ +@@ -41,6 +41,12 @@ * configure: Regenerate. diff --git a/patches/powerpc-sysv-without-string-ops b/patches/powerpc-sysv-without-string-ops index bb96a37..c647583 100644 --- a/patches/powerpc-sysv-without-string-ops +++ b/patches/powerpc-sysv-without-string-ops @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -17,6 +17,12 @@ +@@ -41,6 +41,12 @@ * configure: Regenerate. diff --git a/patches/ppc64-darwin b/patches/ppc64-darwin index 8cda4a8..f655ed9 100644 --- a/patches/ppc64-darwin +++ b/patches/ppc64-darwin @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,10 @@ +@@ -93,6 +93,10 @@ * configure: Regenerate. @@ -17,7 +17,7 @@ Index: libffi/configure =================================================================== --- libffi.orig/configure +++ libffi/configure -@@ -12133,7 +12133,7 @@ case "$host" in +@@ -12130,7 +12130,7 @@ case "$host" in powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc ;; @@ -26,7 +26,7 @@ Index: libffi/configure TARGET=POWERPC_DARWIN; TARGETDIR=powerpc ;; powerpc-*-aix* | rs6000-*-aix*) -@@ -12142,7 +12142,7 @@ case "$host" in +@@ -12139,7 +12139,7 @@ case "$host" in powerpc-*-freebsd*) TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc ;; diff --git a/patches/remove-debug-code b/patches/remove-debug-code index 59c9bce..71990b8 100644 --- a/patches/remove-debug-code +++ b/patches/remove-debug-code @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -41,6 +41,26 @@ +@@ -65,6 +65,26 @@ X 10.7. * configure: Rebuilt. @@ -132,7 +132,7 @@ Index: libffi/Makefile.in subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \ -@@ -121,48 +122,49 @@ am__installdirs = "$(DESTDIR)$(libdir)" +@@ -113,48 +114,49 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libffi_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp @@ -211,7 +211,7 @@ Index: libffi/Makefile.in nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) $(am__objects_5) \ $(am__objects_6) $(am__objects_7) $(am__objects_8) \ -@@ -172,17 +174,17 @@ nodist_libffi_la_OBJECTS = $(am__objects +@@ -164,17 +166,17 @@ nodist_libffi_la_OBJECTS = $(am__objects $(am__objects_18) $(am__objects_19) $(am__objects_20) \ $(am__objects_21) $(am__objects_22) $(am__objects_23) \ $(am__objects_24) $(am__objects_25) $(am__objects_26) \ @@ -234,7 +234,7 @@ Index: libffi/Makefile.in $(am__objects_4) $(am__objects_5) $(am__objects_6) \ $(am__objects_7) $(am__objects_8) $(am__objects_9) \ $(am__objects_10) $(am__objects_11) $(am__objects_12) \ -@@ -190,8 +192,9 @@ am__objects_29 = $(am__objects_1) $(am__ +@@ -182,8 +184,9 @@ am__objects_29 = $(am__objects_1) $(am__ $(am__objects_16) $(am__objects_17) $(am__objects_18) \ $(am__objects_19) $(am__objects_20) $(am__objects_21) \ $(am__objects_22) $(am__objects_23) $(am__objects_24) \ @@ -246,7 +246,7 @@ Index: libffi/Makefile.in libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \ $(nodist_libffi_convenience_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -@@ -489,7 +492,7 @@ MAKEOVERRIDES = +@@ -478,7 +481,7 @@ MAKEOVERRIDES = ACLOCAL_AMFLAGS = $(ACLOCAL_AMFLAGS) -I m4 lib_LTLIBRARIES = libffi.la noinst_LTLIBRARIES = libffi_convenience.la @@ -255,7 +255,7 @@ Index: libffi/Makefile.in src/raw_api.c src/java_raw_api.c src/closures.c pkgconfigdir = $(libdir)/pkgconfig -@@ -503,13 +506,13 @@ nodist_libffi_la_SOURCES = $(am__append_ +@@ -492,13 +495,13 @@ nodist_libffi_la_SOURCES = $(am__append_ $(am__append_18) $(am__append_19) $(am__append_20) \ $(am__append_21) $(am__append_22) $(am__append_23) \ $(am__append_24) $(am__append_25) $(am__append_26) \ @@ -272,7 +272,7 @@ Index: libffi/Makefile.in all: fficonfig.h $(MAKE) $(AM_MAKEFLAGS) all-recursive -@@ -614,12 +617,12 @@ src/$(am__dirstamp): +@@ -603,12 +606,12 @@ src/$(am__dirstamp): src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) diff --git a/patches/sparc-abi-check b/patches/sparc-abi-check index fff315b..1a3f19e 100644 --- a/patches/sparc-abi-check +++ b/patches/sparc-abi-check @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -69,6 +69,11 @@ +@@ -93,6 +93,11 @@ * configure: Regenerate. diff --git a/patches/sparc-v8-aggregate-returns b/patches/sparc-v8-aggregate-returns index 6cbc879..87dfaf7 100644 --- a/patches/sparc-v8-aggregate-returns +++ b/patches/sparc-v8-aggregate-returns @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -50,6 +50,12 @@ +@@ -93,6 +93,12 @@ * configure: Regenerate. diff --git a/patches/stdcall-x86-closure-fix b/patches/stdcall-x86-closure-fix index 5a884e6..7f7eae8 100644 --- a/patches/stdcall-x86-closure-fix +++ b/patches/stdcall-x86-closure-fix @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -201,6 +201,14 @@ +@@ -225,6 +225,14 @@ * testsuite/libffi.call/cls_longdouble.c: Likewise. * testsuite/libffi.call/huge_struct.c: Likewise. @@ -43,7 +43,7 @@ Index: libffi/src/x86/ffi.c =================================================================== --- libffi.orig/src/x86/ffi.c +++ libffi/src/x86/ffi.c -@@ -155,12 +155,10 @@ ffi_status ffi_prep_cif_machdep(ffi_cif +@@ -228,12 +228,10 @@ ffi_status ffi_prep_cif_machdep(ffi_cif switch (cif->rtype->type) { case FFI_TYPE_VOID: @@ -60,7 +60,7 @@ Index: libffi/src/x86/ffitarget.h =================================================================== --- libffi.orig/src/x86/ffitarget.h +++ libffi/src/x86/ffitarget.h -@@ -31,6 +31,9 @@ +@@ -32,6 +32,9 @@ /* ---- System specific configurations ----------------------------------- */ @@ -70,7 +70,7 @@ Index: libffi/src/x86/ffitarget.h #if defined (X86_64) && defined (__i386__) #undef X86_64 #define X86 -@@ -67,16 +70,14 @@ typedef enum ffi_abi { +@@ -70,16 +73,14 @@ typedef enum ffi_abi { FFI_LAST_ABI, /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV @@ -89,7 +89,7 @@ Index: libffi/src/x86/ffitarget.h FFI_SYSV, FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ FFI_LAST_ABI, -@@ -86,7 +87,6 @@ typedef enum ffi_abi { +@@ -89,7 +90,6 @@ typedef enum ffi_abi { FFI_DEFAULT_ABI = FFI_UNIX64 #endif #endif diff --git a/patches/ungccify b/patches/ungccify index 45de771..b8cc2a3 100644 --- a/patches/ungccify +++ b/patches/ungccify @@ -31,7 +31,7 @@ Index: libffi/Makefile.in subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \ -@@ -496,7 +494,7 @@ nodist_libffi_la_SOURCES = $(am__append_ +@@ -495,7 +493,7 @@ nodist_libffi_la_SOURCES = $(am__append_ $(am__append_27) libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) diff --git a/patches/unlikely b/patches/unlikely index 5a220da..b4f6ac8 100644 --- a/patches/unlikely +++ b/patches/unlikely @@ -2,13 +2,16 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -1,3 +1,8 @@ +@@ -17,6 +17,11 @@ + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Anthony Green + Dmitry Nadezhin + + * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. + - 2012-01-23 Andreas Schwab + 2012-01-23 Andreas Schwab * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain Index: libffi/include/ffi_common.h diff --git a/patches/variadic b/patches/variadic index 01120e3..d3e09bc 100644 --- a/patches/variadic +++ b/patches/variadic @@ -572,7 +572,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -17,6 +17,17 @@ +@@ -41,6 +41,17 @@ * configure: Regenerate. diff --git a/patches/win64-struct-args b/patches/win64-struct-args index fd74890..faf6a99 100644 --- a/patches/win64-struct-args +++ b/patches/win64-struct-args @@ -17,7 +17,7 @@ Index: libffi/src/x86/ffi.c =================================================================== --- libffi.orig/src/x86/ffi.c +++ libffi/src/x86/ffi.c -@@ -291,27 +291,8 @@ void ffi_call(ffi_cif *cif, void (*fn)(v +@@ -364,27 +364,8 @@ void ffi_call(ffi_cif *cif, void (*fn)(v { #ifdef X86_WIN64 case FFI_WIN64: @@ -51,7 +51,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -238,6 +238,14 @@ +@@ -262,6 +262,14 @@ * fficonfig.h.in: Regenerate. * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error. diff --git a/patches/win64-underscore b/patches/win64-underscore index 734c182..1193663 100644 --- a/patches/win64-underscore +++ b/patches/win64-underscore @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -134,6 +134,13 @@ +@@ -158,6 +158,13 @@ (.eh_frame): Use FDE_ENCODING. (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE. diff --git a/patches/windows-ce-arm b/patches/windows-ce-arm index 2d00b54..486d8ce 100644 --- a/patches/windows-ce-arm +++ b/patches/windows-ce-arm @@ -50,7 +50,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -17,6 +17,11 @@ +@@ -41,6 +41,11 @@ * configure: Regenerate. diff --git a/patches/x86_pcrel_test b/patches/x86_pcrel_test index c388ad6..ccaaa68 100644 --- a/patches/x86_pcrel_test +++ b/patches/x86_pcrel_test @@ -2,7 +2,7 @@ Index: libffi/ChangeLog =================================================================== --- libffi.orig/ChangeLog +++ libffi/ChangeLog -@@ -76,6 +76,11 @@ +@@ -100,6 +100,11 @@ uintptr_t first. * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise. diff --git a/src/x86/ffi.c b/src/x86/ffi.c index 34f9c66..c5f962c 100644 --- a/src/x86/ffi.c +++ b/src/x86/ffi.c @@ -48,6 +48,13 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; @@ -59,6 +66,16 @@ void ffi_prep_args(char *stack, extended_cif *ecif) ) { *(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*); } @@ -134,6 +151,24 @@ void ffi_prep_args(char *stack, extended_cif *ecif) { 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); @@ -141,7 +176,45 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; } @@ -250,7 +323,7 @@ ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *, #elif defined(X86_WIN32) extern void ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)(void)); + 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)); @@ -295,8 +368,37 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) #elif defined(X86_WIN32) case FFI_SYSV: case FFI_STDCALL: - ffi_call_win32(ffi_prep_args, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); + 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: @@ -623,8 +725,37 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue) #ifdef X86_WIN32 case FFI_SYSV: case FFI_STDCALL: - ffi_call_win32(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); + 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) + cif->abi = abi = FFI_THISCALL; + if (passed_regs < 1 && abi == FFI_THISCALL) + cif->abi = abi = FFI_STDCALL; + ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + } break; #else case FFI_SYSV: diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h index 542e6d4..cfda21c 100644 --- a/src/x86/ffitarget.h +++ b/src/x86/ffitarget.h @@ -1,6 +1,7 @@ /* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 1996-2003, 2010 Red Hat, Inc. - Copyright (C) 2008 Free Software Foundation, Inc. + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003, 2010 Red Hat, Inc. + Copyright (C) 2008 Free Software Foundation, Inc. Target configuration macros for x86 and x86-64. @@ -67,6 +68,8 @@ typedef enum ffi_abi { #ifdef X86_WIN32 FFI_SYSV, FFI_STDCALL, + FFI_THISCALL, + FFI_FASTCALL, FFI_LAST_ABI, /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV diff --git a/src/x86/win32.S b/src/x86/win32.S index 34ec0fd..e472d62 100644 --- a/src/x86/win32.S +++ b/src/x86/win32.S @@ -45,6 +45,7 @@ _TEXT SEGMENT ffi_call_win32 PROC NEAR, ffi_prep_args : NEAR PTR DWORD, ecif : NEAR PTR DWORD, + cif_abi : DWORD, cif_bytes : DWORD, cif_flags : DWORD, rvalue : NEAR PTR DWORD, @@ -64,6 +65,19 @@ ffi_call_win32 PROC NEAR, ;; Return stack to previous state and call the function add esp, 8 + ;; Handle thiscall and fastcall + cmp cif_abi, 3 ;; FFI_THISCALL + jz do_thiscall + cmp cif_abi, 4 ;; FFI_FASTCALL + jnz do_stdcall + mov ecx, DWORD PTR [esp] + mov edx, DWORD PTR [esp+4] + add esp, 8 + jmp do_stdcall +do_thiscall: + mov ecx, DWORD PTR [esp] + add esp, 4 +do_stdcall: call fn ;; cdecl: we restore esp in the epilogue, so there's no need to @@ -405,7 +419,7 @@ _ffi_call_win32: movl %esp,%ebp .LCFI1: # Make room for all of the new args. - movl 16(%ebp),%ecx + movl 20(%ebp),%ecx subl %ecx,%esp movl %esp,%eax @@ -417,19 +431,34 @@ _ffi_call_win32: # Return stack to previous state and call the function addl $8,%esp - + + # Handle fastcall and thiscall + cmpl $3, 16(%ebp) # FFI_THISCALL + jz .do_thiscall + cmpl $4, 16(%ebp) # FFI_FASTCALL + jnz .do_fncall + movl (%esp), %ecx + movl 4(%esp), %edx + addl $8, %esp + jmp .do_fncall +.do_thiscall: + movl (%esp), %ecx + addl $4, %esp + +.do_fncall: + # FIXME: Align the stack to a 128-bit boundary to avoid # potential performance hits. - call *28(%ebp) + call *32(%ebp) # stdcall functions pop arguments off the stack themselves # Load %ecx with the return type code - movl 20(%ebp),%ecx + movl 24(%ebp),%ecx # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) + cmpl $0,28(%ebp) jne 0f # Even if there is no space for the return value, we are @@ -488,50 +517,50 @@ _ffi_call_win32: .Lretint: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx movl %eax,0(%ecx) jmp .Lepilogue .Lretfloat: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx fstps (%ecx) jmp .Lepilogue .Lretdouble: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx fstpl (%ecx) jmp .Lepilogue .Lretlongdouble: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx fstpt (%ecx) jmp .Lepilogue .Lretint64: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx movl %eax,0(%ecx) movl %edx,4(%ecx) jmp .Lepilogue .Lretstruct1b: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx movb %al,0(%ecx) jmp .Lepilogue .Lretstruct2b: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx movw %ax,0(%ecx) jmp .Lepilogue .Lretstruct4b: # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx + movl 28(%ebp),%ecx movl %eax,0(%ecx) jmp .Lepilogue diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in index 496d5bf..b249542 100644 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@ -38,14 +38,6 @@ subdir = testsuite DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_cc_maxopt.m4 \ - $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ - $(top_srcdir)/m4/ax_check_compiler_flags.m4 \ - $(top_srcdir)/m4/ax_compiler_vendor.m4 \ - $(top_srcdir)/m4/ax_configure_args.m4 \ - $(top_srcdir)/m4/ax_enable_builddir.m4 \ - $(top_srcdir)/m4/ax_gcc_archflag.m4 \ - $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ @@ -125,7 +117,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -146,7 +137,6 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ -ax_enable_builddir_sed = @ax_enable_builddir_sed@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/testsuite/libffi.call/fastthis1_win32.c b/testsuite/libffi.call/fastthis1_win32.c new file mode 100644 index 0000000..b3c4c73 --- /dev/null +++ b/testsuite/libffi.call/fastthis1_win32.c @@ -0,0 +1,50 @@ +/* Area: ffi_call + Purpose: Check fastcall fct call on X86_WIN32 systems. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ + +#include "ffitest.h" + +static size_t __attribute__((fastcall)) my_fastcall_f(char *s, float a) +{ + return (size_t) ((int) strlen(s) + (int) a); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + float v2; + args[0] = &ffi_type_pointer; + args[1] = &ffi_type_float; + values[0] = (void*) &s; + values[1] = (void*) &v2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + v2 = 0.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + v2 = -1.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 6); + + s = "1234567890123456789012345"; + v2 = 1.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 26); + + printf("fastcall fct1 tests passed\n"); + exit(0); +} diff --git a/testsuite/libffi.call/fastthis2_win32.c b/testsuite/libffi.call/fastthis2_win32.c new file mode 100644 index 0000000..f148a12 --- /dev/null +++ b/testsuite/libffi.call/fastthis2_win32.c @@ -0,0 +1,50 @@ +/* Area: ffi_call + Purpose: Check fastcall fct call on X86_WIN32 systems. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ + +#include "ffitest.h" + +static size_t __attribute__((fastcall)) my_fastcall_f(float a, char *s) +{ + return (size_t) ((int) strlen(s) + (int) a); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + float v2; + args[1] = &ffi_type_pointer; + args[0] = &ffi_type_float; + values[1] = (void*) &s; + values[0] = (void*) &v2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + v2 = 0.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + v2 = -1.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 6); + + s = "1234567890123456789012345"; + v2 = 1.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 26); + + printf("fastcall fct2 tests passed\n"); + exit(0); +} diff --git a/testsuite/libffi.call/fastthis3_win32.c b/testsuite/libffi.call/fastthis3_win32.c new file mode 100644 index 0000000..5cf82bb --- /dev/null +++ b/testsuite/libffi.call/fastthis3_win32.c @@ -0,0 +1,56 @@ +/* Area: ffi_call + Purpose: Check fastcall f call on X86_WIN32 systems. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ + +#include "ffitest.h" + +static size_t __attribute__((fastcall)) my_fastcall_f(float a, char *s, int i) +{ + return (size_t) ((int) strlen(s) + (int) a + i); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + int v1; + float v2; + args[2] = &ffi_type_sint; + args[1] = &ffi_type_pointer; + args[0] = &ffi_type_float; + values[2] = (void*) &v1; + values[1] = (void*) &s; + values[0] = (void*) &v2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 3, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + v1 = 1; + v2 = 0.0; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 2); + + s = "1234567"; + v2 = -1.0; + v1 = -2; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 4); + + s = "1234567890123456789012345"; + v2 = 1.0; + v1 = 2; + ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); + CHECK(rint == 28); + + printf("fastcall fct3 tests passed\n"); + exit(0); +} diff --git a/testsuite/libffi.call/many2_win32.c b/testsuite/libffi.call/many2_win32.c new file mode 100644 index 0000000..4adbe4d --- /dev/null +++ b/testsuite/libffi.call/many2_win32.c @@ -0,0 +1,63 @@ +/* Area: ffi_call + Purpose: Check stdcall many call on X86_WIN32 systems. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ + +#include "ffitest.h" +#include + +static float __attribute__((fastcall)) fastcall_many(float f1, + float f2, + float f3, + float f4, + float f5, + float f6, + float f7, + float f8, + float f9, + float f10, + float f11, + float f12, + float f13) +{ + return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[13]; + void *values[13]; + float fa[13]; + float f, ff; + unsigned long ul; + + for (ul = 0; ul < 13; ul++) + { + args[ul] = &ffi_type_float; + values[ul] = &fa[ul]; + fa[ul] = (float) ul; + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 13, + &ffi_type_float, args) == FFI_OK); + + ff = fastcall_many(fa[0], fa[1], + fa[2], fa[3], + fa[4], fa[5], + fa[6], fa[7], + fa[8], fa[9], + fa[10], fa[11], fa[12]); + + ffi_call(&cif, FFI_FN(fastcall_many), &f, values); + + if (f - ff < FLT_EPSILON) + printf("fastcall many arg tests ok!\n"); + else + CHECK(0); + exit(0); +} diff --git a/testsuite/libffi.call/strlen2_win32.c b/testsuite/libffi.call/strlen2_win32.c new file mode 100644 index 0000000..b348e43 --- /dev/null +++ b/testsuite/libffi.call/strlen2_win32.c @@ -0,0 +1,45 @@ +/* Area: ffi_call + Purpose: Check fastcall strlen call on X86_WIN32 systems. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ + +#include "ffitest.h" + +static size_t __attribute__((fastcall)) my_fastcall_strlen(char *s) +{ + return (strlen(s)); +} + +int d +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + args[0] = &ffi_type_pointer; + values[0] = (void*) &s; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values); + CHECK(rint == 7); + + s = "1234567890123456789012345"; + ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values); + CHECK(rint == 25); + + printf("fastcall strlen tests passed\n"); + exit(0); +} diff --git a/testsuite/libffi.call/struct1_win32.c b/testsuite/libffi.call/struct1_win32.c new file mode 100644 index 0000000..4a7eb94 --- /dev/null +++ b/testsuite/libffi.call/struct1_win32.c @@ -0,0 +1,65 @@ +/* Area: ffi_call + Purpose: Check structures with fastcall/thiscall convention. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +#include "ffitest.h" + +typedef struct +{ + unsigned char uc; + double d; + unsigned int ui; +} test_structure_1; + +static __attribute__ ((fastcall)) test_structure_1 struct1(test_structure_1 ts) +{ + ts.uc++; + ts.d--; + ts.ui++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[4]; + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uchar; + ts1_type_elements[1] = &ffi_type_double; + ts1_type_elements[2] = &ffi_type_uint; + ts1_type_elements[3] = NULL; + + test_structure_1 ts1_arg; + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.uc = '\x01'; + ts1_arg.d = 3.14159; + ts1_arg.ui = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui == 556); + CHECK(ts1_result->d == 3.14159 - 1); + + free (ts1_result); + exit(0); +} diff --git a/testsuite/libffi.call/struct2_win32.c b/testsuite/libffi.call/struct2_win32.c new file mode 100644 index 0000000..2bfbdc5 --- /dev/null +++ b/testsuite/libffi.call/struct2_win32.c @@ -0,0 +1,67 @@ +/* Area: ffi_call + Purpose: Check structures in fastcall/stdcall function + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +#include "ffitest.h" + +typedef struct +{ + double d1; + double d2; +} test_structure_2; + +static test_structure_2 __attribute__ ((fastcall)) struct2(test_structure_2 ts) +{ + ts.d1--; + ts.d2--; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + test_structure_2 ts2_arg; + ffi_type ts2_type; + ffi_type *ts2_type_elements[3]; + ts2_type.size = 0; + ts2_type.alignment = 0; + ts2_type.type = FFI_TYPE_STRUCT; + ts2_type.elements = ts2_type_elements; + ts2_type_elements[0] = &ffi_type_double; + ts2_type_elements[1] = &ffi_type_double; + ts2_type_elements[2] = NULL; + + + /* This is a hack to get a properly aligned result buffer */ + test_structure_2 *ts2_result = + (test_structure_2 *) malloc (sizeof(test_structure_2)); + + args[0] = &ts2_type; + values[0] = &ts2_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, &ts2_type, args) == FFI_OK); + + ts2_arg.d1 = 5.55; + ts2_arg.d2 = 6.66; + + printf ("%g\n", ts2_arg.d1); + printf ("%g\n", ts2_arg.d2); + + ffi_call(&cif, FFI_FN(struct2), ts2_result, values); + + printf ("%g\n", ts2_result->d1); + printf ("%g\n", ts2_result->d2); + + CHECK(ts2_result->d1 == 5.55 - 1); + CHECK(ts2_result->d2 == 6.66 - 1); + + free (ts2_result); + exit(0); +} -- 2.7.4