[PATCH] Add support for Cygwin-64 to libffi

Bernd Edlinger bernd.edlinger@hotmail.de
Tue May 13 09:26:00 GMT 2014


Hello,

I'm about to add support for Cygwin-64 and Java to GCC's libffi.

There were a few problems in the libffi that needed to be fixed for this.

Could some one please take care that this patch (or an equivalent fix)
also goes to the original libffi sources?


Thanks,
Bernd Edlinger


libffi/ChangeLog:

2014-05-11  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.



Please note, that we already have a small patch  in win64.S since almost a year,
which did apparently not get checked in into the libffi sources either.


see http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=196900

--- trunk/libffi/src/x86/win64.S	2013/03/22 09:12:46	196899
+++ trunk/libffi/src/x86/win64.S	2013/03/22 09:38:55	196900
@@ -295,7 +295,7 @@
 	mov	%rax, %rcx	# context is first parameter
 	mov	%rsp, %rdx	# stack is second parameter
 	add	$48, %rdx	# point to start of arguments
-	mov	$SYMBOL_NAME(ffi_closure_win64_inner), %rax
+	leaq	SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax
 	callq	*%rax		# call the real closure function
 	add	$40, %rsp
 	movq	%rax, %xmm0	# If the closure returned a float,



 		 	   		  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-cygwin64.diff
Type: application/octet-stream
Size: 9449 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libffi-discuss/attachments/20140513/0c3cb172/attachment.obj>


More information about the Libffi-discuss mailing list