From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8939 invoked by alias); 6 Mar 2012 15:36:51 -0000 Received: (qmail 8463 invoked by uid 22791); 6 Mar 2012 15:36:49 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,TW_BF,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e32.co.us.ibm.com (HELO e32.co.us.ibm.com) (32.97.110.150) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Mar 2012 15:36:32 +0000 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2012 08:36:30 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2012 08:35:04 -0700 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 0F8671FF0050 for ; Tue, 6 Mar 2012 08:34:56 -0700 (MST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q26FYpeD167006 for ; Tue, 6 Mar 2012 08:34:54 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q26FYo3A021056 for ; Tue, 6 Mar 2012 08:34:50 -0700 Received: from [192.168.1.103] (vorma.rchland.ibm.com [9.10.86.174]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q26FYmMr020894; Tue, 6 Mar 2012 08:34:48 -0700 Message-ID: <1331048083.21041.17.camel@otta> Subject: Re: libffi fails to build on powerpc64-linux From: Peter Bergner To: Anthony Green Cc: Kyle.D.Moffett@boeing.com, libffi-discuss@sourceware.org, dclarke@blastwave.org Date: Tue, 06 Mar 2012 15:36:00 -0000 In-Reply-To: References: <64185.10.0.66.17.1330988704.squirrel@interact.purplecow.org> <1330990156.29904.24.camel@otta> <1330993709.21041.5.camel@otta> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12030615-3270-0000-0000-00000495B129 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/msg00090.txt.bz2 On Mon, 2012-03-05 at 22:18 -0500, Anthony Green wrote: > (let me preface this by apologizing for the build breakage) No worries. I'm not here to point fingers, just trying to help fix the 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: > > > > > > === 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. Ahh, looking at Kyle's patch, his patch removes the goto soft_float_prep goto and label, so maybe he just forgot to delete the soft_double_prep goto as well. Nuking that with my patch builds and the make check results are the same as before. > 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. Agreed, it would be nice for Kyle to comment. Looking at the bugzilla above, he said: > This passes the testsuite on soft-floating-point PowerPC, and it builds > and passes the testsuite on PowerPC e500 systems which cannot even > assemble the regular floating-point instruction set. Both of these are non FP power systems, so I can see why he didn't see these build errors, since the broken code is inside of "#ifndef __NO_FPRS__" (double negative?). My updated patch removing the soft_double_prep goto is below. This was tested on my POWER7 and ppc970 systems (gcc's on both systems default to creating 64-bit binaries). Doing a build on one of my old POWER5 systems with a gcc that defaults to producing 32-bit binaries, I'm seeing the following testsuite failures: Running /home/bergner/src/libffi-src/testsuite/libffi.call/call.exp ... FAIL: libffi.call/many.c -O0 -W -Wall execution test FAIL: libffi.call/many.c -O2 execution test FAIL: libffi.call/many.c -O3 execution test FAIL: libffi.call/many.c -Os execution test FAIL: libffi.call/many.c -O2 -fomit-frame-pointer execution test Running /home/bergner/src/libffi-src/testsuite/libffi.special/special.exp ... === libffi Summary === # of expected passes 1654 # of unexpected failures 5 # of unsupported tests 55 I'll debug those to try and find out what is happening. Peter * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp. Silence casting pointer to integer of different size warning. (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..baca694 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); @@ -211,8 +212,6 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack) case FFI_TYPE_DOUBLE: /* With FFI_LINUX_SOFT_FLOAT doubles are handled like UINT64. */ - if (ecif->cif->abi == FFI_LINUX_SOFT_FLOAT) - goto soft_double_prep; double_tmp = **p_argv.d; if (fparg_count >= NUM_FPR_ARG_REGISTERS) @@ -925,7 +924,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 +1131,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++;