From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26044 invoked by alias); 6 Mar 2012 03:18:22 -0000 Received: (qmail 26036 invoked by uid 22791); 6 Mar 2012 03:18:21 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,TW_BF X-Spam-Check-By: sourceware.org Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Mar 2012 03:18:04 +0000 Received: by wibhi20 with SMTP id hi20so3126111wib.0 for ; Mon, 05 Mar 2012 19:18:03 -0800 (PST) Received-SPF: pass (google.com: domain of green@moxielogic.com designates 10.216.138.129 as permitted sender) client-ip=10.216.138.129; Authentication-Results: mr.google.com; spf=pass (google.com: domain of green@moxielogic.com designates 10.216.138.129 as permitted sender) smtp.mail=green@moxielogic.com Received: from mr.google.com ([10.216.138.129]) by 10.216.138.129 with SMTP id a1mr7073443wej.49.1331003883440 (num_hops = 1); Mon, 05 Mar 2012 19:18:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=dF1UZZt+cpsPR94PrVgIkkpJaJLnJdHCoICbrToqA0s=; b=WNpccloXL7kqIA05rx1vErMhHYY1as2id5npXquzTqKahZ3f58BmkL7SoGn8wHLFr9 ZgwHeKAM49VDBE+taSBv1In6wI+sfaTw6UgQWlmrzMk0oi3K7j0SMIOHmKWW7bpILHw+ 7FqE7X0iegvrpBK8TBRDPYmj3UNwHhko1z1Jh8he9nBWLe1duTJQzPQrBsvVNVu90zMt JoHbUy2PFBEV2STH9HtGjbwx8RqlXwv5CJhosBHpLWpC0KdccZvsFA7qtzMIQcNJOGr+ aGVFahn13ZCN8NBS7XMIAdWLmg8MUd3Nud5iKxu+hSC4sgr0tJscijDi8eVjxkJytVt3 4f0g== MIME-Version: 1.0 Received: by 10.216.138.129 with SMTP id a1mr5628068wej.49.1331003883350; Mon, 05 Mar 2012 19:18:03 -0800 (PST) Received: by 10.223.78.200 with HTTP; Mon, 5 Mar 2012 19:18:03 -0800 (PST) In-Reply-To: <1330993709.21041.5.camel@otta> References: <64185.10.0.66.17.1330988704.squirrel@interact.purplecow.org> <1330990156.29904.24.camel@otta> <1330993709.21041.5.camel@otta> Date: Tue, 06 Mar 2012 03:18:00 -0000 Message-ID: Subject: Re: libffi fails to build on powerpc64-linux From: Anthony Green To: Peter Bergner , Kyle.D.Moffett@boeing.com Cc: libffi-discuss@sourceware.org, dclarke@blastwave.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmFFkH3DEwDOVh7eqacw/FcXh5HaOQdCaunQlTybsF39FigltqBCtKivWS2NJA71r3jrvYc X-IsSubscribed: yes Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org X-SW-Source: 2012/txt/msg00083.txt.bz2 (let me preface this by apologizing for the build breakage) On Mon, Mar 5, 2012 at 7:28 PM, Peter Bergner 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: > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D=3D=3D libffi Summary =3D=3D=3D > > # of expected passes =A0 =A0 =A0 =A0 =A0 =A01659 > # of unsupported tests =A0 =A0 =A0 =A0 =A055 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=3D5;filename=3Dpowerpc-ffi= -softfloat.patch;att=3D1;bug=3D644338 ...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 > > > =A0 =A0 =A0 =A0* src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_t= mp. > =A0 =A0 =A0 =A0Cast pointers to unsigned long. > =A0 =A0 =A0 =A0Declare soft_double_prep label. > =A0 =A0 =A0 =A0(ffi_call): Silence possibly undefined warning. > =A0 =A0 =A0 =A0(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 *con= st stack) > =A0 gpr_base.u =3D stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTE= RS; > =A0 intarg_count =3D 0; > =A0#ifndef __NO_FPRS__ > + =A0double double_tmp; > =A0 fpr_base.d =3D gpr_base.d - NUM_FPR_ARG_REGISTERS; > =A0 fparg_count =3D 0; > =A0 copy_space.c =3D ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base= .c); > @@ -155,9 +156,9 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *con= st stack) > =A0 next_arg.u =3D stack + 2; > > =A0 /* Check that everything starts aligned properly. =A0*/ > - =A0FFI_ASSERT (((unsigned) (char *) stack & 0xF) =3D=3D 0); > - =A0FFI_ASSERT (((unsigned) copy_space.c & 0xF) =3D=3D 0); > - =A0FFI_ASSERT (((unsigned) stacktop.c & 0xF) =3D=3D 0); > + =A0FFI_ASSERT (((unsigned long) (char *) stack & 0xF) =3D=3D 0); > + =A0FFI_ASSERT (((unsigned long) copy_space.c & 0xF) =3D=3D 0); > + =A0FFI_ASSERT (((unsigned long) stacktop.c & 0xF) =3D=3D 0); > =A0 FFI_ASSERT ((bytes & 0xF) =3D=3D 0); > =A0 FFI_ASSERT (copy_space.c >=3D next_arg.c); > > @@ -293,6 +294,9 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *con= st stack) > > =A0 =A0 =A0 =A0case FFI_TYPE_UINT64: > =A0 =A0 =A0 =A0case FFI_TYPE_SINT64: > + > + =A0 =A0 =A0 soft_double_prep: > + > =A0 =A0 =A0 =A0 =A0if (intarg_count =3D=3D NUM_GPR_ARG_REGISTERS-1) > =A0 =A0 =A0 =A0 =A0 =A0intarg_count++; > =A0 =A0 =A0 =A0 =A0if (intarg_count >=3D NUM_GPR_ARG_REGISTERS) > @@ -925,7 +929,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue= , void **avalue) > =A0 =A0*/ > =A0 unsigned int smst_buffer[2]; > =A0 extended_cif ecif; > - =A0unsigned int rsize; > + =A0unsigned int rsize =3D 0; > > =A0 ecif.cif =3D cif; > =A0 ecif.avalue =3D avalue; > @@ -1132,7 +1136,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void= *rvalue, > > =A0 =A0 =A0 =A0 =A0if (nf < 8) > =A0 =A0 =A0 =A0 =A0 =A0{ > - =A0 =A0 =A0 =A0 =A0 =A0 temp =3D pfr->d; > + =A0 =A0 =A0 =A0 =A0 =A0 double temp =3D pfr->d; > =A0 =A0 =A0 =A0 =A0 =A0 =A0pfr->f =3D (float) temp; > =A0 =A0 =A0 =A0 =A0 =A0 =A0avalue[i] =3D pfr; > =A0 =A0 =A0 =A0 =A0 =A0 =A0nf++; > >