From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15183 invoked by alias); 5 Mar 2012 22:56:11 -0000 Received: (qmail 15175 invoked by uid 22791); 5 Mar 2012 22:56:10 -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 e2.ny.us.ibm.com (HELO e2.ny.us.ibm.com) (32.97.182.142) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Mar 2012 22:55:57 +0000 Received: from /spool/local by e2.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 Mar 2012 17:55:56 -0500 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e2.ny.us.ibm.com (192.168.1.102) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 5 Mar 2012 17:55:53 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id AFA4238C805A for ; Mon, 5 Mar 2012 17:55:52 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q25Mtqm4261272 for ; Mon, 5 Mar 2012 17:55:52 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q25MtqDh011627 for ; Mon, 5 Mar 2012 19:55:52 -0300 Received: from [192.168.1.103] (vorma.rchland.ibm.com [9.10.86.174]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q25MtoFK011562; Mon, 5 Mar 2012 19:55:51 -0300 Message-ID: <1330988150.29904.19.camel@otta> Subject: libffi fails to build on powerpc64-linux From: Peter Bergner To: libffi-discuss@sourceware.org Cc: Anthony Green Date: Mon, 05 Mar 2012 22:56:00 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12030522-5112-0000-0000-000005DF0226 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/msg00079.txt.bz2 After the latest libffi merge into GCC, GCC no longer builds on powerpc64-linux due to the following errors: /home/bergner/gcc/gcc-mainline-testsuite-base/libffi/src/powerpc/ffi.c: In function ‘ffi_prep_args_SYSV’: /home/bergner/gcc/gcc-mainline-testsuite-base/libffi/src/powerpc/ffi.c:199:4: error: ‘double_tmp’ undeclared (first use in this function) /home/bergner/gcc/gcc-mainline-testsuite-base/libffi/src/powerpc/ffi.c:199:4: note: each undeclared identifier is reported only once for each function it appears in /home/bergner/gcc/gcc-mainline-testsuite-base/libffi/src/powerpc/ffi.c:215:6: error: label ‘soft_double_prep’ used but not defined /home/bergner/gcc/gcc-mainline-testsuite-base/libffi/src/powerpc/ffi.c: In function ‘ffi_closure_helper_SYSV’: /home/bergner/gcc/gcc-mainline-testsuite-base/libffi/src/powerpc/ffi.c:1135:8: error: ‘temp’ undeclared (first use in this function) Building upstream libffi code directly, it fails exactly the same way. The "double_tmp" and "temp" errors are easily fixed with the following obvious patch: diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c index 1920c91..191b9dc 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); @@ -1132,7 +1133,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++; But I'm not confident enough to place the missing ‘soft_double_prep’ label. Can someone more familiar with this code patch that and then remerge the updated code into GCC? I'm willing to help build and test any patch someone comes up with. As an FYI, I'll mention I opened a GCC bugzilla to track this on the GCC side of things: http://gcc.gnu.org/PR52497 Peter