[PATCH v3] binutils, gdb: support zstd compressed debug sections

Simon Marchi simon.marchi@polymtl.ca
Fri Sep 23 18:57:53 GMT 2022



On 2022-09-23 14:20, Fangrui Song wrote:
> On 2022-09-23, Simon Marchi wrote:
>>
>>
>> On 2022-09-23 11:45, Nick Clifton wrote:
>>> Hi Fangrui,
>>>
>>>> PR29397 PR29563: The new configure option --with-zstd defaults to auto.
>>>> If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support zstd
>>>> compressed debug sections for most tools.
> 
> Hi Simon and Nick,
> 
> I have checked that `make all-gdb` works in a --enable-gdb --without-debuginfod build.
> 
> I then inspected the 2020 commits adding AC_DEBUGINFOD to
> gdb/configure.ac and binutils/configure.ac. They come with no
> PKG_PROG_PKG_CONFIG and config/debuginfod.m4 does not have
> PKG_PROG_PKG_CONFIG, but they still work.  So I think AC_ZSTD doesn't
> need PKG_PROG_PKG_CONFIG, either. Though I have no insight why it
> behaves that way:)

Ok, I am a bit confused.  Based on my comprehension, since the first
call to PKG_CHECK_MODULES may not happen do to a condition:

  if test "x$with_debuginfod" != xno; then
    PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >= 0.179],
    ...
  fi

... the probing for pkg-config should not happen if --without-debuginfod
is used.  But in gdb/configure, I see that the probing for pkg-config
actually appears outside the condition.

Anyway, good if it works.

> +diff --git a/gdb/NEWS b/gdb/NEWS
> +index 9619842bc03..1457c99ff04 100644
> +--- a/gdb/NEWS
> ++++ b/gdb/NEWS
> +@@ -57,6 +57,8 @@
> + + * The Windows native target now supports target async.
> + ++* gdb now supports zstd compressed debug sections (ELFCOMPRESS_ZSTD) for ELF.
> ++

I'm not sure I understand the diff above, but I think it's missing an
empty line between the previous bullet and the new bullet.  Otherwise,
that is OK for GDB.

Simon


More information about the Binutils mailing list