Bison host requirement

Dan Nicholson dbn.lists at
Sat Apr 14 09:54:57 PDT 2007

A couple people recently hit a bug building bash in Ch. 5 using the
bison from their host. There's a bug from one reporter and a split up
support thread from the other:

They both had bison-1.75 on their hosts. The current host requirement
says bison-1.26a. That came from a comment I found in the bash code,
but was never confirmed.

I confirmed now that things are broken with 1.75, but work with 1.875
and 2.0. You can test this by installing bison-1.75 to a temporary
location. Make sure to do the whole "make install" because the stuff
in $datadir/bison is essential. Then build bash-3.2, making sure that
the parser is generated with bison. This can be done by applying the
patch or just "touch parse.y".

The bash testcase is that when the "in ..." part is left out of a for
loop, it reads the arguments from $@. This was causing the perl build
to bomb. Here's the simple script I was using (basically, the stripped
down part of the script in perl that was failing):

set -- foo
set +x
for dir do
  echo $dir

In the good case, the output will be
+ for dir in '"$@"'
+ echo foo

In the bad case, the output will be
+ for dir in '""'
+ echo

It never substitutes $@. This is defined by, which is
generated from parse.y by bison.

One question I have is, what's the deal with bison-1.875a? I don't
remember what the "a" version was about, and it's not on the GNU ftp
site. Is it sufficient to list 1.875 as the minimum?


More information about the lfs-dev mailing list