http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60470
Bug ID: 60470 Summary: Building gcc using "make" fails after a successful configure when flex and bison are not installed. Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: shlomif at shlomifish dot org Dear sirs and madams, when trying to build GCC in the Subversion on Mageia Linux x86-64 Cauldron (5), after I ran this: #!/bin/bash ~/Download/unpack/prog/c/gcc/trunk/configure \ --prefix="$HOME"/apps/prog/gcc-4.9-snapshot \ --enable-languages="c,c++" ./configure is successful but "make" fails with an error, because I have byacc installed instead of bison (in /usr/bin/yacc) and I don't have flex installed. See: [SHELL] shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ rpm -q flex package flex is not installed shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ rpm -q bison package bison is not installed shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ which yacc /usr/bin/yacc shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ which lex which: no lex in (/home/shlomif/apps/perl/brew/bin:/home/shlomif/apps/vim/bin:/home/shlomif/apps/gwenview/bin:/home/shlomif/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/perl/modules/bin:/opt/valgrind-trunk/bin:/home/shlomif/apps/latemp/bin:/home/shlomif/apps/quadpres/bin:/home/shlomif/apps/wml/bin:/home/shlomif/bin:/home/shlomif/apps/vim/bin:/home/shlomif/apps/gwenview/bin:/usr/local/bin:/usr/bin:/usr/games:/usr/lib64/qt4/bin) shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ rpm -qf /usr/bin/yacc file /usr/bin/yacc is not owned by any package shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ ls -l /usr/bin/yacc lrwxrwxrwx 1 root root 22 Nov 29 2011 /usr/bin/yacc -> /etc/alternatives/yacc shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ ls -l /etc/alternatives/yacc lrwxrwxrwx 1 root root 14 Mar 8 21:16 /etc/alternatives/yacc -> /usr/bin/byacc shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ ls -l /usr/bin/byacc -rwxr-xr-x 1 root root 90768 Feb 14 02:26 /usr/bin/byacc shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ gvim ~/conf/build/gcc-4.9.x-trunk.sh shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ rpm -qf /usr/bin/byacc byacc-20140101-1.mga5 shlomif@telaviv1:~/Download/unpack/prog/c/gcc/BUILD$ [/SHELL] I think ./configure should detect that this is the case and report it, or alternatively that the build system will be made to work with byacc. Here is the error I am getting: [ERROR] [ -f stage_final ] || echo stage3 > stage_final make[1]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' make[2]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' rm -f stage_current make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' make[2]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' make[2]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libiberty' make[4]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libiberty/testsuite' make[4]: Nothing to be done for 'all'. make[4]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libiberty/testsuite' make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libiberty' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/lto-plugin' make all-am make[4]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/lto-plugin' make[4]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/lto-plugin' make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/lto-plugin' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/intl' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/intl' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/build-x86_64-unknown-linux-gnu/libiberty' make[4]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/build-x86_64-unknown-linux-gnu/libiberty/testsuite' make[4]: Nothing to be done for 'all'. make[4]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/build-x86_64-unknown-linux-gnu/libiberty/testsuite' make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/build-x86_64-unknown-linux-gnu/libiberty' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/build-x86_64-unknown-linux-gnu/fixincludes' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/build-x86_64-unknown-linux-gnu/fixincludes' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/zlib' true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g" "CXXFLAGS=-g" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/home/shlomif/apps/prog/gcc-4.9-snapshot" "infodir=/home/shlomif/apps/prog/gcc-4.9-snapshot/share/info" "libdir=/home/shlomif/apps/prog/gcc-4.9-snapshot/lib" "prefix=/home/shlomif/apps/prog/gcc-4.9-snapshot" "tooldir=/home/shlomif/apps/prog/gcc-4.9-snapshot/x86_64-unknown-linux-gnu" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do # make make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/zlib' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libbacktrace' make all-am make[4]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libbacktrace' true DO=all multi-do # make make[4]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libbacktrace' make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libbacktrace' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libcpp' test -f config.h || (rm -f stamp-h1 && make stamp-h1) make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libcpp' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libdecnumber' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/libdecnumber' make[3]: Entering directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/gcc' g++ -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -o build/gengtype \ build/gengtype.o build/errors.o build/gengtype-lex.o build/gengtype-parse.o build/gengtype-state.o build/version.o ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a build/gengtype.o: In function `create_optional_field_': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype.c:1002: undefined reference to `lexer_line' build/gengtype.o: In function `adjust_field_rtx_def': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype.c:1137: undefined reference to `lexer_line' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype.c:1193: undefined reference to `lexer_line' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype.c:1203: undefined reference to `lexer_line' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype.c:1272: undefined reference to `lexer_line' build/gengtype.o:/home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype.c:1312: more undefined references to `lexer_line' follow build/gengtype-parse.o: In function `token': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:53: undefined reference to `yylex(char const**)' build/gengtype-parse.o: In function `parse_error': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:141: undefined reference to `lexer_line' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:141: undefined reference to `lexer_line' build/gengtype-parse.o: In function `struct_field_seq': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:786: undefined reference to `lexer_line' build/gengtype-parse.o: In function `type': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:835: undefined reference to `lexer_line' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:876: undefined reference to `lexer_line' build/gengtype-parse.o:/home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:876: more undefined references to `lexer_line' follow build/gengtype-parse.o: In function `parse_file(char const*)': /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:1094: undefined reference to `yybegin(char const*)' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:1120: undefined reference to `lexer_toplevel_done' /home/shlomif/Download/unpack/prog/c/gcc/trunk/gcc/gengtype-parse.c:1125: undefined reference to `yyend()' collect2: error: ld returned 1 exit status Makefile:2530: recipe for target 'build/gengtype' failed make[3]: *** [build/gengtype] Error 1 make[3]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD/gcc' Makefile:4177: recipe for target 'all-stage1-gcc' failed make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' Makefile:20364: recipe for target 'stage1-bubble' failed make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory '/home/shlomif/Download/unpack/prog/c/gcc/BUILD' Makefile:890: recipe for target 'all' failed make: *** [all] Error 2 [/ERROR] I noticed that I am able to build gcc-4.9.0 after installing the buildrequires of Mageia’s gcc rpm SPEC, which include bison and flex. Thanks! Regards, -- Shlomi Fish