)]}'
{
  "commit": "015bb5e104ec2bbd7ce7a3b7650431927be0cb38",
  "tree": "8744d913f610b55b57b1b8897e366e1de3bc77f6",
  "parents": [
    "f33422af6d81c623871f1407e2fce0794e90739a"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Tue Aug 11 13:18:02 2026 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu Aug 13 10:03:41 2026 +0100"
  },
  "message": "gdb/configure: fix string quoting in AC_MSG_WARN and AC_MSG_ERROR\n\nEli pointed out an issue with --enable-binary-file-formats, when GDB\nis built with --enable-binary-file-formats\u003d\u0027coff,xcoff,elf,macho\u0027 on a\ntarget that doesn\u0027t support Mach-O, then GDB would configure\ncorrectly, but then fail to build with an error like:\n\n     CXXLD  gdb.exe\n     d:/usr/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:\n             machoread.o: in function `macho_check_dsym\u0027:\n     d:\\gnu\\gdb-18.0.90\\gdb/machoread.c:738:(.text+0xb16):\n             undefined reference to `bfd_mach_o_lookup_command\u0027\n     d:/usr/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:\n             d:\\gnu\\gdb-18.0.90\\gdb/machoread.c:757:(.text+0xbe6):\n                     undefined reference to `bfd_mach_o_lookup_command\u0027\n     collect2.exe: error: ld returned 1 exit status\n\nSee the original report here:\n\n  https://inbox.sourceware.org/gdb-patches/865x1j1z61.fsf@gnu.org\n\nIt turns out the problem was incorrect quoting in an AC_MSG_ERROR call\nwithin the configure script.  The current code is structured like\nthis:\n\n  if CONDITION_1; then\n    AC_MSG_ERROR(\"some message, some more message\")\n  elif CONDITION_2; then\n    AC_MSG_ERROR(\"some message, some more message\")\n  fi\n\nAs \"...\" is not recognized as quoting by m4, the comma inside is\ninterpreted as an m4 argument separator, so \u0027some more message\"\u0027\nincluding the trailing quote becomes the exit status and \u0027\"some\nmessage\u0027 becomes the error message.\n\nConfigure understands to quote the \u0027\"\u0027 in the error message, but the\n\u0027\"\u0027 in the exit status is not quoted, which leaves an unbalanced quote\nin the configure script.\n\nLuckily the second AC_MSG_ERROR line also has the same problem, which\nadds a second unbalanced \u0027\"\u0027 into the configure script, which closes\nthe string started by the first unbalanced quote.\n\nThe string formed by these two unbalanced quotes just happens to\ninclude the entire CONDITION_2 `if` check.\n\nFix this by replacing the use of \u0027\"...\"\u0027 with \u0027[...]\u0027 instead.\n\nThis issue was introduced in commit:\n\n  commit 809c1abc19d487daeed75842da867ce633159210\n  Date:   Wed Aug 21 11:10:50 2024 -0300\n\n    gdb, configure: Add enable-binary-file-format option for configure\n\nAs well as the two AC_MSG_ERROR calls the above commit introduced an\nincorrectly quoted AC_MSG_WARN call, I\u0027ve fixed that too.\n\nThe above commit also added an unnecessary \u0027;\u0027 at the end of the two\nAC_MSG_ERROR lines, I\u0027ve removed them in this commit.\n\nWhile reviewing the above commit I spotted a couple of issues with the\nerror messages themselves.  First \u0027elf\u0027 should be \u0027ELF\u0027 when talking\nabout the file format, so I fixed that.  And second, AC_MSG_ERROR\ncalls normally don\u0027t have a trailing period, so I removed these from\nthe error messages added by 809c1abc19d487da.\n\nNow when configuring with\n--enable-binary-file-formats\u003d\u0027coff,xcoff,elf,macho\u0027 on a target that\ndoesn\u0027t support Mach-O, e.g. GNU/Linux, the configure will stop like\nthis:\n\n  checking for ELF support in BFD... yes\n  checking for library containing dlopen... (cached) none required\n  checking for Mach-O support in BFD... no\n  configure: error: Mach-O support was requested, but BFD does not support it\n  make: *** [Makefile:13461: configure-gdb] Error 1\n\nFinally, during a final review of this patch I spotted another place\nin our configure script where we were not quoting the argument to\nAC_MSG_WARN correctly.  In this case the error was added in commit\ne76c5d173bbf7137.  The problem line is:\n\n  AC_MSG_WARN(disabling guile support, $GUILD fails compiling for $host)\n\nAs AC_MSG_WARN expects only a single argument, everything after the\ncomma will be discarded.  Quote the string with \u0027[...]\u0027 to ensure the\nfull string is printed.\n\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "303d6ea011c40242dae1f6612f5cd8d0fc04efcd",
      "old_mode": 33261,
      "old_path": "gdb/configure",
      "new_id": "633004d3f70dc0d70aa337db814a4d3a55061c3c",
      "new_mode": 33261,
      "new_path": "gdb/configure"
    },
    {
      "type": "modify",
      "old_id": "e55a733fba7d3d4935c619ea1b72a348f1c1b37b",
      "old_mode": 33188,
      "old_path": "gdb/configure.ac",
      "new_id": "943b2218a4165ce57073537149248cf0123a746a",
      "new_mode": 33188,
      "new_path": "gdb/configure.ac"
    }
  ]
}
