This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] (head) Resolve bootstrap failure when using older bison's.


Hi,

Following patch allows gcc-HEAD to bootstrap with an older bison (v1.29).
Without this patch, bison will generate headers like this :

++++ gengtype-yacc.h ++++
#ifndef G-YACC_19566_H
# define G-YACC_19566_H

typedef union {
  type_p t;
  pair_p p;
  options_p o;
  const char *s;
} YYSTYPE;
[...]

Resulting in a bootstrap error as the preprocessor warns on the extra symbols behind the 'G' in '#ifndef'

The patch changes the resulting header into :

#ifndef G_YACC_19566_H
# define G_YACC_19566_H
[...]


gcc-3.3-cvs suffers from the same problem, but as we don't fail on a warning this is not fatal.



2003-05-02 Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com>


	* Makefile.in ($(parsedir)/gengtype-yacc.c,
	$(parsedir)/c-parse.c): Support older bisons.


root:/usr/src/cvs-others/gcc-trees/gcc-head/gcc/gcc# cvs diff -u Makefile.in Index: Makefile.in =================================================================== RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v retrieving revision 1.1044 diff -u -r1.1044 Makefile.in --- Makefile.in 29 Apr 2003 20:34:45 -0000 1.1044 +++ Makefile.in 2 May 2003 08:19:21 -0000 @@ -1238,11 +1238,11 @@

 $(parsedir)/c-parse.c: $(parsedir)/c-parse.y
 	cd $(parsedir) && \
-	if $(BISON) $(BISONFLAGS) -o c-p$$$$.c c-parse.y; then \
-	  test -f c-p$$$$.output && mv -f c-p$$$$.output c-parse.output ; \
-	  mv -f c-p$$$$.c c-parse.c ; \
+	if $(BISON) $(BISONFLAGS) -o c_p$$$$.c c-parse.y; then \
+	  test -f c_p$$$$.output && mv -f c_p$$$$.output c-parse.output ; \
+	  mv -f c_p$$$$.c c-parse.c ; \
 	else \
-	  rm -f c-p$$$$.* ; \
+	  rm -f c_p$$$$.* ; \
 	  false ; \
 	fi

@@ -2225,11 +2225,11 @@
 	fi

 $(parsedir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
-	if $(BISON) $(BISONFLAGS) -d -o g-yacc.$$$$.c $(srcdir)/gengtype-yacc.y; then \
-	  mv -f g-yacc.$$$$.h $(parsedir)/gengtype-yacc.h; \
-	  mv -f g-yacc.$$$$.c $(parsedir)/gengtype-yacc.c; \
+	if $(BISON) $(BISONFLAGS) -d -o g_yacc.$$$$.c $(srcdir)/gengtype-yacc.y; then \
+	  mv -f g_yacc.$$$$.h $(parsedir)/gengtype-yacc.h; \
+	  mv -f g_yacc.$$$$.c $(parsedir)/gengtype-yacc.c; \
 	else \
-	  rm -f g-yacc.$$$$.*; \
+	  rm -f g_yacc.$$$$.*; \
 	  false; \
 	fi

Greetings,
--
Jeroen Dobbelaere
Embedded Software Engineer

ACUNIA Embedded Solutions
http://www.acunia.com/aes



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]