This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.4 PATCH: Improve IRIX 6.5 <internal/stdio_core.h> fixing
- From: Bruce Korb <bkorb at veritas dot com>
- To: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org, Bruce Korb <bkorb at gnu dot org>
- Date: Mon, 06 Oct 2003 12:02:41 -0700
- Subject: Re: 3.4 PATCH: Improve IRIX 6.5 <internal/stdio_core.h> fixing
- References: <16257.46076.274085.813587@xayide.TechFak.Uni-Bielefeld.DE>
- Reply-to: bkorb at veritas dot com
Rainer Orth wrote:
>
> After upgrading an SGI box to IRIX 6.5.21f, bootstrap failed due to
> incorrect fixincludes:
>
> 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?
I'm surprised it works. This expression:
> + "s@[ \t]va_list _ap;@__gnuc_va_list _ap;@\n"
ought to leave the above line looking like this:
> + __SGI_LIBC_NAMESPACE_QUALIFIER__gnuc_va_list _ap;
assuming I am not misreading :-}, that isn't exactly right,
either. (easy to do, misreading that stuff ...)
Ah, I get it, this new expression doesn't function
anymore because the first substitution will always catch
it first. Please, just delete the expression. Thanks.
> -----------------------------------------------------------------------------
> 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"