From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6008 invoked by alias); 10 Nov 2014 04:24:56 -0000 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 Received: (qmail 5908 invoked by uid 89); 10 Nov 2014 04:24:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f50.google.com Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 10 Nov 2014 04:24:54 +0000 Received: by mail-pa0-f50.google.com with SMTP id eu11so7462742pac.9 for ; Sun, 09 Nov 2014 20:24:52 -0800 (PST) X-Received: by 10.70.38.68 with SMTP id e4mr29084016pdk.15.1415593492578; Sun, 09 Nov 2014 20:24:52 -0800 (PST) Received: from bubble.grove.modra.org ([58.160.155.134]) by mx.google.com with ESMTPSA id il5sm13493762pbb.56.2014.11.09.20.24.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Nov 2014 20:24:51 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id E609DEA4722; Mon, 10 Nov 2014 14:54:42 +1030 (ACDT) Date: Mon, 10 Nov 2014 04:24:00 -0000 From: Alan Modra To: libffi-discuss@sourceware.org Cc: Richard Henderson , "Lynn A. Boger" Subject: Fix powerpc breakage from 6e8a4460 Message-ID: <20141110042442.GH3990@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2014/txt/msg00206.txt.bz2 The addition of FFI_TYPE_COMPLEX broke powerpc libffi, showing up as four testsuite failures on powerpc64le. This fixes the breakage and ensures a more spectacular set of failures if something like this happens again. * src/powerpc/ffitarget.h: #error on unexpected FFI_TYPE_LAST. (FFI_PPC_TYPE_LAST): Define. (FFI_TYPE_UINT128): Define in terms of FFI_PPC_TYPE_LAST. (FFI_SYSV_TYPE_SMALL_STRUCT, FFI_V2_TYPE_FLOAT_HOMOG): Likewise. (FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Likewise. --- src/powerpc/ffitarget.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/powerpc/ffitarget.h b/src/powerpc/ffitarget.h index b47b0f5..84aa586 100644 --- a/src/powerpc/ffitarget.h +++ b/src/powerpc/ffitarget.h @@ -142,19 +142,30 @@ typedef enum ffi_abi { # define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs #endif -/* For additional types like the below, take care about the order in - ppc_closures.S. They must follow after the FFI_TYPE_LAST. */ +/* ppc_closure.S and linux64_closure.S expect this. */ +#define FFI_PPC_TYPE_LAST FFI_TYPE_POINTER + +/* We define additional types below. If generic types are added that + must be supported by powerpc libffi then it is likely that + FFI_PPC_TYPE_LAST needs increasing *and* the jump tables in + ppc_closure.S and linux64_closure.S be extended. */ + +#if !(FFI_TYPE_LAST == FFI_PPC_TYPE_LAST \ + || (FFI_TYPE_LAST == FFI_TYPE_COMPLEX \ + && !defined FFI_TARGET_HAS_COMPLEX_TYPE)) +# error "You likely have a broken powerpc libffi" +#endif /* Needed for soft-float long-double-128 support. */ -#define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1) +#define FFI_TYPE_UINT128 (FFI_PPC_TYPE_LAST + 1) /* Needed for FFI_SYSV small structure returns. */ -#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2) +#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 2) /* Used by ELFv2 for homogenous structure returns. */ -#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_TYPE_LAST + 1) -#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_TYPE_LAST + 2) -#define FFI_V2_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 3) +#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_PPC_TYPE_LAST + 1) +#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_PPC_TYPE_LAST + 2) +#define FFI_V2_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 3) #if _CALL_ELF == 2 # define FFI_TRAMPOLINE_SIZE 32 -- Alan Modra Australia Development Lab, IBM