prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Cannot build elfutils
  With the current head (b5eb298f3efde1ae32545a3363bed46e1811ab76) 
  
  ```
  $ spack install elfutils
  ==> Installing elfutils
  ==> Using cached archive: ~/Documents/git/spack/var/spack/cache/elfutils/elfutils-0.163.tar.bz2
  ==> Already staged elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3 in ~/Documents/git/spack/var/spack/stage/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3
  ==> Already patched elfutils
  ==> Building elfutils [AutotoolsPackage]
  ==> Executing phase : 'autoreconf'
  ==> Executing phase : 'configure'
  ==> Error: ProcessError: Command exited with status 1:
      '~/Documents/git/spack/var/spack/stage/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3/elfutils-0.163/configure' '--prefix=~/Documents/git/spack/opt/spack/linux-debian8-x86_64/gcc-4.9.2/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3' '--enable-maintainer-mode'
  ~/Documents/git/spack/lib/spack/spack/build_systems/autotools.py:266, in configure:
       258      def configure(self, spec, prefix):
       259          """Runs configure with the arguments specified in
       260          :py:meth:`~.AutotoolsPackage.configure_args`
       261          and an appropriately set prefix.
       262          """
       263          options = ['--prefix={0}'.format(prefix)] + self.configure_args()
       264  
       265          with working_dir(self.build_directory, create=True):
    >> 266              inspect.getmodule(self).configure(*options)
  
  See build log for details:
    ~/spack-stage/spack-stage-9_hjUA/elfutils-0.163/spack-build.out
  ```
  ```
  $ tail ~/spack-stage/spack-stage-9_hjUA/elfutils-0.163/spack-build.out
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking size of long... 8
  checking for struct user_regs_struct... yes
  checking ~/Documents/git/spack/lib/spack/env/gcc/gcc option for 32-bit word size... -m32
  checking for 64-bit host... yes
  checking whether ~/Documents/git/spack/lib/spack/env/gcc/gcc -m32 makes executables we can run... yes
  checking for flex... no
  configure: error: flex needed in maintainer mode
  ```
  Adding ```depends_on('flex')``` leads to 
  ```
  configure: error: bison needed in maintainer mode
  ```
  
  Is this a know issue? How do I fix this?
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `var/spack/repos/builtin/packages/elfutils/package.py`
  Content:
  ```
  1 ##############################################################################
  2 # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
  3 # Produced at the Lawrence Livermore National Laboratory.
  4 #
  5 # This file is part of Spack.
  6 # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
  7 # LLNL-CODE-647188
  8 #
  9 # For details, see https://github.com/llnl/spack
  10 # Please also see the NOTICE and LICENSE files for our notice and the LGPL.
  11 #
  12 # This program is free software; you can redistribute it and/or modify
  13 # it under the terms of the GNU Lesser General Public License (as
  14 # published by the Free Software Foundation) version 2.1, February 1999.
  15 #
  16 # This program is distributed in the hope that it will be useful, but
  17 # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
  18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
  19 # conditions of the GNU Lesser General Public License for more details.
  20 #
  21 # You should have received a copy of the GNU Lesser General Public
  22 # License along with this program; if not, write to the Free Software
  23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24 ##############################################################################
  25 from spack import *
  26 
  27 
  28 class Elfutils(AutotoolsPackage):
  29     """elfutils is a collection of various binary tools such as
  30     eu-objdump, eu-readelf, and other utilities that allow you to
  31     inspect and manipulate ELF files. Refer to Table 5.Tools Included
  32     in elfutils for Red Hat Developer for a complete list of binary
  33     tools that are distributed with the Red Hat Developer Toolset
  34     version of elfutils."""
  35 
  36     homepage = "https://fedorahosted.org/elfutils/"
  37 
  38     url      = "https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2"
  39     list_url = "https://sourceware.org/elfutils/ftp"
  40     list_depth = 1
  41 
  42     version('0.168', '52adfa40758d0d39e5d5c57689bf38d6')
  43     version('0.163', '77ce87f259987d2e54e4d87b86cbee41', preferred=True)
  44 
  45     provides('elf@1')
  46 
  47     def configure_args(self):
  48         return ['--enable-maintainer-mode']
  49
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/var/spack/repos/builtin/packages/elfutils/package.py b/var/spack/repos/builtin/packages/elfutils/package.py
  --- a/var/spack/repos/builtin/packages/elfutils/package.py
  +++ b/var/spack/repos/builtin/packages/elfutils/package.py
  @@ -35,14 +35,22 @@
   
       homepage = "https://fedorahosted.org/elfutils/"
   
  -    url      = "https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2"
  +    url = "https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2"
       list_url = "https://sourceware.org/elfutils/ftp"
       list_depth = 1
   
  +    version('0.170', '03599aee98c9b726c7a732a2dd0245d5')
       version('0.168', '52adfa40758d0d39e5d5c57689bf38d6')
       version('0.163', '77ce87f259987d2e54e4d87b86cbee41', preferred=True)
   
  +    depends_on('flex', type='build')
  +    depends_on('bison', type='build')
  +    depends_on('gettext')
  +
       provides('elf@1')
   
       def configure_args(self):
  -        return ['--enable-maintainer-mode']
  +        # configure doesn't use LIBS correctly
  +        return [
  +            'LDFLAGS=-L%s -lintl' % self.spec['gettext'].prefix.lib,
  +            '--enable-maintainer-mode']
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/elfutils/package.py b/var/spack/repos/builtin/packages/elfutils/package.py\n--- a/var/spack/repos/builtin/packages/elfutils/package.py\n+++ b/var/spack/repos/builtin/packages/elfutils/package.py\n@@ -35,14 +35,22 @@\n \n     homepage = \"https://fedorahosted.org/elfutils/\"\n \n-    url      = \"https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2\"\n+    url = \"https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2\"\n     list_url = \"https://sourceware.org/elfutils/ftp\"\n     list_depth = 1\n \n+    version('0.170', '03599aee98c9b726c7a732a2dd0245d5')\n     version('0.168', '52adfa40758d0d39e5d5c57689bf38d6')\n     version('0.163', '77ce87f259987d2e54e4d87b86cbee41', preferred=True)\n \n+    depends_on('flex', type='build')\n+    depends_on('bison', type='build')\n+    depends_on('gettext')\n+\n     provides('elf@1')\n \n     def configure_args(self):\n-        return ['--enable-maintainer-mode']\n+        # configure doesn't use LIBS correctly\n+        return [\n+            'LDFLAGS=-L%s -lintl' % self.spec['gettext'].prefix.lib,\n+            '--enable-maintainer-mode']\n", "issue": "Cannot build elfutils\nWith the current head (b5eb298f3efde1ae32545a3363bed46e1811ab76) \r\n\r\n```\r\n$ spack install elfutils\r\n==> Installing elfutils\r\n==> Using cached archive: ~/Documents/git/spack/var/spack/cache/elfutils/elfutils-0.163.tar.bz2\r\n==> Already staged elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3 in ~/Documents/git/spack/var/spack/stage/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3\r\n==> Already patched elfutils\r\n==> Building elfutils [AutotoolsPackage]\r\n==> Executing phase : 'autoreconf'\r\n==> Executing phase : 'configure'\r\n==> Error: ProcessError: Command exited with status 1:\r\n    '~/Documents/git/spack/var/spack/stage/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3/elfutils-0.163/configure' '--prefix=~/Documents/git/spack/opt/spack/linux-debian8-x86_64/gcc-4.9.2/elfutils-0.163-72pp6vadezugf5nmy5gbqksrmpukksa3' '--enable-maintainer-mode'\r\n~/Documents/git/spack/lib/spack/spack/build_systems/autotools.py:266, in configure:\r\n     258      def configure(self, spec, prefix):\r\n     259          \"\"\"Runs configure with the arguments specified in\r\n     260          :py:meth:`~.AutotoolsPackage.configure_args`\r\n     261          and an appropriately set prefix.\r\n     262          \"\"\"\r\n     263          options = ['--prefix={0}'.format(prefix)] + self.configure_args()\r\n     264  \r\n     265          with working_dir(self.build_directory, create=True):\r\n  >> 266              inspect.getmodule(self).configure(*options)\r\n\r\nSee build log for details:\r\n  ~/spack-stage/spack-stage-9_hjUA/elfutils-0.163/spack-build.out\r\n```\r\n```\r\n$ tail ~/spack-stage/spack-stage-9_hjUA/elfutils-0.163/spack-build.out\r\nchecking for inttypes.h... yes\r\nchecking for stdint.h... yes\r\nchecking for unistd.h... yes\r\nchecking size of long... 8\r\nchecking for struct user_regs_struct... yes\r\nchecking ~/Documents/git/spack/lib/spack/env/gcc/gcc option for 32-bit word size... -m32\r\nchecking for 64-bit host... yes\r\nchecking whether ~/Documents/git/spack/lib/spack/env/gcc/gcc -m32 makes executables we can run... yes\r\nchecking for flex... no\r\nconfigure: error: flex needed in maintainer mode\r\n```\r\nAdding ```depends_on('flex')``` leads to \r\n```\r\nconfigure: error: bison needed in maintainer mode\r\n```\r\n\r\nIs this a know issue? How do I fix this?\n", "before_files": [{"content": "##############################################################################\n# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory.\n#\n# This file is part of Spack.\n# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.\n# LLNL-CODE-647188\n#\n# For details, see https://github.com/llnl/spack\n# Please also see the NOTICE and LICENSE files for our notice and the LGPL.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License (as\n# published by the Free Software Foundation) version 2.1, February 1999.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and\n# conditions of the GNU Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n##############################################################################\nfrom spack import *\n\n\nclass Elfutils(AutotoolsPackage):\n    \"\"\"elfutils is a collection of various binary tools such as\n    eu-objdump, eu-readelf, and other utilities that allow you to\n    inspect and manipulate ELF files. Refer to Table 5.Tools Included\n    in elfutils for Red Hat Developer for a complete list of binary\n    tools that are distributed with the Red Hat Developer Toolset\n    version of elfutils.\"\"\"\n\n    homepage = \"https://fedorahosted.org/elfutils/\"\n\n    url      = \"https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2\"\n    list_url = \"https://sourceware.org/elfutils/ftp\"\n    list_depth = 1\n\n    version('0.168', '52adfa40758d0d39e5d5c57689bf38d6')\n    version('0.163', '77ce87f259987d2e54e4d87b86cbee41', preferred=True)\n\n    provides('elf@1')\n\n    def configure_args(self):\n        return ['--enable-maintainer-mode']\n", "path": "var/spack/repos/builtin/packages/elfutils/package.py"}], "after_files": [{"content": "##############################################################################\n# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory.\n#\n# This file is part of Spack.\n# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.\n# LLNL-CODE-647188\n#\n# For details, see https://github.com/llnl/spack\n# Please also see the NOTICE and LICENSE files for our notice and the LGPL.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License (as\n# published by the Free Software Foundation) version 2.1, February 1999.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and\n# conditions of the GNU Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n##############################################################################\nfrom spack import *\n\n\nclass Elfutils(AutotoolsPackage):\n    \"\"\"elfutils is a collection of various binary tools such as\n    eu-objdump, eu-readelf, and other utilities that allow you to\n    inspect and manipulate ELF files. Refer to Table 5.Tools Included\n    in elfutils for Red Hat Developer for a complete list of binary\n    tools that are distributed with the Red Hat Developer Toolset\n    version of elfutils.\"\"\"\n\n    homepage = \"https://fedorahosted.org/elfutils/\"\n\n    url = \"https://sourceware.org/elfutils/ftp/0.168/elfutils-0.168.tar.bz2\"\n    list_url = \"https://sourceware.org/elfutils/ftp\"\n    list_depth = 1\n\n    version('0.170', '03599aee98c9b726c7a732a2dd0245d5')\n    version('0.168', '52adfa40758d0d39e5d5c57689bf38d6')\n    version('0.163', '77ce87f259987d2e54e4d87b86cbee41', preferred=True)\n\n    depends_on('flex', type='build')\n    depends_on('bison', type='build')\n    depends_on('gettext')\n\n    provides('elf@1')\n\n    def configure_args(self):\n        # configure doesn't use LIBS correctly\n        return [\n            'LDFLAGS=-L%s -lintl' % self.spec['gettext'].prefix.lib,\n            '--enable-maintainer-mode']\n", "path": "var/spack/repos/builtin/packages/elfutils/package.py"}]}