This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Don't assume XPG5 support on IRIX 5 in s-oscons-tmplt.c
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Arnaud Charlet <charlet at adacore dot com>
- Date: Mon, 30 Nov 2009 21:21:41 +0100
- Subject: PATCH: Don't assume XPG5 support on IRIX 5 in s-oscons-tmplt.c
A recent mainline bootstrap failed on mips-sgi-irix5.3 building gnatlib:
g-expect.adb:1203:47: "Target_OS" is undefined
s-oscons.ads:54:01: (style) multiple blank lines
s-oscons.ads:59:01: (style) multiple blank lines
s-oscons.ads:64:01: (style) multiple blank lines
s-oscons.ads:69:01: (style) multiple blank lines
s-oscons.ads:74:01: (style) multiple blank lines
s-oscons.ads:81:01: (style) multiple blank lines
s-oscons.ads:86:01: (style) multiple blank lines
s-oscons.ads:91:01: (style) multiple blank lines
s-oscons.ads:96:01: (style) multiple blank lines
s-oscons.ads:101:01: (style) multiple blank lines
s-oscons.ads:106:01: (style) multiple blank lines
s-oscons.ads:111:01: (style) multiple blank lines
s-oscons.ads:116:01: (style) multiple blank lines
s-oscons.ads:127:01: (style) multiple blank lines
s-oscons.ads:148:01: (style) multiple blank lines
make[5]: *** [g-expect.o] Error 1
make[5]: Leaving directory `/tmp_mnt/vol/gcc/obj/gcc-4.5.0-20091116/5.3-gcc/gcc/ada/rts'
make[4]: *** [gnatlib] Error 2
This happened because s-oscons-tmplt.c failed to compile:
s-oscons-tmplt.c: In function 'main':
s-oscons-tmplt.c:260:95: error: '_XOPEN_IOV_MAX' undeclared (first use in this function)
s-oscons-tmplt.c:260:95: error: (Each undeclared identifier is reported only once
s-oscons-tmplt.c:260:95: error: for each function it appears in.)
There seems to be a bug in the Makefiles since the build didn't stop
here, but generated an invalid s-oscons.ads. I haven't looked further
here yet.
Anyway, the error is that again the assumption has crept in that
__mips&&__sgi means IRIX 6, which is wrong: IRIX 5.3 doesn't define
either _XOPEN5 or _XOPEN_IOV_MAX. The trivial patch below fixes this
and allowed the IRIX 5.3 bootstrap to continue.
Ok for mainline?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2009-11-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* s-oscons-tmplt.c [__mips && __sgi]: Only define _XOPEN5, IOV_MAX
if _XOPEN_IOV_MAX is defined.
Index: gcc/ada/s-oscons-tmplt.c
===================================================================
--- gcc/ada/s-oscons-tmplt.c (revision 154216)
+++ gcc/ada/s-oscons-tmplt.c (working copy)
@@ -84,12 +84,14 @@
#define _XOPEN_SOURCE 500
#elif defined (__mips) && defined (__sgi)
-/** For IRIX _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as IOV_MAX,
- ** otherwise IOV_MAX is not defined.
+/** For IRIX 6, _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as
+ ** IOV_MAX, otherwise IOV_MAX is not defined. IRIX 5 has neither.
**/
+#ifdef _XOPEN_IOV_MAX
#define _XOPEN5
#define IOV_MAX _XOPEN_IOV_MAX
#endif
+#endif
#include <stdlib.h>
#include <string.h>