This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3.4 PATCH: Improve IRIX 6.5 <internal/stdio_core.h> fixing
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Bruce Korb <bkorb at gnu dot org>
- Date: Mon, 6 Oct 2003 20:27:08 +0200 (MEST)
- Subject: 3.4 PATCH: Improve IRIX 6.5 <internal/stdio_core.h> fixing
After upgrading an SGI box to IRIX 6.5.21f, bootstrap failed due to
incorrect fixincludes:
In file included from /vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/stdio.h:18,
from /vol/gnu/src/gcc/gcc-dist/libf2c/libI77/fio.h:2,
from /vol/gnu/src/gcc/gcc-dist/libf2c/libI77/uio.c:3:
/vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/internal/stdio_core.h: In function `snprintf':
/vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/internal/stdio_core.h:319: error: `__gnuc___gnuc_va_list' undeclared (first use in this function)
/vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/internal/stdio_core.h:319: error: (Each undeclared identifier is reported only once
/vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/internal/stdio_core.h:319: error: for each function it appears in.)
/vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/internal/stdio_core.h:319: error: parse error before "_ap"
/vol/gcc/obj/gcc-3.4-20030905/6.5.21-cc-java/gcc/include/internal/stdio_core.h:322: error: `_ap' undeclared (first use in this function)
make[3]: *** [uio.lo] Error 1
It turns out this is due to two problems with fixing
<internal/stdio_core.h>:
* fixincl mis-fixes <internal/stdio_core.h>: in inline snprintf:
- __SGI_LIBC_NAMESPACE_QUALIFIER va_list _ap;
+ __SGI_LIBC_NAMESPACE_QUALIFIER __gnuc___gnuc_va_list _ap;
i.e. the __gnuc prefix is added twice.
* The irix_stdio_va_list didn't work in a couple of places since the
prototypes for the affected functions have been broken into several
lines.
The following patch fixes both problems and allows mips-sgi-irix6.5
bootstrap to finish successfully.
Ok for mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Thu Oct 2 19:24:42 2003 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* fixinc/inclhack.def (stdio_va_list): Avoid double substitution
on `va_list _ap;'.
(irix_stdio_va_list): Don't require leading printf, IRIX 6.5.21
introduced some multi-line prototypes.
* fixinc/fixincl.x: Regenerate.
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.181
diff -u -p -r1.181 inclhack.def
--- fixinc/inclhack.def 29 Sep 2003 20:02:07 -0000 1.181
+++ fixinc/inclhack.def 6 Oct 2003 18:24:06 -0000
@@ -1480,9 +1480,9 @@ fix = {
files = stdio.h;
files = internal/stdio_core.h;
- select = '(printf\(.*), /\* va_list \*/ char \*';
+ select = '/\* va_list \*/ char \*';
c_fix = format;
- c_fix_arg = "%1, __gnuc_va_list";
+ c_fix_arg = "__gnuc_va_list";
test_text =
"extern int printf( const char *, /* va_list */ char * );";
};
@@ -2406,7 +2406,7 @@ fix = {
*/
sed = "s@ va_list @ __gnuc_va_list @\n"
"s@ va_list)@ __gnuc_va_list)@\n"
- "s@va_list _ap;@__gnuc_va_list _ap;@\n"
+ "s@[ \t]va_list _ap;@__gnuc_va_list _ap;@\n"
"s@(va_list)&@(__gnuc_va_list)\\&@\n"
"s@ _VA_LIST_));@ __gnuc_va_list));@\n"
"s@ __VA_LIST__));@ __gnuc_va_list));@\n"