From: Brian Candler Date: 2007-11-18T06:00:40+09:00 Subject: Re: Failing to compile trunk under Ubuntu > What version of GCC do you have? What revision number of trunk is this? $ gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5) $ svn info Path: . URL: http://svn.ruby-lang.org/repos/ruby/trunk Repository Root: http://svn.ruby-lang.org/repos/ruby Repository UUID: b2dd03c8-39d4-4d8f-98ff-823fe69b080e Revision: 13952 Node Kind: directory Schedule: normal Last Changed Author: suke Last Changed Rev: 13952 Last Changed Date: 2007-11-17 15:04:55 +0000 (Sat, 17 Nov 2007) Properties Last Updated: 2007-11-17 17:45:58 +0000 (Sat, 17 Nov 2007) > I have GCC 4.2.2 and it works for me. I don't see a note in the README about a particular compiler version being required. ruby 1.8 is very portable, and it would be a shame if ruby 1.9 did not compile on a common OS, or it used an esoteric feature of C :-( Maybe it's more a question of what version of bison I have: $ bison --version bison (GNU Bison) 2.1 Written by Robert Corbett and Richard Stallman. ... snip I tried commenting out the offending line: --- parse.c.orig 2007-11-17 20:37:56.000000000 +0000 +++ parse.c 2007-11-17 20:54:43.000000000 +0000 @@ -4201,7 +4201,7 @@ if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + // YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { This made the compile go further but it stopped again here with an almost identical error: make[1]: Entering directory `/v/build/ruby-trunk/ext/ripper' gcc -I. -I../../.ext/include/i686-linux -I../.././include -I../.././ext/ripper -I../.. -I../../. -DRUBY_EXTCONF_H=\"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c ripper.c parse.c: In function ���yydestruct���: parse.c:4204: error: ���parser��� undeclared (first use in this function) parse.c:4204: error: (Each undeclared identifier is reported only once parse.c:4204: error: for each function it appears in.) make[1]: *** [ripper.o] Error 1 make[1]: Leaving directory `/v/build/ruby-trunk/ext/ripper' make: *** [all] Error 1 So I commented out this line too: --- ext/ripper/ripper.c.orig 2007-11-17 20:53:12.000000000 +0000 +++ ext/ripper/ripper.c 2007-11-17 20:53:12.000000000 +0000 @@ -4201,7 +4201,7 @@ if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + // YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { and now the compile completes successfully. $ ./ruby -v ruby 1.9.0 (2007-11-17 patchlevel 0) [i686-linux] Regards, Brian.