public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix Solaris 9/x86 bootstrap
@ 2012-08-21  8:53 Rainer Orth
  2012-08-21  8:55 ` Richard Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: Rainer Orth @ 2012-08-21  8:53 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol9-gengtype.patch --]
[-- Type: text/x-patch, Size: 391 bytes --]

# 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.  */
 
 

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix Solaris 9/x86 bootstrap
  2012-08-21  8:53 Fix Solaris 9/x86 bootstrap Rainer Orth
@ 2012-08-21  8:55 ` Richard Guenther
  2012-08-22 12:55   ` Rainer Orth
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2012-08-21  8:55 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix Solaris 9/x86 bootstrap
  2012-08-21  8:55 ` Richard Guenther
@ 2012-08-22 12:55   ` Rainer Orth
  0 siblings, 0 replies; 3+ messages in thread
From: Rainer Orth @ 2012-08-22 12:55 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Richard Guenther <richard.guenther@gmail.com> writes:

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

Fine with me.  The following patch does just that, moving the #undefs
as far down in system.h as seemed reasonable.

Bootstrapped without regressions on i386-pc-solaris2.10 and
x86_64-unknown-linux-gnu; i386-pc-solaris2.9 build just started running
the testsuite.

Ok for mainline?

	Rainer


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

	* rtl.h (FFS, FLOAT, ABS, PC): Don't undef.
	* system.h (FFS, FLOAT, ABS, PC): Undef.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol9-gengtype.patch --]
[-- Type: text/x-patch, Size: 1117 bytes --]

# HG changeset patch
# Parent 4cd1f4bc7b3c2901830dde3d7ace137718eae0e4
Fix Solaris 9/x86 bootstrap

	* rtl.h (FFS, FLOAT, ABS, PC): Don't undef.
	* system.h (FFS, FLOAT, ABS, PC): Undef.

diff --git a/gcc/rtl.h b/gcc/rtl.h
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -33,11 +33,6 @@ along with GCC; see the file COPYING3.  
 #include "hashtab.h"
 #include "flags.h"
 
-#undef FFS  /* Some systems predefine this symbol; don't let it interfere.  */
-#undef FLOAT /* Likewise.  */
-#undef ABS /* Likewise.  */
-#undef PC /* Likewise.  */
-
 /* Value used by some passes to "recognize" noop moves as valid
  instructions.  */
 #define NOOP_MOVE_INSN_CODE	INT_MAX
diff --git a/gcc/system.h b/gcc/system.h
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -638,6 +638,11 @@ extern int vsnprintf(char *, size_t, con
 /* Get libiberty declarations.  */
 #include "libiberty.h"
 
+#undef FFS  /* Some systems predefine this symbol; don't let it interfere.  */
+#undef FLOAT /* Likewise.  */
+#undef ABS /* Likewise.  */
+#undef PC /* Likewise.  */
+
 /* Provide a default for the HOST_BIT_BUCKET.
    This suffices for POSIX-like hosts.  */
 

[-- Attachment #3: Type: text/plain, Size: 144 bytes --]



-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-22 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21  8:53 Fix Solaris 9/x86 bootstrap Rainer Orth
2012-08-21  8:55 ` Richard Guenther
2012-08-22 12:55   ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).