Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (21 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28dir.info
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/libffi/ChangeLog

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1 2003-02-05  Release Manager
    2 
    3         * GCC 3.2.2 Released.
     12004-02-14  Release Manager
     2
     3        * GCC 3.3.3 Released.
     4
     52003-10-16  Release Manager
     6
     7        * GCC 3.3.2 Released.
     8
     92003-09-09  Alan Modra  <amodra@bigpond.net.au>
     10
     11        * configure: Regenerate.
     12
     132003-08-08  Kean Johnston  <jkj@sco.com>
     14
     15        * configure.in: Add support for sco3.2v5.0*
     16        * configure: Regenerated
     17
     182003-08-04  Release Manager
     19
     20        * GCC 3.3.1 Released.
     21
     222003-08-04  Release Manager
     23
     24        * GCC 3.3.1 Released.
     25
     262003-07-11  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
     27
     28        * README: Note that libffi is not part of GCC.  Update the project
     29        URL and status.
     30
     312003-05-13  Release Manager
     32
     33        * GCC 3.3 Released.
     34
     352003-05-13  Release Manager
     36
     37        * GCC 3.3 Released.
     38
     392003-05-13  Release Manager
     40
     41        * GCC 3.3 Released.
     42
     432003-05-07  Jeff Sturm  <jsturm@one-point.com>
     44
     45        Fixes PR bootstrap/10656
     46        * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler
     47        support for .register pseudo-op.
     48        * src/sparc/v8.S: Use it.
     49        * fficonfig.h.in: Rebuilt.
     50        * configure: Rebuilt.
     51
     522003-04-04  Loren J. Rittle  <ljrittle@acm.org>
     53
     54        * include/Makefile.in: Regenerate.
     55
     562003-03-22  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
     57
     58        * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32
     59        bit mode.
     60        * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV):
     61        Receive closure pointer through parameter, read args using
     62        __builtin_dwarf_cfa.
     63        (FFI_INIT_TRAMPOLINE): Send closure reference through eax.
     64
     652003-02-06  Andreas Tobler <a.tobler@schweiz.ch>
     66
     67        * libffi/src/powerpc/darwin_closure.S:
     68        Fix alignement bug, allocate 8 bytes for the result.
     69        * libffi/src/powerpc/aix_closure.S:
     70        Likewise.
     71        * libffi/src/powerpc/ffi_darwin.c:
     72        Update stackframe description for aix/darwin_closure.S.
     73
     742003-01-31  Christian Cornelssen  <ccorn@cs.tu-berlin.de>,
     75            Andreas Schwab  <schwab@suse.de>
     76
     77        * configure.in: Adjust command to source config-ml.in to account
     78        for changes to the libffi_basedir definition.
     79        (libffi_basedir): Remove ${srcdir} from value and include trailing
     80        slash if nonempty.
     81
     82        * configure: Regenerate.
    483
    5842003-01-29  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
     
    786        * src/powerpc/ppc_closure.S: Recode to fit shared libs.
    887
    9 2002-11-19  Release Manager
    10 
    11         * GCC 3.2.1 Released.
    12 
    13 2002-11-19  Release Manager
    14 
    15         * GCC 3.2.1 Released.
    16 
    17 2002-11-18  Release Manager
    18 
    19         * GCC 3.2.1 Released.
    20 
    21 2002-10-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
     882003-01-28  Andrew Haley  <aph@redhat.com>
     89
     90        * include/ffi.h.in: Enable FFI_CLOSURES for x86_64.
     91        * src/x86/ffi64.c (ffi_prep_closure): New.
     92        (ffi_closure_UNIX64_inner): New.
     93        * src/x86/unix64.S (ffi_closure_UNIX64): New.
     94
     952003-01-22  Andrew Haley  <aph@redhat.com>
     96
     97        * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to
     98        unwind info.
     99
     1002003-01-21  Andreas Tobler  <a.tobler@schweiz.ch>
     101
     102        * src/powerpc/darwin.S: Add unwind info.
     103        * src/powerpc/darwin_closure.S: Likewise.
     104
     1052003-01-14  Andrew Haley  <aph@redhat.com>
     106
     107        * src/x86/ffi64.c (ffi_prep_args): Check for void retval.
     108        (ffi_prep_cif_machdep): Likewise.
     109        * src/x86/unix64.S: Add unwind info.
     110
     1112003-01-14  Andreas Jaeger  <aj@suse.de>
     112
     113        * src/ffitest.c (main): Only use ffi_closures if those are
     114        supported.
     115
     1162003-01-13  Andreas Tobler <a.tobler@schweiz.ch>
     117
     118        * libffi/src/ffitest.c
     119        add closure testcases
     120
     1212003-01-13 Kevin B. Hendricks <khendricks@ivey.uwo.ca>
     122
     123        * libffi/src/powerpc/ffi.c
     124        fix alignment bug for float (4 byte aligned iso 8 byte)
     125
     1262003-01-03  Jeff Sturm  <jsturm@one-point.com>
     127
     128        * include/ffi.h.in: Add closure defines for SPARC, SPARC64.
     129        * src/ffitest.c (main): Use static storage for closure.
     130        * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New.
     131        * src/sparc/v8.S (ffi_closure_v8): New.
     132        * src/sparc/v9.S (ffi_closure_v9): New.
     133
     1342002-11-10  Ranjit Mathew <rmathew@hotmail.com>
     135
     136        * include/ffi.h.in: Added FFI_STDCALL ffi_type
     137          enumeration for X86_WIN32.
     138        * src/x86/win32.S: Added ffi_call_STDCALL function
     139          definition.
     140        * src/x86/ffi.c (ffi_call/ffi_raw_call): Added
     141          switch cases for recognising FFI_STDCALL and
     142          calling ffi_call_STDCALL if target is X86_WIN32.
     143        * src/ffitest.c (my_stdcall_strlen/stdcall_many):
     144          stdcall versions of the "my_strlen" and "many"
     145          test functions (for X86_WIN32).
     146          Added test cases to test stdcall invocation using
     147          these functions.
     148
     1492002-11-27  Ulrich Weigand  <uweigand@de.ibm.com>
     150
     151        * src/s390/sysv.S (.eh_frame section): Make section read-only.
     152
     1532002-11-26  Jim Wilson  <wilson@redhat.com>
     154
     155        * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64.
     156
     1572002-11-15  Ulrich Weigand  <uweigand@de.ibm.com>
     158
     159        * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding.
     160
     1612002-11-11  DJ Delorie  <dj@redhat.com>
     162
     163        * configure.in: Look for common files in the right place.
     164
     1652002-10-08  Ulrich Weigand  <uweigand@de.ibm.com>
     166
     167        * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret
     168        raw data as _Jv_word values, not ffi_raw.
     169        (ffi_java_ptrarray_to_raw): Likewise.
     170        (ffi_java_rvalue_to_raw): New function.
     171        (ffi_java_raw_call): Call it.
     172        (ffi_java_raw_to_rvalue): New function.
     173        (ffi_java_translate_args): Call it.
     174        * src/ffitest.c (closure_test_fn): Interpret return value
     175        as ffi_arg, not int.
     176        * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing
     177        FFI_TYPE_POINTER case.
     178        (ffi_closure_helper_SYSV): Likewise.  Also, assume return
     179        values extended to word size.
     180
     1812002-10-02  Andreas Jaeger  <aj@suse.de>
     182
     183        * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output.
     184
     1852002-10-01  Bo Thorsen  <bo@smetana.suse.de>
     186
     187        * include/ffi.h.in: Fix i386 win32 compilation.
     188
     1892002-09-30  Ulrich Weigand  <uweigand@de.ibm.com>
     190
     191        * configure.in: Add s390x-*-linux-* target.
     192        * configure: Regenerate.
     193        * include/ffi.h.in: Define S390X for s390x targets.
     194        (FFI_CLOSURES): Define for s390/s390x.
     195        (FFI_TRAMPOLINE_SIZE): Likewise.
     196        (FFI_NATIVE_RAW_API): Likewise.
     197        * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
     198        * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
     199        * src/s390/ffi.c: Major rework of existing code.  Add support for
     200        s390x targets.  Add closure support.
     201        * src/s390/sysv.S: Likewise.
     202
     2032002-09-29  Richard Earnshaw  <rearnsha@arm.com>
     204
     205        * src/arm/sysv.S: Fix typo.
     206
     2072002-09-28  Richard Earnshaw  <rearnsha@arm.com>
     208
     209        * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor
     210        has defined __USER_LABEL_PREFIX__, then use it in CNAME.
     211        (ffi_call_SYSV): Handle soft-float.
     212
     2132002-09-27  Bo Thorsen  <bo@suse.de>
     214
     215        * include/ffi.h.in: Fix multilib x86-64 support.
     216
     2172002-09-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
    22218
    23219        * Makefile.am (all-multi): Fix multilib parallel build.
    24220
    25 2002-08-14  Release Manager
    26 
    27         * GCC 3.2 Released.
    28 
    29 2002-07-25  Release Manager
    30 
    31         * GCC 3.1.1 Released.
    32 
    33 2002-05-28  Bo Thorsen  <bo@suse.de>
    34 
    35         * src/x86/ffi.c (ffi_prep_incoming_args_SYSV): Remove avn
    36         here too.
     2212002-07-19  Kaz Kojima  <kkojima@gcc.gnu.org>
     222
     223        * configure.in (sh[34]*-*-linux*): Add brackets.
     224        * configure: Regenerate.
     225
     2262002-07-18  Kaz Kojima  <kkojima@gcc.gnu.org>
     227
     228        * Makefile.am: Add SH support.
     229        * Makefile.in: Regenerate.
     230        * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target.
     231        * configure: Regenerate.
     232        * include/ffi.h.in: Add SH support.
     233        * src/sh/ffi.c: New file.
     234        * src/sh/sysv.S: New file.
     235        * src/types.c: Add SH support.
     236
     2372002-07-16  Bo Thorsen  <bo@suse.de>
     238
     239        * src/x86/ffi64.c: New file that adds x86-64 support.
     240        * src/x86/unix64.S: New file that handles argument setup for
     241        x86-64.
     242        * src/x86/sysv.S: Don't use this on x86-64.
     243        * src/x86/ffi.c: Don't use this on x86-64.
     244        Remove unused vars.
     245        * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
     246        for x86-64.
     247        * src/ffitest.c (struct6): New test that tests a special case in
     248        the x86-64 ABI.
     249        (struct7): Likewise.
     250        (struct8): Likewise.
     251        (struct9): Likewise.
     252        (closure_test_fn): Silence warning about this when it's not used.
     253        (main): Add the new tests.
     254        (main): Fix a couple of wrong casts and silence some compiler warnings.
     255        * include/ffi.h.in: Add x86-64 ABI definition.
     256        * fficonfig.h.in: Regenerate.
     257        * Makefile.am: Add x86-64 support.
     258        * configure.in: Likewise.
     259        * Makefile.in: Regenerate.
     260        * configure: Likewise.
     261
     2622002-06-24  Bo Thorsen  <bo@suse.de>
     263
     264        * src/types.c: Merge settings for similar architectures.
     265        Add x86-64 sizes and alignments.
     266
     2672002-06-23  Bo Thorsen  <bo@suse.de>
     268
     269        * src/arm/ffi.c (ffi_prep_args): Remove unused vars.
     270        * src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
     271        * src/mips/ffi.c (ffi_prep_args): Likewise.
     272        * src/m68k/ffi.c (ffi_prep_args): Likewise.
     273
     2742002-07-18  H.J. Lu  (hjl@gnu.org)
     275
     276        * Makefile.am (TARGET_SRC_MIPS_LINUX): New.
     277        (libffi_la_SOURCES): Support MIPS_LINUX.
     278        (libffi_convenience_la_SOURCES): Likewise.
     279        * Makefile.in: Regenerated.
     280
     281        * configure.in (mips64*-*): Skip.
     282        (mips*-*-linux*): New.
     283        * configure: Regenerated.
     284
     285        * src/mips/ffi.c: Include <sgidefs.h>.
     286
     2872002-06-06  Ulrich Weigand  <uweigand@de.ibm.com>
     288
     289        * src/s390/sysv.S: Save/restore %r6.  Add DWARF-2 unwind info.
    37290
    382912002-05-27  Roger Sayle  <roger@eyesopen.com>
     
    45298        fix formatting.
    46299
    47 2002-05-14  Release Manager
    48 
    49         * GCC 3.1 Released.
    50 
    51 2002-05-14  Release Manager
    52 
    53         * GCC 3.1 Released.
     3002002-05-13  Andreas Tobler  <a.tobler@schweiz.ch>
     301
     302        * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at
     303        beginning of function (for older apple cc).
    54304
    553052002-05-08  Alexandre Oliva  <aoliva@redhat.com>
     
    59309        * configure: Rebuilt.
    60310
     3112002-05-05  Jason Thorpe  <thorpej@wasabisystems.com>
     312
     313        * configure.in (sparc64-*-netbsd*): Add target.
     314        (sparc-*-netbsdelf*): Likewise.
     315        * configure: Regenerate.
     316
    613172002-04-28  David S. Miller  <davem@redhat.com>
    62318
    63319        * configure.in, configure: Fix SPARC test in previous change.
     320
     3212002-04-29  Gerhard Tonn  <GerhardTonn@swol.de>
     322
     323        * Makefile.am: Add Linux for S/390 support.
     324        * Makefile.in: Regenerate.
     325        * configure.in: Add Linux for S/390 support.
     326        * configure: Regenerate.
     327        * include/ffi.h.in: Add Linux for S/390 support.
     328        * src/s390/ffi.c: New file from libffi CVS tree.
     329        * src/s390/sysv.S: New file from libffi CVS tree.
    64330
    653312002-04-28  Jakub Jelinek  <jakub@redhat.com>
     
    85351        * src/sparc/v8.S: Make .eh_frame dependent on target word size.
    86352
     3532002-04-06  Jason Thorpe  <thorpej@wasabisystems.com>
     354
     355        * configure.in (alpha*-*-netbsd*): Add target.
     356        * configure: Regenerate.
     357
    873582002-04-04  Jeff Sturm  <jsturm@one-point.com>
    88359
    89360        * src/sparc/v8.S: Add unwind info.
    90361        * src/sparc/v9.S: Likewise.
    91 
    92 2002-04-01  Loren J. Rittle  <ljrittle@acm.org>
    93 
    94         * configure.in: Enable alpha*-*-freebsd*.
    95         * configure: Rebuilt.
    96362
    973632002-03-30  Krister Walfridsson  <cato@df.lth.se>
     
    105371        * src/mips/n32.s: Delete
    106372        * src/mips/o32.s: Delete
     373
     3742002-03-21  Loren J. Rittle  <ljrittle@acm.org>
     375
     376        * configure.in: Enable alpha*-*-freebsd*.
     377        * configure: Rebuilt.
    107378
    1083792002-03-17  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
     
    2024732001-06-06  Andrew Haley  <aph@redhat.com>
    203474
    204         * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
     475        * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
    205476
    2064772001-06-03  Andrew Haley  <aph@redhat.com>
    207478
    208         * src/alpha/osf.S: Add unwind info.
    209         * src/powerpc/sysv.S: Add unwind info.
    210         * src/powerpc/ppc_closure.S: Likewise.
     479        * src/alpha/osf.S: Add unwind info.
     480        * src/powerpc/sysv.S: Add unwind info.
     481        * src/powerpc/ppc_closure.S: Likewise.
    211482
    2124832000-05-31  Jeff Sturm  <jsturm@one-point.com>
     
    367638        * Makefile.in: Rebuilt.
    368639        * ltconfig (extra_compiler_flags, extra_compiler_flags_value):
    369         New variables. Set for gcc using -print-multi-lib. Export them
    370         to libtool.
    371         (sparc64-*-linux-gnu*): Use libsuff 64 for search paths.
    372         * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options
    373         for -shared links.
    374         (extra_compiler_flags_value, extra_compiler_flags): Check these
    375         for extra compiler options which need to be passed down in
    376         compiler_flags.
     640        New variables. Set for gcc using -print-multi-lib. Export them
     641        to libtool.
     642        (sparc64-*-linux-gnu*): Use libsuff 64 for search paths.
     643        * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options
     644        for -shared links.
     645        (extra_compiler_flags_value, extra_compiler_flags): Check these
     646        for extra compiler options which need to be passed down in
     647        compiler_flags.
    377648
    3786492000-04-16  Anthony Green  <green@redhat.com>
     
    3836542000-04-14  Jakub Jelinek  <jakub@redhat.com>
    384655
    385         * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds.
     656        * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds.
    386657        Set SPARC FFI_DEFAULT_ABI based on SPARC64 define.
    387658        * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args.
     
    493764        * configure.in: Change version to 2.00-beta.
    494765
    495         * fficonfig.h.in: Rebuilt.
     766        * fficonfig.h.in: Rebuilt.
    496767        * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
    497768
  • branches/GNU/src/gcc/libffi/ChangeLog.libgcj

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
     12003-02-20  Alexandre Oliva  <aoliva@redhat.com>
     2
     3        * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to
     4        config.status.
     5        * configure: Rebuilt.
     6
    172002-01-27  Alexandre Oliva  <aoliva@redhat.com>
    28
  • branches/GNU/src/gcc/libffi/Makefile.am

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    99                src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
    1010                src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
     11                src/x86/ffi64.c src/x86/unix64.S \
    1112                src/alpha/ffi.c src/alpha/osf.S \
    1213                src/m68k/ffi.c src/m68k/sysv.S \
     
    1617                src/powerpc/darwin.S src/powerpc/aix.S \
    1718                src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
    18                 src/arm/ffi.c src/arm/sysv.S
     19                src/arm/ffi.c src/arm/sysv.S \
     20                src/s390/ffi.c src/s390/sysv.S \
     21                src/sh/ffi.c src/sh/sysv.S
    1922
    2023VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
     
    8487
    8588TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
     89TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
    8690TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
    8791TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
     
    9599TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
    96100TARGET_SRC_ARM =  src/arm/sysv.S src/arm/ffi.c
     101TARGET_SRC_S390 =  src/s390/sysv.S src/s390/ffi.c
     102TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
     103TARGET_SRC_SH =  src/sh/sysv.S src/sh/ffi.c
    97104
    98105##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
     
    104111libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
    105112endif
     113if MIPS_LINUX
     114libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
     115libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
     116endif
    106117if MIPS_SGI
    107118libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
     
    147158libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
    148159libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
     160endif
     161if S390
     162libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
     163libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
     164endif
     165if X86_64
     166libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
     167libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
     168endif
     169if SH
     170libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
     171libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
    149172endif
    150173
  • branches/GNU/src/gcc/libffi/Makefile.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    9292                src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
    9393                src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
     94                src/x86/ffi64.c src/x86/unix64.S \
    9495                src/alpha/ffi.c src/alpha/osf.S \
    9596                src/m68k/ffi.c src/m68k/sysv.S \
     
    99100                src/powerpc/darwin.S src/powerpc/aix.S \
    100101                src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
    101                 src/arm/ffi.c src/arm/sysv.S
     102                src/arm/ffi.c src/arm/sysv.S \
     103                src/s390/ffi.c src/s390/sysv.S \
     104                src/sh/ffi.c src/sh/sysv.S
    102105
    103106
     
    163166
    164167TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
     168TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
    165169TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
    166170TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
     
    174178TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
    175179TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
     180TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c
     181TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
     182TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c
    176183
    177184libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
     
    179186
    180187@MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
     188@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
    181189@MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
    182190@X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
     
    190198@POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
    191199@ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
     200@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
     201@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
     202@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
    192203@MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
     204@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
    193205@MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
    194206@X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
     
    202214@POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
    203215@ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
     216@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
     217@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
     218@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
    204219
    205220AM_CFLAGS = -fexceptions
     
    209224INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
    210225ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    211 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
     226mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs
    212227CONFIG_HEADER = fficonfig.h
    213228CONFIG_CLEAN_FILES =
     
    221236libffi_convenience_la_LDFLAGS =
    222237libffi_convenience_la_LIBADD =
    223 @POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
    224 @POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
    225 @POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
    226 @POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
    227238@ALPHA_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
    228239@ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     
    235246@MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
    236247@MIPS_GCC_TRUE@src/mips/n32.lo
     248@S390_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     249@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     250@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
     251@M68K_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     252@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     253@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
     254@X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     255@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     256@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
     257@POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
     258@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     259@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
     260@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
     261@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
     262@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     263@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo
    237264@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
    238265@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
    239266@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
    240 @M68K_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    241 @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    242 @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
     267@X86_64_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
     268@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     269@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
     270@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo
    243271@SPARC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
    244272@SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     
    249277@POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
    250278@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo
    251 @X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    252 @X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    253 @X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
    254 @ARM_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    255 @ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    256 @ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
     279@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
     280@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     281@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
     282@MIPS_SGI_TRUE@src/mips/n32.lo
    257283@POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
    258284@POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
     
    260286@POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \
    261287@POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
    262 @MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
    263 @MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
    264 @MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
    265 @MIPS_SGI_TRUE@src/mips/n32.lo
     288@ARM_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     289@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     290@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
    266291libffi_la_LIBADD =
     292@SH_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
     293@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
     294@SH_TRUE@src/sh/ffi.lo
     295@IA64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     296@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     297@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
     298@X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
     299@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
     300@X86_TRUE@src/x86/sysv.lo
    267301@POWERPC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    268302@POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    269303@POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
    270304@POWERPC_TRUE@src/powerpc/ppc_closure.lo
    271 @ALPHA_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    272 @ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    273 @ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
    274 @IA64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    275 @IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    276 @IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
    277 @MIPS_GCC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    278 @MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    279 @MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
    280 @X86_WIN32_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    281 @X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    282 @X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
    283 @M68K_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    284 @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    285 @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
     305@MIPS_LINUX_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     306@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     307@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo
    286308@SPARC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    287309@SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     
    291313@POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \
    292314@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo
    293 @X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
    294 @X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
    295 @X86_TRUE@src/x86/sysv.lo
     315@MIPS_SGI_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     316@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     317@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
    296318@ARM_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
    297319@ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
    298320@ARM_TRUE@src/arm/ffi.lo
     321@ALPHA_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     322@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     323@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
     324@MIPS_GCC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     325@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     326@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
     327@S390_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     328@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     329@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
     330@M68K_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     331@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     332@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
     333@X86_WIN32_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     334@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     335@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
     336@X86_64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
     337@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
     338@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \
     339@X86_64_TRUE@src/x86/sysv.lo
    299340@POWERPC_DARWIN_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    300341@POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    301342@POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \
    302343@POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
    303 @MIPS_SGI_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
    304 @MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
    305 @MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
    306344noinst_PROGRAMS =  ffitest$(EXEEXT)
    307345PROGRAMS =  $(noinst_PROGRAMS)
     
    579617        $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \
    580618           $(distdir)/src/m68k $(distdir)/src/mips \
    581            $(distdir)/src/powerpc $(distdir)/src/sparc \
    582            $(distdir)/src/x86
     619           $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \
     620           $(distdir)/src/sparc $(distdir)/src/x86
    583621        @for file in $(DISTFILES); do \
    584622          if test -f $$file; then d=.; else d=$(srcdir); fi; \
  • branches/GNU/src/gcc/libffi/README

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1 README for libffi-2.00
     1This directory contains the libffi package, which is not part of GCC but
     2shipped with GCC as convenience.
     3
     4Status
     5======
    26
    37libffi-2.00 has not been released yet! This is a development snapshot!
    48
    5 libffi-1.20 was released on [SOME FUTURE DAY]. Check the libffi web
    6 page for updates: <URL:http://sourceware.cygnus.com/libffi/>.
     9libffi-1.20 was released on October 5, 1998. Check the libffi web
     10page for updates: <URL:http://sources.redhat.com/libffi/>.
    711
    812
  • branches/GNU/src/gcc/libffi/configure

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    634634if test "${srcdir}" = "."; then
    635635  if test "${with_target_subdir}" != "."; then
    636     libffi_basedir="${srcdir}/${with_multisrctop}.."
     636    libffi_basedir="${with_multisrctop}../"
    637637  else
    638     libffi_basedir="${srcdir}/${with_multisrctop}"
     638    libffi_basedir="${with_multisrctop}"
    639639  fi
    640640else
    641   libffi_basedir="${srcdir}"
    642 fi
    643 
     641  libffi_basedir=
     642fi
    644643
    645644ac_aux_dir=
    646 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
     645for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do
    647646  if test -f $ac_dir/install-sh; then
    648647    ac_aux_dir=$ac_dir
     
    656655done
    657656if test -z "$ac_aux_dir"; then
    658   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
     657  { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; }
    659658fi
    660659ac_config_guess=$ac_aux_dir/config.guess
    661660ac_config_sub=$ac_aux_dir/config.sub
    662661ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
     662
    663663
    664664
     
    12391239
    12401240hpux10.20*|hpux11*)
    1241   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
    1242   lt_cv_file_magic_cmd=/usr/bin/file
    1243   lt_cv_file_magic_test_file=/usr/lib/libc.sl
     1241  case $host_cpu in
     1242  hppa*)
     1243    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
     1244    lt_cv_file_magic_cmd=/usr/bin/file
     1245    lt_cv_file_magic_test_file=/usr/lib/libc.sl
     1246    ;;
     1247  ia64*)
     1248    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
     1249    lt_cv_file_magic_cmd=/usr/bin/file
     1250    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     1251    ;;
     1252  esac
    12441253  ;;
    12451254
     
    13311340
    13321341echo $ac_n "checking for object suffix""... $ac_c" 1>&6
    1333 echo "configure:1334: checking for object suffix" >&5
     1342echo "configure:1343: checking for object suffix" >&5
    13341343if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
    13351344  echo $ac_n "(cached) $ac_c" 1>&6
     
    13371346  rm -f conftest*
    13381347echo 'int i = 1;' > conftest.$ac_ext
    1339 if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1348if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    13401349  for ac_file in conftest.*; do
    13411350    case $ac_file in
     
    13571366
    13581367echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
    1359 echo "configure:1360: checking for executable suffix" >&5
     1368echo "configure:1369: checking for executable suffix" >&5
    13601369if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
    13611370  echo $ac_n "(cached) $ac_c" 1>&6
     
    13671376  echo 'int main () { return 0; }' > conftest.$ac_ext
    13681377  ac_cv_exeext=
    1369   if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     1378  if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
    13701379    for file in conftest.*; do
    13711380      case $file in
     
    14001409  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
    14011410    echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
    1402 echo "configure:1403: checking for ${ac_tool_prefix}file" >&5
     1411echo "configure:1412: checking for ${ac_tool_prefix}file" >&5
    14031412if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
    14041413  echo $ac_n "(cached) $ac_c" 1>&6
     
    14621471  if test -n "$ac_tool_prefix"; then
    14631472    echo $ac_n "checking for file""... $ac_c" 1>&6
    1464 echo "configure:1465: checking for file" >&5
     1473echo "configure:1474: checking for file" >&5
    14651474if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
    14661475  echo $ac_n "(cached) $ac_c" 1>&6
     
    15331542set dummy ${ac_tool_prefix}ranlib; ac_word=$2
    15341543echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    1535 echo "configure:1536: checking for $ac_word" >&5
     1544echo "configure:1545: checking for $ac_word" >&5
    15361545if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
    15371546  echo $ac_n "(cached) $ac_c" 1>&6
     
    15651574set dummy ranlib; ac_word=$2
    15661575echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    1567 echo "configure:1568: checking for $ac_word" >&5
     1576echo "configure:1577: checking for $ac_word" >&5
    15681577if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
    15691578  echo $ac_n "(cached) $ac_c" 1>&6
     
    16001609set dummy ${ac_tool_prefix}strip; ac_word=$2
    16011610echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    1602 echo "configure:1603: checking for $ac_word" >&5
     1611echo "configure:1612: checking for $ac_word" >&5
    16031612if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
    16041613  echo $ac_n "(cached) $ac_c" 1>&6
     
    16321641set dummy strip; ac_word=$2
    16331642echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    1634 echo "configure:1635: checking for $ac_word" >&5
     1643echo "configure:1644: checking for $ac_word" >&5
    16351644if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
    16361645  echo $ac_n "(cached) $ac_c" 1>&6
     
    16991708*-*-irix6*)
    17001709  # Find out which ABI we are using.
    1701   echo '#line 1702 "configure"' > conftest.$ac_ext
    1702   if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1710  echo '#line 1711 "configure"' > conftest.$ac_ext
     1711  if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1712   if test "$lt_cv_prog_gnu_ld" = yes; then
     1713    case `/usr/bin/file conftest.$ac_objext` in
     1714    *32-bit*)
     1715      LD="${LD-ld} -melf32bsmip"
     1716      ;;
     1717    *N32*)
     1718      LD="${LD-ld} -melf32bmipn32"
     1719      ;;
     1720    *64-bit*)
     1721      LD="${LD-ld} -melf64bmip"
     1722      ;;
     1723    esac
     1724   else
    17031725    case `/usr/bin/file conftest.$ac_objext` in
    17041726    *32-bit*)
     
    17121734      ;;
    17131735    esac
     1736   fi
     1737  fi
     1738  rm -rf conftest*
     1739  ;;
     1740
     1741ia64-*-hpux*)
     1742  # Find out which ABI we are using.
     1743  echo 'int i;' > conftest.$ac_ext
     1744  if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1745    case "`/usr/bin/file conftest.o`" in
     1746    *ELF-32*)
     1747      HPUX_IA64_MODE="32"
     1748      ;;
     1749    *ELF-64*)
     1750      HPUX_IA64_MODE="64"
     1751      ;;
     1752    esac
     1753  fi
     1754  rm -rf conftest*
     1755  ;;
     1756
     1757x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
     1758  # Find out which ABI we are using.
     1759  echo 'int i;' > conftest.$ac_ext
     1760  if { (eval echo configure:1761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1761    case "`/usr/bin/file conftest.o`" in
     1762    *32-bit*)
     1763      case $host in
     1764        x86_64-*linux*)
     1765          LD="${LD-ld} -m elf_i386"
     1766          ;;
     1767        ppc64-*linux*|powerpc64-*linux*)
     1768          LD="${LD-ld} -m elf32ppclinux"
     1769          ;;
     1770        s390x-*linux*)
     1771          LD="${LD-ld} -m elf_s390"
     1772          ;;
     1773        sparc64-*linux*)
     1774          LD="${LD-ld} -m elf32_sparc"
     1775          ;;
     1776      esac
     1777      ;;
     1778    *64-bit*)
     1779      case $host in
     1780        x86_64-*linux*)
     1781          LD="${LD-ld} -m elf_x86_64"
     1782          ;;
     1783        ppc*-*linux*|powerpc*-*linux*)
     1784          LD="${LD-ld} -m elf64ppc"
     1785          ;;
     1786        s390*-*linux*)
     1787          LD="${LD-ld} -m elf64_s390"
     1788          ;;
     1789        sparc*-*linux*)
     1790          LD="${LD-ld} -m elf64_sparc"
     1791          ;;
     1792      esac
     1793      ;;
     1794    esac
    17141795  fi
    17151796  rm -rf conftest*
     
    17211802  CFLAGS="$CFLAGS -belf"
    17221803  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
    1723 echo "configure:1724: checking whether the C compiler needs -belf" >&5
     1804echo "configure:1805: checking whether the C compiler needs -belf" >&5
    17241805if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
    17251806  echo $ac_n "(cached) $ac_c" 1>&6
     
    17341815
    17351816     cat > conftest.$ac_ext <<EOF
    1736 #line 1737 "configure"
     1817#line 1818 "configure"
    17371818#include "confdefs.h"
    17381819
     
    17411822; return 0; }
    17421823EOF
    1743 if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1824if { (eval echo configure:1825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    17441825  rm -rf conftest*
    17451826  lt_cv_cc_needs_belf=yes
     
    18691950# ./install, which can be erroneously created by make from ./install.sh.
    18701951echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
    1871 echo "configure:1872: checking for a BSD compatible install" >&5
     1952echo "configure:1953: checking for a BSD compatible install" >&5
    18721953if test -z "$INSTALL"; then
    18731954if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
     
    19222003
    19232004echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
    1924 echo "configure:1925: checking whether build environment is sane" >&5
     2005echo "configure:2006: checking whether build environment is sane" >&5
    19252006# Just in case
    19262007sleep 1
     
    19792060
    19802061echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
    1981 echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5
     2062echo "configure:2063: checking whether ${MAKE-make} sets \${MAKE}" >&5
    19822063set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
    19832064if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
     
    20182099missing_dir=`cd $ac_aux_dir && pwd`
    20192100echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
    2020 echo "configure:2021: checking for working aclocal" >&5
     2101echo "configure:2102: checking for working aclocal" >&5
    20212102# Run test in a subshell; some versions of sh will print an error if
    20222103# an executable is not found, even if stderr is redirected.
     
    20312112
    20322113echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
    2033 echo "configure:2034: checking for working autoconf" >&5
     2114echo "configure:2115: checking for working autoconf" >&5
    20342115# Run test in a subshell; some versions of sh will print an error if
    20352116# an executable is not found, even if stderr is redirected.
     
    20442125
    20452126echo $ac_n "checking for working automake""... $ac_c" 1>&6
    2046 echo "configure:2047: checking for working automake" >&5
     2127echo "configure:2128: checking for working automake" >&5
    20472128# Run test in a subshell; some versions of sh will print an error if
    20482129# an executable is not found, even if stderr is redirected.
     
    20572138
    20582139echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
    2059 echo "configure:2060: checking for working autoheader" >&5
     2140echo "configure:2141: checking for working autoheader" >&5
    20602141# Run test in a subshell; some versions of sh will print an error if
    20612142# an executable is not found, even if stderr is redirected.
     
    20702151
    20712152echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
    2072 echo "configure:2073: checking for working makeinfo" >&5
     2153echo "configure:2154: checking for working makeinfo" >&5
    20732154# Run test in a subshell; some versions of sh will print an error if
    20742155# an executable is not found, even if stderr is redirected.
     
    20872168
    20882169echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
    2089 echo "configure:2090: checking for executable suffix" >&5
     2170echo "configure:2171: checking for executable suffix" >&5
    20902171if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
    20912172  echo $ac_n "(cached) $ac_c" 1>&6
     
    20972178  echo 'int main () { return 0; }' > conftest.$ac_ext
    20982179  ac_cv_exeext=
    2099   if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     2180  if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
    21002181    for file in conftest.*; do
    21012182      case $file in
     
    21182199
    21192200echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
    2120 echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5
     2201echo "configure:2202: checking whether to enable maintainer-specific portions of Makefiles" >&5
    21212202    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
    21222203if test "${enable_maintainer_mode+set}" = set; then
     
    21442225set dummy gcc; ac_word=$2
    21452226echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    2146 echo "configure:2147: checking for $ac_word" >&5
     2227echo "configure:2228: checking for $ac_word" >&5
    21472228if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    21482229  echo $ac_n "(cached) $ac_c" 1>&6
     
    21742255set dummy cc; ac_word=$2
    21752256echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    2176 echo "configure:2177: checking for $ac_word" >&5
     2257echo "configure:2258: checking for $ac_word" >&5
    21772258if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    21782259  echo $ac_n "(cached) $ac_c" 1>&6
     
    22252306set dummy cl; ac_word=$2
    22262307echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    2227 echo "configure:2228: checking for $ac_word" >&5
     2308echo "configure:2309: checking for $ac_word" >&5
    22282309if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    22292310  echo $ac_n "(cached) $ac_c" 1>&6
     
    22572338
    22582339echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
    2259 echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
     2340echo "configure:2341: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
    22602341
    22612342ac_ext=c
     
    22682349cat > conftest.$ac_ext << EOF
    22692350
    2270 #line 2271 "configure"
     2351#line 2352 "configure"
    22712352#include "confdefs.h"
    22722353
    22732354main(){return(0);}
    22742355EOF
    2275 if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     2356if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    22762357  ac_cv_prog_cc_works=yes
    22772358  # If we can't run a trivial program, we are probably using a cross compiler.
     
    22992380fi
    23002381echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
    2301 echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
     2382echo "configure:2383: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
    23022383echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
    23032384cross_compiling=$ac_cv_prog_cc_cross
    23042385
    23052386echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
    2306 echo "configure:2307: checking whether we are using GNU C" >&5
     2387echo "configure:2388: checking whether we are using GNU C" >&5
    23072388if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    23082389  echo $ac_n "(cached) $ac_c" 1>&6
     
    23132394#endif
    23142395EOF
    2315 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
     2396if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    23162397  ac_cv_prog_gcc=yes
    23172398else
     
    23322413CFLAGS=
    23332414echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
    2334 echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5
     2415echo "configure:2416: checking whether ${CC-cc} accepts -g" >&5
    23352416if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    23362417  echo $ac_n "(cached) $ac_c" 1>&6
     
    23732454mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
    23742455i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
     2456i*86-*-sco3.2v5*) TARGET=X86; TARGETDIR=x86;;
    23752457i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
    23762458i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
     
    23822464sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
    23832465sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
    2384 sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
    2385 sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
    2386 alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
     2466sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
     2467sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
     2468alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
    23872469ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
    23882470m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
     2471mips64*-*);;
     2472mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
    23892473powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
    23902474powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
     
    23932477rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
    23942478arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
     2479s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
     2480s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
     2481x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
     2482sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
    23952483esac
    23962484
     
    24192507
    24202508
     2509if test x$TARGET = xMIPS_LINUX; then
     2510  MIPS_LINUX_TRUE=
     2511  MIPS_LINUX_FALSE='#'
     2512else
     2513  MIPS_LINUX_TRUE='#'
     2514  MIPS_LINUX_FALSE=
     2515fi
     2516
     2517
    24212518if test x$TARGET = xSPARC; then
    24222519  SPARC_TRUE=
     
    25082605fi
    25092606
     2607
     2608if test x$TARGET = xS390; then
     2609  S390_TRUE=
     2610  S390_FALSE='#'
     2611else
     2612  S390_TRUE='#'
     2613  S390_FALSE=
     2614fi
     2615
     2616
     2617if test x$TARGET = xX86_64; then
     2618  X86_64_TRUE=
     2619  X86_64_FALSE='#'
     2620else
     2621  X86_64_TRUE='#'
     2622  X86_64_FALSE=
     2623fi
     2624
     2625
     2626if test x$TARGET = xSH; then
     2627  SH_TRUE=
     2628  SH_FALSE='#'
     2629else
     2630  SH_TRUE='#'
     2631  SH_FALSE=
     2632fi
     2633
     2634if test x$TARGET = xMIPS_LINUX; then
     2635  TARGET=MIPS
     2636fi
     2637
    25102638echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
    2511 echo "configure:2512: checking how to run the C preprocessor" >&5
     2639echo "configure:2640: checking how to run the C preprocessor" >&5
    25122640# On Suns, sometimes $CPP names a directory.
    25132641if test -n "$CPP" && test -d "$CPP"; then
     
    25242652  # not just through cpp.
    25252653  cat > conftest.$ac_ext <<EOF
    2526 #line 2527 "configure"
     2654#line 2655 "configure"
    25272655#include "confdefs.h"
    25282656#include <assert.h>
     
    25302658EOF
    25312659ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2532 { (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2660{ (eval echo configure:2661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    25332661ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    25342662if test -z "$ac_err"; then
     
    25412669  CPP="${CC-cc} -E -traditional-cpp"
    25422670  cat > conftest.$ac_ext <<EOF
    2543 #line 2544 "configure"
     2671#line 2672 "configure"
    25442672#include "confdefs.h"
    25452673#include <assert.h>
     
    25472675EOF
    25482676ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2549 { (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2677{ (eval echo configure:2678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    25502678ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    25512679if test -z "$ac_err"; then
     
    25582686  CPP="${CC-cc} -nologo -E"
    25592687  cat > conftest.$ac_ext <<EOF
    2560 #line 2561 "configure"
     2688#line 2689 "configure"
    25612689#include "confdefs.h"
    25622690#include <assert.h>
     
    25642692EOF
    25652693ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2566 { (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2694{ (eval echo configure:2695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    25672695ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    25682696if test -z "$ac_err"; then
     
    25892717
    25902718echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
    2591 echo "configure:2592: checking for ANSI C header files" >&5
     2719echo "configure:2720: checking for ANSI C header files" >&5
    25922720if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    25932721  echo $ac_n "(cached) $ac_c" 1>&6
    25942722else
    25952723  cat > conftest.$ac_ext <<EOF
    2596 #line 2597 "configure"
     2724#line 2725 "configure"
    25972725#include "confdefs.h"
    25982726#include <stdlib.h>
     
    26022730EOF
    26032731ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2604 { (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2732{ (eval echo configure:2733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    26052733ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    26062734if test -z "$ac_err"; then
     
    26192747  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    26202748cat > conftest.$ac_ext <<EOF
    2621 #line 2622 "configure"
     2749#line 2750 "configure"
    26222750#include "confdefs.h"
    26232751#include <string.h>
     
    26372765  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    26382766cat > conftest.$ac_ext <<EOF
    2639 #line 2640 "configure"
     2767#line 2768 "configure"
    26402768#include "confdefs.h"
    26412769#include <stdlib.h>
     
    26582786else
    26592787  cat > conftest.$ac_ext <<EOF
    2660 #line 2661 "configure"
     2788#line 2789 "configure"
    26612789#include "confdefs.h"
    26622790#include <ctype.h>
     
    26692797
    26702798EOF
    2671 if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     2799if { (eval echo configure:2800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    26722800then
    26732801  :
     
    26952823do
    26962824echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    2697 echo "configure:2698: checking for $ac_func" >&5
     2825echo "configure:2826: checking for $ac_func" >&5
    26982826if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    26992827  echo $ac_n "(cached) $ac_c" 1>&6
    27002828else
    27012829  cat > conftest.$ac_ext <<EOF
    2702 #line 2703 "configure"
     2830#line 2831 "configure"
    27032831#include "confdefs.h"
    27042832/* System header to define __stub macros and hopefully few prototypes,
     
    27232851; return 0; }
    27242852EOF
    2725 if { (eval echo configure:2726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     2853if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    27262854  rm -rf conftest*
    27272855  eval "ac_cv_func_$ac_func=yes"
     
    27502878# for constant arguments.  Useless!
    27512879echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
    2752 echo "configure:2753: checking for working alloca.h" >&5
     2880echo "configure:2881: checking for working alloca.h" >&5
    27532881if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
    27542882  echo $ac_n "(cached) $ac_c" 1>&6
    27552883else
    27562884  cat > conftest.$ac_ext <<EOF
    2757 #line 2758 "configure"
     2885#line 2886 "configure"
    27582886#include "confdefs.h"
    27592887#include <alloca.h>
     
    27622890; return 0; }
    27632891EOF
    2764 if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     2892if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    27652893  rm -rf conftest*
    27662894  ac_cv_header_alloca_h=yes
     
    27832911
    27842912echo $ac_n "checking for alloca""... $ac_c" 1>&6
    2785 echo "configure:2786: checking for alloca" >&5
     2913echo "configure:2914: checking for alloca" >&5
    27862914if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
    27872915  echo $ac_n "(cached) $ac_c" 1>&6
    27882916else
    27892917  cat > conftest.$ac_ext <<EOF
    2790 #line 2791 "configure"
     2918#line 2919 "configure"
    27912919#include "confdefs.h"
    27922920
     
    28162944; return 0; }
    28172945EOF
    2818 if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     2946if { (eval echo configure:2947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    28192947  rm -rf conftest*
    28202948  ac_cv_func_alloca_works=yes
     
    28482976
    28492977echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
    2850 echo "configure:2851: checking whether alloca needs Cray hooks" >&5
     2978echo "configure:2979: checking whether alloca needs Cray hooks" >&5
    28512979if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
    28522980  echo $ac_n "(cached) $ac_c" 1>&6
    28532981else
    28542982  cat > conftest.$ac_ext <<EOF
    2855 #line 2856 "configure"
     2983#line 2984 "configure"
    28562984#include "confdefs.h"
    28572985#if defined(CRAY) && ! defined(CRAY2)
     
    28783006for ac_func in _getb67 GETB67 getb67; do
    28793007  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    2880 echo "configure:2881: checking for $ac_func" >&5
     3008echo "configure:3009: checking for $ac_func" >&5
    28813009if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    28823010  echo $ac_n "(cached) $ac_c" 1>&6
    28833011else
    28843012  cat > conftest.$ac_ext <<EOF
    2885 #line 2886 "configure"
     3013#line 3014 "configure"
    28863014#include "confdefs.h"
    28873015/* System header to define __stub macros and hopefully few prototypes,
     
    29063034; return 0; }
    29073035EOF
    2908 if { (eval echo configure:2909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     3036if { (eval echo configure:3037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    29093037  rm -rf conftest*
    29103038  eval "ac_cv_func_$ac_func=yes"
     
    29333061
    29343062echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
    2935 echo "configure:2936: checking stack direction for C alloca" >&5
     3063echo "configure:3064: checking stack direction for C alloca" >&5
    29363064if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
    29373065  echo $ac_n "(cached) $ac_c" 1>&6
     
    29413069else
    29423070  cat > conftest.$ac_ext <<EOF
    2943 #line 2944 "configure"
     3071#line 3072 "configure"
    29443072#include "confdefs.h"
    29453073find_stack_direction ()
     
    29603088}
    29613089EOF
    2962 if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     3090if { (eval echo configure:3091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    29633091then
    29643092  ac_cv_c_stack_direction=1
     
    29833111
    29843112echo $ac_n "checking size of short""... $ac_c" 1>&6
    2985 echo "configure:2986: checking size of short" >&5
     3113echo "configure:3114: checking size of short" >&5
    29863114if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
    29873115  echo $ac_n "(cached) $ac_c" 1>&6
     
    29893117  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    29903118  cat > conftest.$ac_ext <<EOF
    2991 #line 2992 "configure"
     3119#line 3120 "configure"
    29923120#include "confdefs.h"
    29933121#include "confdefs.h"
     
    29993127; return 0; }
    30003128EOF
    3001 if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3129if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    30023130  rm -rf conftest*
    30033131  ac_cv_sizeof_short=$ac_size
     
    30223150
    30233151echo $ac_n "checking size of int""... $ac_c" 1>&6
    3024 echo "configure:3025: checking size of int" >&5
     3152echo "configure:3153: checking size of int" >&5
    30253153if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
    30263154  echo $ac_n "(cached) $ac_c" 1>&6
     
    30283156  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    30293157  cat > conftest.$ac_ext <<EOF
    3030 #line 3031 "configure"
     3158#line 3159 "configure"
    30313159#include "confdefs.h"
    30323160#include "confdefs.h"
     
    30383166; return 0; }
    30393167EOF
    3040 if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3168if { (eval echo configure:3169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    30413169  rm -rf conftest*
    30423170  ac_cv_sizeof_int=$ac_size
     
    30613189
    30623190echo $ac_n "checking size of long""... $ac_c" 1>&6
    3063 echo "configure:3064: checking size of long" >&5
     3191echo "configure:3192: checking size of long" >&5
    30643192if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
    30653193  echo $ac_n "(cached) $ac_c" 1>&6
     
    30673195  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    30683196  cat > conftest.$ac_ext <<EOF
    3069 #line 3070 "configure"
     3197#line 3198 "configure"
    30703198#include "confdefs.h"
    30713199#include "confdefs.h"
     
    30773205; return 0; }
    30783206EOF
    3079 if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3207if { (eval echo configure:3208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    30803208  rm -rf conftest*
    30813209  ac_cv_sizeof_long=$ac_size
     
    31003228
    31013229echo $ac_n "checking size of long long""... $ac_c" 1>&6
    3102 echo "configure:3103: checking size of long long" >&5
     3230echo "configure:3231: checking size of long long" >&5
    31033231if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
    31043232  echo $ac_n "(cached) $ac_c" 1>&6
     
    31063234  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    31073235  cat > conftest.$ac_ext <<EOF
    3108 #line 3109 "configure"
     3236#line 3237 "configure"
    31093237#include "confdefs.h"
    31103238#include "confdefs.h"
     
    31163244; return 0; }
    31173245EOF
    3118 if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3246if { (eval echo configure:3247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    31193247  rm -rf conftest*
    31203248  ac_cv_sizeof_long_long=$ac_size
     
    31393267
    31403268echo $ac_n "checking size of float""... $ac_c" 1>&6
    3141 echo "configure:3142: checking size of float" >&5
     3269echo "configure:3270: checking size of float" >&5
    31423270if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
    31433271  echo $ac_n "(cached) $ac_c" 1>&6
     
    31453273  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    31463274  cat > conftest.$ac_ext <<EOF
    3147 #line 3148 "configure"
     3275#line 3276 "configure"
    31483276#include "confdefs.h"
    31493277#include "confdefs.h"
     
    31553283; return 0; }
    31563284EOF
    3157 if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3285if { (eval echo configure:3286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    31583286  rm -rf conftest*
    31593287  ac_cv_sizeof_float=$ac_size
     
    31783306
    31793307echo $ac_n "checking size of double""... $ac_c" 1>&6
    3180 echo "configure:3181: checking size of double" >&5
     3308echo "configure:3309: checking size of double" >&5
    31813309if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
    31823310  echo $ac_n "(cached) $ac_c" 1>&6
     
    31843312  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    31853313  cat > conftest.$ac_ext <<EOF
    3186 #line 3187 "configure"
     3314#line 3315 "configure"
    31873315#include "confdefs.h"
    31883316#include "confdefs.h"
     
    31943322; return 0; }
    31953323EOF
    3196 if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3324if { (eval echo configure:3325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    31973325  rm -rf conftest*
    31983326  ac_cv_sizeof_double=$ac_size
     
    32173345
    32183346echo $ac_n "checking size of long double""... $ac_c" 1>&6
    3219 echo "configure:3220: checking size of long double" >&5
     3347echo "configure:3348: checking size of long double" >&5
    32203348if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
    32213349  echo $ac_n "(cached) $ac_c" 1>&6
     
    32233351  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    32243352  cat > conftest.$ac_ext <<EOF
    3225 #line 3226 "configure"
     3353#line 3354 "configure"
    32263354#include "confdefs.h"
    32273355#include "confdefs.h"
     
    32333361; return 0; }
    32343362EOF
    3235 if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3363if { (eval echo configure:3364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    32363364  rm -rf conftest*
    32373365  ac_cv_sizeof_long_double=$ac_size
     
    32573385
    32583386echo $ac_n "checking size of void *""... $ac_c" 1>&6
    3259 echo "configure:3260: checking size of void *" >&5
     3387echo "configure:3388: checking size of void *" >&5
    32603388if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
    32613389  echo $ac_n "(cached) $ac_c" 1>&6
     
    32633391  for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
    32643392  cat > conftest.$ac_ext <<EOF
    3265 #line 3266 "configure"
     3393#line 3394 "configure"
    32663394#include "confdefs.h"
    32673395#include "confdefs.h"
     
    32733401; return 0; }
    32743402EOF
    3275 if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3403if { (eval echo configure:3404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    32763404  rm -rf conftest*
    32773405  ac_cv_sizeof_void_p=$ac_size
     
    32963424
    32973425echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
    3298 echo "configure:3299: checking whether byte ordering is bigendian" >&5
     3426echo "configure:3427: checking whether byte ordering is bigendian" >&5
    32993427if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
    33003428  echo $ac_n "(cached) $ac_c" 1>&6
     
    33033431# See if sys/param.h defines the BYTE_ORDER macro.
    33043432cat > conftest.$ac_ext <<EOF
    3305 #line 3306 "configure"
     3433#line 3434 "configure"
    33063434#include "confdefs.h"
    33073435#include <sys/types.h>
     
    33143442; return 0; }
    33153443EOF
    3316 if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3444if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    33173445  rm -rf conftest*
    33183446  # It does; now see whether it defined to BIG_ENDIAN or not.
    33193447cat > conftest.$ac_ext <<EOF
    3320 #line 3321 "configure"
     3448#line 3449 "configure"
    33213449#include "confdefs.h"
    33223450#include <sys/types.h>
     
    33293457; return 0; }
    33303458EOF
    3331 if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3459if { (eval echo configure:3460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    33323460  rm -rf conftest*
    33333461  ac_cv_c_bigendian=yes
     
    33493477else
    33503478  cat > conftest.$ac_ext <<EOF
    3351 #line 3352 "configure"
     3479#line 3480 "configure"
    33523480#include "confdefs.h"
    33533481main () {
     
    33623490}
    33633491EOF
    3364 if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     3492if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    33653493then
    33663494  ac_cv_c_bigendian=no
     
    33803508if test $ac_cv_c_bigendian = unknown; then
    33813509echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
    3382 echo "configure:3383: checking to probe for byte ordering" >&5
     3510echo "configure:3511: checking to probe for byte ordering" >&5
    33833511
    33843512cat >conftest.c <<EOF
     
    34303558if test x$TARGET = xSPARC; then
    34313559    echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
    3432 echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5
     3560echo "configure:3561: checking assembler and linker support unaligned pc related relocs" >&5
    34333561if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
    34343562  echo $ac_n "(cached) $ac_c" 1>&6
     
    34403568        LDFLAGS="$LDFLAGS -shared"
    34413569        cat > conftest.$ac_ext <<EOF
    3442 #line 3443 "configure"
     3570#line 3571 "configure"
    34433571#include "confdefs.h"
    34443572asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
     
    34473575; return 0; }
    34483576EOF
    3449 if { (eval echo configure:3450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     3577if { (eval echo configure:3578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    34503578  rm -rf conftest*
    34513579  libffi_cv_as_sparc_ua_pcrel=yes
     
    34653593        cat >> confdefs.h <<\EOF
    34663594#define HAVE_AS_SPARC_UA_PCREL 1
     3595EOF
     3596
     3597    fi
     3598
     3599    echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
     3600echo "configure:3601: checking assembler .register pseudo-op support" >&5
     3601if eval "test \"`echo '$''{'libffi_cv_as_register_pseudo_op'+set}'`\" = set"; then
     3602  echo $ac_n "(cached) $ac_c" 1>&6
     3603else
     3604 
     3605       libffi_cv_as_register_pseudo_op=unknown
     3606       # Check if we have .register
     3607       cat > conftest.$ac_ext <<EOF
     3608#line 3609 "configure"
     3609#include "confdefs.h"
     3610asm (".register %g2, #scratch");
     3611int main() {
     3612
     3613; return 0; }
     3614EOF
     3615if { (eval echo configure:3616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3616  rm -rf conftest*
     3617  libffi_cv_as_register_pseudo_op=yes
     3618else
     3619  echo "configure: failed program was:" >&5
     3620  cat conftest.$ac_ext >&5
     3621  rm -rf conftest*
     3622  libffi_cv_as_register_pseudo_op=no
     3623fi
     3624rm -f conftest*
     3625   
     3626fi
     3627
     3628echo "$ac_t""$libffi_cv_as_register_pseudo_op" 1>&6
     3629    if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
     3630       cat >> confdefs.h <<\EOF
     3631#define HAVE_AS_REGISTER_PSEUDO_OP 1
    34673632EOF
    34683633
     
    37103875s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g
    37113876s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g
     3877s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g
     3878s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g
    37123879s%@SPARC_TRUE@%$SPARC_TRUE%g
    37133880s%@SPARC_FALSE@%$SPARC_FALSE%g
     
    37303897s%@ARM_TRUE@%$ARM_TRUE%g
    37313898s%@ARM_FALSE@%$ARM_FALSE%g
     3899s%@S390_TRUE@%$S390_TRUE%g
     3900s%@S390_FALSE@%$S390_FALSE%g
     3901s%@X86_64_TRUE@%$X86_64_TRUE%g
     3902s%@X86_64_FALSE@%$X86_64_FALSE%g
     3903s%@SH_TRUE@%$SH_TRUE%g
     3904s%@SH_FALSE@%$SH_FALSE%g
    37323905s%@CPP@%$CPP%g
    37333906s%@ALLOCA@%$ALLOCA%g
     
    39554128CC="${CC}"
    39564129DEFS="$DEFS"
     4130ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
    39574131test ! -d include && mkdir include
    39584132test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
     
    39704144if test -n "$CONFIG_FILES"; then
    39714145   LD="${ORIGINAL_LD_FOR_MULTILIBS}"
    3972    ac_file=Makefile . ${libffi_basedir}/../config-ml.in
     4146   ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
    39734147fi
    39744148
  • branches/GNU/src/gcc/libffi/configure.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    2323if test "${srcdir}" = "."; then
    2424  if test "${with_target_subdir}" != "."; then
    25     libffi_basedir="${srcdir}/${with_multisrctop}.."
     25    libffi_basedir="${with_multisrctop}../"
    2626  else
    27     libffi_basedir="${srcdir}/${with_multisrctop}"
     27    libffi_basedir="${with_multisrctop}"
    2828  fi
    2929else
    30   libffi_basedir="${srcdir}"
     30  libffi_basedir=
    3131fi
    3232AC_SUBST(libffi_basedir)
     33AC_CONFIG_AUX_DIR(${libffi_basedir}..)
    3334
    3435AC_CANONICAL_HOST
     
    4849mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
    4950i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
     51i*86-*-sco3.2v5*) TARGET=X86; TARGETDIR=x86;;
    5052i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
    5153i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
     
    5759sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
    5860sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
    59 sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
    60 sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
    61 alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
     61sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
     62sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
     63alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
    6264ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
    6365m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
     66mips64*-*);;
     67mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
    6468powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
    6569powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
     
    6872rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
    6973arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
     74s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
     75s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
     76x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
     77sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
    7078esac
    7179
     
    7684AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
    7785AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
     86AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX)
    7887AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
    7988AM_CONDITIONAL(X86, test x$TARGET = xX86)
     
    8695AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
    8796AM_CONDITIONAL(ARM, test x$TARGET = xARM)
     97AM_CONDITIONAL(S390, test x$TARGET = xS390)
     98AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64)
     99AM_CONDITIONAL(SH, test x$TARGET = xSH)
     100
     101if test x$TARGET = xMIPS_LINUX; then
     102  TARGET=MIPS
     103fi
    88104
    89105AC_HEADER_STDC
     
    119135                  [Define if your assembler and linker support unaligned PC relative relocs.])
    120136    fi
     137
     138    AC_CACHE_CHECK([assembler .register pseudo-op support],
     139       libffi_cv_as_register_pseudo_op, [
     140       libffi_cv_as_register_pseudo_op=unknown
     141       # Check if we have .register
     142       AC_TRY_COMPILE([asm (".register %g2, #scratch");],,
     143                       [libffi_cv_as_register_pseudo_op=yes],
     144                       [libffi_cv_as_register_pseudo_op=no])
     145    ])
     146    if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
     147       AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
     148               [Define if your assembler supports .register.])
     149    fi
    121150fi
    122151
     
    172201if test -n "$CONFIG_FILES"; then
    173202   LD="${ORIGINAL_LD_FOR_MULTILIBS}"
    174    ac_file=Makefile . ${libffi_basedir}/../config-ml.in
     203   ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
    175204fi
    176205],
     
    184213CC="${CC}"
    185214DEFS="$DEFS"
     215ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
    186216test ! -d include && mkdir include
    187217test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
  • branches/GNU/src/gcc/libffi/fficonfig.h.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    2626#undef STDC_HEADERS
    2727
    28 /* Define if your processor stores words with the most significant
    29    byte first (like Motorola and SPARC, unlike Intel and VAX).  */
    30 #undef WORDS_BIGENDIAN
    31 
    3228/* Define this if you want extra debugging */
    3329#undef FFI_DEBUG
     
    4339#undef FFI_NO_RAW_API
    4440
    45 /* The number of bytes in a double.  */
    46 #undef SIZEOF_DOUBLE
    47 
    48 /* The number of bytes in a float.  */
    49 #undef SIZEOF_FLOAT
    50 
    51 /* The number of bytes in a int.  */
    52 #undef SIZEOF_INT
    53 
    54 /* The number of bytes in a long.  */
    55 #undef SIZEOF_LONG
    56 
    57 /* The number of bytes in a long double.  */
    58 #undef SIZEOF_LONG_DOUBLE
    59 
    60 /* The number of bytes in a long long.  */
    61 #undef SIZEOF_LONG_LONG
    62 
    63 /* The number of bytes in a short.  */
    64 #undef SIZEOF_SHORT
    65 
    66 /* The number of bytes in a void *.  */
    67 #undef SIZEOF_VOID_P
    68 
    6941/* Define if you have the memcpy function.  */
    7042#undef HAVE_MEMCPY
    7143
    72 /* Define if your assembler and linker support unaligned PC relative relocs.  */
     44/* The number of bytes in type short */
     45#undef SIZEOF_SHORT
     46
     47/* The number of bytes in type int */
     48#undef SIZEOF_INT
     49
     50/* The number of bytes in type long */
     51#undef SIZEOF_LONG
     52
     53/* The number of bytes in type long long */
     54#undef SIZEOF_LONG_LONG
     55
     56/* The number of bytes in type float */
     57#undef SIZEOF_FLOAT
     58
     59/* The number of bytes in type double */
     60#undef SIZEOF_DOUBLE
     61
     62/* The number of bytes in type long double */
     63#undef SIZEOF_LONG_DOUBLE
     64
     65/* The number of bytes in type void * */
     66#undef SIZEOF_VOID_P
     67
     68/* whether byteorder is bigendian */
     69#undef WORDS_BIGENDIAN
     70
     71/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
     72#undef BYTEORDER
     73
     74/* Define if your assembler and linker support unaligned PC relative relocs. */
    7375#undef HAVE_AS_SPARC_UA_PCREL
     76
     77/* Define if your assembler supports .register. */
     78#undef HAVE_AS_REGISTER_PSEUDO_OP
     79
  • branches/GNU/src/gcc/libffi/include/Makefile.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1 # Makefile.in generated automatically by automake 1.4 from Makefile.am
    2 
    3 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
     1# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
     2
     3# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
    44# This Makefile.in is free software; the Free Software Foundation
    55# gives unlimited permission to copy and/or distribute it,
     
    8282VERSION = @VERSION@
    8383libffi_basedir = @libffi_basedir@
     84toolexecdir = @toolexecdir@
     85toolexeclibdir = @toolexeclibdir@
    8486
    8587AUTOMAKE_OPTIONS = foreign
     
    9092
    9193hack_DATA = fficonfig.h ffi.h ffi_mips.h
    92 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
     94mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs
    9395CONFIG_HEADER = ../fficonfig.h
    9496CONFIG_CLEAN_FILES =  ffi.h
     
    100102DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
    101103
    102 TAR = gnutar
     104TAR = gtar
    103105GZIP_ENV = --best
    104106all: all-redirect
  • branches/GNU/src/gcc/libffi/include/ffi.h.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------*-C-*-
    2    libffi @VERSION@ - Copyright (c) 1996-2002  Cygnus Solutions
     2   libffi @VERSION@ - Copyright (c) 1996-2003  Cygnus Solutions
    33
    44   Permission is hereby granted, free of charge, to any person obtaining
     
    165165#endif
    166166
     167#ifdef S390
     168#if defined (__s390x__)
     169#define S390X
     170#endif
     171#endif
     172
     173#ifdef X86_64
     174#if defined (__i386__)
     175#undef X86_64
     176#define X86
     177#endif
     178#endif
     179
    167180#ifndef LIBFFI_ASM
    168181
     
    190203#endif
    191204
    192   /* ---- Intel x86 ---------------- */
    193 #ifdef X86
    194   FFI_SYSV,
    195   FFI_DEFAULT_ABI = FFI_SYSV,
    196 #endif
    197 
    198205  /* ---- Intel x86 Win32 ---------- */
    199206#ifdef X86_WIN32
    200207  FFI_SYSV,
     208  FFI_STDCALL,
     209  /* TODO: Add fastcall support for the sake of completeness */
    201210  FFI_DEFAULT_ABI = FFI_SYSV,
     211#endif
     212
     213  /* ---- Intel x86 and AMD x86-64 - */
     214#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
     215  FFI_SYSV,
     216  FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
     217#ifdef __i386__
     218  FFI_DEFAULT_ABI = FFI_SYSV,
     219#else
     220  FFI_DEFAULT_ABI = FFI_UNIX64,
     221#endif
    202222#endif
    203223
     
    248268  /* ---- ARM  --------------------- */
    249269#ifdef ARM
     270  FFI_SYSV,
     271  FFI_DEFAULT_ABI = FFI_SYSV,
     272#endif
     273
     274  /* ---- S390 --------------------- */
     275#ifdef S390
     276  FFI_SYSV,
     277  FFI_DEFAULT_ABI = FFI_SYSV,
     278#endif
     279
     280  /* ---- SuperH ------------------- */
     281#ifdef SH
    250282  FFI_SYSV,
    251283  FFI_DEFAULT_ABI = FFI_SYSV,
     
    265297} ffi_type;
    266298
    267 /* These are defined in ffi.c */
     299/* These are defined in types.c */
    268300extern ffi_type ffi_type_void;
    269301extern ffi_type ffi_type_uint8;
     
    374406/* ---- Definitions for closures ----------------------------------------- */
    375407
    376 #ifdef X86
    377 
    378 #define FFI_CLOSURES 1          /* x86 supports closures */
    379 #define FFI_TRAMPOLINE_SIZE 10
    380 #define FFI_NATIVE_RAW_API 1    /* and has native raw api support */
    381 
    382 #elif defined(X86_WIN32)
     408#ifdef __i386__
    383409
    384410#define FFI_CLOSURES 1          /* x86 supports closures */
     
    423449#define FFI_CLOSURES 1
    424450#define FFI_TRAMPOLINE_SIZE 24 /* see struct below */
     451#define FFI_NATIVE_RAW_API 0
     452
     453#elif defined(SPARC64)
     454
     455#define FFI_CLOSURES 1
     456#define FFI_TRAMPOLINE_SIZE 24
     457#define FFI_NATIVE_RAW_API 0
     458
     459#elif defined(SPARC)
     460
     461#define FFI_CLOSURES 1
     462#define FFI_TRAMPOLINE_SIZE 16
     463#define FFI_NATIVE_RAW_API 0
     464
     465#elif defined(S390)
     466
     467#define FFI_CLOSURES 1
     468#ifdef S390X
     469#define FFI_TRAMPOLINE_SIZE 32
     470#else
     471#define FFI_TRAMPOLINE_SIZE 16
     472#endif
     473#define FFI_NATIVE_RAW_API 0
     474
     475#elif defined(SH)
     476
     477#define FFI_CLOSURES 1
     478#define FFI_TRAMPOLINE_SIZE 16
     479#define FFI_NATIVE_RAW_API 0
     480
     481#elif defined(__x86_64__)
     482
     483#define FFI_CLOSURES 1
     484#define FFI_TRAMPOLINE_SIZE 24
    425485#define FFI_NATIVE_RAW_API 0
    426486
  • branches/GNU/src/gcc/libffi/src/arm/ffi.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    3737{
    3838  register unsigned int i;
    39   register int tmp;
    40   register unsigned int avn;
    4139  register void **p_argv;
    4240  register char *argp;
    4341  register ffi_type **p_arg;
    4442
    45   tmp = 0;
    4643  argp = stack;
    4744
     
    5148  }
    5249
    53   avn = ecif->cif->nargs;
    5450  p_argv = ecif->avalue;
    5551
    5652  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
    57        (i != 0) && (avn != 0);
     53       (i != 0);
    5854       i--, p_arg++)
    5955    {
     
    6561      }
    6662
    67       if (avn != 0)
    68         {
    69           avn--;
    7063          z = (*p_arg)->size;
    7164          if (z < sizeof(int))
     
    108101          p_argv++;
    109102          argp += z;
    110         }
    111103    }
    112104 
  • branches/GNU/src/gcc/libffi/src/arm/sysv.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    2929#include <machine/asm.h>
    3030#else
    31 /* XXX these lose for some platforms, I'm sure. */
     31#ifdef __USER_LABEL_PREFIX__
     32#define CONCAT1(a, b) CONCAT2(a, b)
     33#define CONCAT2(a, b) a ## b
     34
     35/* Use the right prefix for global labels.  */
     36#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
     37#else
    3238#define CNAME(x) x
     39#endif
    3340#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
    3441#endif
     
    97104# return FLOAT
    98105        cmp     a4, #FFI_TYPE_FLOAT
     106#ifdef __SOFTFP__
     107        streq   a1, [a3]
     108#else
    99109        stfeqs  f0, [a3]
     110#endif
    100111        beq     epilogue
    101112
    102113# return DOUBLE or LONGDOUBLE
    103114        cmp     a4, #FFI_TYPE_DOUBLE
     115#ifdef __SOFTFP__
     116        stmeqia a3, {a1, a2}
     117#else
    104118        stfeqd  f0, [a3]
     119#endif
    105120
    106121epilogue:
  • branches/GNU/src/gcc/libffi/src/ffitest.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    ffitest.c - Copyright (c) 1996, 1997, 1998  Cygnus Solutions
     2   ffitest.c - Copyright (c) 1996, 1997, 1998, 2002, 2003  Red Hat, Inc.
    33
    44   Permission is hereby granted, free of charge, to any person obtaining
     
    4949  return (strlen(s));
    5050}
     51
     52#ifdef X86_WIN32
     53static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s)
     54{
     55  return (strlen(s));
     56}
     57#endif /* X86_WIN32 */
    5158
    5259static int promotion(signed char sc, signed short ss,
     
    113120}
    114121
     122#ifdef X86_WIN32
     123static float __attribute__((stdcall)) stdcall_many(float f1,
     124                                                   float f2,
     125                                                   float f3,
     126                                                   float f4,
     127                                                   float f5,
     128                                                   float f6,
     129                                                   float f7,
     130                                                   float f8,
     131                                                   float f9,
     132                                                   float f10,
     133                                                   float f11,
     134                                                   float f12,
     135                                                   float f13)
     136{
     137  return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
     138}
     139#endif /* X86_WIN32 */
     140
    115141static double dblit(float f)
    116142{
     
    153179  char c2;
    154180} test_structure_5;
     181
     182typedef struct
     183{
     184  float f;
     185  double d;
     186} test_structure_6;
     187
     188typedef struct
     189{
     190  float f1;
     191  float f2;
     192  double d;
     193} test_structure_7;
     194
     195typedef struct
     196{
     197  float f1;
     198  float f2;
     199  float f3;
     200  float f4;
     201} test_structure_8;
     202
     203typedef struct
     204{
     205  float f;
     206  int i;
     207} test_structure_9;
    155208
    156209static test_structure_1 struct1(test_structure_1 ts)
     
    195248}
    196249
     250static test_structure_6 struct6 (test_structure_6 ts)
     251{
     252  ts.f += 1;
     253  ts.d += 1;
     254
     255  return ts;
     256}
     257
     258static test_structure_7 struct7 (test_structure_7 ts)
     259{
     260  ts.f1 += 1;
     261  ts.f2 += 1;
     262  ts.d += 1;
     263
     264  return ts;
     265}
     266
     267static test_structure_8 struct8 (test_structure_8 ts)
     268{
     269  ts.f1 += 1;
     270  ts.f2 += 1;
     271  ts.f3 += 1;
     272  ts.f4 += 1;
     273
     274  return ts;
     275}
     276
     277static test_structure_9 struct9 (test_structure_9 ts)
     278{
     279  ts.f += 1;
     280  ts.i += 1;
     281
     282  return ts;
     283}
     284
    197285/* Take an int and a float argument, together with int userdata, and    */
    198286/* return the sum.                                                      */
    199 static void closure_test_fn(ffi_cif* cif,void* resp,void** args, void* userdata)
    200 {
    201     *(int*)resp =
    202          *(int *)args[0] + (int)(*(float *)args[1]) + (int)(long)userdata;
    203 }
    204 
    205 typedef int (*closure_test_type)(int, float);
     287#if FFI_CLOSURES
     288static void
     289closure_test_fn(ffi_cif* cif,void* resp,void** args, void* userdata)
     290{
     291  *(ffi_arg*)resp =
     292    (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
     293    (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
     294    (int)(*(signed short *)args[4]) +
     295    (int)(*(unsigned long long *)args[5]) +
     296    (int)*(int *)args[6] + (int)(*(int *)args[7]) +
     297    (int)(*(double *)args[8]) + (int)*(int *)args[9] +
     298    (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
     299    (int)*(int *)args[12] + (int)(*(int *)args[13]) +
     300    (int)(*(int *)args[14]) +  *(int *)args[15] + (int)(long)userdata;
     301
     302        printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
     303               (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
     304               (int)(*(unsigned long long *)args[2]),
     305               (int)*(int *)args[3], (int)(*(signed short *)args[4]),
     306               (int)(*(unsigned long long *)args[5]),
     307               (int)*(int *)args[6], (int)(*(int *)args[7]),
     308               (int)(*(double *)args[8]), (int)*(int *)args[9],
     309               (int)(*(int *)args[10]), (int)(*(float *)args[11]),
     310               (int)*(int *)args[12], (int)(*(int *)args[13]),
     311               (int)(*(int *)args[14]),*(int *)args[15],
     312               (int)(long)userdata, *(int*)resp);
     313}
     314
     315typedef int (*closure_test_type)(unsigned long long, int, unsigned long long,
     316                                 int, signed short, unsigned long long, int,
     317                                 int, double, int, int, float, int, int,
     318                                 int, int);
     319
     320static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
     321                             void* userdata)
     322 {
     323    *(ffi_arg*)resp =
     324      (int)*(float *)args[0] +(int)(*(float *)args[1]) +
     325      (int)(*(float *)args[2]) + (int)*(float *)args[3] +
     326      (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
     327      (int)*(float *)args[6] + (int)(*(int *)args[7]) +
     328      (int)(*(double*)args[8]) + (int)*(int *)args[9] +
     329      (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
     330      (int)*(int *)args[12] + (int)(*(int *)args[13]) +
     331      (int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata;
     332
     333    printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
     334           (int)*(float *)args[0], (int)(*(float *)args[1]),
     335           (int)(*(float *)args[2]), (int)*(float *)args[3],
     336           (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
     337           (int)*(float *)args[6], (int)(*(int *)args[7]),
     338           (int)(*(double *)args[8]), (int)*(int *)args[9],
     339           (int)(*(int *)args[10]), (int)(*(float *)args[11]),
     340           (int)*(int *)args[12], (int)(*(int *)args[13]),
     341           (int)(*(int *)args[14]), *(int *)args[15],
     342           (int)(long)userdata, *(int*)resp);
     343}
     344
     345typedef int (*closure_test_type1)(float, float, float, float, signed short,
     346                                  float, float, int, double, int, int, float,
     347                                  int, int, int, int);
     348
     349static void closure_test_fn2(ffi_cif* cif,void* resp,void** args,
     350                             void* userdata)
     351 {
     352    *(ffi_arg*)resp =
     353      (int)*(double *)args[0] +(int)(*(double *)args[1]) +
     354      (int)(*(double *)args[2]) + (int)*(double *)args[3] +
     355      (int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) +
     356      (int)*(double *)args[6] + (int)(*(int *)args[7]) +
     357      (int)(*(double *)args[8]) + (int)*(int *)args[9] +
     358      (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
     359      (int)*(int *)args[12] + (int)(*(float *)args[13]) +
     360      (int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata;
     361
     362    printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
     363           (int)*(double *)args[0], (int)(*(double *)args[1]),
     364           (int)(*(double *)args[2]), (int)*(double *)args[3],
     365           (int)(*(signed short *)args[4]), (int)(*(double *)args[5]),
     366           (int)*(double *)args[6], (int)(*(int *)args[7]),
     367           (int)(*(double*)args[8]), (int)*(int *)args[9],
     368           (int)(*(int *)args[10]), (int)(*(float *)args[11]),
     369           (int)*(int *)args[12], (int)(*(float *)args[13]),
     370           (int)(*(int *)args[14]), *(int *)args[15], (int)(long)userdata,
     371           *(int*)resp);
     372 }
     373
     374typedef int (*closure_test_type2)(double, double, double, double, signed short,
     375                                  double, double, int, double, int, int, float,
     376                                  int, float, int, int);
     377
     378static void closure_test_fn3(ffi_cif* cif,void* resp,void** args,
     379                             void* userdata)
     380 {
     381    *(ffi_arg*)resp =
     382      (int)*(float *)args[0] +(int)(*(float *)args[1]) +
     383      (int)(*(float *)args[2]) + (int)*(float *)args[3] +
     384      (int)(*(float *)args[4]) + (int)(*(float *)args[5]) +
     385      (int)*(float *)args[6] + (int)(*(float *)args[7]) +
     386      (int)(*(double *)args[8]) + (int)*(int *)args[9] +
     387      (int)(*(float *)args[10]) + (int)(*(float *)args[11]) +
     388      (int)*(int *)args[12] + (int)(*(float *)args[13]) +
     389      (int)(*(float *)args[14]) +  *(int *)args[15] + (int)(long)userdata;
     390
     391    printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
     392           (int)*(float *)args[0], (int)(*(float *)args[1]),
     393           (int)(*(float *)args[2]), (int)*(float *)args[3],
     394           (int)(*(float *)args[4]), (int)(*(float *)args[5]),
     395           (int)*(float *)args[6], (int)(*(float *)args[7]),
     396           (int)(*(double *)args[8]), (int)*(int *)args[9],
     397           (int)(*(float *)args[10]), (int)(*(float *)args[11]),
     398           (int)*(int *)args[12], (int)(*(float *)args[13]),
     399           (int)(*(float *)args[14]), *(int *)args[15], (int)(long)userdata,
     400           *(int*)resp);
     401 }
     402
     403typedef int (*closure_test_type3)(float, float, float, float, float, float,
     404                                  float, float, double, int, float, float, int,
     405                                  float, float, int);
     406#endif
    206407
    207408int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[])
     
    226427  long long rlonglong;
    227428
     429# if FFI_CLOSURES
     430  /* The closure must not be an automatic variable on
     431     platforms (Solaris) that forbid stack execution by default. */
     432  static ffi_closure cl;
     433#endif
     434
     435  ffi_type * cl_arg_types[17];
     436
    228437  ffi_type ts1_type;
    229438  ffi_type ts2_type;
     
    231440  ffi_type ts4_type; 
    232441  ffi_type ts5_type;
     442  ffi_type ts6_type;
     443  ffi_type ts7_type;
     444  ffi_type ts8_type;
     445  ffi_type ts9_type;
    233446  ffi_type *ts1_type_elements[4];
    234447  ffi_type *ts2_type_elements[3];
     
    236449  ffi_type *ts4_type_elements[4];
    237450  ffi_type *ts5_type_elements[3];
     451  ffi_type *ts6_type_elements[3];
     452  ffi_type *ts7_type_elements[4];
     453  ffi_type *ts8_type_elements[5];
     454  ffi_type *ts9_type_elements[3];
    238455
    239456  ts1_type.size = 0;
     
    256473  ts5_type.alignment = 0;
    257474  ts5_type.type = FFI_TYPE_STRUCT;
     475
     476  ts6_type.size = 0;
     477  ts6_type.alignment = 0;
     478  ts6_type.type = FFI_TYPE_STRUCT;
     479
     480  ts7_type.size = 0;
     481  ts7_type.alignment = 0;
     482  ts7_type.type = FFI_TYPE_STRUCT;
     483
     484  ts8_type.size = 0;
     485  ts8_type.alignment = 0;
     486  ts8_type.type = FFI_TYPE_STRUCT;
     487
     488  ts9_type.size = 0;
     489  ts9_type.alignment = 0;
     490  ts9_type.type = FFI_TYPE_STRUCT;
    258491
    259492  /*@-immediatetrans@*/
     
    263496  ts4_type.elements = ts4_type_elements;
    264497  ts5_type.elements = ts5_type_elements;
     498  ts6_type.elements = ts6_type_elements;
     499  ts7_type.elements = ts7_type_elements;
     500  ts8_type.elements = ts8_type_elements;
     501  ts9_type.elements = ts9_type_elements;
    265502  /*@=immediatetrans@*/
    266503 
     
    286523  ts5_type_elements[2] = NULL;
    287524
     525  ts6_type_elements[0] = &ffi_type_float;
     526  ts6_type_elements[1] = &ffi_type_double;
     527  ts6_type_elements[2] = NULL;
     528
     529  ts7_type_elements[0] = &ffi_type_float;
     530  ts7_type_elements[1] = &ffi_type_float;
     531  ts7_type_elements[2] = &ffi_type_double;
     532  ts7_type_elements[3] = NULL;
     533
     534  ts8_type_elements[0] = &ffi_type_float;
     535  ts8_type_elements[1] = &ffi_type_float;
     536  ts8_type_elements[2] = &ffi_type_float;
     537  ts8_type_elements[3] = &ffi_type_float;
     538  ts8_type_elements[4] = NULL;
     539
     540  ts9_type_elements[0] = &ffi_type_float;
     541  ts9_type_elements[1] = &ffi_type_sint;
     542  ts9_type_elements[2] = NULL;
     543
    288544  ul = 0;
    289545
     
    327583        ul++;
    328584        ffi_call(&cif, FFI_FN(return_sc), &rint, values);
    329         CHECK(rint == (int) sc);
     585        CHECK(rint == (ffi_arg) sc);
    330586      }
    331587
     
    414670    ffi_call(&cif, FFI_FN(floating), &rint, values);
    415671
    416     printf ("%d vs %d\n", rint, floating (si1, f, d, ld, si2));
     672    printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld, si2));
    417673
    418674    CHECK(rint == floating(si1, f, d, ld, si2));
     
    484740
    485741    /*@-usedef@*/
    486     ff =  many(fa[0], fa[1],
     742    ff = many (fa[0], fa[1],
    487743               fa[2], fa[3],
    488744               fa[4], fa[5],
     
    533789              ul++;
    534790              ffi_call(&cif, FFI_FN(promotion), &rint, values);
    535               CHECK(rint == (int) sc + (int) ss + (int) uc + (int) us);
     791              CHECK((int)rint == (signed char) sc + (signed short) ss +
     792                    (unsigned char) uc + (unsigned short) us);
    536793            }
    537794    printf("%lu promotion tests run\n", ul);
     
    580837   
    581838    /* Initialize the cif */
    582     CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
    583                        &ts2_type, args) == FFI_OK);
     839    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK);
    584840
    585841    ts2_arg.d1 = 5.55;
     
    648904   
    649905    /* Initialize the cif */
    650     CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
    651                        &ts4_type, args) == FFI_OK);
     906    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK);
    652907
    653908    ts4_arg.ui1 = 2;
     
    679934   
    680935    /* Initialize the cif */
    681     CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
    682                        &ts5_type, args) == FFI_OK);
     936    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK);
    683937
    684938    ts5_arg1.c1 = 2;
     
    698952  }
    699953
     954  /* struct tests */
     955  {
     956    test_structure_6 ts6_arg;
     957
     958    /* This is a hack to get a properly aligned result buffer */
     959    test_structure_6 *ts6_result =
     960      (test_structure_6 *) malloc (sizeof(test_structure_6));
     961
     962    args[0] = &ts6_type;
     963    values[0] = &ts6_arg;
     964
     965    /* Initialize the cif */
     966    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK);
     967
     968    ts6_arg.f = 5.55f;
     969    ts6_arg.d = 6.66;
     970
     971    printf ("%g\n", ts6_arg.f);
     972    printf ("%g\n", ts6_arg.d);
     973
     974    ffi_call(&cif, FFI_FN(struct6), ts6_result, values);
     975
     976    printf ("%g\n", ts6_result->f);
     977    printf ("%g\n", ts6_result->d);
     978
     979    CHECK(ts6_result->f == 5.55f + 1);
     980    CHECK(ts6_result->d == 6.66 + 1);
     981
     982    printf("structure test 6 ok!\n");
     983
     984    free (ts6_result);
     985  }
     986
     987  /* struct tests */
     988  {
     989    test_structure_7 ts7_arg;
     990
     991    /* This is a hack to get a properly aligned result buffer */
     992    test_structure_7 *ts7_result =
     993      (test_structure_7 *) malloc (sizeof(test_structure_7));
     994
     995    args[0] = &ts7_type;
     996    values[0] = &ts7_arg;
     997
     998    /* Initialize the cif */
     999    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK);
     1000
     1001    ts7_arg.f1 = 5.55f;
     1002    ts7_arg.f2 = 55.5f;
     1003    ts7_arg.d = 6.66;
     1004
     1005    printf ("%g\n", ts7_arg.f1);
     1006    printf ("%g\n", ts7_arg.f2);
     1007    printf ("%g\n", ts7_arg.d);
     1008
     1009    ffi_call(&cif, FFI_FN(struct7), ts7_result, values);
     1010
     1011    printf ("%g\n", ts7_result->f1);
     1012    printf ("%g\n", ts7_result->f2);
     1013    printf ("%g\n", ts7_result->d);
     1014
     1015    CHECK(ts7_result->f1 == 5.55f + 1);
     1016    CHECK(ts7_result->f2 == 55.5f + 1);
     1017    CHECK(ts7_result->d == 6.66 + 1);
     1018
     1019    printf("structure test 7 ok!\n");
     1020
     1021    free (ts7_result);
     1022  }
     1023
     1024  /* struct tests */
     1025  {
     1026    test_structure_8 ts8_arg;
     1027
     1028    /* This is a hack to get a properly aligned result buffer */
     1029    test_structure_8 *ts8_result =
     1030      (test_structure_8 *) malloc (sizeof(test_structure_8));
     1031
     1032    args[0] = &ts8_type;
     1033    values[0] = &ts8_arg;
     1034
     1035    /* Initialize the cif */
     1036    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK);
     1037
     1038    ts8_arg.f1 = 5.55f;
     1039    ts8_arg.f2 = 55.5f;
     1040    ts8_arg.f3 = -5.55f;
     1041    ts8_arg.f4 = -55.5f;
     1042
     1043    printf ("%g\n", ts8_arg.f1);
     1044    printf ("%g\n", ts8_arg.f2);
     1045    printf ("%g\n", ts8_arg.f3);
     1046    printf ("%g\n", ts8_arg.f4);
     1047
     1048    ffi_call(&cif, FFI_FN(struct8), ts8_result, values);
     1049
     1050    printf ("%g\n", ts8_result->f1);
     1051    printf ("%g\n", ts8_result->f2);
     1052    printf ("%g\n", ts8_result->f3);
     1053    printf ("%g\n", ts8_result->f4);
     1054
     1055    CHECK(ts8_result->f1 == 5.55f + 1);
     1056    CHECK(ts8_result->f2 == 55.5f + 1);
     1057    CHECK(ts8_result->f3 == -5.55f + 1);
     1058    CHECK(ts8_result->f4 == -55.5f + 1);
     1059
     1060    printf("structure test 8 ok!\n");
     1061
     1062    free (ts8_result);
     1063  }
     1064
     1065  /* struct tests */
     1066  {
     1067    test_structure_9 ts9_arg;
     1068
     1069    /* This is a hack to get a properly aligned result buffer */
     1070    test_structure_9 *ts9_result =
     1071      (test_structure_9 *) malloc (sizeof(test_structure_9));
     1072
     1073    args[0] = &ts9_type;
     1074    values[0] = &ts9_arg;
     1075
     1076    /* Initialize the cif */
     1077    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK);
     1078
     1079    ts9_arg.f = 5.55f;
     1080    ts9_arg.i = 5;
     1081
     1082    printf ("%g\n", ts9_arg.f);
     1083    printf ("%d\n", ts9_arg.i);
     1084
     1085    ffi_call(&cif, FFI_FN(struct9), ts9_result, values);
     1086
     1087    printf ("%g\n", ts9_result->f);
     1088    printf ("%d\n", ts9_result->i);
     1089
     1090    CHECK(ts9_result->f == 5.55f + 1);
     1091    CHECK(ts9_result->i == 5 + 1);
     1092
     1093    printf("structure test 9 ok!\n");
     1094
     1095    free (ts9_result);
     1096  }
     1097
    7001098#else
    7011099  printf("Structure passing doesn't work on Win32.\n");
    7021100#endif /* X86_WIN32 */
    7031101
     1102#ifdef X86_WIN32
     1103  /* stdcall strlen tests */
     1104  {
     1105    args[0] = &ffi_type_pointer;
     1106    values[0] = (void*) &s;
     1107
     1108    /* Initialize the cif */
     1109    CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1,
     1110                       &ffi_type_sint, args) == FFI_OK);
     1111
     1112    s = "a";
     1113    ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
     1114    CHECK(rint == 1);
     1115
     1116    s = "1234567";
     1117    ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
     1118    CHECK(rint == 7);
     1119
     1120    s = "1234567890123456789012345";
     1121    ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
     1122    CHECK(rint == 25);
     1123
     1124    printf("stdcall strlen tests passed\n");
     1125  }
     1126
     1127  /* stdcall many arg tests */
     1128  {
     1129    float ff;
     1130    float fa[13];
     1131
     1132    for (ul = 0; ul < 13; ul++)
     1133      {
     1134        args[ul] = &ffi_type_float;
     1135        values[ul] = &fa[ul];
     1136        fa[ul] = (float) ul;
     1137      }
     1138
     1139    /* Initialize the cif */
     1140    CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13,
     1141                       &ffi_type_float, args) == FFI_OK);
     1142
     1143    /*@-usedef@*/
     1144    ff =  stdcall_many(fa[0], fa[1],
     1145               fa[2], fa[3],
     1146               fa[4], fa[5],
     1147               fa[6], fa[7],
     1148               fa[8], fa[9],
     1149               fa[10],fa[11],fa[12]);
     1150    /*@=usedef@*/
     1151
     1152    ffi_call(&cif, FFI_FN(stdcall_many), &f, values);
     1153
     1154    /*@-realcompare@*/
     1155    if (f - ff < FLT_EPSILON)
     1156    /*@=realcompare@*/
     1157        printf("stdcall many arg tests ok!\n");
     1158    else
     1159        CHECK(0);
     1160  }
     1161#endif /* X86_WIN32 */
     1162
    7041163# if FFI_CLOSURES
    7051164  /* A simple closure test */
    7061165    {
    707       ffi_closure cl;
    708       ffi_type * cl_arg_types[3];
    709 
    710       cl_arg_types[0] = &ffi_type_sint;
     1166      (void) puts("\nEnter FFI_CLOSURES\n");
     1167
     1168      cl_arg_types[0] = &ffi_type_uint64;
     1169      cl_arg_types[1] = &ffi_type_uint;
     1170      cl_arg_types[2] = &ffi_type_uint64;
     1171      cl_arg_types[3] = &ffi_type_uint;
     1172      cl_arg_types[4] = &ffi_type_sshort;
     1173      cl_arg_types[5] = &ffi_type_uint64;
     1174      cl_arg_types[6] = &ffi_type_uint;
     1175      cl_arg_types[7] = &ffi_type_uint;
     1176      cl_arg_types[8] = &ffi_type_double;
     1177      cl_arg_types[9] = &ffi_type_uint;
     1178      cl_arg_types[10] = &ffi_type_uint;
     1179      cl_arg_types[11] = &ffi_type_float;
     1180      cl_arg_types[12] = &ffi_type_uint;
     1181      cl_arg_types[13] = &ffi_type_uint;
     1182      cl_arg_types[14] = &ffi_type_uint;
     1183      cl_arg_types[15] = &ffi_type_uint;
     1184      cl_arg_types[16] = NULL;   
     1185
     1186      /* Initialize the cif */
     1187      CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
     1188                         &ffi_type_sint, cl_arg_types) == FFI_OK);
     1189
     1190      CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn,
     1191                             (void *) 3 /* userdata */) == FFI_OK);
     1192     
     1193      CHECK((*((closure_test_type)(&cl)))
     1194            (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
     1195             19, 21, 1) == 680);
     1196    }
     1197
     1198    {
     1199
     1200      cl_arg_types[0] = &ffi_type_float;
    7111201      cl_arg_types[1] = &ffi_type_float;
    712       cl_arg_types[2] = NULL;
     1202      cl_arg_types[2] = &ffi_type_float;
     1203      cl_arg_types[3] = &ffi_type_float;
     1204      cl_arg_types[4] = &ffi_type_sshort;
     1205      cl_arg_types[5] = &ffi_type_float;
     1206      cl_arg_types[6] = &ffi_type_float;
     1207      cl_arg_types[7] = &ffi_type_uint;
     1208      cl_arg_types[8] = &ffi_type_double;
     1209      cl_arg_types[9] = &ffi_type_uint;
     1210      cl_arg_types[10] = &ffi_type_uint;
     1211      cl_arg_types[11] = &ffi_type_float;
     1212      cl_arg_types[12] = &ffi_type_uint;
     1213      cl_arg_types[13] = &ffi_type_uint;
     1214      cl_arg_types[14] = &ffi_type_uint;
     1215      cl_arg_types[15] = &ffi_type_uint;
     1216      cl_arg_types[16] = NULL;
    7131217     
    7141218      /* Initialize the cif */
    715       CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
    716                          &ffi_type_sint, cl_arg_types) == FFI_OK);
    717 
    718       CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn,
    719                              (void *) 3 /* userdata */)
    720             == FFI_OK);
    721       CHECK((*((closure_test_type)(&cl)))(1, 2.0) == 6);
     1219      CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
     1220                         &ffi_type_sint, cl_arg_types) == FFI_OK);
     1221
     1222      CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn1,
     1223                             (void *) 3 /* userdata */)  == FFI_OK);
     1224     
     1225      CHECK((*((closure_test_type1)(&cl)))
     1226            (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
     1227             19, 21, 1) == 255);
    7221228    }
     1229
     1230    {
     1231
     1232      cl_arg_types[0] = &ffi_type_double;
     1233      cl_arg_types[1] = &ffi_type_double;
     1234      cl_arg_types[2] = &ffi_type_double;
     1235      cl_arg_types[3] = &ffi_type_double;
     1236      cl_arg_types[4] = &ffi_type_sshort;
     1237      cl_arg_types[5] = &ffi_type_double;
     1238      cl_arg_types[6] = &ffi_type_double;
     1239      cl_arg_types[7] = &ffi_type_uint;
     1240      cl_arg_types[8] = &ffi_type_double;
     1241      cl_arg_types[9] = &ffi_type_uint;
     1242      cl_arg_types[10] = &ffi_type_uint;
     1243      cl_arg_types[11] = &ffi_type_float;
     1244      cl_arg_types[12] = &ffi_type_uint;
     1245      cl_arg_types[13] = &ffi_type_float;
     1246      cl_arg_types[14] = &ffi_type_uint;
     1247      cl_arg_types[15] = &ffi_type_uint;
     1248      cl_arg_types[16] = NULL;
     1249     
     1250      /* Initialize the cif */
     1251      CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
     1252                         &ffi_type_sint, cl_arg_types) == FFI_OK);
     1253
     1254      CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn2,
     1255                             (void *) 3 /* userdata */) == FFI_OK);
     1256
     1257      CHECK((*((closure_test_type2)(&cl)))
     1258            (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
     1259             19.0, 21, 1) == 255);
     1260
     1261    }
     1262
     1263    {
     1264
     1265      cl_arg_types[0] = &ffi_type_float;
     1266      cl_arg_types[1] = &ffi_type_float;
     1267      cl_arg_types[2] = &ffi_type_float;
     1268      cl_arg_types[3] = &ffi_type_float;
     1269      cl_arg_types[4] = &ffi_type_float;
     1270      cl_arg_types[5] = &ffi_type_float;
     1271      cl_arg_types[6] = &ffi_type_float;
     1272      cl_arg_types[7] = &ffi_type_float;
     1273      cl_arg_types[8] = &ffi_type_double;
     1274      cl_arg_types[9] = &ffi_type_uint;
     1275      cl_arg_types[10] = &ffi_type_float;
     1276      cl_arg_types[11] = &ffi_type_float;
     1277      cl_arg_types[12] = &ffi_type_uint;
     1278      cl_arg_types[13] = &ffi_type_float;
     1279      cl_arg_types[14] = &ffi_type_float;
     1280      cl_arg_types[15] = &ffi_type_uint;
     1281      cl_arg_types[16] = NULL;
     1282     
     1283      /* Initialize the cif */
     1284      CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
     1285                         &ffi_type_sint, cl_arg_types) == FFI_OK);
     1286
     1287      CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn3,
     1288                             (void *) 3 /* userdata */)  == FFI_OK);
     1289     
     1290      CHECK((*((closure_test_type3)(&cl)))
     1291            (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
     1292             19.19, 21.21, 1) == 135);
     1293    }
     1294
     1295    (void) puts("\nFinished FFI_CLOSURES\n");
     1296
    7231297# endif
    7241298
  • branches/GNU/src/gcc/libffi/src/java_raw_api.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    8282        case FFI_TYPE_UINT8:
    8383        case FFI_TYPE_SINT8:
    84           *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1);
     84          *args = (void*) ((char*)(raw++) + 3);
    8585          break;
    8686         
    8787        case FFI_TYPE_UINT16:
    8888        case FFI_TYPE_SINT16:
    89           *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2);
    90           break;
    91 
    92 #if SIZEOF_ARG >= 4       
    93         case FFI_TYPE_UINT32:
    94         case FFI_TYPE_SINT32:
    95           *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4);
    96           break;
    97 #endif
    98        
     89          *args = (void*) ((char*)(raw++) + 2);
     90          break;
     91
    9992#if SIZEOF_ARG == 8       
    10093        case FFI_TYPE_UINT64:
     
    158151        {
    159152        case FFI_TYPE_UINT8:
     153#if WORDS_BIGENDIAN
     154          *(UINT32*)(raw++) = *(UINT8*) (*args);
     155#else
    160156          (raw++)->uint = *(UINT8*) (*args);
     157#endif
    161158          break;
    162159
    163160        case FFI_TYPE_SINT8:
     161#if WORDS_BIGENDIAN
     162          *(SINT32*)(raw++) = *(SINT8*) (*args);
     163#else
    164164          (raw++)->sint = *(SINT8*) (*args);
     165#endif
    165166          break;
    166167
    167168        case FFI_TYPE_UINT16:
     169#if WORDS_BIGENDIAN
     170          *(UINT32*)(raw++) = *(UINT16*) (*args);
     171#else
    168172          (raw++)->uint = *(UINT16*) (*args);
     173#endif
    169174          break;
    170175
    171176        case FFI_TYPE_SINT16:
     177#if WORDS_BIGENDIAN
     178          *(SINT32*)(raw++) = *(SINT16*) (*args);
     179#else
    172180          (raw++)->sint = *(SINT16*) (*args);
    173           break;
    174 
    175 #if SIZEOF_ARG >= 4
     181#endif
     182          break;
     183
    176184        case FFI_TYPE_UINT32:
     185#if WORDS_BIGENDIAN
     186          *(UINT32*)(raw++) = *(UINT32*) (*args);
     187#else
    177188          (raw++)->uint = *(UINT32*) (*args);
     189#endif
    178190          break;
    179191
    180192        case FFI_TYPE_SINT32:
     193#if WORDS_BIGENDIAN
     194          *(SINT32*)(raw++) = *(SINT32*) (*args);
     195#else
    181196          (raw++)->sint = *(SINT32*) (*args);
    182           break;
    183 #endif
    184         case FFI_TYPE_FLOAT:
     197#endif
     198          break;
     199
     200        case FFI_TYPE_FLOAT:
    185201          (raw++)->flt = *(FLOAT32*) (*args);
    186202          break;
     
    212228#if !FFI_NATIVE_RAW_API
    213229
     230static void
     231ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
     232{
     233#if WORDS_BIGENDIAN && SIZEOF_ARG == 8
     234  switch (cif->rtype->type)
     235    {
     236    case FFI_TYPE_UINT8:
     237    case FFI_TYPE_UINT16:
     238    case FFI_TYPE_UINT32:
     239      *(UINT64 *)rvalue <<= 32;
     240      break;
     241
     242    case FFI_TYPE_SINT8:
     243    case FFI_TYPE_SINT16:
     244    case FFI_TYPE_SINT32:
     245    case FFI_TYPE_INT:
     246      *(SINT64 *)rvalue <<= 32;
     247      break;
     248
     249    default:
     250      break;
     251    }
     252#endif
     253}
     254
     255static void
     256ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue)
     257{
     258#if WORDS_BIGENDIAN && SIZEOF_ARG == 8
     259  switch (cif->rtype->type)
     260    {
     261    case FFI_TYPE_UINT8:
     262    case FFI_TYPE_UINT16:
     263    case FFI_TYPE_UINT32:
     264      *(UINT64 *)rvalue >>= 32;
     265      break;
     266
     267    case FFI_TYPE_SINT8:
     268    case FFI_TYPE_SINT16:
     269    case FFI_TYPE_SINT32:
     270    case FFI_TYPE_INT:
     271      *(SINT64 *)rvalue >>= 32;
     272      break;
     273
     274    default:
     275      break;
     276    }
     277#endif
     278}
    214279
    215280/* This is a generic definition of ffi_raw_call, to be used if the
     
    228293  ffi_java_raw_to_ptrarray (cif, raw, avalue);
    229294  ffi_call (cif, fn, rvalue, avalue);
     295  ffi_java_rvalue_to_raw (cif, rvalue);
    230296}
    231297
     
    241307  ffi_java_ptrarray_to_raw (cif, avalue, raw);
    242308  (*cl->fun) (cif, rvalue, raw, cl->user_data);
     309  ffi_java_raw_to_rvalue (cif, rvalue);
    243310}
    244311
  • branches/GNU/src/gcc/libffi/src/m68k/ffi.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1717{
    1818  unsigned int i;
    19   int tmp;
    20   unsigned int avn;
    2119  void **p_argv;
    2220  char *argp;
     
    2422  void *struct_value_ptr;
    2523
    26   tmp = 0;
    2724  argp = stack;
    2825
     
    3330    struct_value_ptr = NULL;
    3431
    35   avn = ecif->cif->nargs;
    3632  p_argv = ecif->avalue;
    3733
    3834  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
    39        i != 0 && avn != 0;
     35       i != 0;
    4036       i--, p_arg++)
    4137    {
     
    4642        argp = (char *) ALIGN (argp, (*p_arg)->alignment);
    4743
    48       if (avn != 0)
    49         {
    50           avn--;
    5144          z = (*p_arg)->size;
    5245          if (z < sizeof (int))
     
    8376          p_argv++;
    8477          argp += z;
    85         }
    8678    }
    8779
  • branches/GNU/src/gcc/libffi/src/mips/ffi.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    2424   ----------------------------------------------------------------------- */
    2525
     26#include <sgidefs.h>
    2627#include <ffi.h>
    2728#include <ffi_common.h>
     
    5152{
    5253  register int i;
    53   register int avn;
    5454  register void **p_argv;
    5555  register char *argp;
     
    8181    }
    8282
    83   avn = ecif->cif->nargs;
    8483  p_argv = ecif->avalue;
    8584
    86   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
    87        i && avn;
    88        i--, p_arg++)
     85  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
    8986    {
    9087      size_t z;
     
    10299#endif     
    103100
    104       if (avn)
    105         {
    106           avn--;
    107101          z = (*p_arg)->size;
    108102          if (z < sizeof(SLOT_TYPE_UNSIGNED))
     
    180174          argp += z;
    181175          FIX_ARGP;
    182         }
    183176    }
    184177 
  • branches/GNU/src/gcc/libffi/src/powerpc/aix_closure.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    aix_closures.S - Copyright (c) 2002 Free Software Foundation, Inc.
    3    based on darwin_closures.S
     2   aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc.
     3   based on darwin_closure.S
    44 
    55   PowerPC Assembly glue.
     
    107107        /* 32 Bytes (params) */
    108108        /* 104 Bytes (13*8 from FPR) */
    109         /* 4 Bytes (result)
    110         /* 164 Bytes */
    111        
    112         stwu r1,-164(r1)        /* skip over caller save area */
     109        /* 8 Bytes (result)
     110        /* 168 Bytes */
     111       
     112        stwu r1,-176(r1)        /* skip over caller save area
     113                                keep stack aligned to 16  */
    113114
    114115/* we want to build up an area for the parameters passed */
    115116/* in registers (both floating point and integer) */
    116117       
    117         /* we store gpr 3 to gpr 10 (aligned to 4) */
    118         /* in the parents outgoing area            */
    119         stw   r3, 188(r1)
    120         stw   r4, 192(r1)
    121         stw   r5, 196(r1)
    122         stw   r6, 200(r1)
    123         stw   r7, 204(r1)
    124         stw   r8, 208(r1)
    125         stw   r9, 212(r1)
    126         stw   r10, 216(r1)
     118        /* we store gpr 3 to gpr 10 (aligned to 4)
     119        in the parents outgoing area  */
     120        stw   r3, 200(r1)
     121        stw   r4, 204(r1)
     122        stw   r5, 208(r1)
     123        stw   r6, 212(r1)
     124        stw   r7, 216(r1)
     125        stw   r8, 220(r1)
     126        stw   r9, 224(r1)
     127        stw   r10, 228(r1)
    127128
    128129        /* next save fpr 1 to fpr 13 (aligned to 8) */
     
    149150       
    150151        /* now load up the pointer to the saved gpr registers */
    151         addi r5,r1,188
     152        addi r5,r1,200
    152153
    153154        /* now load up the pointer to the saved fpr registers */
     
    156157        /* now load up the pointer to the outgoing parameter  */
    157158        /* stack in the previous frame */
    158         addi r7,r1,220
     159        addi r7,r1,232
    159160       
    160161        /* make the call */
     
    244245L..44:
    245246       
    246         addi r1,r1,164          /* restore stack pointer */
     247        addi r1,r1,176          /* restore stack pointer */
    247248        lwz r0,8(r1)            /* get return address */
    248249        mtlr r0                 /* reset link register */
  • branches/GNU/src/gcc/libffi/src/powerpc/darwin.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    33   
    44   PowerPC Assembly glue.
    5 
    6    $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $
    75
    86   Permission is hereby granted, free of charge, to any person obtaining
     
    4038        .align 2
    4139_ffi_call_DARWIN:
    42         mr      r12,r8 // We only need r12 until the call, so it doesn't have to be saved...
     40LFB0:   
     41        mr      r12,r8          /* We only need r12 until the call,
     42                                so it doesn't have to be saved...  */
     43LFB1:   
    4344        /* Save the old stack pointer as AP.  */
    4445        mr      r8,r1
    45 
     46LCFI0: 
    4647        /* Allocate the stack space we need.  */
    4748        stwux   r1,r1,r4       
     
    5051        mflr    r9
    5152
    52         stw     r28,-16(r8)
     53        stw     r28,-16(r8)     
    5354        stw     r29,-12(r8)
    5455        stw     r30, -8(r8)
    5556        stw     r31, -4(r8)
    56        
    57         stw     r9,  8(r8)
     57
     58        stw     r9,  8(r8)     
    5859        stw     r2, 20(r1)
     60LCFI1: 
    5961
    6062        /* Save arguments over call...  */
    61         mr      r31,r5  /* flags, */
    62         mr      r30,r6  /* rvalue, */
    63         mr      r29,r7  /* function address, */
    64         mr      r28,r8  /* our AP. */
    65                
     63        mr      r31,r5  /* flags,  */
     64        mr      r30,r6  /* rvalue,  */
     65        mr      r29,r7  /* function address,  */
     66        mr      r28,r8  /* our AP.  */
     67LCFI2:         
    6668        /* Call ffi_prep_args.  */
    6769        mr      r4,r1
     
    146148        stfs    f1,0(r30)
    147149        b       L(done_return_value)
    148 //END(_ffi_call_DARWIN)
     150LFE1:   
     151/* END(_ffi_call_DARWIN)  */
    149152
    150153/* Provide a null definition of _ffi_call_AIX.  */
     
    156159_ffi_call_AIX:
    157160        blr
    158 //END(_ffi_call_AIX)
    159 
     161/* END(_ffi_call_AIX)  */
     162
     163.data
     164.section __TEXT,__eh_frame
     165Lframe1:
     166        .set    L$set$0,LECIE1-LSCIE1
     167        .long   L$set$0 ; Length of Common Information Entry
     168LSCIE1:
     169        .long   0x0     ; CIE Identifier Tag
     170        .byte   0x1     ; CIE Version
     171        .ascii  "zR\0"  ; CIE Augmentation
     172        .byte   0x1     ; uleb128 0x1; CIE Code Alignment Factor
     173        .byte   0x7c    ; sleb128 -4; CIE Data Alignment Factor
     174        .byte   0x41    ; CIE RA Column
     175        .byte   0x1     ; uleb128 0x1; Augmentation size
     176        .byte   0x10    ; FDE Encoding (pcrel)
     177        .byte   0xc     ; DW_CFA_def_cfa
     178        .byte   0x1     ; uleb128 0x1
     179        .byte   0x0     ; uleb128 0x0
     180        .align  2
     181LECIE1:
     182LSFDE1:
     183        .set    L$set$1,LEFDE1-LASFDE1
     184        .long   L$set$1 ; FDE Length
     185LASFDE1:
     186        .set    L$set$2,LASFDE1-Lframe1
     187        .long   L$set$2 ; FDE CIE offset
     188        .long   LFB0-.  ; FDE initial location
     189        .set    L$set$3,LFE1-LFB0
     190        .long   L$set$3 ; FDE address range
     191        .byte   0x0     ; uleb128 0x0; Augmentation size
     192        .byte   0x4     ; DW_CFA_advance_loc4
     193        .set    L$set$4,LCFI0-LFB1
     194        .long   L$set$4
     195        .byte   0xd     ; DW_CFA_def_cfa_register
     196        .byte   0x08    ; uleb128 0x08
     197        .byte   0x4     ; DW_CFA_advance_loc4
     198        .set    L$set$5,LCFI1-LCFI0
     199        .long   L$set$5
     200        .byte   0x11    ; DW_CFA_offset_extended_sf
     201        .byte   0x41    ; uleb128 0x41
     202        .byte   0x7e    ; sleb128 -2
     203        .byte   0x9f    ; DW_CFA_offset, column 0x1f
     204        .byte   0x1     ; uleb128 0x1
     205        .byte   0x9e    ; DW_CFA_offset, column 0x1e
     206        .byte   0x2     ; uleb128 0x2
     207        .byte   0x9d    ; DW_CFA_offset, column 0x1d
     208        .byte   0x3     ; uleb128 0x3
     209        .byte   0x9c    ; DW_CFA_offset, column 0x1c
     210        .byte   0x4     ; uleb128 0x4
     211        .byte   0x4     ; DW_CFA_advance_loc4
     212        .set    L$set$6,LCFI2-LCFI1
     213        .long   L$set$6
     214        .byte   0xd     ; DW_CFA_def_cfa_register
     215        .byte   0x1c    ; uleb128 0x1c
     216        .align 2
     217LEFDE1:
     218       
  • branches/GNU/src/gcc/libffi/src/powerpc/darwin_closure.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    darwin_closures.S - Copyright (c) 2002 Free Software Foundation, Inc.
    3    based on ppc_closures.S
     2   darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation,
     3   Inc. based on ppc_closure.S
    44 
    55   PowerPC Assembly glue.
     
    3838        .align 2
    3939_ffi_closure_ASM:
    40        
    41         mflr r0                 /* extract return address */
    42         stw r0, 8(r1)           /* save the return address */
    43        
    44         /* 24 Bytes (Linkage Area) */
    45         /* 32 Bytes (outgoing parameter area, always reserved) */
    46         /* 104 Bytes (13*8 from FPR) */
    47         /* 4 Bytes (result)
    48         /* 164 Bytes */
    49        
    50         stwu r1,-164(r1)        /* skip over caller save area */
    51        
    52 /* we want to build up an area for the parameters passed */
    53 /* in registers (both floating point and integer) */
    54        
    55         /* we store gpr 3 to gpr 10 (aligned to 4) */
    56         /* in the parents outgoing area            */
    57         stw   r3, 188(r1)
    58         stw   r4, 192(r1)
    59         stw   r5, 196(r1)
    60         stw   r6, 200(r1)
    61         stw   r7, 204(r1)
    62         stw   r8, 208(r1)
    63         stw   r9, 212(r1)
    64         stw   r10, 216(r1)
     40LFB1:           
     41        mflr r0                 /* extract return address  */
     42        stw r0, 8(r1)           /* save the return address  */
     43LCFI0: 
     44        /* 24 Bytes (Linkage Area)
     45           32 Bytes (outgoing parameter area, always reserved)
     46           104 Bytes (13*8 from FPR)   
     47           8 Bytes (result)
     48           168 Bytes  */
     49       
     50        stwu r1,-176(r1)        /* skip over caller save area
     51                                keep stack aligned to 16  */
     52LCFI1:         
     53        /* we want to build up an area for the parameters passed
     54        in registers (both floating point and integer)  */
     55       
     56        /* we store gpr 3 to gpr 10 (aligned to 4)
     57        in the parents outgoing area  */
     58        stw   r3, 200(r1)
     59        stw   r4, 204(r1)
     60        stw   r5, 208(r1)
     61        stw   r6, 212(r1)
     62        stw   r7, 216(r1)
     63        stw   r8, 220(r1)
     64        stw   r9, 224(r1)
     65        stw   r10, 228(r1)
    6566
    6667        /* we save fpr 1 to fpr 13 (aligned to 8) */
     
    8687        addi r4,r1,160
    8788       
    88         /* now load up the pointer to the saved gpr registers */
    89         addi r5,r1,188
     89        /* now load up the pointer to the saved gpr registers  */
     90        addi r5,r1,200
    9091
    9192        /* now load up the pointer to the saved fpr registers */
    9293        addi r6,r1,56
    9394
    94         /* now load up the pointer to the outgoing parameter  */
    95         /* stack in the previous frame */
    96         addi r7,r1,220
     95        /* now load up the pointer to the outgoing parameter
     96        stack in the previous frame */
     97        addi r7,r1,232
    9798       
    9899        /* make the call */
     
    112113        add r3,r3,r4            /* add contents of table to table address */
    113114        mtctr r3
    114         bctr                    /* jump to it */
     115        bctr                    /* jump to it  */
     116LFE1:
     117        .align  2
    115118
    116119.L60:
     
    181184.L44:
    182185       
    183         addi r1,r1,164          /* restore stack pointer */
    184         lwz r0,8(r1)            /* get return address */
    185         mtlr r0                 /* reset link register */
     186        addi r1,r1,176          /* restore stack pointer */
     187        lwz r0,8(r1)            /* get return address  */
     188        mtlr r0                 /* reset link register  */
    186189        blr
    187190       
    188 /* END(ffi_closure_ASM) */
    189 
     191/* END(ffi_closure_ASM)  */
     192
     193.data
     194.section __TEXT,__eh_frame
     195Lframe1:
     196        .set    L$set$0,LECIE1-LSCIE1
     197        .long   L$set$0 ; Length of Common Information Entry
     198LSCIE1:
     199        .long   0x0     ; CIE Identifier Tag
     200        .byte   0x1     ; CIE Version
     201        .ascii  "zR\0"  ; CIE Augmentation
     202        .byte   0x1     ; uleb128 0x1; CIE Code Alignment Factor
     203        .byte   0x7c    ; sleb128 -4; CIE Data Alignment Factor
     204        .byte   0x41    ; CIE RA Column
     205        .byte   0x1     ; uleb128 0x1; Augmentation size
     206        .byte   0x10    ; FDE Encoding (pcrel)
     207        .byte   0xc     ; DW_CFA_def_cfa
     208        .byte   0x1     ; uleb128 0x1
     209        .byte   0x0     ; uleb128 0x0
     210        .align  2
     211LECIE1:
     212LSFDE1:
     213        .set    L$set$1,LEFDE1-LASFDE1
     214        .long   L$set$1 ; FDE Length
     215
     216LASFDE1:
     217        .set    L$set$2,LASFDE1-Lframe1
     218        .long   L$set$2 ; FDE CIE offset
     219        .long   LFB1-.  ; FDE initial location
     220        .set    L$set$3,LFE1-LFB1
     221        .long   L$set$3 ; FDE address range
     222        .byte   0x0     ; uleb128 0x0; Augmentation size
     223        .byte   0x4     ; DW_CFA_advance_loc4
     224        .set    L$set$3,LCFI1-LCFI0
     225        .long   L$set$3
     226        .byte   0xe     ; DW_CFA_def_cfa_offset
     227        .byte   176,1   ; uleb128 176
     228        .byte   0x4     ; DW_CFA_advance_loc4
     229        .set    L$set$4,LCFI0-LFB1
     230        .long   L$set$4
     231        .byte   0x11    ; DW_CFA_offset_extended_sf
     232        .byte   0x41    ; uleb128 0x41
     233        .byte   0x7e    ; sleb128 -2
     234        .align  2
     235LEFDE1:
     236
  • branches/GNU/src/gcc/libffi/src/powerpc/ffi.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    138138        {
    139139        case FFI_TYPE_FLOAT:
     140          double_tmp = *(float *)*p_argv;
     141          if (fparg_count >= NUM_FPR_ARG_REGISTERS)
     142            {
     143              *(float *)next_arg = (float)double_tmp;
     144              next_arg += 1;
     145            }
     146          else
     147            *fpr_base++ = double_tmp;
     148          fparg_count++;
     149          FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
     150          break;
     151
    140152        case FFI_TYPE_DOUBLE:
    141           if ((*ptr)->type == FFI_TYPE_FLOAT)
    142             double_tmp = *(float *)*p_argv;
    143           else
    144             double_tmp = *(double *)*p_argv;
     153          double_tmp = *(double *)*p_argv;
    145154
    146155          if (fparg_count >= NUM_FPR_ARG_REGISTERS)
     
    321330        {
    322331        case FFI_TYPE_FLOAT:
     332          fparg_count++;
     333          /* floating singles are not 8-aligned on stack */
     334          break;
     335
    323336        case FFI_TYPE_DOUBLE:
    324337          fparg_count++;
     
    613626            /* unfortunately float values are stored as doubles
    614627             * in the ffi_closure_SYSV code (since we don't check
    615              * the type in that routine).  This is also true
    616              * of floats passed on the outgoing parameter stack.
    617              * Also, on the outgoing stack all values are aligned
    618              * to 8
    619              *
    620              * Don't you just love the simplicity of this ABI!
     628             * the type in that routine).
    621629             */
    622630
     
    624632
    625633          if (nf < 8) {
    626              temp = *(double*)pfr;
     634             temp = *(double*)pfr;
    627635             *(float*)pfr = (float)temp;
    628              avalue[i] = pfr;
     636             avalue[i] = pfr;
    629637             nf++;
    630638             pfr+=2;
     
    635643             * naughty thing to do but...
    636644             */
    637              if (((long)pst) & 4) pst++;
    638              temp = *(double*)pst;
    639              *(float*)pst = (float)temp;
    640645             avalue[i] = pst;
    641646             nf++;
    642              pst+=2;
     647             pst+=1;
    643648          }
    644649          break;
  • branches/GNU/src/gcc/libffi/src/powerpc/ffi_darwin.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    66   Darwin ABI support (c) 2001 John Hornkvist
    77   AIX ABI support (c) 2002 Free Software Foundation, Inc.
    8 
    9    $Id: ffi_darwin.c,v 1.3.2.1 2002/03/12 22:35:56 tromey Exp $
    108
    119   Permission is hereby granted, free of charge, to any person obtaining
     
    413411                  | saved TOC pointer 4                   |
    414412                  +---------------------------------------+ 24
    415                   | always reserved 8*4=32  (revious GPRs)|
     413                  | always reserved 8*4=32 (previous GPRs)|
    416414                  | according to the linkage convention   |
    417                   | from AIX                              |
     415                  | from AIX                              |
    418416                  +---------------------------------------+ 56
    419                   | our FPR area 13*8=104                 |
    420                   | f1                                    |
    421                   | .                                     |
    422                   | f13                                   |
     417                  | our FPR area 13*8=104                 |
     418                  | f1                                    |
     419                  | .                                     |
     420                  | f13                                   |
    423421                  +---------------------------------------+ 160
    424                   | result area 4                         |
    425 SP current -->    +---------------------------------------+ 164 <- parent frame
     422                  | result area 8                         |
     423                  +---------------------------------------+ 168
     424                  | alignement to the next multiple of 16 |
     425SP current -->    +---------------------------------------+ 176 <- parent frame
    426426                  | back chain to caller 4                |
    427                   +---------------------------------------+ 168
     427                  +---------------------------------------+ 180
    428428                  | saved CR 4                            |
    429                   +---------------------------------------+ 172
     429                  +---------------------------------------+ 184
    430430                  | saved LR 4                            |
    431                   +---------------------------------------+ 176
     431                  +---------------------------------------+ 188
    432432                  | reserved for compilers 4              |
    433                   +---------------------------------------+ 180
     433                  +---------------------------------------+ 192
    434434                  | reserved for binders 4                |
    435                   +---------------------------------------+ 184
     435                  +---------------------------------------+ 196
    436436                  | saved TOC pointer 4                   |
    437                   +---------------------------------------+ 188
     437                  +---------------------------------------+ 200
    438438                  | always reserved 8*4=32  we store our  |
    439                   | GPRs here                             |
    440                   | r3                                    |
    441                   | .                                     |
    442                   | r10                                   |
    443                   +---------------------------------------+ 220
    444                   | PST area, overflow part               |
     439                  | GPRs here                             |
     440                  | r3                                    |
     441                  | .                                     |
     442                  | r10                                   |
     443                  +---------------------------------------+ 232
     444                  | PST area, overflow part               |
    445445                  +---------------------------------------+ xxx
    446                   | ????                                  |
     446                  | ????                                  |
    447447                  +---------------------------------------+ xxx
    448448
     
    456456  unsigned int *tramp;
    457457  struct ffi_aix_trampoline_struct *tramp_aix;
     458  aix_fd *fd;
    458459 
    459460  switch (cif->abi)
     
    487488
    488489      tramp_aix = (struct ffi_aix_trampoline_struct *) (closure->tramp);
    489       aix_fd *fd = (aix_fd *)(void *)ffi_closure_ASM;
     490      fd = (aix_fd *)(void *)ffi_closure_ASM;
    490491
    491492      FFI_ASSERT (cif->abi == FFI_AIX);
  • branches/GNU/src/gcc/libffi/src/prep_cif.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    104104  FFI_ASSERT(ffi_type_test(cif->rtype));
    105105
    106 #ifndef M68K
     106  /* x86-64 and s390 stack space allocation is handled in prep_machdep.  */
     107#if !defined M68K && !defined __x86_64__ && !defined S390
    107108  /* Make space for the return structure pointer */
    108109  if (cif->rtype->type == FFI_TYPE_STRUCT
     
    123124        return FFI_BAD_TYPEDEF;
    124125
     126#if !defined __x86_64__ && !defined S390
    125127#ifdef SPARC
    126128      if (((*ptr)->type == FFI_TYPE_STRUCT
     
    138140          bytes += STACK_ARG_SIZE((*ptr)->size);
    139141        }
     142#endif
    140143    }
    141144
  • branches/GNU/src/gcc/libffi/src/sparc/ffi.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    ffi.c - Copyright (c) 1996 Cygnus Solutions
     2   ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions
    33   
    44   Sparc Foreign Function Interface
     
    2929#include <stdlib.h>
    3030
     31#ifdef SPARC64
     32extern void ffi_closure_v9(void);
     33#else
     34extern void ffi_closure_v8(void);
     35#endif
     36
    3137/* ffi_prep_args is called by the assembly routine once stack space
    3238   has been allocated for the function's arguments */
     
    3541{
    3642  int i;
    37   int tmp;
    38   int avn;
    3943  void **p_argv;
    4044  char *argp;
    4145  ffi_type **p_arg;
    42 
    43   tmp = 0;
    4446
    4547  /* Skip 16 words for the window save area */
     
    6769#endif
    6870
    69   avn = ecif->cif->nargs;
    7071  p_argv = ecif->avalue;
    7172
    72   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
    73        i && avn;
    74        i--, p_arg++)
     73  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
    7574    {
    7675      size_t z;
    7776
    78       if (avn)
    79         {
    80           avn--;
    8177          if ((*p_arg)->type == FFI_TYPE_STRUCT
    8278#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
     
    123119          p_argv++;
    124120          argp += z;
    125         }
    126121    }
    127122 
     
    421416
    422417}
     418
     419ffi_status
     420ffi_prep_closure (ffi_closure* closure,
     421                  ffi_cif* cif,
     422                  void (*fun)(ffi_cif*, void*, void**, void*),
     423                  void *user_data)
     424{
     425  unsigned int *tramp = (unsigned int *) &closure->tramp[0];
     426  unsigned long fn;
     427  unsigned long ctx = (unsigned long) closure;
     428
     429#ifdef SPARC64
     430  /* Trampoline address is equal to the closure address.  We take advantage
     431     of that to reduce the trampoline size by 8 bytes. */
     432  FFI_ASSERT (cif->abi == FFI_V9);
     433  fn = (unsigned long) ffi_closure_v9;
     434  tramp[0] = 0x83414000;        /* rd   %pc, %g1        */
     435  tramp[1] = 0xca586010;        /* ldx  [%g1+16], %g5   */
     436  tramp[2] = 0x81c14000;        /* jmp  %g5             */
     437  tramp[3] = 0x01000000;        /* nop                  */
     438  *((unsigned long *) &tramp[4]) = fn;
     439#else
     440  FFI_ASSERT (cif->abi == FFI_V8);
     441  fn = (unsigned long) ffi_closure_v8;
     442  tramp[0] = 0x03000000 | fn >> 10;     /* sethi %hi(fn), %g1   */
     443  tramp[1] = 0x05000000 | ctx >> 10;    /* sethi %hi(ctx), %g2  */
     444  tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp   %g1+%lo(fn)    */
     445  tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or    %g2, %lo(ctx)  */
     446#endif
     447
     448  closure->cif = cif;
     449  closure->fun = fun;
     450  closure->user_data = user_data;
     451
     452  /* Flush the Icache.  FIXME: alignment isn't certain, assume 8 bytes */
     453#ifdef SPARC64
     454  asm volatile ("flush  %0" : : "r" (closure) : "memory");
     455  asm volatile ("flush  %0" : : "r" (((char *) closure) + 8) : "memory");
     456#else
     457  asm volatile ("iflush %0" : : "r" (closure) : "memory");
     458  asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory");
     459#endif
     460
     461  return FFI_OK;
     462}
     463
     464int
     465ffi_closure_sparc_inner(ffi_closure *closure,
     466  void *rvalue, unsigned long *gpr, double *fpr)
     467{
     468  ffi_cif *cif;
     469  void **avalue;
     470  ffi_type **arg_types;
     471  int i, avn, argn;
     472
     473  cif = closure->cif;
     474  avalue = alloca(cif->nargs * sizeof(void *));
     475
     476  argn = 0;
     477
     478  /* Copy the caller's structure return address to that the closure
     479     returns the data directly to the caller.  */
     480  if (cif->flags == FFI_TYPE_STRUCT)
     481    {
     482      rvalue = (void *) gpr[0];
     483      argn = 1;
     484    }
     485
     486  i = 0;
     487  avn = cif->nargs;
     488  arg_types = cif->arg_types;
     489 
     490  /* Grab the addresses of the arguments from the stack frame.  */
     491  while (i < avn)
     492    {
     493      /* Assume big-endian.  FIXME */
     494      argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
     495
     496#ifdef SPARC64
     497      if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT
     498                 || arg_types[i]->type == FFI_TYPE_DOUBLE
     499#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
     500                 || arg_types[i]->type == FFI_TYPE_LONGDOUBLE
     501#endif
     502                ))
     503        avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size;
     504      else
     505#endif
     506        avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size;
     507      i++;
     508    }
     509
     510  /* Invoke the closure.  */
     511  (closure->fun) (cif, rvalue, avalue, closure->user_data);
     512
     513  /* Tell ffi_closure_sparc how to perform return type promotions.  */
     514  return cif->rtype->type;
     515}
  • branches/GNU/src/gcc/libffi/src/sparc/v8.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    v8.S - Copyright (c) 1996, 1997 Cygnus Solutions
     2   v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions
    33   
    44   Sparc Foreign Function Interface
     
    9494.ffi_call_V8_end:
    9595        .size   ffi_call_V8,.ffi_call_V8_end-ffi_call_V8
     96
     97
     98#define STACKFRAME      104     /* 16*4 register window +
     99                                   1*4 struct return + 
     100                                   6*4 args backing store +
     101                                   3*4 locals */
     102
     103/* ffi_closure_v8(...)
     104
     105   Receives the closure argument in %g2.   */
     106
     107        .text
     108        .align 8
     109        .globl ffi_closure_v8
     110
     111ffi_closure_v8:
     112#ifdef HAVE_AS_REGISTER_PSEUDO_OP
     113                .register       %g2, #scratch
     114#endif
     115.LLFB2:
     116        save    %sp, -STACKFRAME, %sp
     117.LLCFI1:
     118
     119        ! Store all of the potential argument registers in va_list format.
     120        st      %i0, [%fp+68+0]
     121        st      %i1, [%fp+68+4]
     122        st      %i2, [%fp+68+8]
     123        st      %i3, [%fp+68+12]
     124        st      %i4, [%fp+68+16]
     125        st      %i5, [%fp+68+20]
     126
     127        ! Call ffi_closure_sparc_inner to do the bulk of the work.
     128        mov     %g2, %o0
     129        add     %fp, -8, %o1
     130        add     %fp,  68, %o2
     131        call    ffi_closure_sparc_inner
     132         mov    0, %o3
     133
     134        ! Load up the return value in the proper type.
     135        cmp     %o0, FFI_TYPE_VOID
     136        be      done1
     137
     138        cmp     %o0, FFI_TYPE_FLOAT
     139        be,a    done1
     140         ld     [%fp-8], %f0
     141
     142        cmp     %o0, FFI_TYPE_DOUBLE
     143        be,a    done1
     144         ldd    [%fp-8], %f0
     145
     146        cmp     %o0, FFI_TYPE_SINT64
     147        be,a    integer
     148         ld     [%fp-4], %i1
     149
     150        cmp     %o0, FFI_TYPE_UINT64
     151        be,a    integer
     152         ld     [%fp-4], %i1
     153
     154integer:
     155        ld      [%fp-8], %i0
     156
     157done1:
     158        ret
     159         restore
     160.LLFE2:
     161
     162.ffi_closure_v8_end:
     163        .size   ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8
    96164
    97165#ifdef SPARC64
     
    149217        .align  WS
    150218.LLEFDE1:
     219.LLSFDE2:
     220        .uaword .LLEFDE2-.LLASFDE2      ! FDE Length
     221.LLASFDE2:
     222        .uaword .LLASFDE2-.LLframe1     ! FDE CIE offset
     223#ifdef HAVE_AS_SPARC_UA_PCREL
     224        .uaword %r_disp32(.LLFB2)
     225        .uaword .LLFE2-.LLFB2   ! FDE address range
     226#else
     227        .align  WS
     228        .nword  .LLFB2
     229        .uanword .LLFE2-.LLFB2  ! FDE address range
     230#endif
     231        .byte   0x0     ! uleb128 0x0; Augmentation size
     232        .byte   0x4     ! DW_CFA_advance_loc4
     233        .uaword .LLCFI1-.LLFB2
     234        .byte   0xd     ! DW_CFA_def_cfa_register
     235        .byte   0x1e    ! uleb128 0x1e
     236        .byte   0x2d    ! DW_CFA_GNU_window_save
     237        .byte   0x9     ! DW_CFA_register
     238        .byte   0xf     ! uleb128 0xf
     239        .byte   0x1f    ! uleb128 0x1f
     240        .align  WS
     241.LLEFDE2:
  • branches/GNU/src/gcc/libffi/src/sparc/v9.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    v9.S - Copyright (c) 2000 Cygnus Solutions
     2   v9.S - Copyright (c) 2000, 2003 Cygnus Solutions
    33   
    44   Sparc 64bit Foreign Function Interface
     
    100100        be,pn   %icc, dostruct
    101101
    102          cmp    %i3, FFI_TYPE_LONGDOUBLE
     102        cmp     %i3, FFI_TYPE_LONGDOUBLE
    103103        bne,pt  %icc, done
    104104         nop
     
    125125.ffi_call_V9_end:
    126126        .size   ffi_call_V9,.ffi_call_V9_end-ffi_call_V9
     127
     128
     129#define STACKFRAME       240    /* 16*8 register window +
     130                                   6*8 args backing store +
     131                                   8*8 locals */
     132#define FP              %fp+STACK_BIAS
     133
     134/* ffi_closure_v9(...)
     135
     136   Receives the closure argument in %g1.   */
     137
     138        .text
     139        .align 8
     140        .globl ffi_closure_v9
     141
     142ffi_closure_v9:
     143.LLFB2:
     144        save    %sp, -STACKFRAME, %sp
     145.LLCFI1:
     146
     147        ! Store all of the potential argument registers in va_list format.
     148        stx     %i0, [FP+128+0]
     149        stx     %i1, [FP+128+8]
     150        stx     %i2, [FP+128+16]
     151        stx     %i3, [FP+128+24]
     152        stx     %i4, [FP+128+32]
     153        stx     %i5, [FP+128+40]
     154
     155        ! Store possible floating point argument registers too.
     156        std     %f0, [FP-48]
     157        std     %f2, [FP-40]
     158        std     %f4, [FP-32]
     159        std     %f6, [FP-24]
     160        std     %f8, [FP-16]
     161        std     %f10, [FP-8]
     162
     163        ! Call ffi_closure_sparc_inner to do the bulk of the work.
     164        mov     %g1, %o0
     165        add     %fp, STACK_BIAS-64, %o1
     166        add     %fp, STACK_BIAS+128, %o2
     167        call    ffi_closure_sparc_inner
     168         add    %fp, STACK_BIAS-48, %o3
     169
     170        ! Load up the return value in the proper type.
     171        cmp     %o0, FFI_TYPE_VOID
     172        be,pn   %icc, done1
     173
     174        cmp     %o0, FFI_TYPE_FLOAT
     175        be,a,pn %icc, done1
     176         ld     [FP-64], %f0
     177
     178        cmp     %o0, FFI_TYPE_DOUBLE
     179        be,a,pn %icc, done1
     180         ldd    [FP-64], %f0
     181
     182        cmp     %o0, FFI_TYPE_LONGDOUBLE
     183        be,a,pn %icc, longdouble1
     184         ldd    [FP-64], %f0
     185
     186        cmp     %o0, FFI_TYPE_STRUCT
     187        be,pn   %icc, struct1
     188
     189        ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER
     190        ldx     [FP-64], %i0
     191
     192done1:
     193        ret
     194         restore
     195
     196struct1:
     197        ldx [FP-56], %i2
     198        ret
     199         restore
     200
     201longdouble1:
     202        ldd     [FP-56], %f2
     203        ret
     204         restore
     205.LLFE2:
     206
     207.ffi_closure_v9_end:
     208        .size   ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9
    127209
    128210        .section        ".eh_frame",#alloc,#write
     
    170252        .align 8
    171253.LLEFDE1:
    172 
    173 #endif
     254.LLSFDE2:
     255        .uaword .LLEFDE2-.LLASFDE2      ! FDE Length
     256.LLASFDE2:
     257        .uaword .LLASFDE2-.LLframe1     ! FDE CIE offset
     258#ifdef HAVE_AS_SPARC_UA_PCREL
     259        .uaword %r_disp32(.LLFB2)
     260        .uaword .LLFE2-.LLFB2           ! FDE address range
     261#else
     262        .align 8
     263        .xword  .LLFB2
     264        .uaxword        .LLFE2-.LLFB2   ! FDE address range
     265#endif
     266        .byte   0x0     ! uleb128 0x0; Augmentation size
     267        .byte   0x4     ! DW_CFA_advance_loc4
     268        .uaword .LLCFI1-.LLFB2
     269        .byte   0xd     ! DW_CFA_def_cfa_register
     270        .byte   0x1e    ! uleb128 0x1e
     271        .byte   0x2d    ! DW_CFA_GNU_window_save
     272        .byte   0x9     ! DW_CFA_register
     273        .byte   0xf     ! uleb128 0xf
     274        .byte   0x1f    ! uleb128 0x1f
     275        .align 8
     276.LLEFDE2:
     277#endif
  • branches/GNU/src/gcc/libffi/src/types.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    4343FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT);
    4444
    45 #if defined ALPHA || defined SPARC64
     45#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \
     46    || defined IA64
    4647
    4748FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);
     
    5354#endif
    5455
    55 #ifdef X86
     56#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K
    5657
    5758FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
    5859FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
    5960
    60 #elif defined X86_WIN32
    61 
    62 FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
    63 FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
    64 
    65 #elif defined ARM
    66 
    67 FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
    68 FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
    69 
    70 #elif defined M68K
     61#elif defined SH
    7162
    7263FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
     
    8172
    8273
    83 #ifdef X86
    84 
    85 FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
    86 FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
    87 
    88 #elif defined X86_WIN32
     74#if defined X86 || defined X86_WIN32 || defined M68K
    8975
    9076FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
     
    9682FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
    9783
    98 #elif defined M68K
     84#elif defined SH
    9985
    10086FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
    101 FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
     87FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
    10288
    10389#elif defined SPARC
    10490
    10591FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
     92#ifdef SPARC64
     93FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
     94#else
     95FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE);
     96#endif
    10697
    107 #ifdef SPARC64
     98#elif defined X86_64
    10899
     100FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
    109101FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
    110 
    111 #else
    112 
    113 FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE);
    114 
    115 #endif
    116102
    117103#else
  • branches/GNU/src/gcc/libffi/src/x86/ffi.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    ffi.c - Copyright (c) 1996, 1998, 1999  Cygnus Solutions
     2   ffi.c - Copyright (c) 1996, 1998, 1999, 2001  Red Hat, Inc.
     3           Copyright (c) 2002  Ranjit Mathew
     4           Copyright (c) 2002  Bo Thorsen
     5           Copyright (c) 2002  Roger Sayle
    36   
    47   x86 Foreign Function Interface
     
    2427   ----------------------------------------------------------------------- */
    2528
     29#ifndef __x86_64__
     30
    2631#include <ffi.h>
    2732#include <ffi_common.h>
     
    3742{
    3843  register unsigned int i;
    39   register int tmp;
    4044  register void **p_argv;
    4145  register char *argp;
    4246  register ffi_type **p_arg;
    4347
    44   tmp = 0;
    4548  argp = stack;
    4649
     
    149152/*@=exportheader@*/
    150153
     154#ifdef X86_WIN32
     155/*@-declundef@*/
     156/*@-exportheader@*/
     157extern void ffi_call_STDCALL(void (*)(char *, extended_cif *),
     158                          /*@out@*/ extended_cif *,
     159                          unsigned, unsigned,
     160                          /*@out@*/ unsigned *,
     161                          void (*fn)());
     162/*@=declundef@*/
     163/*@=exportheader@*/
     164#endif /* X86_WIN32 */
     165
    151166void ffi_call(/*@dependent@*/ ffi_cif *cif,
    152167              void (*fn)(),
     
    181196      /*@=usedef@*/
    182197      break;
     198#ifdef X86_WIN32
     199    case FFI_STDCALL:
     200      /*@-usedef@*/
     201      ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes,
     202                    cif->flags, ecif.rvalue, fn);
     203      /*@=usedef@*/
     204      break;
     205#endif /* X86_WIN32 */
    183206    default:
    184207      FFI_ASSERT(0);
     
    192215static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
    193216                                         void** args, ffi_cif* cif);
    194 static void ffi_closure_SYSV ();
    195 static void ffi_closure_raw_SYSV ();
    196 
    197 /* This function is jumped to by the trampoline, on entry, %ecx (a
    198  * caller-save register) holds the address of the closure. 
    199  * Clearly, this requires __GNUC__, so perhaps we should translate this
    200  * into an assembly file if this is to be distributed with ffi.
    201  */
     217static void ffi_closure_SYSV (ffi_closure *)
     218     __attribute__ ((regparm(1)));
     219static void ffi_closure_raw_SYSV (ffi_raw_closure *)
     220     __attribute__ ((regparm(1)));
     221
     222/* This function is jumped to by the trampoline */
    202223
    203224static void
    204 ffi_closure_SYSV ()
     225ffi_closure_SYSV (closure)
     226     ffi_closure *closure;
    205227{
    206228  // this is our return value storage
     
    208230
    209231  // our various things...
    210   void          *args;
    211232  ffi_cif       *cif;
    212233  void         **arg_area;
    213   ffi_closure   *closure;
    214234  unsigned short rtype;
    215235  void          *resp = (void*)&res;
    216 
    217   /* grab the trampoline context pointer */
    218   asm ("movl %%ecx,%0" : "=r" (closure));
    219  
     236  void *args = __builtin_dwarf_cfa ();
     237
    220238  cif         = closure->cif;
    221239  arg_area    = (void**) alloca (cif->nargs * sizeof (void*)); 
    222   asm ("leal 8(%%ebp),%0" : "=q" (args)); 
    223240
    224241  /* this call will initialize ARG_AREA, such that each
     
    267284{
    268285  register unsigned int i;
    269   register int tmp;
    270286  register void **p_argv;
    271287  register char *argp;
    272288  register ffi_type **p_arg;
    273289
    274   tmp = 0;
    275290  argp = stack;
    276291
     
    282297  p_argv = avalue;
    283298
    284   for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
     299  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
    285300    {
    286301      size_t z;
    287302
    288303      /* Align if necessary */
    289       if (((*p_arg)->alignment - 1) & (unsigned) argp)
     304      if (((*p_arg)->alignment - 1) & (unsigned) argp) {
    290305        argp = (char *) ALIGN(argp, (*p_arg)->alignment);
     306      }
    291307
    292308      z = (*p_arg)->size;
     
    299315      argp += z;
    300316    }
    301 
     317 
    302318  return;
    303319}
     
    309325   unsigned int  __fun = (unsigned int)(FUN); \
    310326   unsigned int  __ctx = (unsigned int)(CTX); \
    311    unsigned int  __dis = __fun - ((unsigned int) __tramp + 10); \
    312    *(unsigned char*) &__tramp[0] = 0xb9; \
    313    *(unsigned int*)  &__tramp[1] = __ctx; \
    314    *(unsigned char*) &__tramp[5] = 0xe9; \
    315    *(unsigned int*)  &__tramp[6] = __dis; \
     327   unsigned int  __dis = __fun - ((unsigned int) __tramp + FFI_TRAMPOLINE_SIZE); \
     328   *(unsigned char*) &__tramp[0] = 0xb8; \
     329   *(unsigned int*)  &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
     330   *(unsigned char *) &__tramp[5] = 0xe9; \
     331   *(unsigned int*)  &__tramp[6] = __dis; /* jmp __fun  */ \
    316332 })
    317333
     
    343359
    344360static void
    345 ffi_closure_raw_SYSV ()
     361ffi_closure_raw_SYSV (closure)
     362     ffi_raw_closure *closure;
    346363{
    347364  // this is our return value storage
     
    349366
    350367  // our various things...
    351   void            *args;
    352368  ffi_raw         *raw_args;
    353369  ffi_cif         *cif;
    354   ffi_raw_closure *closure;
    355370  unsigned short   rtype;
    356371  void            *resp = (void*)&res;
    357372
    358   /* grab the trampoline context pointer */
    359   asm ("movl %%ecx,%0" : "=r" (closure));
    360 
    361   /* take the argument pointer */
    362   asm ("leal 8(%%ebp),%0" : "=q" (args)); 
    363 
    364373  /* get the cif */
    365374  cif = closure->cif;
    366375
    367376  /* the SYSV/X86 abi matches the RAW API exactly, well.. almost */
    368   raw_args = (ffi_raw*) args;
     377  raw_args = (ffi_raw*) __builtin_dwarf_cfa ();
    369378
    370379  (closure->fun) (cif, resp, raw_args, closure->user_data);
     
    450459              void (*fn)());
    451460
     461#ifdef X86_WIN32
     462extern void
     463ffi_call_STDCALL(void (*)(char *, extended_cif *),
     464              /*@out@*/ extended_cif *,
     465              unsigned, unsigned,
     466              /*@out@*/ unsigned *,
     467              void (*fn)());
     468#endif /* X86_WIN32 */
     469
    452470void
    453471ffi_raw_call(/*@dependent@*/ ffi_cif *cif,
     
    484502      /*@=usedef@*/
    485503      break;
     504#ifdef X86_WIN32
     505    case FFI_STDCALL:
     506      /*@-usedef@*/
     507      ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes,
     508                    cif->flags, ecif.rvalue, fn);
     509      /*@=usedef@*/
     510      break;
     511#endif /* X86_WIN32 */
    486512    default:
    487513      FFI_ASSERT(0);
     
    491517
    492518#endif
     519
     520#endif /* __x86_64__  */
  • branches/GNU/src/gcc/libffi/src/x86/sysv.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    sysv.S - Copyright (c) 1996, 1998, 2001  Cygnus Solutions
     2   sysv.S - Copyright (c) 1996, 1998, 2001, 2002  Cygnus Solutions
    33   
    44   X86 Foreign Function Interface
     
    2323   OTHER DEALINGS IN THE SOFTWARE.
    2424   ----------------------------------------------------------------------- */
     25
     26#ifndef __x86_64__
    2527
    2628#define LIBFFI_ASM     
     
    164166.LEFDE1:
    165167        .set    .LLFDE1,.LEFDE1-.LSFDE1
     168
     169#endif /* ifndef __x86_64__ */
  • branches/GNU/src/gcc/libffi/src/x86/win32.S

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* -----------------------------------------------------------------------
    2    win32.S - Copyright (c) 1996, 1998, 2001  Cygnus Solutions
     2   win32.S - Copyright (c) 1996, 1998, 2001, 2002  Red Hat, Inc.
     3             Copyright (c) 2001  John Beniton
     4             Copyright (c) 2002  Ranjit Mathew
     5                       
    36 
    47   X86 Foreign Function Interface
     
    5356        addl  $8,%esp
    5457 
    55         call  *28(%ebp)
     58        # FIXME: Align the stack to a 128-bit boundary to avoid
     59        # potential performance hits.
     60
     61        call  *28(%ebp)
    5662 
    5763        # Remove the space we pushed for the args
     
    124130 
    125131.ffi_call_SYSV_end:
     132
     133        # This assumes we are using gas.
     134        .balign 16
     135.globl _ffi_call_STDCALL
     136
     137_ffi_call_STDCALL:
     138        pushl %ebp
     139        movl  %esp,%ebp
     140
     141        # Make room for all of the new args.
     142        movl  16(%ebp),%ecx
     143        subl  %ecx,%esp
     144
     145        movl  %esp,%eax
     146
     147        # Place all of the ffi_prep_args in position
     148        pushl 12(%ebp)
     149        pushl %eax
     150        call  *8(%ebp)
     151
     152        # Return stack to previous state and call the function
     153        addl  $8,%esp
     154
     155        # FIXME: Align the stack to a 128-bit boundary to avoid
     156        # potential performance hits.
     157
     158        call  *28(%ebp)
     159
     160        # stdcall functions pop arguments off the stack themselves
     161
     162        # Load %ecx with the return type code
     163        movl  20(%ebp),%ecx
     164
     165        # If the return value pointer is NULL, assume no return value.
     166        cmpl  $0,24(%ebp)
     167        jne   sc_retint
     168
     169        # Even if there is no space for the return value, we are
     170        # obliged to handle floating-point values.
     171        cmpl  $FFI_TYPE_FLOAT,%ecx
     172        jne   sc_noretval
     173        fstp  %st(0)
     174
     175        jmp   sc_epilogue
     176
     177sc_retint:
     178        cmpl  $FFI_TYPE_INT,%ecx
     179        jne   sc_retfloat
     180        # Load %ecx with the pointer to storage for the return value
     181        movl  24(%ebp),%ecx
     182        movl  %eax,0(%ecx)
     183        jmp   sc_epilogue
     184
     185sc_retfloat:
     186        cmpl  $FFI_TYPE_FLOAT,%ecx
     187        jne   sc_retdouble
     188         # Load %ecx with the pointer to storage for the return value
     189        movl  24(%ebp),%ecx
     190        fstps (%ecx)
     191        jmp   sc_epilogue
     192
     193sc_retdouble:
     194        cmpl  $FFI_TYPE_DOUBLE,%ecx
     195        jne   sc_retlongdouble
     196        # Load %ecx with the pointer to storage for the return value
     197        movl  24(%ebp),%ecx
     198        fstpl (%ecx)
     199        jmp   sc_epilogue
     200
     201sc_retlongdouble:
     202        cmpl  $FFI_TYPE_LONGDOUBLE,%ecx
     203        jne   sc_retint64
     204        # Load %ecx with the pointer to storage for the return value
     205        movl  24(%ebp),%ecx
     206        fstpt (%ecx)
     207        jmp   sc_epilogue
     208
     209sc_retint64:
     210        cmpl  $FFI_TYPE_SINT64,%ecx
     211        jne   sc_retstruct
     212        # Load %ecx with the pointer to storage for the return value
     213        movl  24(%ebp),%ecx
     214        movl  %eax,0(%ecx)
     215        movl  %edx,4(%ecx)
     216
     217sc_retstruct:
     218        # Nothing to do!
     219
     220sc_noretval:
     221sc_epilogue:
     222        movl %ebp,%esp
     223        popl %ebp
     224        ret
     225
     226.ffi_call_STDCALL_end:
Note: See TracChangeset for help on using the changeset viewer.