This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[libffi, testsuite] Provide PRIuPTR, PRI[du]64 for IRIX 6.5
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: java-patches at gcc dot gnu dot org, Anthony Green <green at redhat dot com>, Andreas Tobler <andreast at gcc dot gnu dot org>
- Date: Thu, 25 Nov 2010 18:12:32 +0100
- Subject: [libffi, testsuite] Provide PRIuPTR, PRI[du]64 for IRIX 6.5
A couple of libffi tests currently fail to compile on IRIX 6.5 since
various PRI* defines aren't visible. While they exist in <inttypes.h>,
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 <ro@columba.CeBiTec.Uni-Bielefeld.DE>
* 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 <inttypes.h> provides all definitions, but only for C99
+ compilations. */
+#if (_MIPS_SZLONG == 32)
+#define PRId64 "lld"
+#define PRIu64 "llu"
+#endif
+/* This doesn't match <inttypes.h>, which always has "lld" here, but the
+ arguments are uint64_t, int64_t, which are unsigned long, long for
+ 64-bit in <sgidefs.h>. */
+#if (_MIPS_SZLONG == 64)
+#define PRId64 "ld"
+#define PRIu64 "lu"
+#endif
+/* This doesn't match <inttypes.h>, 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__)
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University