[PATCH][RFC] add --enable-zstd-compressed-debug-sections configure option
Martin Liška
mliska@suse.cz
Mon Oct 3 07:49:25 GMT 2022
On 10/1/22 09:31, Fangrui Song wrote:
> On 2022-09-30, Martin Liška wrote:
>> On 9/30/22 13:25, Pedro Alves wrote:
>>> On 2022-09-30 10:48 a.m., Martin Liška wrote:
>>>> Hello.
>>>>
>>>> The patch can set up default compression algorithm as zstd instead of the
>>>> default zlib-gabi.
>>>>
>>>> The patch is lightly tested as readelf can't decompress debug sections:
>>>> https://sourceware.org/bugzilla/show_bug.cgi?id=29640
>>>>
>>>> Thoughts?
>>>>
>>>> ChangeLog:
>>>>
>>>> * configure.ac: Add --enable-zstd-compressed-debug-sections
>>>> configure option.
>>>> * configure: Regenerate.
>>>
>>> This may become a bit awkward in the future when other better format appears, and you want to
>>> switch to use it by default. Like, imagine zstd2 is invented. At that point we'd have to decide
>>> whether to add code to error out if the user specifies both
>>> "--enable-zstd-compressed-debug-sections --enable-zstd2-compressed-debug-sections",
>>> or always pick the latter option, or some such.
>>
>> Understood.
>>
>>>
>>> IMHO, it seems cleaner and more future proof to add instead:
>>>
>>> --enable-default-compressed-debug-sections=zlib|zlib-gnu|zlib-gabi|zstd
>>>
>>> WDYT?
>>
>> Yep, it's much nicer. Anyway, lemme try preparing a patch that does a bit of refactoring
>> before I introduce such a patch.
>>
>> Martin
>
> Personally I'll prefer that the compiler drivers (GCC and Clang) pass
> the default options to ld/as, and they have good infrastructure for
> customization... (Clang recently got better configuration file
> (https://clang.llvm.org/docs/UsersManual.html#configuration-files)
> support which enables more convenient default driver options.)
>
> Setting default options in ld/as allow very few projects which bypass
> the compiler driver to use zstd compressed debug sections but the
> benefit is probably low...
Well, I would prefer having the configure option, similar to
--enable-compressed-debug-sections, we as openSUSE rely on that where
we select the corresponding option value in binutils package.
Martin
More information about the Binutils
mailing list