diff mbox

Fix Solaris 9/x86 bootstrap

Message ID yddipcck4n6.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Aug. 21, 2012, 8:53 a.m. UTC
Solaris 9/x86 bootstrap was broken after the cxx-conversion merge:

In file included from /vol/gcc/src/hg/trunk/local/gcc/gengtype.c:957:
/vol/gcc/src/hg/trunk/local/gcc/rtl.def:347: error: expected identifier before n
umeric constant
/vol/gcc/src/hg/trunk/local/gcc/rtl.def:347: error: expected '}' before numeric
constant

This happens since g++, unlike gcc, defines __EXTENSIONS__, which
exposes the equivalent of

#define PC 14

Initially I tried to avoid this by having gengtype.c include rtl.h,
which already has the #undef, but this produced so much fallout that I
decided it's better to just replicate it here.

The patch allowed an i386-pc-solaris2.9 bootstrap to finish.  I think
this counts as obvious unless someone prefers the rtl.h route
nonetheless.

Ok for mainline?

	Rainer


2012-08-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gengtype.c (PC): Undef.

Comments

Richard Biener Aug. 21, 2012, 8:55 a.m. UTC | #1
On Tue, Aug 21, 2012 at 10:53 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Solaris 9/x86 bootstrap was broken after the cxx-conversion merge:
>
> In file included from /vol/gcc/src/hg/trunk/local/gcc/gengtype.c:957:
> /vol/gcc/src/hg/trunk/local/gcc/rtl.def:347: error: expected identifier before n
> umeric constant
> /vol/gcc/src/hg/trunk/local/gcc/rtl.def:347: error: expected '}' before numeric
> constant
>
> This happens since g++, unlike gcc, defines __EXTENSIONS__, which
> exposes the equivalent of
>
> #define PC 14
>
> Initially I tried to avoid this by having gengtype.c include rtl.h,
> which already has the #undef, but this produced so much fallout that I
> decided it's better to just replicate it here.
>
> The patch allowed an i386-pc-solaris2.9 bootstrap to finish.  I think
> this counts as obvious unless someone prefers the rtl.h route
> nonetheless.
>
> Ok for mainline?

Doesn't that belong in system.h instead?  And removed from rtl.h?

Thanks,
Richard.

>         Rainer
>
>
> 2012-08-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         * gengtype.c (PC): Undef.
>
>
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
diff mbox

Patch

# HG changeset patch
# Parent cf74f0e72cab4965ba20bf236eac2fac2b87064e
Fix Solaris 9 bootstrap

diff --git a/gcc/gengtype.c b/gcc/gengtype.c
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -35,6 +35,8 @@ 
 #include "gengtype.h"
 #include "filenames.h"
 
+#undef PC /* Some systems predefine this symbol; don't let it interfere.  */
+
 /* Data types, macros, etc. used only in this file.  */