From patchwork Thu Nov 25 17:12:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 73101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BD31FB70D5 for ; Fri, 26 Nov 2010 04:12:59 +1100 (EST) Received: (qmail 4522 invoked by alias); 25 Nov 2010 17:12:49 -0000 Received: (qmail 4496 invoked by uid 22791); 25 Nov 2010 17:12:47 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, TW_BF, TW_DB, TW_FD, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Nov 2010 17:12:43 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 096667F4; Thu, 25 Nov 2010 18:12:41 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lYuPakLHfJ-P; Thu, 25 Nov 2010 18:12:39 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 3373E7F3; Thu, 25 Nov 2010 18:12:39 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id oAPHCWTE010162; Thu, 25 Nov 2010 18:12:32 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: java-patches@gcc.gnu.org, Anthony Green , Andreas Tobler Subject: [libffi, testsuite] Provide PRIuPTR, PRI[du]64 for IRIX 6.5 Date: Thu, 25 Nov 2010 18:12:32 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org A couple of libffi tests currently fail to compile on IRIX 6.5 since various PRI* defines aren't visible. While they exist in , they are only exposed for C99 compilations, and even if they were, there are a couple of problems described in comments in the patch. The following patch fixes this and allows most testcases to succeed. I've filed libffi/46660 cls_double_va.c, cls_longdouble_va.c FAIL on IRIX 6.5 libffi/46661 32-bit cls_pointer.c, cls_pointer_stack.c FAIL on IRIX 6.5 for the remaining ones. Tested with make check, ok for mainline (and an eventual 4.5 backport)? Thanks. Rainer 2010-11-22 Rainer Orth * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define. (PRIuPTR): Define. diff -r 6fa06fdbdfaa libffi/testsuite/libffi.call/ffitest.h --- a/libffi/testsuite/libffi.call/ffitest.h Mon Nov 22 21:05:42 2010 +0100 +++ b/libffi/testsuite/libffi.call/ffitest.h Thu Nov 25 18:09:57 2010 +0100 @@ -77,6 +77,26 @@ #define PRIuPTR "lu" #endif +/* IRIX kludge. */ +#if defined(__sgi) +/* IRIX 6.5 provides all definitions, but only for C99 + compilations. */ +#if (_MIPS_SZLONG == 32) +#define PRId64 "lld" +#define PRIu64 "llu" +#endif +/* This doesn't match , which always has "lld" here, but the + arguments are uint64_t, int64_t, which are unsigned long, long for + 64-bit in . */ +#if (_MIPS_SZLONG == 64) +#define PRId64 "ld" +#define PRIu64 "lu" +#endif +/* This doesn't match , which has "u" here, but the arguments + are uintptr_t, which is always unsigned long. */ +#define PRIuPTR "lu" +#endif + /* Solaris < 10 kludge. */ #if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR) #if defined(__arch64__) || defined (__x86_64__)