)]}'
{
  "commit": "16bd13978f3e02e869cea603579b9f60401ed61c",
  "tree": "5fe0e4759d1e1554e7e1b4f1108158ccf213b6d2",
  "parents": [
    "e875475e19d13aa4283571f399848eab64f96ae0"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Wed Sep 28 11:33:30 2022 +0100"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Wed Sep 28 20:26:11 2022 +0100"
  },
  "message": "Fix GDB build: ELF support check \u0026 -lzstd\n\nGDB fails to build for me, on Ubuntu 20.04.  I get:\n\n ...\n   CXXLD  gdb\n /usr/bin/ld: linux-tdep.o: in function `linux_corefile_thread(thread_info*, linux_corefile_thread_data*)\u0027:\n /home/pedro/gdb/binutils-gdb/src/gdb/linux-tdep.c:1831: undefined reference to `gcore_elf_build_thread_register_notes(gdbarch*, thread_info*, gdb_signal, bfd*, std::unique_ptr\u003cchar, gdb::xfree_deleter\u003cchar\u003e \u003e*, int*)\u0027\n /usr/bin/ld: linux-tdep.o: in function `linux_make_corefile_notes(gdbarch*, bfd*, int*)\u0027:\n /home/pedro/gdb/binutils-gdb/src/gdb/linux-tdep.c:2117: undefined reference to `gcore_elf_make_tdesc_note(bfd*, std::unique_ptr\u003cchar, gdb::xfree_deleter\u003cchar\u003e \u003e*, int*)\u0027\n collect2: error: ld returned 1 exit status\n make[2]: *** [Makefile:2149: gdb] Error 1\n make[2]: Leaving directory \u0027/home/pedro/gdb/binutils-gdb/build/gdb\u0027\n make[1]: *** [Makefile:11847: all-gdb] Error 2\n make[1]: Leaving directory \u0027/home/pedro/gdb/binutils-gdb/build\u0027\n make: *** [Makefile:1004: all] Error 2\n\nThose undefined functions exist in gdb/gcore-elf.c, which is only\nincluded in the build if GDB\u0027s configure thinks that the target you\u0027re\nconfiguring for is an ELF target.  GDB\u0027s configure thinks my system\nisn\u0027t ELF, which is incorrect.\n\nFor the ELF support check, gdb/config.log shows:\n\n configure:17387: checking for ELF support in BFD\n configure:17407: gcc -o conftest -I/home/pedro/gdb/binutils-gdb/src/gdb/../include -I../bfd -I/home/pedro/gdb/binutils-gdb/src/gdb/../bfd -g3 -O0      -L../bfd -L../libiberty  -lzstd   conftest.c -lbfd -liberty -lz  -lncursesw -lm -ldl  \u003e\u00265\n /usr/bin/ld: ../bfd/libbfd.a(compress.o): in function `decompress_contents\u0027:\n /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:42: undefined reference to `ZSTD_decompress\u0027\n /usr/bin/ld: /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:44: undefined reference to `ZSTD_isError\u0027\n /usr/bin/ld: ../bfd/libbfd.a(compress.o): in function `bfd_compress_section_contents\u0027:\n /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:195: undefined reference to `ZSTD_compress\u0027\n /usr/bin/ld: /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:198: undefined reference to `ZSTD_isError\u0027\n collect2: error: ld returned 1 exit status\n configure:17407: $? \u003d 1\n ...\n configure:17417: result: no\n\nNote how above, in the gcc command line, \"-lzstd\" appears before\n\"-lbfd\".  That explain the link failure.  It should appear after, like\n-lz does.\n\nThis commit fixes it, by moving ZSTD_LIBS from LDFLAGS to LIBS, next\nto -lz, in GDB_AC_CHECK_BFD, and regenerating gdb/configure.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d29630\nChange-Id: I1f4128dde634e8ea04c9002904f1005a8b3a6863\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "28846119dcb82a52761cfc5bd33855ad67f8663a",
      "old_mode": 33188,
      "old_path": "gdb/acinclude.m4",
      "new_id": "62fa66c7af3013c0f0d91bd6a78f5bd5ceb04fe2",
      "new_mode": 33188,
      "new_path": "gdb/acinclude.m4"
    },
    {
      "type": "modify",
      "old_id": "238b66f3c60e6842bd684fa773b31eb690387650",
      "old_mode": 33261,
      "old_path": "gdb/configure",
      "new_id": "33677262783b6789e8e2289b204146ac3f2b89e1",
      "new_mode": 33261,
      "new_path": "gdb/configure"
    }
  ]
}
