This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug gdb/22618] New: bad diagnosis and recovery suggestion when bison or flex is missing


https://sourceware.org/bugzilla/show_bug.cgi?id=22618

            Bug ID: 22618
           Summary: bad diagnosis and recovery suggestion when bison or
                    flex is missing
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: jreiser at BitWagon dot com
  Target Milestone: ---

When building gdb on a system where bison or flex is not found in $PATH, then
the error diagnosis and recovery suggestion is incomplete.  The suggestion
forgets to say:
   Run "make clean" after installing [bison or flex] before continuing.

This causes needless bewilderment and lost time when subsequent 'make'
complains about a missing file syslex.c.  Maintainers of the gdb package in
various Linux distributions often encourage "file bug reports upstream"
[namely, here at sourceware.org instead of at the distribution level].  Thus
"gdb developer" often includes "ordinary users" who encounter problems with
distributed packaged gdb.

Furthermore, checking for bison and flex should be part of the top-level
./configure for gdb, and not [only] in lower-level .../configure scripts.  By
default, a complete top-level build does require both bison and flex; supplying
them at first will avoid the necessity of "tending" the top-level 'make'
interactively.  Add options "--without bison" and "--without flex" to the
top-level 'configure' if desired to please those experienced developers who
manage to avoid using bison and flex by excluding various sub-packages of gdb.

When doing a complete top-level build of gdb, then the bison diagnosis is:
=====
Making all in po
/home/jreiser/binutils-gdb/missing: line 81: bison: command not found
make[4]: Entering directory '/home/jreiser/binutils-gdb/gprof/po'
file=`echo bg | sed 's,.*/,,'`.gmo \
  && rm -f $file && PATH=../src:$PATH /usr/bin/msgfmt -o $file bg.po
WARNING: 'bison' is missing on your system.
         You should only need it if you modified a '.y' file.
         You may want to install the GNU Bison package:
         <http://www.gnu.org/software/bison/>
make[2]: *** [Makefile:986: arparse.c] Error 127
make[2]: *** Waiting for unfinished jobs....
file=`echo da | sed 's,.*/,,'`.gmo \
  && rm -f $file && PATH=../src:$PATH /usr/bin/msgfmt -o $file da.po
/home/jreiser/binutils-gdb/missing: line 81: bison: command not found
file=`echo de | sed 's,.*/,,'`.gmo \
  && rm -f $file && PATH=../src:$PATH /usr/bin/msgfmt -o $file de.po
WARNING: 'bison' is missing on your system.
         You should only need it if you modified a '.y' file.
         You may want to install the GNU Bison package:
         <http://www.gnu.org/software/bison/>
make[2]: *** [Makefile:986: sysinfo.c] Error 127
make[2]: Leaving directory '/home/jreiser/binutils-gdb/binutils'
=====

After installing bison, then re-running 'make' gives the flex diagnosis:
=====
/home/jreiser/binutils-gdb/missing: line 81: flex: command not found
updating sysinfo.h
WARNING: 'flex' is missing on your system.
         You should only need it if you modified a '.l' file.
         You may want to install the Fast Lexical Analyzer package:
         <http://flex.sourceforge.net/>
make[2]: *** [Makefile:983: syslex.c] Error 127
make[2]: *** Waiting for unfinished jobs....
gcc -DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT    
-DDEFAULT_INLINE=0   -Wall -Wdeclaration-after-statement -Wpointer-arith
-Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch
-Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement
-Wempty-body -Wmissing-parameter-type -Wold-style-declaration
-Wold-style-definition -Wformat-nonliteral   -DMODET   -I. -I. -I../common
-I./../common -I../../include -I./../../include -I../../bfd -I./../../bfd
-I../../opcodes -I./../../opcodes  -g -O2 -c -o version.o -MT version.o -MMD
-MP -MF .deps/version.Tpo version.c
make[2]: Leaving directory '/home/jreiser/binutils-gdb/binutils'
=====

After installing flex, then re-running 'make' gives the error:
=====
gcc -c -I. -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
-Wstack-usage=262144 -Werror -I./../zlib -g -O2 -Wno-error ./syslex_wrap.c
./syslex_wrap.c:25:10: fatal error: syslex.c: No such file or directory
 #include "syslex.c"
          ^~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:1375: syslex_wrap.o] Error 1
make[2]: Leaving directory '/home/jreiser/binutils-gdb/binutils'
=====
That error takes a while to figure out.  The top-level ./configure should
diagnose the lack of bison and flex.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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