Questions about the libffi development process

Richard Henderson rth@redhat.com
Tue Apr 21 18:11:00 GMT 2015


On 04/17/2015 08:29 PM, Russell Keith-Magee wrote:
> I've got 2 questions about the libffi development process.
> 
> 1. A recent commit:
> 
> https://github.com/atgreen/libffi/commit/a4b785ea
> 
> (authored by Richard Henderson) appears to have broken ARMv7 support
> to the point where libffi doesn't build. (Or, at least, it raises a
> syntax error on iOS - but I can't see any reason the same problem
> wouldn't exist for other ARM platforms).

It certainly does build for armv7l-unknown-linux-gnueabihf.  But then, only iOS
defines FFI_EXEC_TRAMPOLINE_TABLE, wherein the trouble lies.

The development process relies on those having access to proprietary operating
systems fixing the problems that arise on those systems.  I don't have access
to iOS.

That said, the problem appears to be trivial.  Please try the following.


r~
-------------- next part --------------
diff --git a/src/arm/ffi.c b/src/arm/ffi.c
index 9c8732d..f030a0c 100644
--- a/src/arm/ffi.c
+++ b/src/arm/ffi.c
@@ -537,7 +537,7 @@ void ffi_go_closure_VFP (void) FFI_HIDDEN;
 #include <stdio.h>
 #include <stdlib.h>
 
-extern void *ffi_closure_trampoline_table_page;
+extern int ffi_closure_trampoline_table_page[];
 
 typedef struct ffi_trampoline_table ffi_trampoline_table;
 typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
diff --git a/src/arm/sysv.S b/src/arm/sysv.S
index fd16589..6b3ad21 100644
--- a/src/arm/sysv.S
+++ b/src/arm/sysv.S
@@ -313,12 +313,13 @@ ARM_FUNC_END(ffi_closure_ret)
    keep all the magic numbers the same within ffi.c.  */
 
 	.align	12
-ARM_FUNC_START(ffi_closure_trampoline_table_page)
+ARM_FUNC_START(ffi_closure_trampoline_table_page, 1)
 .rept	4096 / 12
 	nop
 	ldr	ip, [pc, #-4092]
 	ldr	pc, [pc, #-4092]
 .endr
+ARM_FUNC_END(ffi_closure_trampoline_table_page)
 
 #else
 


More information about the Libffi-discuss mailing list