This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libffi fails to build on powerpc64-linux


(let me preface this by apologizing for the build breakage)

On Mon, Mar 5, 2012 at 7:28 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> Taking my best swag at where the soft_double_prep label should be
> (comment said it should be handled like UINT64), I tried the following
> patch which allows everything to build without warnings and seems to
> pass the testsuite:
>
>
> ? ? ? ? ? ? ? ?=== libffi Summary ===
>
> # of expected passes ? ? ? ? ? ?1659
> # of unsupported tests ? ? ? ? ?55

Those results look fine, however, the soft_double_prep label was
specifically removed by this patch...

http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=powerpc-ffi-softfloat.patch;att=1;bug=644338

...which was designed to enable support for soft-float ppc targets,
among other things.   I see now that the original patch didn't remove
all references to soft_double_prep.

At this point, I'm hoping that Kyle Moffett, the author of this patch
can have a look.  My guess is that either I mis-applied the patch, or
he posted the wrong patch to apply.

Thanks!

AG




>
>
> Comments?
>
>
> Peter
>
>
> ? ? ? ?* src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
> ? ? ? ?Cast pointers to unsigned long.
> ? ? ? ?Declare soft_double_prep label.
> ? ? ? ?(ffi_call): Silence possibly undefined warning.
> ? ? ? ?(ffi_closure_helper_SYSV): Declare variable type.
>
>
> diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c
> index 1920c91..627b4cb 100644
> --- a/src/powerpc/ffi.c
> +++ b/src/powerpc/ffi.c
> @@ -146,6 +146,7 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
> ? gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
> ? intarg_count = 0;
> ?#ifndef __NO_FPRS__
> + ?double double_tmp;
> ? fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
> ? fparg_count = 0;
> ? copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
> @@ -155,9 +156,9 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
> ? next_arg.u = stack + 2;
>
> ? /* Check that everything starts aligned properly. ?*/
> - ?FFI_ASSERT (((unsigned) (char *) stack & 0xF) == 0);
> - ?FFI_ASSERT (((unsigned) copy_space.c & 0xF) == 0);
> - ?FFI_ASSERT (((unsigned) stacktop.c & 0xF) == 0);
> + ?FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
> + ?FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
> + ?FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
> ? FFI_ASSERT ((bytes & 0xF) == 0);
> ? FFI_ASSERT (copy_space.c >= next_arg.c);
>
> @@ -293,6 +294,9 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
>
> ? ? ? ?case FFI_TYPE_UINT64:
> ? ? ? ?case FFI_TYPE_SINT64:
> +
> + ? ? ? soft_double_prep:
> +
> ? ? ? ? ?if (intarg_count == NUM_GPR_ARG_REGISTERS-1)
> ? ? ? ? ? ?intarg_count++;
> ? ? ? ? ?if (intarg_count >= NUM_GPR_ARG_REGISTERS)
> @@ -925,7 +929,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
> ? ?*/
> ? unsigned int smst_buffer[2];
> ? extended_cif ecif;
> - ?unsigned int rsize;
> + ?unsigned int rsize = 0;
>
> ? ecif.cif = cif;
> ? ecif.avalue = avalue;
> @@ -1132,7 +1136,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
>
> ? ? ? ? ?if (nf < 8)
> ? ? ? ? ? ?{
> - ? ? ? ? ? ? temp = pfr->d;
> + ? ? ? ? ? ? double temp = pfr->d;
> ? ? ? ? ? ? ?pfr->f = (float) temp;
> ? ? ? ? ? ? ?avalue[i] = pfr;
> ? ? ? ? ? ? ?nf++;
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]