1. 08 May, 2018 1 commit
  2. 04 May, 2018 1 commit
    • libffi PowerPC64 ELFv1 fp arg fixes · 71d372eb
      The ELFv1 ABI says: "Single precision floating point values are mapped
      to the second word in a single doubleword" and also "Floating point
      registers f1 through f13 are used consecutively to pass up to 13
      floating point values, one member aggregates passed by value
      containing a floating point value, and to pass complex floating point
      values".
      
      libffi wasn't expecting float args in the second word, and wasn't
      passing one member aggregates in fp registers.  This patch fixes those
      problems, making use of the existing ELFv2 homogeneous aggregate
      support since a one element fp struct is a special case of an
      homogeneous aggregate.
      
      I've also set a flag when returning pointers that might be used one
      day.  This is just a tidy since the ppc64 assembly support code
      currently doesn't test FLAG_RETURNS_64BITS for integer types..
      
      	* src/powerpc/ffi_linux64.c (discover_homogeneous_aggregate):
      	Compile for ELFv1 too, handling single element aggregates.
      	(ffi_prep_cif_linux64_core): Call discover_homogeneous_aggregate
      	for ELFv1.  Set FLAG_RETURNS_64BITS for FFI_TYPE_POINTER return.
      	(ffi_prep_args64): Call discover_homogeneous_aggregate for ELFv1,
      	and handle single element structs containing float or double
      	as if the element wasn't wrapped in a struct.  Store floats in
      	second word of doubleword slot when big-endian.
      	(ffi_closure_helper_LINUX64): Similarly.
      
      From-SVN: r259934
      Alan Modra committed
  3. 03 Oct, 2017 1 commit
    • Import from libffi master repository. · fbdc3780
      2017-08-31  Tony Reix  <tony.reix@atos.net>
      
              * src/powerpc/aix.S (ffi_call_AIX): Add debugging pseudo-op and
              labels for EH.
              (ffi_call_go_AIX): New function.
              (_GLOBAL__F_libffi_src_powerpc_aix): New EH frame.
              * src/powerpc/aix_closure.S (ffi_closure_ASM): Add debugging
              pseudo-op and labels for EH.
              (ffi_go_closure_ASM): New function.
              (_GLOBAL__F_libffi_src_powerpc_aix_closure): New EH frame.
              * src/powrpc/ffi_darwin.c (ffi_call_go): New function.
              (ffi_prep_go_closure): New function.
              (ffi_closure_helper_common): Rename from ffi_closure_helper_DARWIN.
              (ffi_closure_helper_DARWIN): Call ffi_closure_helper_common.
              (ffi_go_closure_helper_DARWIN): Call ffi_closure_helper_common.
              * src/powerpc/ffitarget.h (FFI_GO_CLOSURES): Define.
      
      From-SVN: r253386
      Tony Reix committed
  4. 04 Sep, 2016 1 commit
    • ffi.c (ffi_struct_type): Put type declaration on separate line. · 5961d13d
      	* src/pa/ffi.c (ffi_struct_type): Put type declaration on separate line.
      	(ffi_prep_args_pa32): Likewise.
      	(ffi_size_stack_pa32): Likewise.
      	(ffi_prep_cif_machdep): Likewise.
      	(ffi_call): Likewise.  Rename to ffi_call_int.  Add closure argument
      	and update call to ffi_call_pa32.
      	(ffi_call, ffi_call_go, ffi_prep_go_closure): New.
      	(ffi_closure_inner_pa32): Update to handle go closures.
      	* src/pa/ffitarget.h (FFI_GO_CLOSURES): Define.
      	* src/pa/hpux32.S (ffi_call_pa32): Pass go closure argument in static
      	chain register (%ret1).
      	(ffi_closure_pa32): Set closure type argument to zero.
      	(ffi_go_closure_pa32): New function.  Add unwind data for it.
      	* src/pa/linux.S: Likewise.  Use cfi directives for unwind data.
      	* testsuite/libffi.go/static-chain.h (STATIC_CHAIN_REG): Define for
      	hppa.
      
      From-SVN: r239978
      John David Anglin committed
  5. 17 Mar, 2016 1 commit
  6. 30 Sep, 2015 1 commit
    • [RS6000] Correct powerpc sysv stack argument accounting · c57173b6
      ppc32 starts using the stack for integer arg passing when we run out
      of integer arg passing registers.  Similarly, we start using the stack
      for floating point args when we run out of floating point registers.
      The decision on where an integer arg goes does not depend on number of
      floating point args, nor does the decision on where a floating point
      arg goes depend on number of integer args.  Alignment of stack args
      also simply depends on number of stack args.
      
      This patch untangles the horrible mess we had, with intarg_count being
      wrongly used to count both integer args and stack words.
      
      	* src/powerpc/ffi_sysv.c (ffi_prep_cif_sysv_core): Count fprs,
      	gprs, and stack words separately.
      	(ffi_prep_args_SYSV): Similarly.
      
      From-SVN: r228307
      Alan Modra committed
  7. 10 Feb, 2015 1 commit
    • ffitarget.h (ffi_arg): Use unsigned long long for ILP32. · 97c32df4
      2015-02-10  Andrew Pinski  <apinski@cavium.com>
      
              * src/aarch64/ffitarget.h (ffi_arg): Use unsigned long long for ILP32.
              (FFI_SIZEOF_ARG): Define to 64 for ILP32.
              (ffi_sarg): Use signed long long for ILP32.
      
              * src/aarch64/sysv.S (PTR_REG): New macro.
              (PTR_SIZE): New macro.
              (ffi_closure_SYSV): Load cif, fn and user_data using PTR_REG.
              (ffi_go_closure_SYSV): Load cif and fn using PTR_REG.
      
      From-SVN: r220598
      Andrew Pinski committed
  8. 28 Jan, 2015 1 commit
  9. 19 Jan, 2015 1 commit
  10. 13 Jan, 2015 2 commits
  11. 12 Jan, 2015 1 commit
  12. 11 Sep, 2014 1 commit
  13. 25 Jul, 2014 1 commit
  14. 13 May, 2014 1 commit
    • Enable Java on Cygwin-64 · 54fde020
      Currently it is not possible to build GCC's libjava support on Cygwin-64.
      
      This patch fixes the current build-problems on Cygwin-64 and the most
      fundamental bugs on that platform.
      
      Note you must still add --enable-threads=posix to successfully build the
      java language support.
      
      
      boehm-gc/ChangeLog:
      
      2014-05-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              Fix current cygwin-64 build problems.
              * include/gc_config_macros.h (GC_PTHREADS): Use __CYGWIN__ instead
              of __CYGWIN32__ here.
              * win32_threads.c (GC_push_all_stacks): Push all X86_64 registers.
              (GC_get_thread_stack_base): Get the stack base for X86_64.
      
      libffi/ChangeLog:
      
      2014-05-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              Fix current cygwin-64 build problems.
              * src/java_raw_api.c: Remove if !defined(FFI_NO_RAW_API).
              * src/x86/ffi.c: Add if defined(__CYGWIN__).
              * src/x86/win64.S (ffi_closure_win64, ffi_call_win64): Added
              handling for FFI_TYPE_UINT64, FFI_TYPE_POINTER and FFI_TYPE_INT.
              Added SEH information.  Fixed formatting.
      
      libgcc/ChangeLog:
      
      2014-05-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              * unwind-seh.c (_Unwind_Backtrace): Uncommented, finished
              implementation.
      
      libjava/ChangeLog:
      
      2014-05-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              Fix current cygwin-64 build problems.
              * configure.host: Added handling for x86_64-*-cygwin/mingw.
              * boehm.cc (_Jv_GCAttachThread, _Jv_GCDetachThread): Don't compile if
              GC_WIN32_THREADS is defined.
              * java/lang/natClass.cc (_Jv_InterfaceAssignableFrom): Rename interface
              to source_interface.
      
      libjava/classpath/ChangeLog:
      
      2014-05-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              Fix current cygwin-64 build problems.
              * native/fdlibm/mprec.c (_REENT_CHECK_MP, _REENT_MP_FREELIST,
              _REENT_MP_P5S, __ULong, __Long): Undefine previous definitions.
      
      From-SVN: r210386
      Bernd Edlinger committed
  15. 12 Mar, 2014 1 commit
  16. 17 Feb, 2014 1 commit
    • re PR libffi/60073 (64-bit libffi.call/cls_double_va.c FAILs after recent modification) · 248d745a
      	PR libffi/60073
      	* src/sparc/v8.S: Assemble only if !SPARC64.
      	* src/sparc/v9.S: Remove obsolete comment.
      	* src/sparc/ffitarget.h (enum ffi_abi): Add FFI_COMPAT_V9.
      	(V8_ABI_P): New macro.
      	(V9_ABI_P): Likewise.
      	(FFI_EXTRA_CIF_FIELDS): Define only if SPARC64.
      	* src/sparc/ffi.c (ffi_prep_args_v8): Compile only if !SPARC64.
      	(ffi_prep_args_v9): Compile only if SPARC64.
      	(ffi_prep_cif_machdep_core): Use V9_ABI_P predicate.
      	(ffi_prep_cif_machdep): Guard access to nfixedargs field.
      	(ffi_prep_cif_machdep_var): Likewise.
      	(ffi_v9_layout_struct): Compile only if SPARC64.
      	(ffi_call): Deal with FFI_V8PLUS and FFI_COMPAT_V9 and fix warnings.
      	(ffi_prep_closure_loc): Use V9_ABI_P and V8_ABI_P predicates.
      	(ffi_closure_sparc_inner_v8): Compile only if !SPARC64.
      	(ffi_closure_sparc_inner_v9): Compile only if SPARC64.  Guard access
      	to nfixedargs field.
      
      From-SVN: r207822
      Eric Botcazou committed
  17. 13 Feb, 2014 1 commit
    • re PR libffi/60073 (64-bit libffi.call/cls_double_va.c FAILs after recent modification) · 30255340
      	PR libffi/60073
      	* src/sparc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define.
      	(FFI_EXTRA_CIF_FIELDS): Likewise.
      	(FFI_NATIVE_RAW_API): Move around.
      	* src/sparc/ffi.c (ffi_prep_cif_machdep_core): New function from...
      	(ffi_prep_cif_machdep): ...here.  Call ffi_prep_cif_machdep_core.
      	(ffi_prep_cif_machdep_var): New function.
      	(ffi_closure_sparc_inner_v9): Do not pass anonymous FP arguments in
      	FP registers.
      	* doc/libffi.texi (Introduction): Fix inaccuracy.
      
      From-SVN: r207763
      Eric Botcazou committed
  18. 10 Dec, 2013 1 commit
    • ffitarget.h: Import from upstream. · e73d2479
      	* src/powerpc/ffitarget.h: Import from upstream.
      	* src/powerpc/ffi_powerpc.h: Likewise.
      	* src/powerpc/ffi.c: Likewise.
      	* src/powerpc/ffi_sysv.c: Likewise.
      	* src/powerpc/ffi_linux64.c: Likewise.
      	* src/powerpc/sysv.S: Likewise.
      	* src/powerpc/ppc_closure.S: Likewise.
      	* src/powerpc/linux64.S: Likewise.
      	* src/powerpc/linux64_closure.S: Likewise.
      	* src/types.c: Likewise.
      	* Makefile.am (EXTRA_DIST): Add new src/powerpc files.
      	(nodist_libffi_la_SOURCES <POWERPC, POWERPC_FREEBSD>): Likewise.
      	* configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc.
      	* include/ffi.h.in (ffi_prep_types): Declare.
      	* src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types.
      	* configure: Regenerate.
      	* fficonfig.h.in: Regenerate.
      	* Makefile.in: Regenerate.
      	* man/Makefile.in: Regenerate.
      	* include/Makefile.in: Regenerate.
      	* testsuite/Makefile.in: Regenerate.
      
      From-SVN: r205844
      Alan Modra committed
  19. 17 Nov, 2013 2 commits
  20. 25 Jun, 2013 1 commit
  21. 22 Mar, 2013 1 commit
  22. 07 Mar, 2013 1 commit
  23. 06 Feb, 2013 1 commit
  24. 26 Dec, 2012 1 commit
  25. 31 Oct, 2012 1 commit
  26. 26 Aug, 2012 1 commit
  27. 08 Aug, 2012 1 commit
  28. 18 Jul, 2012 1 commit
  29. 02 Apr, 2012 1 commit
  30. 29 Mar, 2012 1 commit
  31. 13 Mar, 2012 1 commit
  32. 09 Mar, 2012 1 commit
  33. 04 Mar, 2012 1 commit
  34. 23 Feb, 2012 1 commit
  35. 13 Feb, 2012 1 commit
  36. 11 Feb, 2012 1 commit
  37. 08 Feb, 2012 1 commit
    • prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 also FFI_THISCALL. · 893f4301
              * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32
              also FFI_THISCALL.
              * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype.
              (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code.
              (ffi_prep_closure_loc): Add FFI_THISCALL support.
              * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size.
              * src/x86/win32.S (ffi_closure_THISCALL): New closure code
              for thiscall-calling convention.
              * testsuite/libffi.call/closure_thiscall.c: New test.
      
      From-SVN: r184021
      Kai Tietz committed
  38. 29 Jan, 2012 1 commit
    • ffi.c (ffi_call_win32): Add new argument to prototype for specify calling-convention. · 9b850dd9
              * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new
              argument to prototype for specify calling-convention.
              (ffi_call): Add support for stdcall/thiscall convention.
              (ffi_prep_args): Likewise.
              (ffi_raw_call): Likewise.
              * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and
              FFI_FASTCALL.
              * src/x86/win32.S (_ffi_call_win32): Add support for
              fastcall/thiscall calling-convention calls.
              * testsuite/libffi.call/fastthis1_win32.c: New test.
              * testsuite/libffi.call/fastthis2_win32.c: New test.
              * testsuite/libffi.call/fastthis3_win32.c: New test.
              * testsuite/libffi.call/strlen2_win32.c: New test.
              * testsuite/libffi.call/many2_win32.c: New test.
              * testsuite/libffi.call/struct1_win32.c: New test.
              * testsuite/libffi.call/struct2_win32.c: New test.
      
      From-SVN: r183676
      Kai Tietz committed