Skip to contentSkip to conversation

Compilation problem with Yacc

PATCH Xun Sun 2 participants 2 messages Dec 30, 2005 Kbuild

lore
Share & tools
lore

Xun Sun

author
#0 lore raw

Hi,

Today when I tried to compile grub2 from latest cvs on my Fedora Core 2 system, it errored out with the messages:

gcc -Inormal -I./normal -I. -Iinclude -I./include -Wall -W -DGRUB_DATADIR=\"/usr/local/share/grub/i386-pc\" -g -O2 -DGRUB_UTIL=1 -c -o grub_emu-normal_lexer.o normal/lexer.c normal/lexer.c: In function `grub_script_yylex':
normal/lexer.c:89: error: called object is not a function normal/lexer.c:90: error: syntax error before "return" normal/lexer.c:92: error: called object is not a function normal/lexer.c:93: error: syntax error before '{' token normal/lexer.c:84: warning: unused variable newstate' normal/lexer.c:85: warning: unused variable use' normal/lexer.c:86: warning: unused variable buffer' normal/lexer.c:87: warning: unused variable bp' normal/lexer.c: At top level: normal/lexer.c:105: error: syntax error before string constant normal/lexer.c:105: warning: type defaults to int' in declaration of grub_real_dprintf' normal/lexer.c:105: error:
conflicting types for `grub_real_dprintf'
include/grub/misc.h:67: error: previous declaration of `grub_real_dprintf' normal/lexer.c:105: warning: data definition has no type or storage class normal/lexer.c:106: error: syntax error before numeric constant normal/lexer.c:112: warning: type defaults to int' in declaration of newscript'
normal/lexer.c:112: error: conflicting types for newscript' normal/lexer.c:55: error: previous declaration of newscript' normal/lexer.c:112: warning: data definition has no type or storage class normal/lexer.c:113: warning: type defaults to int' in declaration of grub_script_lexer_done'
normal/lexer.c:113: error: redefinition of grub_script_lexer_done' normal/lexer.c:29: error: grub_script_lexer_done' previously defined here normal/lexer.c:113: warning: data definition has no type or storage class normal/lexer.c:114: error: syntax error before string constant normal/lexer.c:114: warning: type defaults to int' in declaration of grub_real_dprintf'
normal/lexer.c:114: warning: data definition has no type or storage class normal/lexer.c:115: error: syntax error before "return" normal/lexer.c:119: warning: type defaults to int' in declaration of newstate'

The problem as far as I can tell is that the @YACC@ env identified by ./configure was not ued, and the default YACC program (which is from byacc-1.9-27) parsed the normal/parser.y wrongly.

The patch bellow resolves the problem for me:

Index: Makefile.in
===================================================================
RCS file: /cvsroot/grub/grub2/Makefile.in,v
retrieving revision 1.16

Makefile.in 30 Dec 2005 07:38:35 -0000 renamed from Makefile.in 18 Nov 2005 14:56:55 -0000 1.16 +1 -0
diff -u -r1.16 Makefile.in
@@ -66,6 +66,7 @@
 NM = @NM@
 LD = @LD@
 RUBY = @RUBY@
+YACC = @YACC@
 LIBCURSES = @LIBCURSES@
 LIBLZO = @LIBLZO@
 

Makes sense?

--
Thanks & regards
Xun Sun

#1 lore raw

Xun Sun <[email protected]> writes:

Hi,

Quoted 2 lines

Today when I tried to compile grub2 from latest cvs on my Fedora Core 2 system, it errored out with the messages:

Thanks for your report. There are some other issues related to this one. I will take care of all of them real soon.

--
Marco