1
# DP: Fix libffi build failure on powerpc multilib
3
* src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
4
Silence casting pointer to integer of different size warning.
5
Delete goto to previously deleted label.
6
(ffi_call): Silence possibly undefined warning.
7
(ffi_closure_helper_SYSV): Declare variable type.
9
--- a/src/libffi/src/powerpc/ffi.c
10
+++ b/src/libffi/src/powerpc/ffi.c
11
@@ -146,6 +146,7 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
12
gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
16
fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
18
copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
19
@@ -155,9 +156,9 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
20
next_arg.u = stack + 2;
22
/* Check that everything starts aligned properly. */
23
- FFI_ASSERT (((unsigned) (char *) stack & 0xF) == 0);
24
- FFI_ASSERT (((unsigned) copy_space.c & 0xF) == 0);
25
- FFI_ASSERT (((unsigned) stacktop.c & 0xF) == 0);
26
+ FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
27
+ FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
28
+ FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
29
FFI_ASSERT ((bytes & 0xF) == 0);
30
FFI_ASSERT (copy_space.c >= next_arg.c);
32
@@ -211,8 +212,6 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
35
/* With FFI_LINUX_SOFT_FLOAT doubles are handled like UINT64. */
36
- if (ecif->cif->abi == FFI_LINUX_SOFT_FLOAT)
37
- goto soft_double_prep;
38
double_tmp = **p_argv.d;
40
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
41
@@ -925,7 +924,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
43
unsigned int smst_buffer[2];
46
+ unsigned int rsize = 0;
50
@@ -1132,7 +1131,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
55
+ double temp = pfr->d;
56
pfr->f = (float) temp;