mirror of
https://github.com/partic2/libffi
synced 2026-11-11 02:27:19 +00:00
+14
-2
@@ -106,10 +106,18 @@ case "${host}" in
|
|||||||
if test $ac_cv_sizeof_size_t = 4; then
|
if test $ac_cv_sizeof_size_t = 4; then
|
||||||
case "$host" in
|
case "$host" in
|
||||||
x86_64-*x32|x86_64-x32-*)
|
x86_64-*x32|x86_64-x32-*)
|
||||||
|
TARGET_X32=yes
|
||||||
TARGET=X86_64
|
TARGET=X86_64
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
TARGET=X86
|
echo 'int foo (void) { return __x86_64__; }' > conftest.c
|
||||||
|
if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
|
||||||
|
TARGET_X32=yes
|
||||||
|
TARGET=X86_64
|
||||||
|
else
|
||||||
|
TARGET=X86;
|
||||||
|
fi
|
||||||
|
rm -f conftest.*
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
@@ -255,7 +263,11 @@ case "${TARGET}" in
|
|||||||
SOURCES="ffi.c sysv.S"
|
SOURCES="ffi.c sysv.S"
|
||||||
;;
|
;;
|
||||||
X86_64)
|
X86_64)
|
||||||
SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
|
if test x"$TARGET_X32" = xyes; then
|
||||||
|
SOURCES="ffi64.c unix64.S"
|
||||||
|
else
|
||||||
|
SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
X86_WIN64)
|
X86_WIN64)
|
||||||
if test "$MSVC" = 1; then
|
if test "$MSVC" = 1; then
|
||||||
|
|||||||
@@ -389,8 +389,10 @@ examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
|
|||||||
|
|
||||||
/* Perform machine dependent cif processing. */
|
/* Perform machine dependent cif processing. */
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
extern ffi_status
|
extern ffi_status
|
||||||
ffi_prep_cif_machdep_efi64(ffi_cif *cif);
|
ffi_prep_cif_machdep_efi64(ffi_cif *cif);
|
||||||
|
#endif
|
||||||
|
|
||||||
ffi_status
|
ffi_status
|
||||||
ffi_prep_cif_machdep (ffi_cif *cif)
|
ffi_prep_cif_machdep (ffi_cif *cif)
|
||||||
@@ -400,8 +402,10 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
|||||||
size_t bytes, n, rtype_size;
|
size_t bytes, n, rtype_size;
|
||||||
ffi_type *rtype;
|
ffi_type *rtype;
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
if (cif->abi == FFI_EFI64)
|
if (cif->abi == FFI_EFI64)
|
||||||
return ffi_prep_cif_machdep_efi64(cif);
|
return ffi_prep_cif_machdep_efi64(cif);
|
||||||
|
#endif
|
||||||
if (cif->abi != FFI_UNIX64)
|
if (cif->abi != FFI_UNIX64)
|
||||||
return FFI_BAD_ABI;
|
return FFI_BAD_ABI;
|
||||||
|
|
||||||
@@ -663,27 +667,35 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
|||||||
flags, rvalue, fn);
|
flags, rvalue, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
extern void
|
extern void
|
||||||
ffi_call_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue);
|
ffi_call_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue);
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
||||||
{
|
{
|
||||||
|
#ifndef __ILP32__
|
||||||
if (cif->abi == FFI_EFI64)
|
if (cif->abi == FFI_EFI64)
|
||||||
return ffi_call_efi64(cif, fn, rvalue, avalue);
|
return ffi_call_efi64(cif, fn, rvalue, avalue);
|
||||||
|
#endif
|
||||||
ffi_call_int (cif, fn, rvalue, avalue, NULL);
|
ffi_call_int (cif, fn, rvalue, avalue, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
extern void
|
extern void
|
||||||
ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue,
|
ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue,
|
||||||
void **avalue, void *closure);
|
void **avalue, void *closure);
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
||||||
void **avalue, void *closure)
|
void **avalue, void *closure)
|
||||||
{
|
{
|
||||||
|
#ifndef __ILP32__
|
||||||
if (cif->abi == FFI_EFI64)
|
if (cif->abi == FFI_EFI64)
|
||||||
ffi_call_go_efi64(cif, fn, rvalue, avalue, closure);
|
ffi_call_go_efi64(cif, fn, rvalue, avalue, closure);
|
||||||
|
#endif
|
||||||
ffi_call_int (cif, fn, rvalue, avalue, closure);
|
ffi_call_int (cif, fn, rvalue, avalue, closure);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,12 +703,14 @@ ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
|||||||
extern void ffi_closure_unix64(void) FFI_HIDDEN;
|
extern void ffi_closure_unix64(void) FFI_HIDDEN;
|
||||||
extern void ffi_closure_unix64_sse(void) FFI_HIDDEN;
|
extern void ffi_closure_unix64_sse(void) FFI_HIDDEN;
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
extern ffi_status
|
extern ffi_status
|
||||||
ffi_prep_closure_loc_efi64(ffi_closure* closure,
|
ffi_prep_closure_loc_efi64(ffi_closure* closure,
|
||||||
ffi_cif* cif,
|
ffi_cif* cif,
|
||||||
void (*fun)(ffi_cif*, void*, void**, void*),
|
void (*fun)(ffi_cif*, void*, void**, void*),
|
||||||
void *user_data,
|
void *user_data,
|
||||||
void *codeloc);
|
void *codeloc);
|
||||||
|
#endif
|
||||||
|
|
||||||
ffi_status
|
ffi_status
|
||||||
ffi_prep_closure_loc (ffi_closure* closure,
|
ffi_prep_closure_loc (ffi_closure* closure,
|
||||||
@@ -716,8 +730,10 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
|||||||
void (*dest)(void);
|
void (*dest)(void);
|
||||||
char *tramp = closure->tramp;
|
char *tramp = closure->tramp;
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
if (cif->abi == FFI_EFI64)
|
if (cif->abi == FFI_EFI64)
|
||||||
return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc);
|
return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc);
|
||||||
|
#endif
|
||||||
if (cif->abi != FFI_UNIX64)
|
if (cif->abi != FFI_UNIX64)
|
||||||
return FFI_BAD_ABI;
|
return FFI_BAD_ABI;
|
||||||
|
|
||||||
@@ -832,16 +848,20 @@ ffi_closure_unix64_inner(ffi_cif *cif,
|
|||||||
extern void ffi_go_closure_unix64(void) FFI_HIDDEN;
|
extern void ffi_go_closure_unix64(void) FFI_HIDDEN;
|
||||||
extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN;
|
extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN;
|
||||||
|
|
||||||
|
#ifndef __ILP32__
|
||||||
extern ffi_status
|
extern ffi_status
|
||||||
ffi_prep_go_closure_efi64(ffi_go_closure* closure, ffi_cif* cif,
|
ffi_prep_go_closure_efi64(ffi_go_closure* closure, ffi_cif* cif,
|
||||||
void (*fun)(ffi_cif*, void*, void**, void*));
|
void (*fun)(ffi_cif*, void*, void**, void*));
|
||||||
|
#endif
|
||||||
|
|
||||||
ffi_status
|
ffi_status
|
||||||
ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
|
ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
|
||||||
void (*fun)(ffi_cif*, void*, void**, void*))
|
void (*fun)(ffi_cif*, void*, void**, void*))
|
||||||
{
|
{
|
||||||
|
#ifndef __ILP32__
|
||||||
if (cif->abi == FFI_EFI64)
|
if (cif->abi == FFI_EFI64)
|
||||||
return ffi_prep_go_closure_efi64(closure, cif, fun);
|
return ffi_prep_go_closure_efi64(closure, cif, fun);
|
||||||
|
#endif
|
||||||
if (cif->abi != FFI_UNIX64)
|
if (cif->abi != FFI_UNIX64)
|
||||||
return FFI_BAD_ABI;
|
return FFI_BAD_ABI;
|
||||||
|
|
||||||
|
|||||||
@@ -324,7 +324,8 @@ proc run-many-tests { testcases extra_flags } {
|
|||||||
"-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
|
"-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
|
||||||
"-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
|
"-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
|
||||||
}
|
}
|
||||||
} elseif [istarget "x86_64-*-*"] {
|
} elseif { [istarget "x86_64-*-*"] \
|
||||||
|
&& [libffi_feature_test "#ifndef __ILP32__"] } {
|
||||||
set targetabis {
|
set targetabis {
|
||||||
""
|
""
|
||||||
"-DABI_NUM=FFI_WIN64 -DABI_ATTR=__MSABI__"
|
"-DABI_NUM=FFI_WIN64 -DABI_ATTR=__MSABI__"
|
||||||
|
|||||||
Reference in New Issue
Block a user