Package: dash
Version: 0.5.7-3
X-Debbugs-CC: binut...@sourceware.org, g...@sourceware.org


[The binutils and GDB lists are CCed for your information, in case
someone else is seeing the same weirdness.]


Hi!

As of commit cb1b797bd918eca0f8b99e31803e44a0629b93fc in GDB's Git
repository, respectively commit ff557cac634a7675676cb84a573ceadd8b4dbbcb
in binutils' (<git://sourceware.org/git/binutils.git>,
<git://sourceware.org/git/gdb.git>), the current (0.5.7-3) Debian version
of dash apparently fails to parse this revision of opcodes/configure.
Having configured »/bin/sh -> dash«, this issue reproduces in the same
way on both a x86 Debian GNU/Linux and Debian GNU/Hurd system.

    $ git clone git://sourceware.org/git/binutils.git
    $ cd binutils/
    $ git checkout cb1b797bd918eca0f8b99e31803e44a0629b93fc
    $ mkdir b
    $ cd b/
    $ ../configure SHELL=/bin/dash
    $ make configure-opcodes
    [...]
    checking for gcc option to accept ISO C89... none needed
    checking for library containing strerror... none required
    checking for a BSD-compatible install... [...]/opcodes/configure: 3285: 
./configure.lineno: Syntax error: "}" unexpected (expecting ";;")
    make: *** [configure-opcodes] Error 1

When I edit opcodes/configure to put »set -v -x« in its second line, and
re-run »make configure-opcodes«, I see:

    [...]
                  test -s conftest.dir/conftest.two
                then
                  ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
                  break 3
                fi
              fi
            fi
          done
    };
    /home/thomas/tmp/source/gdb/git/opcodes/configure: 3285: 
./configure.lineno: Syntax error: "}" unexpected (expecting "done")
    + exit_status=2
    [...]

Note that the error message now changed from »expecting ";;"« to
»expecting "done"«.  The »};« at the beginning of the line is unexpected;
the »set -v«-logged code here indeed looks differently from what
opcodes/configure contains:

    [...]
                  test -s conftest.dir/conftest.two
                then
                  ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
                  break 3
                fi
              fi
            fi
          done
        done
        ;;
    esac
    
      done
    [...]

In another instance of this issue, I've seen different corruption:
instead of the misplaced »};« I saw »ruct buf« which I suppose stems from
»struct buf« used in a here-document earlier in the file.  So, there
appears to be some corruption in dash's parser?

While said commit cb1b797bd918eca0f8b99e31803e44a0629b93fc (respectively
ff557cac634a7675676cb84a573ceadd8b4dbbcb for GDB), does trigger this
issue (when using the revision just before, configuration finishes
successfully), I don't think it's the cause; this commit appears to be an
unrelated and valid change.

If I build the current upstream version of dash (commit
46abc8c6d8a5e9a5712bdc1312c0b6960eec65a4; just »configure && make«), and
in the binutils/GDB top-level Makefile's »configure-opcodes:« rule
(beginning at line 2902) replace the »$(SHELL) $${libsrcdir}/configure«
with »[...]/dash $${libsrcdir}/configure« (making it use the current
upstream version of dash for the opcodes/configure script), configuration
finishes successfully.  Likewise, when using bash there is no such
problem.


Grüße,
 Thomas

Attachment: pgp1I9BJOYW2w.pgp
Description: PGP signature

Reply via email to